From 1231e6f40c7635625ba43f50718c10ff63fcab58 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 17 Jan 2025 16:45:07 +0100 Subject: [PATCH 01/19] scaffold: module migration --- api/poktroll/migration/genesis.pulsar.go | 596 +++++++++ .../migration/module/module.pulsar.go | 579 +++++++++ api/poktroll/migration/params.pulsar.go | 500 ++++++++ api/poktroll/migration/query.pulsar.go | 1012 +++++++++++++++ api/poktroll/migration/query_grpc.pb.go | 116 ++ api/poktroll/migration/tx.pulsar.go | 1091 +++++++++++++++++ api/poktroll/migration/tx_grpc.pb.go | 118 ++ app/app.go | 7 +- app/app_config.go | 20 +- proto/poktroll/migration/genesis.proto | 17 + proto/poktroll/migration/module/module.proto | 14 + proto/poktroll/migration/params.proto | 15 + proto/poktroll/migration/query.proto | 30 + proto/poktroll/migration/tx.proto | 40 + testutil/keeper/migration.go | 51 + x/migration/keeper/keeper.go | 59 + x/migration/keeper/msg_server.go | 17 + x/migration/keeper/msg_server_test.go | 24 + x/migration/keeper/msg_update_params.go | 23 + x/migration/keeper/msg_update_params_test.go | 64 + x/migration/keeper/params.go | 34 + x/migration/keeper/params_test.go | 18 + x/migration/keeper/query.go | 7 + x/migration/keeper/query_params.go | 20 + x/migration/keeper/query_params_test.go | 20 + x/migration/module/autocli.go | 35 + x/migration/module/genesis.go | 26 + x/migration/module/genesis_test.go | 31 + x/migration/module/module.go | 221 ++++ x/migration/module/simulation.go | 59 + x/migration/simulation/helpers.go | 15 + x/migration/types/codec.go | 21 + x/migration/types/errors.go | 14 + x/migration/types/expected_keepers.go | 29 + x/migration/types/genesis.go | 24 + x/migration/types/genesis.pb.go | 324 +++++ x/migration/types/genesis_test.go | 41 + x/migration/types/keys.go | 24 + x/migration/types/msg_update_params.go | 21 + x/migration/types/params.go | 41 + x/migration/types/params.pb.go | 289 +++++ x/migration/types/query.pb.go | 540 ++++++++ x/migration/types/query.pb.gw.go | 153 +++ x/migration/types/tx.pb.go | 598 +++++++++ x/migration/types/types.go | 1 + 45 files changed, 6992 insertions(+), 7 deletions(-) create mode 100644 api/poktroll/migration/genesis.pulsar.go create mode 100644 api/poktroll/migration/module/module.pulsar.go create mode 100644 api/poktroll/migration/params.pulsar.go create mode 100644 api/poktroll/migration/query.pulsar.go create mode 100644 api/poktroll/migration/query_grpc.pb.go create mode 100644 api/poktroll/migration/tx.pulsar.go create mode 100644 api/poktroll/migration/tx_grpc.pb.go create mode 100644 proto/poktroll/migration/genesis.proto create mode 100644 proto/poktroll/migration/module/module.proto create mode 100644 proto/poktroll/migration/params.proto create mode 100644 proto/poktroll/migration/query.proto create mode 100644 proto/poktroll/migration/tx.proto create mode 100644 testutil/keeper/migration.go create mode 100644 x/migration/keeper/keeper.go create mode 100644 x/migration/keeper/msg_server.go create mode 100644 x/migration/keeper/msg_server_test.go create mode 100644 x/migration/keeper/msg_update_params.go create mode 100644 x/migration/keeper/msg_update_params_test.go create mode 100644 x/migration/keeper/params.go create mode 100644 x/migration/keeper/params_test.go create mode 100644 x/migration/keeper/query.go create mode 100644 x/migration/keeper/query_params.go create mode 100644 x/migration/keeper/query_params_test.go create mode 100644 x/migration/module/autocli.go create mode 100644 x/migration/module/genesis.go create mode 100644 x/migration/module/genesis_test.go create mode 100644 x/migration/module/module.go create mode 100644 x/migration/module/simulation.go create mode 100644 x/migration/simulation/helpers.go create mode 100644 x/migration/types/codec.go create mode 100644 x/migration/types/errors.go create mode 100644 x/migration/types/expected_keepers.go create mode 100644 x/migration/types/genesis.go create mode 100644 x/migration/types/genesis.pb.go create mode 100644 x/migration/types/genesis_test.go create mode 100644 x/migration/types/keys.go create mode 100644 x/migration/types/msg_update_params.go create mode 100644 x/migration/types/params.go create mode 100644 x/migration/types/params.pb.go create mode 100644 x/migration/types/query.pb.go create mode 100644 x/migration/types/query.pb.gw.go create mode 100644 x/migration/types/tx.pb.go create mode 100644 x/migration/types/types.go diff --git a/api/poktroll/migration/genesis.pulsar.go b/api/poktroll/migration/genesis.pulsar.go new file mode 100644 index 000000000..bc982912a --- /dev/null +++ b/api/poktroll/migration/genesis.pulsar.go @@ -0,0 +1,596 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package migration + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_genesis_proto_init() + md_GenesisState = File_poktroll_migration_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.GenesisState.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.GenesisState")) + } + panic(fmt.Errorf("message poktroll.migration.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.GenesisState.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.GenesisState")) + } + panic(fmt.Errorf("message poktroll.migration.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.GenesisState")) + } + panic(fmt.Errorf("message poktroll.migration.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.GenesisState")) + } + panic(fmt.Errorf("message poktroll.migration.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.GenesisState")) + } + panic(fmt.Errorf("message poktroll.migration.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.GenesisState")) + } + panic(fmt.Errorf("message poktroll.migration.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/migration/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the migration module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params defines all the parameters of the module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_poktroll_migration_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_poktroll_migration_genesis_proto protoreflect.FileDescriptor + +var file_poktroll_migration_genesis_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x12, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, + 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x4d, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x42, + 0xb4, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, + 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, + 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_migration_genesis_proto_rawDescOnce sync.Once + file_poktroll_migration_genesis_proto_rawDescData = file_poktroll_migration_genesis_proto_rawDesc +) + +func file_poktroll_migration_genesis_proto_rawDescGZIP() []byte { + file_poktroll_migration_genesis_proto_rawDescOnce.Do(func() { + file_poktroll_migration_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_genesis_proto_rawDescData) + }) + return file_poktroll_migration_genesis_proto_rawDescData +} + +var file_poktroll_migration_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_migration_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: poktroll.migration.GenesisState + (*Params)(nil), // 1: poktroll.migration.Params +} +var file_poktroll_migration_genesis_proto_depIdxs = []int32{ + 1, // 0: poktroll.migration.GenesisState.params:type_name -> poktroll.migration.Params + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_poktroll_migration_genesis_proto_init() } +func file_poktroll_migration_genesis_proto_init() { + if File_poktroll_migration_genesis_proto != nil { + return + } + file_poktroll_migration_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_poktroll_migration_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_migration_genesis_proto_goTypes, + DependencyIndexes: file_poktroll_migration_genesis_proto_depIdxs, + MessageInfos: file_poktroll_migration_genesis_proto_msgTypes, + }.Build() + File_poktroll_migration_genesis_proto = out.File + file_poktroll_migration_genesis_proto_rawDesc = nil + file_poktroll_migration_genesis_proto_goTypes = nil + file_poktroll_migration_genesis_proto_depIdxs = nil +} diff --git a/api/poktroll/migration/module/module.pulsar.go b/api/poktroll/migration/module/module.pulsar.go new file mode 100644 index 000000000..fafe8af22 --- /dev/null +++ b/api/poktroll/migration/module/module.pulsar.go @@ -0,0 +1,579 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package module + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_module_module_proto_init() + md_Module = File_poktroll_migration_module_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_module_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.module.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.module.Module")) + } + panic(fmt.Errorf("message poktroll.migration.module.Module does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.module.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.module.Module")) + } + panic(fmt.Errorf("message poktroll.migration.module.Module does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.module.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.module.Module")) + } + panic(fmt.Errorf("message poktroll.migration.module.Module does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.module.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.module.Module")) + } + panic(fmt.Errorf("message poktroll.migration.module.Module does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.module.Module.authority": + panic(fmt.Errorf("field authority of message poktroll.migration.module.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.module.Module")) + } + panic(fmt.Errorf("message poktroll.migration.module.Module does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.module.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.module.Module")) + } + panic(fmt.Errorf("message poktroll.migration.module.Module does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.module.Module", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Module) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/migration/module/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the config object for the module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority defines the custom module authority. If not set, defaults to the governance module. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_module_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_poktroll_migration_module_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_poktroll_migration_module_module_proto protoreflect.FileDescriptor + +var file_poktroll_migration_module_module_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x34, 0xba, + 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0xde, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x4d, 0xaa, 0x02, 0x19, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0xca, 0x02, 0x19, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xe2, 0x02, + 0x25, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_migration_module_module_proto_rawDescOnce sync.Once + file_poktroll_migration_module_module_proto_rawDescData = file_poktroll_migration_module_module_proto_rawDesc +) + +func file_poktroll_migration_module_module_proto_rawDescGZIP() []byte { + file_poktroll_migration_module_module_proto_rawDescOnce.Do(func() { + file_poktroll_migration_module_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_module_module_proto_rawDescData) + }) + return file_poktroll_migration_module_module_proto_rawDescData +} + +var file_poktroll_migration_module_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_migration_module_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: poktroll.migration.module.Module +} +var file_poktroll_migration_module_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_poktroll_migration_module_module_proto_init() } +func file_poktroll_migration_module_module_proto_init() { + if File_poktroll_migration_module_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_module_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_poktroll_migration_module_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_migration_module_module_proto_goTypes, + DependencyIndexes: file_poktroll_migration_module_module_proto_depIdxs, + MessageInfos: file_poktroll_migration_module_module_proto_msgTypes, + }.Build() + File_poktroll_migration_module_module_proto = out.File + file_poktroll_migration_module_module_proto_rawDesc = nil + file_poktroll_migration_module_module_proto_goTypes = nil + file_poktroll_migration_module_module_proto_depIdxs = nil +} diff --git a/api/poktroll/migration/params.pulsar.go b/api/poktroll/migration/params.pulsar.go new file mode 100644 index 000000000..1b0d8934d --- /dev/null +++ b/api/poktroll/migration/params.pulsar.go @@ -0,0 +1,500 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package migration + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Params protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_migration_params_proto_init() + md_Params = File_poktroll_migration_params_proto.Messages().ByName("Params") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_params_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.Params")) + } + panic(fmt.Errorf("message poktroll.migration.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.Params")) + } + panic(fmt.Errorf("message poktroll.migration.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.Params")) + } + panic(fmt.Errorf("message poktroll.migration.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.Params")) + } + panic(fmt.Errorf("message poktroll.migration.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.Params")) + } + panic(fmt.Errorf("message poktroll.migration.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.Params")) + } + panic(fmt.Errorf("message poktroll.migration.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/migration/params.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Params defines the parameters for the module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_params_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_poktroll_migration_params_proto_rawDescGZIP(), []int{0} +} + +var File_poktroll_migration_params_proto protoreflect.FileDescriptor + +var file_poktroll_migration_params_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x12, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, + 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2e, + 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, + 0xb0, 0x2a, 0x1b, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xb3, + 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, + 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_migration_params_proto_rawDescOnce sync.Once + file_poktroll_migration_params_proto_rawDescData = file_poktroll_migration_params_proto_rawDesc +) + +func file_poktroll_migration_params_proto_rawDescGZIP() []byte { + file_poktroll_migration_params_proto_rawDescOnce.Do(func() { + file_poktroll_migration_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_params_proto_rawDescData) + }) + return file_poktroll_migration_params_proto_rawDescData +} + +var file_poktroll_migration_params_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_migration_params_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: poktroll.migration.Params +} +var file_poktroll_migration_params_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_poktroll_migration_params_proto_init() } +func file_poktroll_migration_params_proto_init() { + if File_poktroll_migration_params_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_poktroll_migration_params_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_migration_params_proto_goTypes, + DependencyIndexes: file_poktroll_migration_params_proto_depIdxs, + MessageInfos: file_poktroll_migration_params_proto_msgTypes, + }.Build() + File_poktroll_migration_params_proto = out.File + file_poktroll_migration_params_proto_rawDesc = nil + file_poktroll_migration_params_proto_goTypes = nil + file_poktroll_migration_params_proto_depIdxs = nil +} diff --git a/api/poktroll/migration/query.pulsar.go b/api/poktroll/migration/query.pulsar.go new file mode 100644 index 000000000..4a34ceb4b --- /dev/null +++ b/api/poktroll/migration/query.pulsar.go @@ -0,0 +1,1012 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package migration + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_migration_query_proto_init() + md_QueryParamsRequest = File_poktroll_migration_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// 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_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(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_QueryParamsRequest) 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_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsRequest 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_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsRequest 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_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsRequest 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_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsRequest 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_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsRequest 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_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsRequest")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsRequest 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_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.QueryParamsRequest", 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) 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_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + 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().(*QueryParamsRequest) + 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().(*QueryParamsRequest) + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: 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, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_query_proto_init() + md_QueryParamsResponse = File_poktroll_migration_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// 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_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(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_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsResponse 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_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsResponse 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_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsResponse 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_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsResponse 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_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsResponse 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_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.QueryParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.QueryParamsResponse 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_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.QueryParamsResponse", 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) 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_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/migration/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_poktroll_migration_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // params holds all the parameters of this module. + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_poktroll_migration_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +var File_poktroll_migration_query_proto protoreflect.FileDescriptor + +var file_poktroll_migration_query_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x12, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 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, 0x54, + 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x94, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x8a, + 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x29, 0x12, 0x27, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xb2, 0x01, 0x0a, 0x16, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, + 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, + 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_migration_query_proto_rawDescOnce sync.Once + file_poktroll_migration_query_proto_rawDescData = file_poktroll_migration_query_proto_rawDesc +) + +func file_poktroll_migration_query_proto_rawDescGZIP() []byte { + file_poktroll_migration_query_proto_rawDescOnce.Do(func() { + file_poktroll_migration_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_query_proto_rawDescData) + }) + return file_poktroll_migration_query_proto_rawDescData +} + +var file_poktroll_migration_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_poktroll_migration_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: poktroll.migration.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: poktroll.migration.QueryParamsResponse + (*Params)(nil), // 2: poktroll.migration.Params +} +var file_poktroll_migration_query_proto_depIdxs = []int32{ + 2, // 0: poktroll.migration.QueryParamsResponse.params:type_name -> poktroll.migration.Params + 0, // 1: poktroll.migration.Query.Params:input_type -> poktroll.migration.QueryParamsRequest + 1, // 2: poktroll.migration.Query.Params:output_type -> poktroll.migration.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_poktroll_migration_query_proto_init() } +func file_poktroll_migration_query_proto_init() { + if File_poktroll_migration_query_proto != nil { + return + } + file_poktroll_migration_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); 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_poktroll_migration_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_poktroll_migration_query_proto_goTypes, + DependencyIndexes: file_poktroll_migration_query_proto_depIdxs, + MessageInfos: file_poktroll_migration_query_proto_msgTypes, + }.Build() + File_poktroll_migration_query_proto = out.File + file_poktroll_migration_query_proto_rawDesc = nil + file_poktroll_migration_query_proto_goTypes = nil + file_poktroll_migration_query_proto_depIdxs = nil +} diff --git a/api/poktroll/migration/query_grpc.pb.go b/api/poktroll/migration/query_grpc.pb.go new file mode 100644 index 000000000..1fc079a50 --- /dev/null +++ b/api/poktroll/migration/query_grpc.pb.go @@ -0,0 +1,116 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/migration/query.proto + +package migration + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Query_Params_FullMethodName = "/poktroll.migration.Query/Params" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + 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 +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.migration.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/migration/query.proto", +} diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go new file mode 100644 index 000000000..a14b2d6f0 --- /dev/null +++ b/api/poktroll/migration/tx.pulsar.go @@ -0,0 +1,1091 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package migration + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MsgUpdateParams protoreflect.MessageDescriptor + fd_MsgUpdateParams_authority protoreflect.FieldDescriptor + fd_MsgUpdateParams_params protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgUpdateParams = File_poktroll_migration_tx_proto.Messages().ByName("MsgUpdateParams") + fd_MsgUpdateParams_authority = md_MsgUpdateParams.Fields().ByName("authority") + fd_MsgUpdateParams_params = md_MsgUpdateParams.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParams)(nil) + +type fastReflection_MsgUpdateParams MsgUpdateParams + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(x) +} + +func (x *MsgUpdateParams) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_tx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParams_messageType fastReflection_MsgUpdateParams_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParams_messageType{} + +type fastReflection_MsgUpdateParams_messageType struct{} + +func (x fastReflection_MsgUpdateParams_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParams)(nil) +} +func (x fastReflection_MsgUpdateParams_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} +func (x fastReflection_MsgUpdateParams_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParams) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParams +} + +// 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_MsgUpdateParams) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParams_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParams) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParams) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParams) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParams)(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_MsgUpdateParams) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_MsgUpdateParams_authority, value) { + return + } + } + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_MsgUpdateParams_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgUpdateParams) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MsgUpdateParams.authority": + return x.Authority != "" + case "poktroll.migration.MsgUpdateParams.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParams 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_MsgUpdateParams) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MsgUpdateParams.authority": + x.Authority = "" + case "poktroll.migration.MsgUpdateParams.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParams 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_MsgUpdateParams) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MsgUpdateParams.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + case "poktroll.migration.MsgUpdateParams.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParams 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_MsgUpdateParams) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MsgUpdateParams.authority": + x.Authority = value.Interface().(string) + case "poktroll.migration.MsgUpdateParams.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParams 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_MsgUpdateParams) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgUpdateParams.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "poktroll.migration.MsgUpdateParams.authority": + panic(fmt.Errorf("field authority of message poktroll.migration.MsgUpdateParams is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParams 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_MsgUpdateParams) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MsgUpdateParams.authority": + return protoreflect.ValueOfString("") + case "poktroll.migration.MsgUpdateParams.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParams")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParams 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_MsgUpdateParams) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgUpdateParams", 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) 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_MsgUpdateParams) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgUpdateParams) + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgUpdateParamsResponse protoreflect.MessageDescriptor +) + +func init() { + file_poktroll_migration_tx_proto_init() + md_MsgUpdateParamsResponse = File_poktroll_migration_tx_proto.Messages().ByName("MsgUpdateParamsResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgUpdateParamsResponse)(nil) + +type fastReflection_MsgUpdateParamsResponse MsgUpdateParamsResponse + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(x) +} + +func (x *MsgUpdateParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_tx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgUpdateParamsResponse_messageType fastReflection_MsgUpdateParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateParamsResponse_messageType{} + +type fastReflection_MsgUpdateParamsResponse_messageType struct{} + +func (x fastReflection_MsgUpdateParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateParamsResponse)(nil) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} +func (x fastReflection_MsgUpdateParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgUpdateParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateParamsResponse +} + +// 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_MsgUpdateParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgUpdateParamsResponse) New() protoreflect.Message { + return new(fastReflection_MsgUpdateParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgUpdateParamsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateParamsResponse)(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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MsgUpdateParamsResponse")) + } + panic(fmt.Errorf("message poktroll.migration.MsgUpdateParamsResponse 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_MsgUpdateParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MsgUpdateParamsResponse", 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) 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_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgUpdateParamsResponse) + 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().(*MsgUpdateParamsResponse) + 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().(*MsgUpdateParamsResponse) + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/migration/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_poktroll_migration_tx_proto_rawDescGZIP(), []int{1} +} + +var File_poktroll_migration_tx_proto protoreflect.FileDescriptor + +var file_poktroll_migration_tx_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, + 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 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, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xc1, 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, 0x3d, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 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, 0x37, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x24, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 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, 0x6e, + 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0xaf, + 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, + 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, + 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_migration_tx_proto_rawDescOnce sync.Once + file_poktroll_migration_tx_proto_rawDescData = file_poktroll_migration_tx_proto_rawDesc +) + +func file_poktroll_migration_tx_proto_rawDescGZIP() []byte { + file_poktroll_migration_tx_proto_rawDescOnce.Do(func() { + file_poktroll_migration_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_tx_proto_rawDescData) + }) + return file_poktroll_migration_tx_proto_rawDescData +} + +var file_poktroll_migration_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_poktroll_migration_tx_proto_goTypes = []interface{}{ + (*MsgUpdateParams)(nil), // 0: poktroll.migration.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: poktroll.migration.MsgUpdateParamsResponse + (*Params)(nil), // 2: poktroll.migration.Params +} +var file_poktroll_migration_tx_proto_depIdxs = []int32{ + 2, // 0: poktroll.migration.MsgUpdateParams.params:type_name -> poktroll.migration.Params + 0, // 1: poktroll.migration.Msg.UpdateParams:input_type -> poktroll.migration.MsgUpdateParams + 1, // 2: poktroll.migration.Msg.UpdateParams:output_type -> poktroll.migration.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_poktroll_migration_tx_proto_init() } +func file_poktroll_migration_tx_proto_init() { + if File_poktroll_migration_tx_proto != nil { + return + } + file_poktroll_migration_params_proto_init() + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgUpdateParamsResponse); 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_poktroll_migration_tx_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_poktroll_migration_tx_proto_goTypes, + DependencyIndexes: file_poktroll_migration_tx_proto_depIdxs, + MessageInfos: file_poktroll_migration_tx_proto_msgTypes, + }.Build() + File_poktroll_migration_tx_proto = out.File + file_poktroll_migration_tx_proto_rawDesc = nil + file_poktroll_migration_tx_proto_goTypes = nil + file_poktroll_migration_tx_proto_depIdxs = nil +} diff --git a/api/poktroll/migration/tx_grpc.pb.go b/api/poktroll/migration/tx_grpc.pb.go new file mode 100644 index 000000000..79681fb48 --- /dev/null +++ b/api/poktroll/migration/tx_grpc.pb.go @@ -0,0 +1,118 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc (unknown) +// source: poktroll/migration/tx.proto + +package migration + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + Msg_UpdateParams_FullMethodName = "/poktroll.migration.Msg/UpdateParams" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + 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 +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.migration.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/migration/tx.proto", +} diff --git a/app/app.go b/app/app.go index 614a04b78..54d97b4e8 100644 --- a/app/app.go +++ b/app/app.go @@ -1,7 +1,8 @@ package app import ( - // this line is used by starport scaffolding # stargate/app/moduleImport + migrationmodulekeeper "github.com/pokt-network/poktroll/x/migration/keeper" +// this line is used by starport scaffolding # stargate/app/moduleImport "io" "os" "path/filepath" @@ -69,7 +70,8 @@ type App struct { // simulation manager sm *module.SimulationManager - // this line is used by starport scaffolding # stargate/app/keeperDeclaration + MigrationKeeper migrationmodulekeeper.Keeper +// this line is used by starport scaffolding # stargate/app/keeperDeclaration // Ignite CLI adds keepers here when scaffolding new modules. Please move the created keeper to the `keepers` package. } @@ -214,6 +216,7 @@ func New( &app.Keepers.ProofKeeper, &app.Keepers.TokenomicsKeeper, &app.Keepers.SharedKeeper, + &app.MigrationKeeper, // this line is used by starport scaffolding # stargate/app/keeperDefinition // Ignite CLI adds keepers here when scaffolding new modules. Please move the created keeper to the `keepers` package. ); err != nil { diff --git a/app/app_config.go b/app/app_config.go index 76cc7b5b2..ddc0ea1e9 100644 --- a/app/app_config.go +++ b/app/app_config.go @@ -1,7 +1,10 @@ package app import ( - // this line is used by starport scaffolding # stargate/app/moduleImport + migrationmodulev1 "github.com/pokt-network/poktroll/api/poktroll/migration/module" +_ "github.com/pokt-network/poktroll/x/migration/module" // import for side-effects +migrationmoduletypes "github.com/pokt-network/poktroll/x/migration/types" +// this line is used by starport scaffolding # stargate/app/moduleImport "time" runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" @@ -140,7 +143,8 @@ var ( proofmoduletypes.ModuleName, tokenomicsmoduletypes.ModuleName, sharedmoduletypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/initGenesis + migrationmoduletypes.ModuleName, +// this line is used by starport scaffolding # stargate/app/initGenesis } // During begin block slashing happens after distr.BeginBlocker so that @@ -172,7 +176,8 @@ var ( proofmoduletypes.ModuleName, tokenomicsmoduletypes.ModuleName, sharedmoduletypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/beginBlockers + migrationmoduletypes.ModuleName, +// this line is used by starport scaffolding # stargate/app/beginBlockers } endBlockers = []string{ @@ -203,7 +208,8 @@ var ( applicationmoduletypes.ModuleName, suppliermoduletypes.ModuleName, sharedmoduletypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/endBlockers + migrationmoduletypes.ModuleName, +// this line is used by starport scaffolding # stargate/app/endBlockers } preBlockers = []string{ @@ -391,7 +397,11 @@ var ( Name: sharedmoduletypes.ModuleName, Config: appconfig.WrapAny(&sharedmodulev1.Module{}), }, - // this line is used by starport scaffolding # stargate/app/moduleConfig + { + Name: migrationmoduletypes.ModuleName, + Config: appconfig.WrapAny(&migrationmodulev1.Module{}), + }, +// this line is used by starport scaffolding # stargate/app/moduleConfig }, }) ) diff --git a/proto/poktroll/migration/genesis.proto b/proto/poktroll/migration/genesis.proto new file mode 100644 index 000000000..c7ad1757c --- /dev/null +++ b/proto/poktroll/migration/genesis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package poktroll.migration; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "poktroll/migration/params.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/migration/types"; + +// GenesisState defines the migration module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/poktroll/migration/module/module.proto b/proto/poktroll/migration/module/module.proto new file mode 100644 index 000000000..bb742cdf2 --- /dev/null +++ b/proto/poktroll/migration/module/module.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package poktroll.migration.module; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/pokt-network/poktroll/x/migration" + }; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} \ No newline at end of file diff --git a/proto/poktroll/migration/params.proto b/proto/poktroll/migration/params.proto new file mode 100644 index 000000000..458f260a7 --- /dev/null +++ b/proto/poktroll/migration/params.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package poktroll.migration; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/migration/types"; + +// Params defines the parameters for the module. +message Params { + option (amino.name) = "poktroll/x/migration/Params"; + option (gogoproto.equal) = true; + + +} \ No newline at end of file diff --git a/proto/poktroll/migration/query.proto b/proto/poktroll/migration/query.proto new file mode 100644 index 000000000..6a8c2d520 --- /dev/null +++ b/proto/poktroll/migration/query.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package poktroll.migration; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "poktroll/migration/params.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/migration/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/pokt-network/poktroll/migration/params"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} \ No newline at end of file diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto new file mode 100644 index 000000000..5352ef90d --- /dev/null +++ b/proto/poktroll/migration/tx.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package poktroll.migration; + +import "amino/amino.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "poktroll/migration/params.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/migration/types"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "poktroll/x/migration/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go new file mode 100644 index 000000000..6be21258c --- /dev/null +++ b/testutil/keeper/migration.go @@ -0,0 +1,51 @@ +package keeper + +import ( + "testing" + + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/x/migration/keeper" + "github.com/pokt-network/poktroll/x/migration/types" +) + +func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { + storeKey := storetypes.NewKVStoreKey(types.StoreKey) + + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + + k := keeper.NewKeeper( + cdc, + runtime.NewKVStoreService(storeKey), + log.NewNopLogger(), + authority.String(), + ) + + ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + if err := k.SetParams(ctx, types.DefaultParams()); err != nil { + panic(err) + } + + return k, ctx +} diff --git a/x/migration/keeper/keeper.go b/x/migration/keeper/keeper.go new file mode 100644 index 000000000..d5ce749e4 --- /dev/null +++ b/x/migration/keeper/keeper.go @@ -0,0 +1,59 @@ +package keeper + +import ( + "fmt" + + "cosmossdk.io/core/store" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + + "github.com/pokt-network/poktroll/x/migration/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeService store.KVStoreService + logger log.Logger + + // the address capable of executing a MsgUpdateParams message. Typically, this + // should be the x/gov module account. + authority string + + + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeService store.KVStoreService, + logger log.Logger, + authority string, + +) Keeper { + if _, err := sdk.AccAddressFromBech32(authority); err != nil { + panic(fmt.Sprintf("invalid authority address: %s", authority)) + } + + return Keeper{ + cdc: cdc, + storeService: storeService, + authority: authority, + logger: logger, + + } +} + +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger() log.Logger { + return k.logger.With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + + diff --git a/x/migration/keeper/msg_server.go b/x/migration/keeper/msg_server.go new file mode 100644 index 000000000..450034866 --- /dev/null +++ b/x/migration/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/pokt-network/poktroll/x/migration/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/migration/keeper/msg_server_test.go b/x/migration/keeper/msg_server_test.go new file mode 100644 index 000000000..41683844d --- /dev/null +++ b/x/migration/keeper/msg_server_test.go @@ -0,0 +1,24 @@ +package keeper_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/x/migration/types" + "github.com/pokt-network/poktroll/x/migration/keeper" +) + +func setupMsgServer(t testing.TB) (keeper.Keeper, types.MsgServer, context.Context) { + k, ctx := keepertest.MigrationKeeper(t) + return k, keeper.NewMsgServerImpl(k), ctx +} + +func TestMsgServer(t *testing.T) { + k, ms, ctx := setupMsgServer(t) + require.NotNil(t, ms) + require.NotNil(t, ctx) + require.NotEmpty(t, k) +} \ No newline at end of file diff --git a/x/migration/keeper/msg_update_params.go b/x/migration/keeper/msg_update_params.go new file mode 100644 index 000000000..10c587425 --- /dev/null +++ b/x/migration/keeper/msg_update_params.go @@ -0,0 +1,23 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/pokt-network/poktroll/x/migration/types" +) + +func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if k.GetAuthority() != req.Authority { + return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := k.SetParams(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/migration/keeper/msg_update_params_test.go b/x/migration/keeper/msg_update_params_test.go new file mode 100644 index 000000000..1e077822d --- /dev/null +++ b/x/migration/keeper/msg_update_params_test.go @@ -0,0 +1,64 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/x/migration/types" +) + +func TestMsgUpdateParams(t *testing.T) { + k, ms, ctx := setupMsgServer(t) + params := types.DefaultParams() + require.NoError(t, k.SetParams(ctx, params)) + wctx := sdk.UnwrapSDKContext(ctx) + + // default params + testCases := []struct { + name string + input *types.MsgUpdateParams + expErr bool + expErrMsg string + }{ + { + name: "invalid authority", + input: &types.MsgUpdateParams{ + Authority: "invalid", + Params: params, + }, + expErr: true, + expErrMsg: "invalid authority", + }, + { + name: "send enabled param", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: types.Params{}, + }, + expErr: false, + }, + { + name: "all good", + input: &types.MsgUpdateParams{ + Authority: k.GetAuthority(), + Params: params, + }, + expErr: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, err := ms.UpdateParams(wctx, tc.input) + + if tc.expErr { + require.Error(t, err) + require.Contains(t, err.Error(), tc.expErrMsg) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/migration/keeper/params.go b/x/migration/keeper/params.go new file mode 100644 index 000000000..91fcb1184 --- /dev/null +++ b/x/migration/keeper/params.go @@ -0,0 +1,34 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/runtime" + + "github.com/pokt-network/poktroll/x/migration/types" +) + + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx context.Context) (params types.Params) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + bz := store.Get(types.ParamsKey) + if bz == nil { + return params + } + + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// SetParams set the params +func (k Keeper) SetParams(ctx context.Context, params types.Params) error { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + store.Set(types.ParamsKey, bz) + + return nil +} diff --git a/x/migration/keeper/params_test.go b/x/migration/keeper/params_test.go new file mode 100644 index 000000000..c0cfdb877 --- /dev/null +++ b/x/migration/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/x/migration/types" +) + +func TestGetParams(t *testing.T) { + k, ctx := keepertest.MigrationKeeper(t) + params := types.DefaultParams() + + require.NoError(t, k.SetParams(ctx, params)) + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/migration/keeper/query.go b/x/migration/keeper/query.go new file mode 100644 index 000000000..28b91e3fb --- /dev/null +++ b/x/migration/keeper/query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/pokt-network/poktroll/x/migration/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/migration/keeper/query_params.go b/x/migration/keeper/query_params.go new file mode 100644 index 000000000..06443c66b --- /dev/null +++ b/x/migration/keeper/query_params.go @@ -0,0 +1,20 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/pokt-network/poktroll/x/migration/types" +) + +func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/migration/keeper/query_params_test.go b/x/migration/keeper/query_params_test.go new file mode 100644 index 000000000..0802b13a6 --- /dev/null +++ b/x/migration/keeper/query_params_test.go @@ -0,0 +1,20 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/x/migration/types" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := keepertest.MigrationKeeper(t) + params := types.DefaultParams() + require.NoError(t, keeper.SetParams(ctx, params)) + + response, err := keeper.Params(ctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go new file mode 100644 index 000000000..847e0d10e --- /dev/null +++ b/x/migration/module/autocli.go @@ -0,0 +1,35 @@ +package migration + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + modulev1 "github.com/pokt-network/poktroll/api/poktroll/migration" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "Params", + Use: "params", + Short: "Shows the parameters of the module", + }, + // this line is used by ignite scaffolding # autocli/query + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: true, // only required if you want to use the custom command + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "UpdateParams", + Skip: true, // skipped because authority gated + }, + // this line is used by ignite scaffolding # autocli/tx + }, + }, + } +} \ No newline at end of file diff --git a/x/migration/module/genesis.go b/x/migration/module/genesis.go new file mode 100644 index 000000000..88000e771 --- /dev/null +++ b/x/migration/module/genesis.go @@ -0,0 +1,26 @@ +package migration + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/pokt-network/poktroll/x/migration/keeper" + "github.com/pokt-network/poktroll/x/migration/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // this line is used by starport scaffolding # genesis/module/init + if err := k.SetParams(ctx, genState.Params); err != nil { + panic(err) + } +} + +// ExportGenesis returns the module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/migration/module/genesis_test.go b/x/migration/module/genesis_test.go new file mode 100644 index 000000000..0356b5ecf --- /dev/null +++ b/x/migration/module/genesis_test.go @@ -0,0 +1,31 @@ +package migration_test + +import ( + "testing" + + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/nullify" + migration "github.com/pokt-network/poktroll/x/migration/module" + "github.com/pokt-network/poktroll/x/migration/types" + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx := keepertest.MigrationKeeper(t) + migration.InitGenesis(ctx, k, genesisState) + got := migration.ExportGenesis(ctx, k) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + + + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/migration/module/module.go b/x/migration/module/module.go new file mode 100644 index 000000000..d41f2465d --- /dev/null +++ b/x/migration/module/module.go @@ -0,0 +1,221 @@ +package migration + +import ( + "context" + "encoding/json" + "fmt" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + + + // this line is used by starport scaffolding # 1 + + modulev1 "github.com/pokt-network/poktroll/api/poktroll/migration/module" + "github.com/pokt-network/poktroll/x/migration/keeper" + "github.com/pokt-network/poktroll/x/migration/types" + +) + +var ( + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) + _ appmodule.HasEndBlocker = (*AppModule)(nil) + +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface that defines the +// independent methods a Cosmos SDK module needs to implement. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the name of the module as a string. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the amino codec for the module, which is used +// to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message. +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. +// The default GenesisState need to be defined by the module developer and is primarily used for testing. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + + + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the module's genesis initialization. It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) +} + +// ExportGenesis returns the module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion is a sequence number for state-breaking change of the module. +// It should be incremented on each consensus-breaking change introduced by the module. +// To avoid wrong/empty versions, the initial version should be set to 1. +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block. +// The begin block implementation is optional. +func (am AppModule) BeginBlock(_ context.Context) error { + return nil +} + +// EndBlock contains the logic that is automatically triggered at the end of each block. +// The end block implementation is optional. +func (am AppModule) EndBlock(_ context.Context) error { + return nil +} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// ---------------------------------------------------------------------------- +// App Wiring Setup +// ---------------------------------------------------------------------------- + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + StoreService store.KVStoreService + Cdc codec.Codec + Config *modulev1.Module + Logger log.Logger + + AccountKeeper types.AccountKeeper + BankKeeper types.BankKeeper + + +} + +type ModuleOutputs struct { + depinject.Out + + MigrationKeeper keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) + } + k := keeper.NewKeeper( + in.Cdc, + in.StoreService, + in.Logger, + authority.String(), + ) + m := NewAppModule( + in.Cdc, + k, + in.AccountKeeper, + in.BankKeeper, + ) + + return ModuleOutputs{MigrationKeeper: k, Module: m} +} diff --git a/x/migration/module/simulation.go b/x/migration/module/simulation.go new file mode 100644 index 000000000..95061b9c0 --- /dev/null +++ b/x/migration/module/simulation.go @@ -0,0 +1,59 @@ +package migration + +import ( + "math/rand" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/pokt-network/poktroll/testutil/sample" + migrationsimulation "github.com/pokt-network/poktroll/x/migration/simulation" + "github.com/pokt-network/poktroll/x/migration/types" +) + +// avoid unused import issue +var ( + _ = migrationsimulation.FindAccount + _ = rand.Rand{} + _ = sample.AccAddress + _ = sdk.AccAddress{} + _ = simulation.MsgEntryKind +) + +const ( + // this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + migrationGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&migrationGenesis) +} + +// RegisterStoreDecoder registers a decoder. +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return []simtypes.WeightedProposalMsg{ + // this line is used by starport scaffolding # simapp/module/OpMsg + } +} diff --git a/x/migration/simulation/helpers.go b/x/migration/simulation/helpers.go new file mode 100644 index 000000000..92c437c0d --- /dev/null +++ b/x/migration/simulation/helpers.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/migration/types/codec.go b/x/migration/types/codec.go new file mode 100644 index 000000000..42406fd9c --- /dev/null +++ b/x/migration/types/codec.go @@ -0,0 +1,21 @@ +package types + +import ( + + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + + // this line is used by starport scaffolding # 1 +) + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 + + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + + diff --git a/x/migration/types/errors.go b/x/migration/types/errors.go new file mode 100644 index 000000000..304742c82 --- /dev/null +++ b/x/migration/types/errors.go @@ -0,0 +1,14 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "cosmossdk.io/errors" +) + +// x/migration module sentinel errors +var ( + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") + +) diff --git a/x/migration/types/expected_keepers.go b/x/migration/types/expected_keepers.go new file mode 100644 index 000000000..56479a8a8 --- /dev/null +++ b/x/migration/types/expected_keepers.go @@ -0,0 +1,29 @@ +package types + +import ( + "context" + + + sdk "github.com/cosmos/cosmos-sdk/types" + +) + + + +// AccountKeeper defines the expected interface for the Account module. +type AccountKeeper interface { + GetAccount(context.Context, sdk.AccAddress) sdk.AccountI // only used for simulation + // Methods imported from account should be defined here +} + +// BankKeeper defines the expected interface for the Bank module. +type BankKeeper interface { + SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here +} + +// ParamSubspace defines the expected Subspace interface for parameters. +type ParamSubspace interface { + Get(context.Context, []byte, interface{}) + Set(context.Context, []byte, interface{}) +} diff --git a/x/migration/types/genesis.go b/x/migration/types/genesis.go new file mode 100644 index 000000000..c41be0742 --- /dev/null +++ b/x/migration/types/genesis.go @@ -0,0 +1,24 @@ +package types + +import ( +// this line is used by starport scaffolding # genesis/types/import +) + +// DefaultIndex is the default global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} diff --git a/x/migration/types/genesis.pb.go b/x/migration/types/genesis.pb.go new file mode 100644 index 000000000..f96c504df --- /dev/null +++ b/x/migration/types/genesis.pb.go @@ -0,0 +1,324 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/migration/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the migration module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_c544bf46e8dacb64, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "poktroll.migration.GenesisState") +} + +func init() { proto.RegisterFile("poktroll/migration/genesis.proto", fileDescriptor_c544bf46e8dacb64) } + +var fileDescriptor_c544bf46e8dacb64 = []byte{ + // 215 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0xcf, 0xcd, 0x4c, 0x2f, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x4f, + 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xa9, + 0xd0, 0x83, 0xab, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x65, 0x52, + 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x95, 0xc7, 0x62, 0x7c, 0x41, + 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x74, 0x25, 0x5f, 0x2e, 0x1e, 0x77, 0x88, 0x75, 0xc1, 0x25, 0x89, + 0x25, 0xa9, 0x42, 0xb6, 0x5c, 0x6c, 0x10, 0x79, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x29, + 0x3d, 0x4c, 0xeb, 0xf5, 0x02, 0xc0, 0x2a, 0x9c, 0x38, 0x4f, 0xdc, 0x93, 0x67, 0x58, 0xf1, 0x7c, + 0x83, 0x16, 0x63, 0x10, 0x54, 0x93, 0x93, 0xcf, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, + 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, + 0x31, 0x44, 0x19, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0x8c, + 0xd4, 0xcd, 0x4b, 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0xbb, 0xb0, 0x02, 0xc9, 0x8d, 0x25, + 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x37, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x01, + 0xf4, 0xcf, 0xd2, 0x25, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/migration/types/genesis_test.go b/x/migration/types/genesis_test.go new file mode 100644 index 000000000..bf405c428 --- /dev/null +++ b/x/migration/types/genesis_test.go @@ -0,0 +1,41 @@ +package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/x/migration/types" +) + +func TestGenesisState_Validate(t *testing.T) { + tests := []struct { + desc string + genState *types.GenesisState + valid bool + } { + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} \ No newline at end of file diff --git a/x/migration/types/keys.go b/x/migration/types/keys.go new file mode 100644 index 000000000..12daba9fd --- /dev/null +++ b/x/migration/types/keys.go @@ -0,0 +1,24 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "migration" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_migration" + + +) + +var ( + ParamsKey = []byte("p_migration") +) + + + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/migration/types/msg_update_params.go b/x/migration/types/msg_update_params.go new file mode 100644 index 000000000..e36d023de --- /dev/null +++ b/x/migration/types/msg_update_params.go @@ -0,0 +1,21 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + if err := m.Params.Validate(); err != nil { + return err + } + + return nil +} diff --git a/x/migration/types/params.go b/x/migration/types/params.go new file mode 100644 index 000000000..e06131dcf --- /dev/null +++ b/x/migration/types/params.go @@ -0,0 +1,41 @@ +package types + +import ( + + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + + + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams( +) Params { + return Params{ + } +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams( + ) +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + } +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + diff --git a/x/migration/types/params.pb.go b/x/migration/types/params.pb.go new file mode 100644 index 000000000..a19499a7f --- /dev/null +++ b/x/migration/types/params.pb.go @@ -0,0 +1,289 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/migration/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_c43627a1a6fcee1f, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "poktroll.migration.Params") +} + +func init() { proto.RegisterFile("poktroll/migration/params.proto", fileDescriptor_c43627a1a6fcee1f) } + +var fileDescriptor_c43627a1a6fcee1f = []byte{ + // 178 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0xcf, 0xcd, 0x4c, 0x2f, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, + 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x29, 0xd0, + 0x83, 0x2b, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x65, 0x52, 0x22, + 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0xd2, 0xe3, 0x62, 0x0b, 0x00, + 0x1b, 0x66, 0xa5, 0xf2, 0x62, 0x81, 0x3c, 0x63, 0xd7, 0xf3, 0x0d, 0x5a, 0xd2, 0x70, 0x0b, 0x2b, + 0x90, 0xac, 0x84, 0xa8, 0x72, 0xf2, 0x39, 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, 0xa3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x90, 0x09, 0xba, + 0x79, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0x58, 0x8d, 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, + 0x62, 0x03, 0x3b, 0xc2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x16, 0xbf, 0x01, 0xe4, 0x00, + 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/migration/types/query.pb.go b/x/migration/types/query.pb.go new file mode 100644 index 000000000..760a31389 --- /dev/null +++ b/x/migration/types/query.pb.go @@ -0,0 +1,540 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/migration/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "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" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_524460f9291c42e8, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_524460f9291c42e8, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.migration.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.migration.QueryParamsResponse") +} + +func init() { proto.RegisterFile("poktroll/migration/query.proto", fileDescriptor_524460f9291c42e8) } + +var fileDescriptor_524460f9291c42e8 = []byte{ + // 323 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xb1, 0x4a, 0x33, 0x41, + 0x14, 0x85, 0x77, 0x7e, 0xf8, 0x03, 0xae, 0x95, 0x63, 0x0a, 0x59, 0x64, 0x22, 0x29, 0x8c, 0x06, + 0xdc, 0x4b, 0x62, 0x6d, 0x93, 0xda, 0x42, 0x83, 0x95, 0xdd, 0x6c, 0x18, 0xc6, 0x25, 0xd9, 0xb9, + 0x93, 0x9d, 0x89, 0x9a, 0xd6, 0xd2, 0x4a, 0xd0, 0x87, 0xb0, 0xf4, 0x31, 0x52, 0x06, 0x6c, 0xac, + 0x44, 0x12, 0xc1, 0xd7, 0x90, 0x9d, 0x59, 0x45, 0x49, 0x82, 0xcd, 0x72, 0xb9, 0xe7, 0x9c, 0x6f, + 0xcf, 0xdc, 0x90, 0x69, 0xec, 0xdb, 0x1c, 0x07, 0x03, 0xc8, 0x52, 0x99, 0x73, 0x9b, 0xa2, 0x82, + 0xe1, 0x48, 0xe4, 0xe3, 0x58, 0xe7, 0x68, 0x91, 0xd2, 0x2f, 0x3d, 0xfe, 0xd6, 0xa3, 0x0d, 0x9e, + 0xa5, 0x0a, 0xc1, 0x7d, 0xbd, 0x2d, 0xaa, 0x4a, 0x94, 0xe8, 0x46, 0x28, 0xa6, 0x72, 0xbb, 0x2d, + 0x11, 0xe5, 0x40, 0x00, 0xd7, 0x29, 0x70, 0xa5, 0xd0, 0xba, 0xbc, 0x29, 0xd5, 0x66, 0x0f, 0x4d, + 0x86, 0x06, 0x12, 0x6e, 0x84, 0xff, 0x27, 0x5c, 0xb6, 0x12, 0x61, 0x79, 0x0b, 0x34, 0x97, 0xa9, + 0x72, 0xe6, 0xd2, 0x5b, 0x5b, 0x52, 0x53, 0xf3, 0x9c, 0x67, 0x25, 0xac, 0x5e, 0x0d, 0xe9, 0x69, + 0x81, 0x38, 0x71, 0xcb, 0xae, 0x18, 0x8e, 0x84, 0xb1, 0xf5, 0xb3, 0x70, 0xf3, 0xd7, 0xd6, 0x68, + 0x54, 0x46, 0xd0, 0xa3, 0xb0, 0xe2, 0xc3, 0x5b, 0x64, 0x87, 0xec, 0xad, 0xb7, 0xa3, 0x78, 0xf1, + 0x95, 0xb1, 0xcf, 0x74, 0xd6, 0x26, 0xaf, 0xb5, 0xe0, 0xf1, 0xe3, 0xa9, 0x49, 0xba, 0x65, 0xa8, + 0xfd, 0x40, 0xc2, 0xff, 0x0e, 0x4b, 0x6f, 0x49, 0x58, 0xf1, 0x3e, 0xba, 0xbb, 0x8c, 0xb1, 0x58, + 0x29, 0x6a, 0xfc, 0xe9, 0xf3, 0x25, 0xeb, 0x70, 0xf3, 0xfc, 0x7e, 0xff, 0x6f, 0x9f, 0x36, 0xa0, + 0x08, 0x1c, 0x28, 0x61, 0xaf, 0x30, 0xef, 0xc3, 0xca, 0x43, 0x74, 0x8e, 0x27, 0x33, 0x46, 0xa6, + 0x33, 0x46, 0xde, 0x66, 0x8c, 0xdc, 0xcd, 0x59, 0x30, 0x9d, 0xb3, 0xe0, 0x65, 0xce, 0x82, 0xf3, + 0xb6, 0x4c, 0xed, 0xc5, 0x28, 0x89, 0x7b, 0x98, 0xad, 0x80, 0x5d, 0xff, 0xc0, 0xd9, 0xb1, 0x16, + 0x26, 0xa9, 0xb8, 0xbb, 0x1e, 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff, 0xec, 0x53, 0x0c, 0xf2, 0x21, + 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.migration.Query/Params", 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) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.migration.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.migration.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/migration/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/migration/types/query.pb.gw.go b/x/migration/types/query.pb.gw.go new file mode 100644 index 000000000..5ab60bb65 --- /dev/null +++ b/x/migration/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: poktroll/migration/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_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_Params_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_Params_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, 2, 3}, []string{"pokt-network", "poktroll", "migration", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go new file mode 100644 index 000000000..319c9fb42 --- /dev/null +++ b/x/migration/types/tx.pb.go @@ -0,0 +1,598 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/migration/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the module parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_21658240592266b6, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "poktroll.migration.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "poktroll.migration.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } + +var fileDescriptor_21658240592266b6 = []byte{ + // 348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0xcf, 0xcd, 0x4c, 0x2f, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, + 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x49, 0xea, 0xc1, 0x25, 0xa5, 0x04, + 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x99, 0x94, 0x78, 0x72, 0x7e, 0x71, 0x6e, + 0x7e, 0xb1, 0x7e, 0x6e, 0x71, 0xba, 0x7e, 0x99, 0x21, 0x88, 0x82, 0x4a, 0x48, 0x42, 0x24, 0xe2, + 0xc1, 0x3c, 0x7d, 0x08, 0x07, 0x2a, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x11, 0x07, 0xb1, 0xa0, + 0xa2, 0xf2, 0x58, 0x5c, 0x53, 0x90, 0x58, 0x94, 0x98, 0x0b, 0xd5, 0xa6, 0x74, 0x90, 0x91, 0x8b, + 0xdf, 0xb7, 0x38, 0x3d, 0xb4, 0x20, 0x25, 0xb1, 0x24, 0x35, 0x00, 0x2c, 0x23, 0x64, 0xc6, 0xc5, + 0x99, 0x58, 0x5a, 0x92, 0x91, 0x5f, 0x94, 0x59, 0x52, 0x29, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, + 0x24, 0x71, 0x69, 0x8b, 0xae, 0x08, 0xd4, 0x3e, 0xc7, 0x94, 0x94, 0xa2, 0xd4, 0xe2, 0xe2, 0xe0, + 0x92, 0xa2, 0xcc, 0xbc, 0xf4, 0x20, 0x84, 0x52, 0x21, 0x5b, 0x2e, 0x36, 0x88, 0xd9, 0x12, 0x4c, + 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x52, 0x7a, 0x98, 0xde, 0xd5, 0x83, 0xd8, 0xe1, 0xc4, 0x79, 0xe2, + 0x9e, 0x3c, 0xc3, 0x8a, 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xa0, 0x9a, 0xac, 0xcc, 0x9b, 0x9e, 0x6f, + 0xd0, 0x42, 0x18, 0xd7, 0xf5, 0x7c, 0x83, 0x96, 0x0a, 0xdc, 0xf9, 0x15, 0x48, 0x1e, 0x40, 0x73, + 0xaf, 0x92, 0x24, 0x97, 0x38, 0x9a, 0x50, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x51, + 0x1e, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x02, 0x17, 0x0f, 0x8a, 0x0f, 0x95, 0xb1, 0xb9, 0x0c, + 0xcd, 0x0c, 0x29, 0x6d, 0x22, 0x14, 0xc1, 0x2c, 0x92, 0x62, 0x6d, 0x00, 0xf9, 0xc5, 0xc9, 0xe7, + 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, 0x8c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, + 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, 0xe6, 0xea, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, + 0xeb, 0x63, 0xf5, 0x62, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x8e, 0x8c, 0x01, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xf4, 0x2a, 0xcc, 0x0a, 0x54, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a (governance) operation for updating the module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/poktroll.migration.Msg/UpdateParams", 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 module + // parameters. The authority defaults to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.migration.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "poktroll.migration.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "poktroll/migration/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.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 *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/migration/types/types.go b/x/migration/types/types.go new file mode 100644 index 000000000..ab1254f4c --- /dev/null +++ b/x/migration/types/types.go @@ -0,0 +1 @@ +package types From 5235822e329574097e99d196ad2c7cbe717b37ab Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 20 Jan 2025 12:54:51 +0100 Subject: [PATCH 02/19] fix: linter error --- x/migration/types/msg_update_params.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/migration/types/msg_update_params.go b/x/migration/types/msg_update_params.go index e36d023de..c228cb30f 100644 --- a/x/migration/types/msg_update_params.go +++ b/x/migration/types/msg_update_params.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -var _ sdk.Msg = &MsgUpdateParams{} +var _ sdk.Msg = new(MsgUpdateParams) // ValidateBasic does a sanity check on the provided data. func (m *MsgUpdateParams) ValidateBasic() error { From 6d9c3d9e5d01c2992c6bb5f939a80701acff649f Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 20 Jan 2025 14:42:25 +0100 Subject: [PATCH 03/19] fix: stable marshaler options --- api/poktroll/migration/genesis.pulsar.go | 25 +++---- .../migration/module/module.pulsar.go | 45 ++++++------ api/poktroll/migration/params.pulsar.go | 26 +++---- api/poktroll/migration/query.pulsar.go | 26 +++---- api/poktroll/migration/tx.pulsar.go | 26 +++---- proto/poktroll/migration/genesis.proto | 1 + proto/poktroll/migration/module/module.proto | 5 +- proto/poktroll/migration/params.proto | 1 + proto/poktroll/migration/query.proto | 1 + proto/poktroll/migration/tx.proto | 1 + x/migration/types/genesis.pb.go | 28 ++++---- x/migration/types/params.pb.go | 28 ++++---- x/migration/types/query.pb.go | 72 +++++++++---------- x/migration/types/tx.pb.go | 42 +++++------ 14 files changed, 157 insertions(+), 170 deletions(-) diff --git a/api/poktroll/migration/genesis.pulsar.go b/api/poktroll/migration/genesis.pulsar.go index bc982912a..7a7ad4714 100644 --- a/api/poktroll/migration/genesis.pulsar.go +++ b/api/poktroll/migration/genesis.pulsar.go @@ -515,18 +515,19 @@ var file_poktroll_migration_genesis_proto_rawDesc = []byte{ 0x32, 0x1a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x42, - 0xb4, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, - 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, - 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, - 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0xb8, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0c, + 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, + 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, + 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/api/poktroll/migration/module/module.pulsar.go b/api/poktroll/migration/module/module.pulsar.go index fafe8af22..092dd13aa 100644 --- a/api/poktroll/migration/module/module.pulsar.go +++ b/api/poktroll/migration/module/module.pulsar.go @@ -5,6 +5,7 @@ import ( _ "cosmossdk.io/api/cosmos/app/v1alpha1" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -492,27 +493,29 @@ var file_poktroll_migration_module_module_proto_rawDesc = []byte{ 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x34, 0xba, - 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0xde, 0x01, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x4d, 0xaa, 0x02, 0x19, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0xca, 0x02, 0x19, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, - 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xe2, 0x02, - 0x25, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x06, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x3a, 0x34, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xe2, 0x01, 0xd8, 0xe2, 0x1e, 0x01, + 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x42, + 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x4d, + 0xaa, 0x02, 0x19, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xca, 0x02, 0x19, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xe2, 0x02, 0x25, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/migration/params.pulsar.go b/api/poktroll/migration/params.pulsar.go index 1b0d8934d..59e393ca3 100644 --- a/api/poktroll/migration/params.pulsar.go +++ b/api/poktroll/migration/params.pulsar.go @@ -421,19 +421,19 @@ var file_poktroll_migration_params_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2e, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x24, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x6d, 0x69, - 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xb3, - 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, - 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, - 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, - 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xb7, + 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/migration/query.pulsar.go b/api/poktroll/migration/query.pulsar.go index 4a34ceb4b..cb890aa65 100644 --- a/api/poktroll/migration/query.pulsar.go +++ b/api/poktroll/migration/query.pulsar.go @@ -915,19 +915,19 @@ var file_poktroll_migration_query_proto_rawDesc = []byte{ 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xb2, 0x01, 0x0a, 0x16, - 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, - 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, - 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xb6, 0x01, 0xd8, 0xe2, + 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, + 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/migration/tx.pulsar.go b/api/poktroll/migration/tx.pulsar.go index a14b2d6f0..f7af6fa34 100644 --- a/api/poktroll/migration/tx.pulsar.go +++ b/api/poktroll/migration/tx.pulsar.go @@ -994,19 +994,19 @@ var file_poktroll_migration_tx_proto_rawDesc = []byte{ 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0xaf, - 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, - 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, - 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb3, + 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, + 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, + 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/poktroll/migration/genesis.proto b/proto/poktroll/migration/genesis.proto index c7ad1757c..f176aaacc 100644 --- a/proto/poktroll/migration/genesis.proto +++ b/proto/poktroll/migration/genesis.proto @@ -6,6 +6,7 @@ import "gogoproto/gogo.proto"; import "poktroll/migration/params.proto"; option go_package = "github.com/pokt-network/poktroll/x/migration/types"; +option (gogoproto.stable_marshaler_all) = true; // GenesisState defines the migration module's genesis state. message GenesisState { diff --git a/proto/poktroll/migration/module/module.proto b/proto/poktroll/migration/module/module.proto index bb742cdf2..26ce1692d 100644 --- a/proto/poktroll/migration/module/module.proto +++ b/proto/poktroll/migration/module/module.proto @@ -1,7 +1,10 @@ syntax = "proto3"; package poktroll.migration.module; +option (gogoproto.stable_marshaler_all) = true; + import "cosmos/app/v1alpha1/module.proto"; +import "gogoproto/gogo.proto"; // Module is the config object for the module. message Module { @@ -11,4 +14,4 @@ message Module { // authority defines the custom module authority. If not set, defaults to the governance module. string authority = 1; -} \ No newline at end of file +} diff --git a/proto/poktroll/migration/params.proto b/proto/poktroll/migration/params.proto index 458f260a7..b20062256 100644 --- a/proto/poktroll/migration/params.proto +++ b/proto/poktroll/migration/params.proto @@ -5,6 +5,7 @@ import "amino/amino.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/pokt-network/poktroll/x/migration/types"; +option (gogoproto.stable_marshaler_all) = true; // Params defines the parameters for the module. message Params { diff --git a/proto/poktroll/migration/query.proto b/proto/poktroll/migration/query.proto index 6a8c2d520..c3c04bc0c 100644 --- a/proto/poktroll/migration/query.proto +++ b/proto/poktroll/migration/query.proto @@ -8,6 +8,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "poktroll/migration/params.proto"; option go_package = "github.com/pokt-network/poktroll/x/migration/types"; +option (gogoproto.stable_marshaler_all) = true; // Query defines the gRPC querier service. service Query { diff --git a/proto/poktroll/migration/tx.proto b/proto/poktroll/migration/tx.proto index 5352ef90d..9e9957de3 100644 --- a/proto/poktroll/migration/tx.proto +++ b/proto/poktroll/migration/tx.proto @@ -8,6 +8,7 @@ import "gogoproto/gogo.proto"; import "poktroll/migration/params.proto"; option go_package = "github.com/pokt-network/poktroll/x/migration/types"; +option (gogoproto.stable_marshaler_all) = true; // Msg defines the Msg service. service Msg { diff --git a/x/migration/types/genesis.pb.go b/x/migration/types/genesis.pb.go index f96c504df..334ae0fd2 100644 --- a/x/migration/types/genesis.pb.go +++ b/x/migration/types/genesis.pb.go @@ -40,16 +40,12 @@ func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } func (m *GenesisState) XXX_Merge(src proto.Message) { xxx_messageInfo_GenesisState.Merge(m, src) @@ -77,7 +73,7 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/genesis.proto", fileDescriptor_c544bf46e8dacb64) } var fileDescriptor_c544bf46e8dacb64 = []byte{ - // 215 bytes of a gzipped FileDescriptorProto + // 219 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0xc8, 0xcf, 0x2e, 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0xcf, 0xcd, 0x4c, 0x2f, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xa9, @@ -86,12 +82,12 @@ var fileDescriptor_c544bf46e8dacb64 = []byte{ 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x74, 0x25, 0x5f, 0x2e, 0x1e, 0x77, 0x88, 0x75, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, 0xb6, 0x5c, 0x6c, 0x10, 0x79, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x29, 0x3d, 0x4c, 0xeb, 0xf5, 0x02, 0xc0, 0x2a, 0x9c, 0x38, 0x4f, 0xdc, 0x93, 0x67, 0x58, 0xf1, 0x7c, - 0x83, 0x16, 0x63, 0x10, 0x54, 0x93, 0x93, 0xcf, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, - 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, - 0x31, 0x44, 0x19, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0x8c, - 0xd4, 0xcd, 0x4b, 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0xbb, 0xb0, 0x02, 0xc9, 0x8d, 0x25, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x37, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x01, - 0xf4, 0xcf, 0xd2, 0x25, 0x01, 0x00, 0x00, + 0x83, 0x16, 0x63, 0x10, 0x54, 0x93, 0x53, 0xc0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, + 0xde, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, + 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, + 0x9f, 0xab, 0x0f, 0x32, 0x56, 0x37, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x5b, 0x1f, 0xee, 0xca, + 0x0a, 0x24, 0x77, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xdd, 0x69, 0x0c, 0x08, 0x00, + 0x00, 0xff, 0xff, 0xd2, 0xec, 0xd5, 0xe0, 0x29, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/migration/types/params.pb.go b/x/migration/types/params.pb.go index a19499a7f..549b399e5 100644 --- a/x/migration/types/params.pb.go +++ b/x/migration/types/params.pb.go @@ -38,16 +38,12 @@ func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } func (m *Params) XXX_Merge(src proto.Message) { xxx_messageInfo_Params.Merge(m, src) @@ -68,19 +64,19 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/params.proto", fileDescriptor_c43627a1a6fcee1f) } var fileDescriptor_c43627a1a6fcee1f = []byte{ - // 178 bytes of a gzipped FileDescriptorProto + // 183 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xc8, 0xcf, 0x2e, 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0xcf, 0xcd, 0x4c, 0x2f, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x29, 0xd0, 0x83, 0x2b, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x65, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0xd2, 0xe3, 0x62, 0x0b, 0x00, 0x1b, 0x66, 0xa5, 0xf2, 0x62, 0x81, 0x3c, 0x63, 0xd7, 0xf3, 0x0d, 0x5a, 0xd2, 0x70, 0x0b, 0x2b, - 0x90, 0xac, 0x84, 0xa8, 0x72, 0xf2, 0x39, 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, 0xa3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x90, 0x09, 0xba, - 0x79, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0x58, 0x8d, 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, - 0x62, 0x03, 0x3b, 0xc2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x16, 0xbf, 0x01, 0xe4, 0x00, - 0x00, 0x00, + 0x90, 0xac, 0x84, 0xa8, 0x72, 0x0a, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x1b, + 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, + 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x8c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, + 0xf5, 0x41, 0xa6, 0xe8, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0x63, 0x35, 0xb2, 0xa4, + 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x10, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x62, + 0x7c, 0x65, 0x65, 0xe8, 0x00, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { diff --git a/x/migration/types/query.pb.go b/x/migration/types/query.pb.go index 760a31389..d82a26af1 100644 --- a/x/migration/types/query.pb.go +++ b/x/migration/types/query.pb.go @@ -45,16 +45,12 @@ func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryParamsRequest.Merge(m, src) @@ -84,16 +80,12 @@ func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_QueryParamsResponse.Merge(m, src) @@ -122,28 +114,28 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/query.proto", fileDescriptor_524460f9291c42e8) } var fileDescriptor_524460f9291c42e8 = []byte{ - // 323 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xb1, 0x4a, 0x33, 0x41, - 0x14, 0x85, 0x77, 0x7e, 0xf8, 0x03, 0xae, 0x95, 0x63, 0x0a, 0x59, 0x64, 0x22, 0x29, 0x8c, 0x06, - 0xdc, 0x4b, 0x62, 0x6d, 0x93, 0xda, 0x42, 0x83, 0x95, 0xdd, 0x6c, 0x18, 0xc6, 0x25, 0xd9, 0xb9, - 0x93, 0x9d, 0x89, 0x9a, 0xd6, 0xd2, 0x4a, 0xd0, 0x87, 0xb0, 0xf4, 0x31, 0x52, 0x06, 0x6c, 0xac, - 0x44, 0x12, 0xc1, 0xd7, 0x90, 0x9d, 0x59, 0x45, 0x49, 0x82, 0xcd, 0x72, 0xb9, 0xe7, 0x9c, 0x6f, - 0xcf, 0xdc, 0x90, 0x69, 0xec, 0xdb, 0x1c, 0x07, 0x03, 0xc8, 0x52, 0x99, 0x73, 0x9b, 0xa2, 0x82, - 0xe1, 0x48, 0xe4, 0xe3, 0x58, 0xe7, 0x68, 0x91, 0xd2, 0x2f, 0x3d, 0xfe, 0xd6, 0xa3, 0x0d, 0x9e, - 0xa5, 0x0a, 0xc1, 0x7d, 0xbd, 0x2d, 0xaa, 0x4a, 0x94, 0xe8, 0x46, 0x28, 0xa6, 0x72, 0xbb, 0x2d, - 0x11, 0xe5, 0x40, 0x00, 0xd7, 0x29, 0x70, 0xa5, 0xd0, 0xba, 0xbc, 0x29, 0xd5, 0x66, 0x0f, 0x4d, - 0x86, 0x06, 0x12, 0x6e, 0x84, 0xff, 0x27, 0x5c, 0xb6, 0x12, 0x61, 0x79, 0x0b, 0x34, 0x97, 0xa9, - 0x72, 0xe6, 0xd2, 0x5b, 0x5b, 0x52, 0x53, 0xf3, 0x9c, 0x67, 0x25, 0xac, 0x5e, 0x0d, 0xe9, 0x69, - 0x81, 0x38, 0x71, 0xcb, 0xae, 0x18, 0x8e, 0x84, 0xb1, 0xf5, 0xb3, 0x70, 0xf3, 0xd7, 0xd6, 0x68, - 0x54, 0x46, 0xd0, 0xa3, 0xb0, 0xe2, 0xc3, 0x5b, 0x64, 0x87, 0xec, 0xad, 0xb7, 0xa3, 0x78, 0xf1, - 0x95, 0xb1, 0xcf, 0x74, 0xd6, 0x26, 0xaf, 0xb5, 0xe0, 0xf1, 0xe3, 0xa9, 0x49, 0xba, 0x65, 0xa8, - 0xfd, 0x40, 0xc2, 0xff, 0x0e, 0x4b, 0x6f, 0x49, 0x58, 0xf1, 0x3e, 0xba, 0xbb, 0x8c, 0xb1, 0x58, - 0x29, 0x6a, 0xfc, 0xe9, 0xf3, 0x25, 0xeb, 0x70, 0xf3, 0xfc, 0x7e, 0xff, 0x6f, 0x9f, 0x36, 0xa0, - 0x08, 0x1c, 0x28, 0x61, 0xaf, 0x30, 0xef, 0xc3, 0xca, 0x43, 0x74, 0x8e, 0x27, 0x33, 0x46, 0xa6, - 0x33, 0x46, 0xde, 0x66, 0x8c, 0xdc, 0xcd, 0x59, 0x30, 0x9d, 0xb3, 0xe0, 0x65, 0xce, 0x82, 0xf3, - 0xb6, 0x4c, 0xed, 0xc5, 0x28, 0x89, 0x7b, 0x98, 0xad, 0x80, 0x5d, 0xff, 0xc0, 0xd9, 0xb1, 0x16, - 0x26, 0xa9, 0xb8, 0xbb, 0x1e, 0x7e, 0x06, 0x00, 0x00, 0xff, 0xff, 0xec, 0x53, 0x0c, 0xf2, 0x21, - 0x02, 0x00, 0x00, + // 325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0xc7, 0x73, 0x82, 0x05, 0xe3, 0xe4, 0xd9, 0x41, 0x82, 0x5c, 0xa5, 0x83, 0xd5, 0x82, 0x79, + 0xb4, 0xce, 0x2e, 0xfd, 0x04, 0xb5, 0x38, 0xb9, 0x5d, 0xca, 0x71, 0x86, 0x36, 0xf7, 0xae, 0xb9, + 0xab, 0xda, 0xd5, 0xd1, 0x49, 0xd0, 0x0f, 0xe1, 0xe8, 0xc7, 0xe8, 0x58, 0x70, 0xe9, 0x24, 0x92, + 0x0a, 0x7e, 0x0d, 0xc9, 0x25, 0x8a, 0xd2, 0x16, 0x97, 0xf0, 0x78, 0xff, 0xff, 0xff, 0x97, 0xff, + 0x3d, 0x9f, 0x69, 0x1c, 0xd8, 0x14, 0x87, 0x43, 0x48, 0x62, 0x99, 0x72, 0x1b, 0xa3, 0x82, 0xd1, + 0x58, 0xa4, 0x93, 0x50, 0xa7, 0x68, 0x91, 0xd2, 0x6f, 0x3d, 0xfc, 0xd1, 0x83, 0x1d, 0x9e, 0xc4, + 0x0a, 0xc1, 0x7d, 0x0b, 0x5b, 0x50, 0x95, 0x28, 0xd1, 0x8d, 0x90, 0x4f, 0xe5, 0x76, 0x5f, 0x22, + 0xca, 0xa1, 0x00, 0xae, 0x63, 0xe0, 0x4a, 0xa1, 0x75, 0x79, 0x53, 0xaa, 0xcd, 0x3e, 0x9a, 0x04, + 0x0d, 0x44, 0xdc, 0x88, 0xe2, 0x9f, 0x70, 0xdd, 0x8a, 0x84, 0xe5, 0x2d, 0xd0, 0x5c, 0xc6, 0xca, + 0x99, 0x4b, 0x6f, 0x6d, 0x45, 0x4d, 0xcd, 0x53, 0x9e, 0x94, 0xb0, 0x7a, 0xd5, 0xa7, 0xe7, 0x39, + 0xa2, 0xeb, 0x96, 0x3d, 0x31, 0x1a, 0x0b, 0x63, 0xeb, 0x17, 0xfe, 0xee, 0x9f, 0xad, 0xd1, 0xa8, + 0x8c, 0xa0, 0x67, 0x7e, 0xa5, 0x08, 0xef, 0x91, 0x03, 0x72, 0xb4, 0xdd, 0x0e, 0xc2, 0xe5, 0x57, + 0x86, 0x45, 0xa6, 0xb3, 0x35, 0x7d, 0xab, 0x79, 0xcf, 0x9f, 0x2f, 0x4d, 0xd2, 0x2b, 0x43, 0xed, + 0x27, 0xe2, 0x6f, 0x3a, 0x2c, 0xbd, 0x27, 0x7e, 0xa5, 0xf0, 0xd1, 0xc3, 0x55, 0x8c, 0xe5, 0x4a, + 0x41, 0xe3, 0x5f, 0x5f, 0x51, 0xb2, 0x0e, 0x77, 0xaf, 0x1f, 0x8f, 0x1b, 0xc7, 0xb4, 0x01, 0x79, + 0xe0, 0x44, 0x09, 0x7b, 0x83, 0xe9, 0x00, 0xd6, 0x1e, 0xa2, 0xd3, 0x9d, 0x66, 0x8c, 0xcc, 0x32, + 0x46, 0xe6, 0x19, 0x23, 0xef, 0x19, 0x23, 0x0f, 0x0b, 0xe6, 0xcd, 0x16, 0xcc, 0x9b, 0x2f, 0x98, + 0x77, 0xd9, 0x96, 0xb1, 0xbd, 0x1a, 0x47, 0x61, 0x1f, 0x93, 0x35, 0xc0, 0xdb, 0x5f, 0x48, 0x3b, + 0xd1, 0xc2, 0x44, 0x15, 0x77, 0xdb, 0xd3, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x97, 0x9a, 0x4e, + 0xc3, 0x25, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/migration/types/tx.pb.go b/x/migration/types/tx.pb.go index 319c9fb42..6299c5f97 100644 --- a/x/migration/types/tx.pb.go +++ b/x/migration/types/tx.pb.go @@ -51,16 +51,12 @@ func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateParams.Merge(m, src) @@ -103,16 +99,12 @@ func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) @@ -134,7 +126,7 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/tx.proto", fileDescriptor_21658240592266b6) } var fileDescriptor_21658240592266b6 = []byte{ - // 348 bytes of a gzipped FileDescriptorProto + // 352 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xc8, 0xcf, 0x2e, 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0xcf, 0xcd, 0x4c, 0x2f, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0x49, 0xea, 0xc1, 0x25, 0xa5, 0x04, @@ -151,12 +143,12 @@ var fileDescriptor_21658240592266b6 = []byte{ 0xd0, 0x42, 0x18, 0xd7, 0xf5, 0x7c, 0x83, 0x96, 0x0a, 0xdc, 0xf9, 0x15, 0x48, 0x1e, 0x40, 0x73, 0xaf, 0x92, 0x24, 0x97, 0x38, 0x9a, 0x50, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x51, 0x1e, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x02, 0x17, 0x0f, 0x8a, 0x0f, 0x95, 0xb1, 0xb9, 0x0c, - 0xcd, 0x0c, 0x29, 0x6d, 0x22, 0x14, 0xc1, 0x2c, 0x92, 0x62, 0x6d, 0x00, 0xf9, 0xc5, 0xc9, 0xe7, - 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, 0x8c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, - 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, 0xe6, 0xea, 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, - 0xeb, 0x63, 0xf5, 0x62, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0x8e, 0x8c, 0x01, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xf4, 0x2a, 0xcc, 0x0a, 0x54, 0x02, 0x00, 0x00, + 0xcd, 0x0c, 0x29, 0x6d, 0x22, 0x14, 0xc1, 0x2c, 0x92, 0x62, 0x6d, 0x00, 0xf9, 0xc5, 0x29, 0xe0, + 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x6f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, + 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x4a, + 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x07, 0x99, 0xad, 0x9b, 0x97, 0x5a, + 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x8f, 0xd5, 0x9b, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, + 0x78, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x58, 0x1b, 0x5f, 0x75, 0x58, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From b225150b2031baabcabbfc2a5e7f298eda8ef73f Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 21 Jan 2025 13:10:18 +0100 Subject: [PATCH 04/19] fix: linter errors --- app/app.go | 4 +- app/app_config.go | 15 ++--- testutil/keeper/migration.go | 8 +-- x/migration/keeper/keeper.go | 18 ++---- x/migration/keeper/msg_server_test.go | 8 +-- x/migration/keeper/msg_update_params.go | 2 +- x/migration/keeper/msg_update_params_test.go | 2 +- x/migration/keeper/params.go | 3 +- x/migration/keeper/params_test.go | 4 +- x/migration/keeper/query_params.go | 2 +- x/migration/keeper/query_params_test.go | 4 +- x/migration/module/autocli.go | 6 +- x/migration/module/genesis_test.go | 6 +- x/migration/module/module.go | 33 +++++------ x/migration/module/simulation.go | 6 +- x/migration/types/codec.go | 4 -- x/migration/types/errors.go | 3 +- x/migration/types/expected_keepers.go | 12 ++-- x/migration/types/genesis_test.go | 58 ++++++++++---------- x/migration/types/keys.go | 6 +- x/migration/types/params.go | 17 ++---- 21 files changed, 92 insertions(+), 129 deletions(-) diff --git a/app/app.go b/app/app.go index 54d97b4e8..6e9cff698 100644 --- a/app/app.go +++ b/app/app.go @@ -2,7 +2,7 @@ package app import ( migrationmodulekeeper "github.com/pokt-network/poktroll/x/migration/keeper" -// this line is used by starport scaffolding # stargate/app/moduleImport + // this line is used by starport scaffolding # stargate/app/moduleImport "io" "os" "path/filepath" @@ -71,7 +71,7 @@ type App struct { sm *module.SimulationManager MigrationKeeper migrationmodulekeeper.Keeper -// this line is used by starport scaffolding # stargate/app/keeperDeclaration + // this line is used by starport scaffolding # stargate/app/keeperDeclaration // Ignite CLI adds keepers here when scaffolding new modules. Please move the created keeper to the `keepers` package. } diff --git a/app/app_config.go b/app/app_config.go index ddc0ea1e9..0c91af588 100644 --- a/app/app_config.go +++ b/app/app_config.go @@ -2,9 +2,10 @@ package app import ( migrationmodulev1 "github.com/pokt-network/poktroll/api/poktroll/migration/module" -_ "github.com/pokt-network/poktroll/x/migration/module" // import for side-effects -migrationmoduletypes "github.com/pokt-network/poktroll/x/migration/types" -// this line is used by starport scaffolding # stargate/app/moduleImport + _ "github.com/pokt-network/poktroll/x/migration/module" // import for side-effects + migrationmoduletypes "github.com/pokt-network/poktroll/x/migration/types" + + // this line is used by starport scaffolding # stargate/app/moduleImport "time" runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" @@ -144,7 +145,7 @@ var ( tokenomicsmoduletypes.ModuleName, sharedmoduletypes.ModuleName, migrationmoduletypes.ModuleName, -// this line is used by starport scaffolding # stargate/app/initGenesis + // this line is used by starport scaffolding # stargate/app/initGenesis } // During begin block slashing happens after distr.BeginBlocker so that @@ -177,7 +178,7 @@ var ( tokenomicsmoduletypes.ModuleName, sharedmoduletypes.ModuleName, migrationmoduletypes.ModuleName, -// this line is used by starport scaffolding # stargate/app/beginBlockers + // this line is used by starport scaffolding # stargate/app/beginBlockers } endBlockers = []string{ @@ -209,7 +210,7 @@ var ( suppliermoduletypes.ModuleName, sharedmoduletypes.ModuleName, migrationmoduletypes.ModuleName, -// this line is used by starport scaffolding # stargate/app/endBlockers + // this line is used by starport scaffolding # stargate/app/endBlockers } preBlockers = []string{ @@ -401,7 +402,7 @@ var ( Name: migrationmoduletypes.ModuleName, Config: appconfig.WrapAny(&migrationmodulev1.Module{}), }, -// this line is used by starport scaffolding # stargate/app/moduleConfig + // this line is used by starport scaffolding # stargate/app/moduleConfig }, }) ) diff --git a/testutil/keeper/migration.go b/testutil/keeper/migration.go index 6be21258c..fd85baf9f 100644 --- a/testutil/keeper/migration.go +++ b/testutil/keeper/migration.go @@ -34,10 +34,10 @@ func MigrationKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { authority := authtypes.NewModuleAddress(govtypes.ModuleName) k := keeper.NewKeeper( - cdc, - runtime.NewKVStoreService(storeKey), - log.NewNopLogger(), - authority.String(), + cdc, + runtime.NewKVStoreService(storeKey), + log.NewNopLogger(), + authority.String(), ) ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) diff --git a/x/migration/keeper/keeper.go b/x/migration/keeper/keeper.go index d5ce749e4..af25b6e3d 100644 --- a/x/migration/keeper/keeper.go +++ b/x/migration/keeper/keeper.go @@ -7,7 +7,6 @@ import ( "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/pokt-network/poktroll/x/migration/types" ) @@ -18,20 +17,18 @@ type ( storeService store.KVStoreService logger log.Logger - // the address capable of executing a MsgUpdateParams message. Typically, this - // should be the x/gov module account. - authority string - - + // the address capable of executing a MsgUpdateParams message. Typically, this + // should be the x/gov module account. + authority string } ) func NewKeeper( - cdc codec.BinaryCodec, + cdc codec.BinaryCodec, storeService store.KVStoreService, - logger log.Logger, + logger log.Logger, authority string, - + ) Keeper { if _, err := sdk.AccAddressFromBech32(authority); err != nil { panic(fmt.Sprintf("invalid authority address: %s", authority)) @@ -42,7 +39,6 @@ func NewKeeper( storeService: storeService, authority: authority, logger: logger, - } } @@ -55,5 +51,3 @@ func (k Keeper) GetAuthority() string { func (k Keeper) Logger() log.Logger { return k.logger.With("module", fmt.Sprintf("x/%s", types.ModuleName)) } - - diff --git a/x/migration/keeper/msg_server_test.go b/x/migration/keeper/msg_server_test.go index 41683844d..3a35e11d5 100644 --- a/x/migration/keeper/msg_server_test.go +++ b/x/migration/keeper/msg_server_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/require" - keepertest "github.com/pokt-network/poktroll/testutil/keeper" - "github.com/pokt-network/poktroll/x/migration/types" - "github.com/pokt-network/poktroll/x/migration/keeper" + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/x/migration/keeper" + "github.com/pokt-network/poktroll/x/migration/types" ) func setupMsgServer(t testing.TB) (keeper.Keeper, types.MsgServer, context.Context) { @@ -21,4 +21,4 @@ func TestMsgServer(t *testing.T) { require.NotNil(t, ms) require.NotNil(t, ctx) require.NotEmpty(t, k) -} \ No newline at end of file +} diff --git a/x/migration/keeper/msg_update_params.go b/x/migration/keeper/msg_update_params.go index 10c587425..0759f393a 100644 --- a/x/migration/keeper/msg_update_params.go +++ b/x/migration/keeper/msg_update_params.go @@ -6,7 +6,7 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/pokt-network/poktroll/x/migration/types" + "github.com/pokt-network/poktroll/x/migration/types" ) func (k msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { diff --git a/x/migration/keeper/msg_update_params_test.go b/x/migration/keeper/msg_update_params_test.go index 1e077822d..b286026b7 100644 --- a/x/migration/keeper/msg_update_params_test.go +++ b/x/migration/keeper/msg_update_params_test.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/pokt-network/poktroll/x/migration/types" + "github.com/pokt-network/poktroll/x/migration/types" ) func TestMsgUpdateParams(t *testing.T) { diff --git a/x/migration/keeper/params.go b/x/migration/keeper/params.go index 91fcb1184..aeac86948 100644 --- a/x/migration/keeper/params.go +++ b/x/migration/keeper/params.go @@ -5,10 +5,9 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" - "github.com/pokt-network/poktroll/x/migration/types" + "github.com/pokt-network/poktroll/x/migration/types" ) - // GetParams get all parameters as types.Params func (k Keeper) GetParams(ctx context.Context) (params types.Params) { store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) diff --git a/x/migration/keeper/params_test.go b/x/migration/keeper/params_test.go index c0cfdb877..c628ac0cb 100644 --- a/x/migration/keeper/params_test.go +++ b/x/migration/keeper/params_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - keepertest "github.com/pokt-network/poktroll/testutil/keeper" - "github.com/pokt-network/poktroll/x/migration/types" + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/x/migration/types" ) func TestGetParams(t *testing.T) { diff --git a/x/migration/keeper/query_params.go b/x/migration/keeper/query_params.go index 06443c66b..db63079c6 100644 --- a/x/migration/keeper/query_params.go +++ b/x/migration/keeper/query_params.go @@ -7,7 +7,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/pokt-network/poktroll/x/migration/types" + "github.com/pokt-network/poktroll/x/migration/types" ) func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { diff --git a/x/migration/keeper/query_params_test.go b/x/migration/keeper/query_params_test.go index 0802b13a6..46deda203 100644 --- a/x/migration/keeper/query_params_test.go +++ b/x/migration/keeper/query_params_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - keepertest "github.com/pokt-network/poktroll/testutil/keeper" - "github.com/pokt-network/poktroll/x/migration/types" + keepertest "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/x/migration/types" ) func TestParamsQuery(t *testing.T) { diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 847e0d10e..96169a21d 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -21,15 +21,15 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { }, }, Tx: &autocliv1.ServiceCommandDescriptor{ - Service: modulev1.Msg_ServiceDesc.ServiceName, + Service: modulev1.Msg_ServiceDesc.ServiceName, EnhanceCustomCommand: true, // only required if you want to use the custom command RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "UpdateParams", - Skip: true, // skipped because authority gated + Skip: true, // skipped because authority gated }, // this line is used by ignite scaffolding # autocli/tx }, }, } -} \ No newline at end of file +} diff --git a/x/migration/module/genesis_test.go b/x/migration/module/genesis_test.go index 0356b5ecf..3e7fb2ba9 100644 --- a/x/migration/module/genesis_test.go +++ b/x/migration/module/genesis_test.go @@ -12,8 +12,8 @@ import ( func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ - Params: types.DefaultParams(), - + Params: types.DefaultParams(), + // this line is used by starport scaffolding # genesis/test/state } @@ -25,7 +25,5 @@ func TestGenesis(t *testing.T) { nullify.Fill(&genesisState) nullify.Fill(got) - - // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/migration/module/module.go b/x/migration/module/module.go index d41f2465d..9632fab53 100644 --- a/x/migration/module/module.go +++ b/x/migration/module/module.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/store" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" "cosmossdk.io/depinject" "cosmossdk.io/log" "github.com/cosmos/cosmos-sdk/client" @@ -17,14 +17,12 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" - // this line is used by starport scaffolding # 1 modulev1 "github.com/pokt-network/poktroll/api/poktroll/migration/module" "github.com/pokt-network/poktroll/x/migration/keeper" "github.com/pokt-network/poktroll/x/migration/types" - ) var ( @@ -37,7 +35,6 @@ var ( _ appmodule.AppModule = (*AppModule)(nil) _ appmodule.HasBeginBlocker = (*AppModule)(nil) _ appmodule.HasEndBlocker = (*AppModule)(nil) - ) // ---------------------------------------------------------------------------- @@ -90,8 +87,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *r } } - - // ---------------------------------------------------------------------------- // AppModule // ---------------------------------------------------------------------------- @@ -121,8 +116,8 @@ func NewAppModule( // RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } // RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) @@ -172,7 +167,7 @@ func (am AppModule) IsAppModule() {} func init() { appmodule.Register( - &modulev1.Module{}, + &modulev1.Module{}, appmodule.Provide(ProvideModule), ) } @@ -187,15 +182,13 @@ type ModuleInputs struct { AccountKeeper types.AccountKeeper BankKeeper types.BankKeeper - - } type ModuleOutputs struct { depinject.Out MigrationKeeper keeper.Keeper - Module appmodule.AppModule + Module appmodule.AppModule } func ProvideModule(in ModuleInputs) ModuleOutputs { @@ -205,16 +198,16 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } k := keeper.NewKeeper( - in.Cdc, + in.Cdc, in.StoreService, - in.Logger, - authority.String(), + in.Logger, + authority.String(), ) m := NewAppModule( - in.Cdc, - k, - in.AccountKeeper, - in.BankKeeper, + in.Cdc, + k, + in.AccountKeeper, + in.BankKeeper, ) return ModuleOutputs{MigrationKeeper: k, Module: m} diff --git a/x/migration/module/simulation.go b/x/migration/module/simulation.go index 95061b9c0..2c4ef40a8 100644 --- a/x/migration/module/simulation.go +++ b/x/migration/module/simulation.go @@ -23,7 +23,7 @@ var ( ) const ( - // this line is used by starport scaffolding # simapp/module/const +// this line is used by starport scaffolding # simapp/module/const ) // GenerateGenesisState creates a randomized GenState of the module. @@ -33,7 +33,7 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs[i] = acc.Address.String() } migrationGenesis := types.GenesisState{ - Params: types.DefaultParams(), + Params: types.DefaultParams(), // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&migrationGenesis) @@ -54,6 +54,6 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp // ProposalMsgs returns msgs used for governance proposals for simulations. func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { return []simtypes.WeightedProposalMsg{ - // this line is used by starport scaffolding # simapp/module/OpMsg + // this line is used by starport scaffolding # simapp/module/OpMsg } } diff --git a/x/migration/types/codec.go b/x/migration/types/codec.go index 42406fd9c..ac5526374 100644 --- a/x/migration/types/codec.go +++ b/x/migration/types/codec.go @@ -1,11 +1,9 @@ package types import ( - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - // this line is used by starport scaffolding # 1 ) @@ -17,5 +15,3 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } - - diff --git a/x/migration/types/errors.go b/x/migration/types/errors.go index 304742c82..ca50b521e 100644 --- a/x/migration/types/errors.go +++ b/x/migration/types/errors.go @@ -9,6 +9,5 @@ import ( // x/migration module sentinel errors var ( ErrInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") - + ErrSample = sdkerrors.Register(ModuleName, 1101, "sample error") ) diff --git a/x/migration/types/expected_keepers.go b/x/migration/types/expected_keepers.go index 56479a8a8..4a50d01a9 100644 --- a/x/migration/types/expected_keepers.go +++ b/x/migration/types/expected_keepers.go @@ -3,23 +3,19 @@ package types import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" - ) - - // AccountKeeper defines the expected interface for the Account module. type AccountKeeper interface { - GetAccount(context.Context, sdk.AccAddress) sdk.AccountI // only used for simulation - // Methods imported from account should be defined here + GetAccount(context.Context, sdk.AccAddress) sdk.AccountI // only used for simulation + // Methods imported from account should be defined here } // BankKeeper defines the expected interface for the Bank module. type BankKeeper interface { - SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins - // Methods imported from bank should be defined here + SpendableCoins(context.Context, sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here } // ParamSubspace defines the expected Subspace interface for parameters. diff --git a/x/migration/types/genesis_test.go b/x/migration/types/genesis_test.go index bf405c428..61cd184b4 100644 --- a/x/migration/types/genesis_test.go +++ b/x/migration/types/genesis_test.go @@ -3,39 +3,39 @@ package types_test import ( "testing" - "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/x/migration/types" + "github.com/stretchr/testify/require" ) func TestGenesisState_Validate(t *testing.T) { - tests := []struct { - desc string - genState *types.GenesisState - valid bool - } { - { - desc: "default is valid", - genState: types.DefaultGenesis(), - valid: true, - }, - { - desc: "valid genesis state", - genState: &types.GenesisState{ - - // this line is used by starport scaffolding # types/genesis/validField - }, - valid: true, - }, - // this line is used by starport scaffolding # types/genesis/testcase + tests := []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase } for _, tc := range tests { t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } -} \ No newline at end of file + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/migration/types/keys.go b/x/migration/types/keys.go index 12daba9fd..be31adac9 100644 --- a/x/migration/types/keys.go +++ b/x/migration/types/keys.go @@ -9,16 +9,12 @@ const ( // MemStoreKey defines the in-memory store key MemStoreKey = "mem_migration" - - ) var ( ParamsKey = []byte("p_migration") ) - - func KeyPrefix(p string) []byte { - return []byte(p) + return []byte(p) } diff --git a/x/migration/types/params.go b/x/migration/types/params.go index e06131dcf..4f3215e35 100644 --- a/x/migration/types/params.go +++ b/x/migration/types/params.go @@ -1,41 +1,32 @@ package types import ( - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var _ paramtypes.ParamSet = (*Params)(nil) - - // ParamKeyTable the param key table for launch module func ParamKeyTable() paramtypes.KeyTable { return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) } // NewParams creates a new Params instance -func NewParams( -) Params { - return Params{ - } +func NewParams() Params { + return Params{} } // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams( - ) + return NewParams() } // ParamSetPairs get the params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - } + return paramtypes.ParamSetPairs{} } // Validate validates the set of params func (p Params) Validate() error { return nil } - From 85992e2ea5da5323144f042146992bd19f2904b0 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 23 Jan 2025 14:00:43 +0100 Subject: [PATCH 05/19] feat: add migrate collect-morse-account subcommand --- api/poktroll/migration/types.pulsar.go | 3374 +++++++++++++++++++++ cmd/poktrolld/cmd/commands.go | 2 + cmd/poktrolld/cmd/migrate/migrate.go | 188 ++ cmd/poktrolld/cmd/migrate/migrate_test.go | 209 ++ cmd/poktrolld/cmd/migrate/types.go | 76 + proto/poktroll/migration/legacy.proto | 42 + proto/poktroll/migration/types.proto | 74 + x/migration/types/types.pb.go | 1508 +++++++++ 8 files changed, 5473 insertions(+) create mode 100644 api/poktroll/migration/types.pulsar.go create mode 100644 cmd/poktrolld/cmd/migrate/migrate.go create mode 100644 cmd/poktrolld/cmd/migrate/migrate_test.go create mode 100644 cmd/poktrolld/cmd/migrate/types.go create mode 100644 proto/poktroll/migration/legacy.proto create mode 100644 proto/poktroll/migration/types.proto create mode 100644 x/migration/types/types.pb.go diff --git a/api/poktroll/migration/types.pulsar.go b/api/poktroll/migration/types.pulsar.go new file mode 100644 index 000000000..48a6ca42a --- /dev/null +++ b/api/poktroll/migration/types.pulsar.go @@ -0,0 +1,3374 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package migration + +import ( + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_MorseAccountState_1_list)(nil) + +type _MorseAccountState_1_list struct { + list *[]*MorseAccount +} + +func (x *_MorseAccountState_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorseAccountState_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorseAccountState_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAccount) + (*x.list)[i] = concreteValue +} + +func (x *_MorseAccountState_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAccount) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorseAccountState_1_list) AppendMutable() protoreflect.Value { + v := new(MorseAccount) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAccountState_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorseAccountState_1_list) NewElement() protoreflect.Value { + v := new(MorseAccount) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAccountState_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MorseAccountState protoreflect.MessageDescriptor + fd_MorseAccountState_accounts protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_types_proto_init() + md_MorseAccountState = File_poktroll_migration_types_proto.Messages().ByName("MorseAccountState") + fd_MorseAccountState_accounts = md_MorseAccountState.Fields().ByName("accounts") +} + +var _ protoreflect.Message = (*fastReflection_MorseAccountState)(nil) + +type fastReflection_MorseAccountState MorseAccountState + +func (x *MorseAccountState) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseAccountState)(x) +} + +func (x *MorseAccountState) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_types_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_MorseAccountState_messageType fastReflection_MorseAccountState_messageType +var _ protoreflect.MessageType = fastReflection_MorseAccountState_messageType{} + +type fastReflection_MorseAccountState_messageType struct{} + +func (x fastReflection_MorseAccountState_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseAccountState)(nil) +} +func (x fastReflection_MorseAccountState_messageType) New() protoreflect.Message { + return new(fastReflection_MorseAccountState) +} +func (x fastReflection_MorseAccountState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAccountState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseAccountState) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAccountState +} + +// 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_MorseAccountState) Type() protoreflect.MessageType { + return _fastReflection_MorseAccountState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseAccountState) New() protoreflect.Message { + return new(fastReflection_MorseAccountState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseAccountState) Interface() protoreflect.ProtoMessage { + return (*MorseAccountState)(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_MorseAccountState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Accounts) != 0 { + value := protoreflect.ValueOfList(&_MorseAccountState_1_list{list: &x.Accounts}) + if !f(fd_MorseAccountState_accounts, 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_MorseAccountState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseAccountState.accounts": + return len(x.Accounts) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccountState 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_MorseAccountState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseAccountState.accounts": + x.Accounts = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccountState 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_MorseAccountState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseAccountState.accounts": + if len(x.Accounts) == 0 { + return protoreflect.ValueOfList(&_MorseAccountState_1_list{}) + } + listValue := &_MorseAccountState_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccountState 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_MorseAccountState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseAccountState.accounts": + lv := value.List() + clv := lv.(*_MorseAccountState_1_list) + x.Accounts = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccountState 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_MorseAccountState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAccountState.accounts": + if x.Accounts == nil { + x.Accounts = []*MorseAccount{} + } + value := &_MorseAccountState_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccountState 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_MorseAccountState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAccountState.accounts": + list := []*MorseAccount{} + return protoreflect.ValueOfList(&_MorseAccountState_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccountState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccountState 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_MorseAccountState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAccountState", 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_MorseAccountState) 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_MorseAccountState) 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_MorseAccountState) 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_MorseAccountState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseAccountState) + 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.Accounts) > 0 { + for _, e := range x.Accounts { + l = options.Size(e) + 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().(*MorseAccountState) + 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.Accounts) > 0 { + for iNdEx := len(x.Accounts) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Accounts[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().(*MorseAccountState) + 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: MorseAccountState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAccountState: 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 Accounts", 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.Accounts = append(x.Accounts, &MorseAccount{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accounts[len(x.Accounts)-1]); 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 = (*_MorseAccount_3_list)(nil) + +type _MorseAccount_3_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MorseAccount_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorseAccount_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorseAccount_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MorseAccount_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorseAccount_3_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAccount_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorseAccount_3_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAccount_3_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MorseAccount protoreflect.MessageDescriptor + fd_MorseAccount_address protoreflect.FieldDescriptor + fd_MorseAccount_pub_key protoreflect.FieldDescriptor + fd_MorseAccount_coins protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_types_proto_init() + md_MorseAccount = File_poktroll_migration_types_proto.Messages().ByName("MorseAccount") + fd_MorseAccount_address = md_MorseAccount.Fields().ByName("address") + fd_MorseAccount_pub_key = md_MorseAccount.Fields().ByName("pub_key") + fd_MorseAccount_coins = md_MorseAccount.Fields().ByName("coins") +} + +var _ protoreflect.Message = (*fastReflection_MorseAccount)(nil) + +type fastReflection_MorseAccount MorseAccount + +func (x *MorseAccount) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseAccount)(x) +} + +func (x *MorseAccount) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_types_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MorseAccount_messageType fastReflection_MorseAccount_messageType +var _ protoreflect.MessageType = fastReflection_MorseAccount_messageType{} + +type fastReflection_MorseAccount_messageType struct{} + +func (x fastReflection_MorseAccount_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseAccount)(nil) +} +func (x fastReflection_MorseAccount_messageType) New() protoreflect.Message { + return new(fastReflection_MorseAccount) +} +func (x fastReflection_MorseAccount_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAccount +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseAccount) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAccount +} + +// 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_MorseAccount) Type() protoreflect.MessageType { + return _fastReflection_MorseAccount_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseAccount) New() protoreflect.Message { + return new(fastReflection_MorseAccount) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseAccount) Interface() protoreflect.ProtoMessage { + return (*MorseAccount)(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_MorseAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Address) != 0 { + value := protoreflect.ValueOfBytes(x.Address) + if !f(fd_MorseAccount_address, value) { + return + } + } + if x.PubKey != nil { + value := protoreflect.ValueOfMessage(x.PubKey.ProtoReflect()) + if !f(fd_MorseAccount_pub_key, value) { + return + } + } + if len(x.Coins) != 0 { + value := protoreflect.ValueOfList(&_MorseAccount_3_list{list: &x.Coins}) + if !f(fd_MorseAccount_coins, 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_MorseAccount) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseAccount.address": + return len(x.Address) != 0 + case "poktroll.migration.MorseAccount.pub_key": + return x.PubKey != nil + case "poktroll.migration.MorseAccount.coins": + return len(x.Coins) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccount 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_MorseAccount) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseAccount.address": + x.Address = nil + case "poktroll.migration.MorseAccount.pub_key": + x.PubKey = nil + case "poktroll.migration.MorseAccount.coins": + x.Coins = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccount 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_MorseAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseAccount.address": + value := x.Address + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseAccount.pub_key": + value := x.PubKey + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MorseAccount.coins": + if len(x.Coins) == 0 { + return protoreflect.ValueOfList(&_MorseAccount_3_list{}) + } + listValue := &_MorseAccount_3_list{list: &x.Coins} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccount 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_MorseAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseAccount.address": + x.Address = value.Bytes() + case "poktroll.migration.MorseAccount.pub_key": + x.PubKey = value.Message().Interface().(*MorsePublicKey) + case "poktroll.migration.MorseAccount.coins": + lv := value.List() + clv := lv.(*_MorseAccount_3_list) + x.Coins = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccount 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_MorseAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAccount.pub_key": + if x.PubKey == nil { + x.PubKey = new(MorsePublicKey) + } + return protoreflect.ValueOfMessage(x.PubKey.ProtoReflect()) + case "poktroll.migration.MorseAccount.coins": + if x.Coins == nil { + x.Coins = []*v1beta1.Coin{} + } + value := &_MorseAccount_3_list{list: &x.Coins} + return protoreflect.ValueOfList(value) + case "poktroll.migration.MorseAccount.address": + panic(fmt.Errorf("field address of message poktroll.migration.MorseAccount is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccount 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_MorseAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAccount.address": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseAccount.pub_key": + m := new(MorsePublicKey) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MorseAccount.coins": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MorseAccount_3_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAccount 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_MorseAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAccount", 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_MorseAccount) 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_MorseAccount) 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_MorseAccount) 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_MorseAccount) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseAccount) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.PubKey != nil { + l = options.Size(x.PubKey) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Coins) > 0 { + for _, e := range x.Coins { + l = options.Size(e) + 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().(*MorseAccount) + 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.Coins) > 0 { + for iNdEx := len(x.Coins) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Coins[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] = 0x1a + } + } + if x.PubKey != nil { + encoded, err := options.Marshal(x.PubKey) + 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.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseAccount) + 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: MorseAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var 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.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) + if x.Address == nil { + x.Address = []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 PubKey", 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.PubKey == nil { + x.PubKey = &MorsePublicKey{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PubKey); 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 Coins", 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.Coins = append(x.Coins, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Coins[len(x.Coins)-1]); 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_MorsePublicKey protoreflect.MessageDescriptor + fd_MorsePublicKey_value protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_types_proto_init() + md_MorsePublicKey = File_poktroll_migration_types_proto.Messages().ByName("MorsePublicKey") + fd_MorsePublicKey_value = md_MorsePublicKey.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_MorsePublicKey)(nil) + +type fastReflection_MorsePublicKey MorsePublicKey + +func (x *MorsePublicKey) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorsePublicKey)(x) +} + +func (x *MorsePublicKey) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_types_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_MorsePublicKey_messageType fastReflection_MorsePublicKey_messageType +var _ protoreflect.MessageType = fastReflection_MorsePublicKey_messageType{} + +type fastReflection_MorsePublicKey_messageType struct{} + +func (x fastReflection_MorsePublicKey_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorsePublicKey)(nil) +} +func (x fastReflection_MorsePublicKey_messageType) New() protoreflect.Message { + return new(fastReflection_MorsePublicKey) +} +func (x fastReflection_MorsePublicKey_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorsePublicKey +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorsePublicKey) Descriptor() protoreflect.MessageDescriptor { + return md_MorsePublicKey +} + +// 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_MorsePublicKey) Type() protoreflect.MessageType { + return _fastReflection_MorsePublicKey_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorsePublicKey) New() protoreflect.Message { + return new(fastReflection_MorsePublicKey) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorsePublicKey) Interface() protoreflect.ProtoMessage { + return (*MorsePublicKey)(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_MorsePublicKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Value) != 0 { + value := protoreflect.ValueOfBytes(x.Value) + if !f(fd_MorsePublicKey_value, 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_MorsePublicKey) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorsePublicKey.value": + return len(x.Value) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePublicKey")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePublicKey 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_MorsePublicKey) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorsePublicKey.value": + x.Value = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePublicKey")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePublicKey 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_MorsePublicKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorsePublicKey.value": + value := x.Value + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePublicKey")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePublicKey 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_MorsePublicKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorsePublicKey.value": + x.Value = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePublicKey")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePublicKey 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_MorsePublicKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorsePublicKey.value": + panic(fmt.Errorf("field value of message poktroll.migration.MorsePublicKey is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePublicKey")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePublicKey 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_MorsePublicKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorsePublicKey.value": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePublicKey")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePublicKey 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_MorsePublicKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorsePublicKey", 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_MorsePublicKey) 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_MorsePublicKey) 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_MorsePublicKey) 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_MorsePublicKey) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorsePublicKey) + 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.Value) + 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().(*MorsePublicKey) + 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.Value) > 0 { + i -= len(x.Value) + copy(dAtA[i:], x.Value) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Value))) + i-- + dAtA[i] = 0x12 + } + 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().(*MorsePublicKey) + 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: MorsePublicKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorsePublicKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", 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.Value = append(x.Value[:0], dAtA[iNdEx:postIndex]...) + if x.Value == nil { + x.Value = []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_MorseApplication protoreflect.MessageDescriptor + fd_MorseApplication_address protoreflect.FieldDescriptor + fd_MorseApplication_public_key protoreflect.FieldDescriptor + fd_MorseApplication_jailed protoreflect.FieldDescriptor + fd_MorseApplication_status protoreflect.FieldDescriptor + fd_MorseApplication_staked_tokens protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_types_proto_init() + md_MorseApplication = File_poktroll_migration_types_proto.Messages().ByName("MorseApplication") + fd_MorseApplication_address = md_MorseApplication.Fields().ByName("address") + fd_MorseApplication_public_key = md_MorseApplication.Fields().ByName("public_key") + fd_MorseApplication_jailed = md_MorseApplication.Fields().ByName("jailed") + fd_MorseApplication_status = md_MorseApplication.Fields().ByName("status") + fd_MorseApplication_staked_tokens = md_MorseApplication.Fields().ByName("staked_tokens") +} + +var _ protoreflect.Message = (*fastReflection_MorseApplication)(nil) + +type fastReflection_MorseApplication MorseApplication + +func (x *MorseApplication) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseApplication)(x) +} + +func (x *MorseApplication) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_types_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_MorseApplication_messageType fastReflection_MorseApplication_messageType +var _ protoreflect.MessageType = fastReflection_MorseApplication_messageType{} + +type fastReflection_MorseApplication_messageType struct{} + +func (x fastReflection_MorseApplication_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseApplication)(nil) +} +func (x fastReflection_MorseApplication_messageType) New() protoreflect.Message { + return new(fastReflection_MorseApplication) +} +func (x fastReflection_MorseApplication_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplication +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseApplication) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplication +} + +// 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_MorseApplication) Type() protoreflect.MessageType { + return _fastReflection_MorseApplication_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseApplication) New() protoreflect.Message { + return new(fastReflection_MorseApplication) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseApplication) Interface() protoreflect.ProtoMessage { + return (*MorseApplication)(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_MorseApplication) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Address) != 0 { + value := protoreflect.ValueOfBytes(x.Address) + if !f(fd_MorseApplication_address, value) { + return + } + } + if len(x.PublicKey) != 0 { + value := protoreflect.ValueOfBytes(x.PublicKey) + if !f(fd_MorseApplication_public_key, value) { + return + } + } + if x.Jailed != false { + value := protoreflect.ValueOfBool(x.Jailed) + if !f(fd_MorseApplication_jailed, value) { + return + } + } + if x.Status != int32(0) { + value := protoreflect.ValueOfInt32(x.Status) + if !f(fd_MorseApplication_status, value) { + return + } + } + if x.StakedTokens != "" { + value := protoreflect.ValueOfString(x.StakedTokens) + if !f(fd_MorseApplication_staked_tokens, 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_MorseApplication) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + return len(x.Address) != 0 + case "poktroll.migration.MorseApplication.public_key": + return len(x.PublicKey) != 0 + case "poktroll.migration.MorseApplication.jailed": + return x.Jailed != false + case "poktroll.migration.MorseApplication.status": + return x.Status != int32(0) + case "poktroll.migration.MorseApplication.staked_tokens": + return x.StakedTokens != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + x.Address = nil + case "poktroll.migration.MorseApplication.public_key": + x.PublicKey = nil + case "poktroll.migration.MorseApplication.jailed": + x.Jailed = false + case "poktroll.migration.MorseApplication.status": + x.Status = int32(0) + case "poktroll.migration.MorseApplication.staked_tokens": + x.StakedTokens = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseApplication.address": + value := x.Address + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseApplication.public_key": + value := x.PublicKey + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseApplication.jailed": + value := x.Jailed + return protoreflect.ValueOfBool(value) + case "poktroll.migration.MorseApplication.status": + value := x.Status + return protoreflect.ValueOfInt32(value) + case "poktroll.migration.MorseApplication.staked_tokens": + value := x.StakedTokens + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + x.Address = value.Bytes() + case "poktroll.migration.MorseApplication.public_key": + x.PublicKey = value.Bytes() + case "poktroll.migration.MorseApplication.jailed": + x.Jailed = value.Bool() + case "poktroll.migration.MorseApplication.status": + x.Status = int32(value.Int()) + case "poktroll.migration.MorseApplication.staked_tokens": + x.StakedTokens = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + panic(fmt.Errorf("field address of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.public_key": + panic(fmt.Errorf("field public_key of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.jailed": + panic(fmt.Errorf("field jailed of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.status": + panic(fmt.Errorf("field status of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.staked_tokens": + panic(fmt.Errorf("field staked_tokens of message poktroll.migration.MorseApplication is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseApplication.public_key": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseApplication.jailed": + return protoreflect.ValueOfBool(false) + case "poktroll.migration.MorseApplication.status": + return protoreflect.ValueOfInt32(int32(0)) + case "poktroll.migration.MorseApplication.staked_tokens": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseApplication", 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_MorseApplication) 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_MorseApplication) 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_MorseApplication) 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_MorseApplication) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseApplication) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PublicKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Jailed { + n += 2 + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + l = len(x.StakedTokens) + 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().(*MorseApplication) + 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.StakedTokens) > 0 { + i -= len(x.StakedTokens) + copy(dAtA[i:], x.StakedTokens) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StakedTokens))) + i-- + dAtA[i] = 0x32 + } + if x.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x20 + } + if x.Jailed { + i-- + if x.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(x.PublicKey) > 0 { + i -= len(x.PublicKey) + copy(dAtA[i:], x.PublicKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseApplication) + 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: MorseApplication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseApplication: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var 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.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) + if x.Address == nil { + x.Address = []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 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if x.PublicKey == nil { + x.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", 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.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MorseValidator protoreflect.MessageDescriptor + fd_MorseValidator_Address protoreflect.FieldDescriptor + fd_MorseValidator_PublicKey protoreflect.FieldDescriptor + fd_MorseValidator_jailed protoreflect.FieldDescriptor + fd_MorseValidator_status protoreflect.FieldDescriptor + fd_MorseValidator_StakedTokens protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_types_proto_init() + md_MorseValidator = File_poktroll_migration_types_proto.Messages().ByName("MorseValidator") + fd_MorseValidator_Address = md_MorseValidator.Fields().ByName("Address") + fd_MorseValidator_PublicKey = md_MorseValidator.Fields().ByName("PublicKey") + fd_MorseValidator_jailed = md_MorseValidator.Fields().ByName("jailed") + fd_MorseValidator_status = md_MorseValidator.Fields().ByName("status") + fd_MorseValidator_StakedTokens = md_MorseValidator.Fields().ByName("StakedTokens") +} + +var _ protoreflect.Message = (*fastReflection_MorseValidator)(nil) + +type fastReflection_MorseValidator MorseValidator + +func (x *MorseValidator) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseValidator)(x) +} + +func (x *MorseValidator) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_types_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_MorseValidator_messageType fastReflection_MorseValidator_messageType +var _ protoreflect.MessageType = fastReflection_MorseValidator_messageType{} + +type fastReflection_MorseValidator_messageType struct{} + +func (x fastReflection_MorseValidator_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseValidator)(nil) +} +func (x fastReflection_MorseValidator_messageType) New() protoreflect.Message { + return new(fastReflection_MorseValidator) +} +func (x fastReflection_MorseValidator_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseValidator +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseValidator) Descriptor() protoreflect.MessageDescriptor { + return md_MorseValidator +} + +// 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_MorseValidator) Type() protoreflect.MessageType { + return _fastReflection_MorseValidator_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseValidator) New() protoreflect.Message { + return new(fastReflection_MorseValidator) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseValidator) Interface() protoreflect.ProtoMessage { + return (*MorseValidator)(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_MorseValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Address) != 0 { + value := protoreflect.ValueOfBytes(x.Address) + if !f(fd_MorseValidator_Address, value) { + return + } + } + if len(x.PublicKey) != 0 { + value := protoreflect.ValueOfBytes(x.PublicKey) + if !f(fd_MorseValidator_PublicKey, value) { + return + } + } + if x.Jailed != false { + value := protoreflect.ValueOfBool(x.Jailed) + if !f(fd_MorseValidator_jailed, value) { + return + } + } + if x.Status != int32(0) { + value := protoreflect.ValueOfInt32(x.Status) + if !f(fd_MorseValidator_status, value) { + return + } + } + if x.StakedTokens != "" { + value := protoreflect.ValueOfString(x.StakedTokens) + if !f(fd_MorseValidator_StakedTokens, 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_MorseValidator) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + return len(x.Address) != 0 + case "poktroll.migration.MorseValidator.PublicKey": + return len(x.PublicKey) != 0 + case "poktroll.migration.MorseValidator.jailed": + return x.Jailed != false + case "poktroll.migration.MorseValidator.status": + return x.Status != int32(0) + case "poktroll.migration.MorseValidator.StakedTokens": + return x.StakedTokens != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + x.Address = nil + case "poktroll.migration.MorseValidator.PublicKey": + x.PublicKey = nil + case "poktroll.migration.MorseValidator.jailed": + x.Jailed = false + case "poktroll.migration.MorseValidator.status": + x.Status = int32(0) + case "poktroll.migration.MorseValidator.StakedTokens": + x.StakedTokens = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseValidator.Address": + value := x.Address + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseValidator.PublicKey": + value := x.PublicKey + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseValidator.jailed": + value := x.Jailed + return protoreflect.ValueOfBool(value) + case "poktroll.migration.MorseValidator.status": + value := x.Status + return protoreflect.ValueOfInt32(value) + case "poktroll.migration.MorseValidator.StakedTokens": + value := x.StakedTokens + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + x.Address = value.Bytes() + case "poktroll.migration.MorseValidator.PublicKey": + x.PublicKey = value.Bytes() + case "poktroll.migration.MorseValidator.jailed": + x.Jailed = value.Bool() + case "poktroll.migration.MorseValidator.status": + x.Status = int32(value.Int()) + case "poktroll.migration.MorseValidator.StakedTokens": + x.StakedTokens = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + panic(fmt.Errorf("field Address of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.PublicKey": + panic(fmt.Errorf("field PublicKey of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.jailed": + panic(fmt.Errorf("field jailed of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.status": + panic(fmt.Errorf("field status of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.StakedTokens": + panic(fmt.Errorf("field StakedTokens of message poktroll.migration.MorseValidator is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseValidator.PublicKey": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseValidator.jailed": + return protoreflect.ValueOfBool(false) + case "poktroll.migration.MorseValidator.status": + return protoreflect.ValueOfInt32(int32(0)) + case "poktroll.migration.MorseValidator.StakedTokens": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseValidator", 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_MorseValidator) 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_MorseValidator) 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_MorseValidator) 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_MorseValidator) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseValidator) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PublicKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Jailed { + n += 2 + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + l = len(x.StakedTokens) + 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().(*MorseValidator) + 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.StakedTokens) > 0 { + i -= len(x.StakedTokens) + copy(dAtA[i:], x.StakedTokens) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StakedTokens))) + i-- + dAtA[i] = 0x3a + } + if x.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x20 + } + if x.Jailed { + i-- + if x.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(x.PublicKey) > 0 { + i -= len(x.PublicKey) + copy(dAtA[i:], x.PublicKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseValidator) + 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: MorseValidator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseValidator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var 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.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) + if x.Address == nil { + x.Address = []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 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if x.PublicKey == nil { + x.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", 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.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/migration/types.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) +) + +// MorseAccountState is the on-chain representation of the imported account state from Morse. +type MorseAccountState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Accounts []*MorseAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (x *MorseAccountState) Reset() { + *x = MorseAccountState{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseAccountState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseAccountState) ProtoMessage() {} + +// Deprecated: Use MorseAccountState.ProtoReflect.Descriptor instead. +func (*MorseAccountState) Descriptor() ([]byte, []int) { + return file_poktroll_migration_types_proto_rawDescGZIP(), []int{0} +} + +func (x *MorseAccountState) GetAccounts() []*MorseAccount { + if x != nil { + return x.Accounts + } + return nil +} + +// MorseAccount is an analog of the Morse ProtoBaseAccount type. It encapsulates +// the minimum information required to import accounts. +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/auth/auth.proto#L14. +type MorseAccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PubKey *MorsePublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + Coins []*v1beta1.Coin `protobuf:"bytes,3,rep,name=coins,proto3" json:"coins,omitempty"` +} + +func (x *MorseAccount) Reset() { + *x = MorseAccount{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseAccount) ProtoMessage() {} + +// Deprecated: Use MorseAccount.ProtoReflect.Descriptor instead. +func (*MorseAccount) Descriptor() ([]byte, []int) { + return file_poktroll_migration_types_proto_rawDescGZIP(), []int{1} +} + +func (x *MorseAccount) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *MorseAccount) GetPubKey() *MorsePublicKey { + if x != nil { + return x.PubKey + } + return nil +} + +func (x *MorseAccount) GetCoins() []*v1beta1.Coin { + if x != nil { + return x.Coins + } + return nil +} + +// MorsePublicKey is required to conform to the encoding of the Morse state export. +// NB: All Morse account public keys will be ed25519 keys by definition. +type MorsePublicKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *MorsePublicKey) Reset() { + *x = MorsePublicKey{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorsePublicKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorsePublicKey) ProtoMessage() {} + +// Deprecated: Use MorsePublicKey.ProtoReflect.Descriptor instead. +func (*MorsePublicKey) Descriptor() ([]byte, []int) { + return file_poktroll_migration_types_proto_rawDescGZIP(), []int{2} +} + +func (x *MorsePublicKey) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates +// the minimum information required to import Morse applications. +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 +type MorseApplication struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` +} + +func (x *MorseApplication) Reset() { + *x = MorseApplication{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseApplication) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseApplication) ProtoMessage() {} + +// Deprecated: Use MorseApplication.ProtoReflect.Descriptor instead. +func (*MorseApplication) Descriptor() ([]byte, []int) { + return file_poktroll_migration_types_proto_rawDescGZIP(), []int{3} +} + +func (x *MorseApplication) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *MorseApplication) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *MorseApplication) GetJailed() bool { + if x != nil { + return x.Jailed + } + return false +} + +func (x *MorseApplication) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MorseApplication) GetStakedTokens() string { + if x != nil { + return x.StakedTokens + } + return "" +} + +// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the +// minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 +type MorseValidator struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` + PublicKey []byte `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + StakedTokens string `protobuf:"bytes,7,opt,name=StakedTokens,proto3" json:"StakedTokens,omitempty"` +} + +func (x *MorseValidator) Reset() { + *x = MorseValidator{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseValidator) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseValidator) ProtoMessage() {} + +// Deprecated: Use MorseValidator.ProtoReflect.Descriptor instead. +func (*MorseValidator) Descriptor() ([]byte, []int) { + return file_poktroll_migration_types_proto_rawDescGZIP(), []int{4} +} + +func (x *MorseValidator) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *MorseValidator) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *MorseValidator) GetJailed() bool { + if x != nil { + return x.Jailed + } + return false +} + +func (x *MorseValidator) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MorseValidator) GetStakedTokens() string { + if x != nil { + return x.StakedTokens + } + return "" +} + +var File_poktroll_migration_types_proto protoreflect.FileDescriptor + +var file_poktroll_migration_types_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x12, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 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, 0x1a, + 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x11, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x4a, 0x0a, 0x08, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, + 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x08, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x96, 0x02, 0x0a, 0x0c, 0x4d, 0x6f, 0x72, 0x73, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x54, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3a, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, + 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x60, 0x0a, + 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, + 0x35, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, + 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x17, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, + 0x88, 0xa2, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, + 0x44, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x42, 0x1c, 0xfa, 0xde, 0x1f, 0x18, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x65, 0x64, 0x32, + 0x35, 0x35, 0x31, 0x39, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xd7, 0x02, 0x0a, 0x10, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x66, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, + 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x09, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x1b, 0xea, 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0xf2, 0xde, 0x1f, 0x0d, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6a, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x22, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x1b, 0xea, 0xde, 0x1f, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xf2, 0xde, 0x1f, 0x0d, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, + 0xc1, 0x02, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x12, 0x66, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, + 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x23, 0xea, + 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0xf2, 0xde, 0x1f, + 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x22, 0x52, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, + 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x0a, 0xea, + 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xea, 0xde, 0x1f, + 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, 0xe8, + 0xa0, 0x1f, 0x01, 0x42, 0xb6, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_migration_types_proto_rawDescOnce sync.Once + file_poktroll_migration_types_proto_rawDescData = file_poktroll_migration_types_proto_rawDesc +) + +func file_poktroll_migration_types_proto_rawDescGZIP() []byte { + file_poktroll_migration_types_proto_rawDescOnce.Do(func() { + file_poktroll_migration_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_types_proto_rawDescData) + }) + return file_poktroll_migration_types_proto_rawDescData +} + +var file_poktroll_migration_types_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_poktroll_migration_types_proto_goTypes = []interface{}{ + (*MorseAccountState)(nil), // 0: poktroll.migration.MorseAccountState + (*MorseAccount)(nil), // 1: poktroll.migration.MorseAccount + (*MorsePublicKey)(nil), // 2: poktroll.migration.MorsePublicKey + (*MorseApplication)(nil), // 3: poktroll.migration.MorseApplication + (*MorseValidator)(nil), // 4: poktroll.migration.MorseValidator + (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin +} +var file_poktroll_migration_types_proto_depIdxs = []int32{ + 1, // 0: poktroll.migration.MorseAccountState.accounts:type_name -> poktroll.migration.MorseAccount + 2, // 1: poktroll.migration.MorseAccount.pub_key:type_name -> poktroll.migration.MorsePublicKey + 5, // 2: poktroll.migration.MorseAccount.coins:type_name -> cosmos.base.v1beta1.Coin + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_poktroll_migration_types_proto_init() } +func file_poktroll_migration_types_proto_init() { + if File_poktroll_migration_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseAccountState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseAccount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorsePublicKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseApplication); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseValidator); 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_poktroll_migration_types_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_migration_types_proto_goTypes, + DependencyIndexes: file_poktroll_migration_types_proto_depIdxs, + MessageInfos: file_poktroll_migration_types_proto_msgTypes, + }.Build() + File_poktroll_migration_types_proto = out.File + file_poktroll_migration_types_proto_rawDesc = nil + file_poktroll_migration_types_proto_goTypes = nil + file_poktroll_migration_types_proto_depIdxs = nil +} diff --git a/cmd/poktrolld/cmd/commands.go b/cmd/poktrolld/cmd/commands.go index 7792e07f7..825d49467 100644 --- a/cmd/poktrolld/cmd/commands.go +++ b/cmd/poktrolld/cmd/commands.go @@ -26,6 +26,7 @@ import ( "github.com/spf13/viper" "github.com/pokt-network/poktroll/app" + "github.com/pokt-network/poktroll/cmd/poktrolld/cmd/migrate" ) func initRootCmd( @@ -52,6 +53,7 @@ func initRootCmd( queryCommand(), txCommand(), keys.Commands(), + migrate.MigrateCmd(), ) } diff --git a/cmd/poktrolld/cmd/migrate/migrate.go b/cmd/poktrolld/cmd/migrate/migrate.go new file mode 100644 index 000000000..5fff61bf1 --- /dev/null +++ b/cmd/poktrolld/cmd/migrate/migrate.go @@ -0,0 +1,188 @@ +package migrate + +import ( + "fmt" + "os" + + cosmosmath "cosmossdk.io/math" + cmtjson "github.com/cometbft/cometbft/libs/json" + "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/app/volatile" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" +) + +var collectMorseAccountsCmd = &cobra.Command{ + Use: "collect-morse-accounts [morse-state-path] [morse-accounts-path]", + Args: cobra.ExactArgs(2), + Short: "Collect all account balances and corresponding stakes from the JSON file at [morse-state-path] and outputs them as JSON to [morse-accounts-path]", + Long: `Collects the account balances and corresponding stakes from the MorseStateExport JSON file at morse-state-path +and outputs them as a MorseAccountState JSON to morse-accounts-path for use with +Shannon's MsgUploadMorseState. The Morse state export is generated via the Morse CLI: +pocket util export-genesis-for-reset [height] [new-chain-id] > morse-state-export.json`, + RunE: runCollectMorseAccounts, +} + +func MigrateCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "migrate", + Short: "Migration commands", + } + cmd.AddCommand(collectMorseAccountsCmd) + + return cmd +} + +// runCollectedMorseAccounts is run by the `poktrolld migrate collect-morse-accounts` command. +func runCollectMorseAccounts(cmd *cobra.Command, args []string) error { + inputPath := args[0] + outputPath := args[1] + + return collectMorseAccounts(inputPath, outputPath) +} + +// collectMorseAccounts transforms the JSON serialized MorseStateExport at +// inputStatePath into a JSON serialized MorseAccountState at outputStatePath. +func collectMorseAccounts(inputStatePath, outputStatePath string) error { + if err := validatePathIsFile(inputStatePath); err != nil { + return err + } + + inputStateJSON, err := os.ReadFile(inputStatePath) + if err != nil { + return err + } + + inputState := new(migrationtypes.MorseStateExport) + if err = cmtjson.Unmarshal(inputStateJSON, inputState); err != nil { + return err + } + + outputStateJSON, err := transformMorseState(inputState) + if err != nil { + return err + } + + if err = os.WriteFile(outputStatePath, outputStateJSON, 0644); err != nil { + return err + } + + return nil +} + +// validatePathIsFile returns an error if the given path does not exist or is not a file. +func validatePathIsFile(path string) error { + info, err := os.Stat(path) + if err != nil { + return err + } + + if info.IsDir() { + return fmt.Errorf("[morse-JSON-input-path] cannot be a directory") + } + + return nil +} + +// transformMorseState consolidates the Morse account balance, application stake, +// and supplier stake for each account as an entry in the resulting MorseAccountState. +// +// TODO_IN_THIS_COMMIT: benchmark and consider at what point (i.e. number of accounts) does asynchronous import processing matter? +func transformMorseState(inputState *migrationtypes.MorseStateExport) ([]byte, error) { + morseWorkspace := &morseImportWorkspace{ + addressToIdx: make(map[string]uint64), + accounts: make([]*migrationtypes.MorseAccount, 0), + } + + // Iterate over accounts and copy the balances. + if err := collectInputAccountBalances(inputState, morseWorkspace); err != nil { + return nil, err + } + + // Iterate over applications and add the stakes to the corresponding account balances. + if err := collectInputApplicationStakes(inputState, morseWorkspace); err != nil { + return nil, err + } + + // Iterate over suppliers and add the stakes to the corresponding account balances. + err := collectInputSupplierStakes(inputState, morseWorkspace) + if err != nil { + return nil, err + } + + morseAccountState := &migrationtypes.MorseAccountState{Accounts: morseWorkspace.accounts} + return cmtjson.Marshal(morseAccountState) +} + +// collectInputAccountBalances iterates over the accounts in the inputState and +// adds the balances to the corresponding account balances in the morseWorkspace. +func collectInputAccountBalances(inputState *migrationtypes.MorseStateExport, morseWorkspace *morseImportWorkspace) error { + for _, exportAccount := range inputState.AppState.Auth.Accounts { + // DEV_NOTE: Ignore module accounts. + if exportAccount.Type != "posmint/Account" { + continue + } + + addr := exportAccount.Value.Address.String() + morseWorkspace.ensureAccount(addr, exportAccount) + + // TODO_IN_THIS_COMMIT: comment... SHOULD ONLY be one denom (upokt). + coin := exportAccount.Value.Coins[0] + if coin.Denom != volatile.DenomuPOKT { + return fmt.Errorf("unsupported denom %q", coin.Denom) + } + + if err := morseWorkspace.addUpokt(addr, coin.Amount); err != nil { + return err + } + } + return nil +} + +// collectInputApplicationStakes iterates over the applications in the inputState and +// adds the stake to the corresponding account balances in the morseWorkspace. +func collectInputApplicationStakes(inputState *migrationtypes.MorseStateExport, morseWorkspace *morseImportWorkspace) error { + for _, exportApplication := range inputState.AppState.Application.Applications { + addr := exportApplication.Address.String() + + // DEV_NOTE: An account SHOULD exist for each actor. + if !morseWorkspace.hasAccount(addr) { + // TODO_IN_THIS_COMMIT: consolidate error types... + return fmt.Errorf("account %q not found", addr) + } + + appStakeAmtUpokt, ok := cosmosmath.NewIntFromString(exportApplication.StakedTokens) + if !ok { + return fmt.Errorf("failed to parse application stake amount %q", exportApplication.StakedTokens) + } + + if err := morseWorkspace.addUpokt(addr, appStakeAmtUpokt); err != nil { + return err + } + } + return nil +} + +// collectInputSupplierStakes iterates over the suppliers in the inputState and +// adds the stake to the corresponding account balances in the morseWorkspace. +func collectInputSupplierStakes(inputState *migrationtypes.MorseStateExport, morseWorkspace *morseImportWorkspace) error { + for _, exportSupplier := range inputState.AppState.Pos.Validators { + addr := exportSupplier.Address.String() + + // DEV_NOTE: An account SHOULD exist for each actor. + if !morseWorkspace.hasAccount(addr) { + // TODO_IN_THIS_COMMIT: consolidate error types... + return fmt.Errorf("account %q not found", addr) + } + + supplierStakeAmtUpokt, ok := cosmosmath.NewIntFromString(exportSupplier.StakedTokens) + if !ok { + return fmt.Errorf("failed to parse supplier stake amount %q", exportSupplier.StakedTokens) + } + + if err := morseWorkspace.addUpokt(addr, supplierStakeAmtUpokt); err != nil { + return err + } + } + return nil +} diff --git a/cmd/poktrolld/cmd/migrate/migrate_test.go b/cmd/poktrolld/cmd/migrate/migrate_test.go new file mode 100644 index 000000000..ebd3c07f6 --- /dev/null +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -0,0 +1,209 @@ +package migrate + +import ( + "bytes" + "os" + "path/filepath" + "strings" + "testing" + "text/template" + + "github.com/stretchr/testify/require" +) + +type morseStateInputLocals struct { + Address1Hex, + Address2Hex, + PublicKey1Hex, + PublicKey2Hex string + Account1Amount, + Account2Amount, + App1StakeAmount, + App2StakeAmount, + Supplier1StakeAmount, + Supplier2StakeAmount uint64 +} + +type morseStateOutputLocals struct { + Address1Hex, + Address2Hex, + PublicKey1Hex, + PublicKey2Hex string + Account1Amount, + Account2Amount uint64 +} + +var ( + mockMorseStateExport = template.Must(template.New("morse_state_export.json").Parse(` +{ + "app_hash": "", + "app_state": { + "application": { + "applications": [ + { + "address": "{{.Address1Hex}}", + "public_key": "{{.PublicKey1Hex}}", + "jailed": false, + "status": 2, + "staked_tokens": "{{.App1StakeAmount}}" + }, + { + "address": "{{.Address2Hex}}", + "public_key": "{{.PublicKey2Hex}}", + "jailed": false, + "status": 2, + "staked_tokens": "{{.App2StakeAmount}}" + } + ] + }, + "auth": { + "accounts": [ + { + "type": "posmint/Account", + "value": { + "address": "{{.Address1Hex}}", + "coins": [ + { + "denom": "upokt", + "amount": "{{.Account1Amount}}" + } + ], + "public_key": { + "type": "crypto/ed25519_public_key", + "value": "{{.PublicKey1Hex}}" + } + } + }, + { + "type": "posmint/Account", + "value": { + "address": "{{.Address2Hex}}", + "coins": [ + { + "denom": "upokt", + "amount": "{{.Account2Amount}}" + } + ], + "public_key": { + "type": "crypto/ed25519_public_key", + "value": "{{.PublicKey2Hex}}" + } + } + } + ] + }, + "pos": { + "validators": [ + { + "address": "{{.Address1Hex}}", + "public_key": "{{.PublicKey1Hex}}", + "jailed": false, + "status": 2, + "tokens": "{{.Supplier1StakeAmount}}" + }, + { + "address": "{{.Address2Hex}}", + "public_key": "{{.PublicKey2Hex}}", + "jailed": false, + "status": 2, + "tokens": "{{.Supplier2StakeAmount}}" + } + ] + } + } +} +`)) + expectedMorseAccountStateJSONTmpl = template.Must(template.New("morse_account_state.json").Parse(`{ + "accounts": [ + { + "address": "{{.Address1Hex}}", + "public_key": { + "value": "{{.PublicKey1Hex}}" + }, + "coins": [ + { + "denom": "upokt", + "amount": "{{.Account1Amount}}" + } + ] + }, + { + "address": "{{.Address2Hex}}", + "public_key": { + "value": "{{.PublicKey2Hex}}" + }, + "coins": [ + { + "denom": "upokt", + "amount": "{{.Account2Amount}}" + } + ] + } + ] +}`)) + + Account1Amount = uint64(2000000) + Account2Amount = uint64(2000020) + App1StakeAmount = uint64(10000000000000) + App2StakeAmount = uint64(10000000000001) + Supplier1StakeAmount = uint64(30000000) + Supplier2StakeAmount = uint64(30000300) + Address1Hex = "934066AAE79DA1E8012BACF4953985DC6BAC3371" + Address2Hex = "3145CF09E0E780A16E57DE7DB2A419CFEA45C830" + PublicKey1Hex = "f68e32d72e7f5f1c797bcd41d8d0e9a1004354c6b1c85429f2ebd7d82ccf4a70" + PublicKey2Hex = "0a825f4415213910f949b9081ee43cca105eae13ca44bb69e93aaad122f52c11" + + morseInputLocals = morseStateInputLocals{ + Address1Hex: Address1Hex, + Address2Hex: Address2Hex, + PublicKey1Hex: PublicKey1Hex, + PublicKey2Hex: PublicKey2Hex, + Account1Amount: Account1Amount, + Account2Amount: Account2Amount, + App1StakeAmount: App1StakeAmount, + App2StakeAmount: App2StakeAmount, + Supplier1StakeAmount: Supplier1StakeAmount, + Supplier2StakeAmount: Supplier2StakeAmount, + } + + morseOutputLocals = morseStateOutputLocals{ + Address1Hex: Address1Hex, + Address2Hex: Address2Hex, + PublicKey1Hex: PublicKey1Hex, + PublicKey2Hex: PublicKey2Hex, + Account1Amount: App1StakeAmount + Account1Amount + Supplier1StakeAmount, + Account2Amount: App2StakeAmount + Account2Amount + Supplier2StakeAmount, + } +) + +func TestCollectMorseAccounts(t *testing.T) { + tmpDir := t.TempDir() + outputPath := filepath.Join(tmpDir, "morse-state-output.json") + inputFile, err := os.CreateTemp(tmpDir, "morse-state-input.json") + require.NoError(t, err) + + err = mockMorseStateExport.Execute(inputFile, morseInputLocals) + require.NoError(t, err) + + err = inputFile.Close() + require.NoError(t, err) + + // Call the function under test. + err = collectMorseAccounts(inputFile.Name(), outputPath) + require.NoError(t, err) + + outputJSON, err := os.ReadFile(outputPath) + require.NoError(t, err) + + expectedJSONBuf := new(bytes.Buffer) + err = expectedMorseAccountStateJSONTmpl.Execute(expectedJSONBuf, morseOutputLocals) + require.NoError(t, err) + + // Strip all whitespace from the expected JSON. + expectedJSON := expectedJSONBuf.String() + expectedJSON = strings.ReplaceAll(expectedJSON, "\n", "") + expectedJSON = strings.ReplaceAll(expectedJSON, " ", "") + + require.NoError(t, err) + require.Equal(t, expectedJSON, string(outputJSON)) +} diff --git a/cmd/poktrolld/cmd/migrate/types.go b/cmd/poktrolld/cmd/migrate/types.go new file mode 100644 index 000000000..a2720d563 --- /dev/null +++ b/cmd/poktrolld/cmd/migrate/types.go @@ -0,0 +1,76 @@ +package migrate + +import ( + "fmt" + + cosmosmath "cosmossdk.io/math" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + + "github.com/pokt-network/poktroll/app/volatile" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" +) + +// TODO_IN_THIS_COMMIT: godoc... +type morseImportWorkspace struct { + // TODO_IN_THIS_COMMIT: godoc... + addressToIdx map[string]uint64 + accounts []*migrationtypes.MorseAccount +} + +// nextIdx returns the next index to be used when appending a new account to the accounts slice. +func (miw *morseImportWorkspace) nextIdx() uint64 { + return uint64(len(miw.accounts)) +} + +// lastIdx returns the last index of the accounts slice. +func (miw *morseImportWorkspace) lastIdx() uint64 { + return uint64(len(miw.accounts) - 1) +} + +// hasAccount returns true if the given address is present in the accounts slice. +func (miw *morseImportWorkspace) hasAccount(addr string) bool { + _, ok := miw.addressToIdx[addr] + return ok +} + +// TODO_IN_THIS_COMMIT: godoc... +func (miw *morseImportWorkspace) ensureAccount( + addr string, + exportAccount *migrationtypes.MorseAuthAccount, +) (accountIdx uint64, balance cosmostypes.Coin) { + var ok bool + balance = cosmostypes.NewCoin(volatile.DenomuPOKT, cosmosmath.ZeroInt()) + + if accountIdx, ok = miw.addressToIdx[addr]; ok { + accountIdx = accountIdx + importAccount := miw.accounts[accountIdx] + // TODO_IN_THIS_COMMIT: comment... SHOULD ONLY be one denom (upokt). + if len(importAccount.Coins) != 0 { + balance = importAccount.Coins[0] + } + } else { + accountIdx = miw.nextIdx() + importAccount := &migrationtypes.MorseAccount{ + Address: exportAccount.Value.Address, + PubKey: exportAccount.Value.PubKey, + Coins: cosmostypes.Coins{balance}, + } + miw.accounts = append(miw.accounts, importAccount) + miw.addressToIdx[addr] = accountIdx + } + + return accountIdx, balance +} + +// TODO_IN_THIS_COMMIT: godoc... +func (miw *morseImportWorkspace) addUpokt(addr string, amount cosmosmath.Int) error { + importAccountIdx, hasAccountAddr := miw.addressToIdx[addr] + if !hasAccountAddr { + return fmt.Errorf("account %q not found", addr) + } + + account := miw.accounts[importAccountIdx] + account.Coins[0].Amount = account.Coins[0].Amount.Add(amount) + + return nil +} diff --git a/proto/poktroll/migration/legacy.proto b/proto/poktroll/migration/legacy.proto new file mode 100644 index 000000000..17ec0b955 --- /dev/null +++ b/proto/poktroll/migration/legacy.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; + +// Types in this file are ONLY present to facilitate the verifiability of the +// migration state from Morse to Shannon. These types are used by the migration +// subcommand (e.g. `poktrolld migrate collect-morse-accounts ...) to transform +// the Morse state export into the Shannon state import. They ARE NOT persisted +// on-chain at any point. +package poktroll.migration; + +import "gogoproto/gogo.proto"; +import "poktroll/migration/types.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/migration/types"; +option (gogoproto.stable_marshaler_all) = true; + +message MorseStateExport { + string app_hash = 1 [(gogoproto.jsontag) = "app_hash"]; + MorseAppState app_state = 2 [(gogoproto.jsontag) = "app_state"]; +} + +message MorseAppState { + MorseApplications application = 1 [(gogoproto.jsontag) = "application"]; + MorseAuth auth = 2 [(gogoproto.jsontag) = "auth"]; + MorsePos pos = 3 [(gogoproto.jsontag) = "pos"]; +} + +message MorseApplications { + repeated MorseApplication applications = 1 [(gogoproto.jsontag) = "applications"]; +} + +message MorseAuthAccount { + string Type = 1 [(gogoproto.jsontag) = "type"]; + MorseAccount Value = 2 [(gogoproto.jsontag) = "value"]; +} + +message MorseAuth { + repeated MorseAuthAccount accounts = 1 [(gogoproto.jsontag) = "accounts"]; +} + +message MorsePos { + repeated MorseValidator validators = 1 [(gogoproto.jsontag) = "validators"]; +} diff --git a/proto/poktroll/migration/types.proto b/proto/poktroll/migration/types.proto new file mode 100644 index 000000000..7b1d64fcb --- /dev/null +++ b/proto/poktroll/migration/types.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package poktroll.migration; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/migration/types"; +option (gogoproto.stable_marshaler_all) = true; + +// MorseAccountState is the on-chain representation of the imported account state from Morse. +message MorseAccountState { + repeated MorseAccount accounts = 1 [(gogoproto.jsontag) = "accounts"]; +} + +// MorseAccount is an analog of the Morse ProtoBaseAccount type. It encapsulates +// the minimum information required to import accounts. +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/auth/auth.proto#L14. +message MorseAccount { + option (gogoproto.messagename) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = true; + option (cosmos_proto.implements_interface) = "Account"; + + bytes address = 1 [(gogoproto.jsontag) = "address", (gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address"]; + MorsePublicKey pub_key = 2 [(gogoproto.jsontag) = "public_key", (gogoproto.moretags) = "yaml:\"public_key\""]; + repeated cosmos.base.v1beta1.Coin coins = 3 [(gogoproto.nullable) = false]; +} + +// MorsePublicKey is required to conform to the encoding of the Morse state export. +// NB: All Morse account public keys will be ed25519 keys by definition. +message MorsePublicKey { + bytes value = 2 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; +} + +// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates +// the minimum information required to import Morse applications. +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 +message MorseApplication { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + bytes address = 1 [ + (gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", + (gogoproto.jsontag) = "address", + (gogoproto.moretags) = "yaml:\"address\"" + ]; + bytes public_key = 2 [ + (gogoproto.jsontag) = "public_key", + (gogoproto.moretags) = "yaml:\"public_key\""]; + bool jailed = 3[ + (gogoproto.jsontag) = "jailed", + (gogoproto.moretags) = "yaml:\"jailed\""]; + int32 status = 4 [ + (gogoproto.jsontag) = "status", + (gogoproto.moretags) = "yaml:\"status\""]; + string staked_tokens = 6; +} + +// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the +// minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 +message MorseValidator { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (gogoproto.goproto_getters) = false; + + bytes Address = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; + bytes PublicKey = 2 [(gogoproto.moretags) = "yaml:\"public_key\"", (gogoproto.jsontag) = "public_key"]; + bool jailed = 3 [(gogoproto.jsontag) = "jailed"]; + int32 status = 4 [(gogoproto.jsontag) = "status"]; + string StakedTokens = 7 [(gogoproto.jsontag) = "tokens"]; +} diff --git a/x/migration/types/types.pb.go b/x/migration/types/types.pb.go new file mode 100644 index 000000000..3d9399d1c --- /dev/null +++ b/x/migration/types/types.pb.go @@ -0,0 +1,1508 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/migration/types.proto + +package types + +import ( + bytes "bytes" + crypto_ed25519 "crypto/ed25519" + fmt "fmt" + github_com_cometbft_cometbft_crypto "github.com/cometbft/cometbft/crypto" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MorseAccountState is the on-chain representation of the imported account state from Morse. +type MorseAccountState struct { + Accounts []*MorseAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts"` +} + +func (m *MorseAccountState) Reset() { *m = MorseAccountState{} } +func (m *MorseAccountState) String() string { return proto.CompactTextString(m) } +func (*MorseAccountState) ProtoMessage() {} +func (*MorseAccountState) Descriptor() ([]byte, []int) { + return fileDescriptor_7ed31f79aa0bc330, []int{0} +} +func (m *MorseAccountState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseAccountState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseAccountState) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseAccountState.Merge(m, src) +} +func (m *MorseAccountState) XXX_Size() int { + return m.Size() +} +func (m *MorseAccountState) XXX_DiscardUnknown() { + xxx_messageInfo_MorseAccountState.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseAccountState proto.InternalMessageInfo + +func (m *MorseAccountState) GetAccounts() []*MorseAccount { + if m != nil { + return m.Accounts + } + return nil +} + +// MorseAccount is an analog of the Morse ProtoBaseAccount type. It encapsulates +// the minimum information required to import accounts. +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/auth/auth.proto#L14. +type MorseAccount struct { + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address"` + PubKey *MorsePublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key" yaml:"public_key"` + Coins []types.Coin `protobuf:"bytes,3,rep,name=coins,proto3" json:"coins"` +} + +func (m *MorseAccount) Reset() { *m = MorseAccount{} } +func (m *MorseAccount) String() string { return proto.CompactTextString(m) } +func (*MorseAccount) ProtoMessage() {} +func (*MorseAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_7ed31f79aa0bc330, []int{1} +} +func (m *MorseAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseAccount.Merge(m, src) +} +func (m *MorseAccount) XXX_Size() int { + return m.Size() +} +func (m *MorseAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MorseAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseAccount proto.InternalMessageInfo + +func (*MorseAccount) XXX_MessageName() string { + return "poktroll.migration.MorseAccount" +} + +// MorsePublicKey is required to conform to the encoding of the Morse state export. +// NB: All Morse account public keys will be ed25519 keys by definition. +type MorsePublicKey struct { + Value crypto_ed25519.PublicKey `protobuf:"bytes,2,opt,name=value,proto3,casttype=crypto/ed25519.PublicKey" json:"value,omitempty"` +} + +func (m *MorsePublicKey) Reset() { *m = MorsePublicKey{} } +func (m *MorsePublicKey) String() string { return proto.CompactTextString(m) } +func (*MorsePublicKey) ProtoMessage() {} +func (*MorsePublicKey) Descriptor() ([]byte, []int) { + return fileDescriptor_7ed31f79aa0bc330, []int{2} +} +func (m *MorsePublicKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorsePublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorsePublicKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorsePublicKey.Merge(m, src) +} +func (m *MorsePublicKey) XXX_Size() int { + return m.Size() +} +func (m *MorsePublicKey) XXX_DiscardUnknown() { + xxx_messageInfo_MorsePublicKey.DiscardUnknown(m) +} + +var xxx_messageInfo_MorsePublicKey proto.InternalMessageInfo + +func (m *MorsePublicKey) GetValue() crypto_ed25519.PublicKey { + if m != nil { + return m.Value + } + return nil +} + +// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates +// the minimum information required to import Morse applications. +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 +type MorseApplication struct { + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status" yaml:"status"` + StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` +} + +func (m *MorseApplication) Reset() { *m = MorseApplication{} } +func (m *MorseApplication) String() string { return proto.CompactTextString(m) } +func (*MorseApplication) ProtoMessage() {} +func (*MorseApplication) Descriptor() ([]byte, []int) { + return fileDescriptor_7ed31f79aa0bc330, []int{3} +} +func (m *MorseApplication) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseApplication) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseApplication.Merge(m, src) +} +func (m *MorseApplication) XXX_Size() int { + return m.Size() +} +func (m *MorseApplication) XXX_DiscardUnknown() { + xxx_messageInfo_MorseApplication.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseApplication proto.InternalMessageInfo + +// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the +// minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 +type MorseValidator struct { + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` + PublicKey []byte `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"public_key" yaml:"public_key"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status"` + StakedTokens string `protobuf:"bytes,7,opt,name=StakedTokens,proto3" json:"tokens"` +} + +func (m *MorseValidator) Reset() { *m = MorseValidator{} } +func (m *MorseValidator) String() string { return proto.CompactTextString(m) } +func (*MorseValidator) ProtoMessage() {} +func (*MorseValidator) Descriptor() ([]byte, []int) { + return fileDescriptor_7ed31f79aa0bc330, []int{4} +} +func (m *MorseValidator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseValidator) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseValidator.Merge(m, src) +} +func (m *MorseValidator) XXX_Size() int { + return m.Size() +} +func (m *MorseValidator) XXX_DiscardUnknown() { + xxx_messageInfo_MorseValidator.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseValidator proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MorseAccountState)(nil), "poktroll.migration.MorseAccountState") + proto.RegisterType((*MorseAccount)(nil), "poktroll.migration.MorseAccount") + proto.RegisterType((*MorsePublicKey)(nil), "poktroll.migration.MorsePublicKey") + proto.RegisterType((*MorseApplication)(nil), "poktroll.migration.MorseApplication") + proto.RegisterType((*MorseValidator)(nil), "poktroll.migration.MorseValidator") +} + +func init() { proto.RegisterFile("poktroll/migration/types.proto", fileDescriptor_7ed31f79aa0bc330) } + +var fileDescriptor_7ed31f79aa0bc330 = []byte{ + // 639 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x73, 0x69, 0x9b, 0xb4, 0x57, 0xb7, 0xa2, 0x16, 0x12, 0x6e, 0x41, 0xbe, 0xe8, 0xba, + 0x44, 0x42, 0xb5, 0xd5, 0x54, 0x1d, 0xc8, 0x16, 0xc3, 0x44, 0x41, 0xaa, 0xdc, 0x8a, 0x81, 0x25, + 0x9c, 0x9d, 0x6b, 0x30, 0x71, 0x72, 0x96, 0xef, 0x5c, 0xc8, 0x37, 0xe8, 0xc8, 0x84, 0x18, 0x2b, + 0x3e, 0x03, 0x5f, 0x80, 0xad, 0x62, 0xea, 0x46, 0x27, 0x0b, 0xa5, 0x0b, 0xca, 0x98, 0xb1, 0x13, + 0xb2, 0xcf, 0x71, 0xdc, 0x20, 0x24, 0x40, 0x62, 0xbb, 0xf7, 0x7f, 0xff, 0x7f, 0xf4, 0xde, 0xef, + 0x9c, 0x83, 0x7a, 0xc0, 0x7a, 0x22, 0x64, 0xbe, 0x6f, 0xf6, 0xbd, 0x6e, 0x48, 0x84, 0xc7, 0x06, + 0xa6, 0x18, 0x06, 0x94, 0x1b, 0x41, 0xc8, 0x04, 0x53, 0xd5, 0x69, 0xdf, 0xc8, 0xfb, 0x5b, 0x9b, + 0x2e, 0xe3, 0x7d, 0xc6, 0xdb, 0xa9, 0xc3, 0x94, 0x85, 0xb4, 0x6f, 0xe9, 0xb2, 0x32, 0x1d, 0xc2, + 0xa9, 0x79, 0xba, 0xeb, 0x50, 0x41, 0x76, 0x4d, 0x97, 0x79, 0x83, 0xac, 0x7f, 0xb7, 0xcb, 0xba, + 0x4c, 0xe6, 0x92, 0x93, 0x54, 0x71, 0x1b, 0x6e, 0x3c, 0x67, 0x21, 0xa7, 0x2d, 0xd7, 0x65, 0xd1, + 0x40, 0x1c, 0x09, 0x22, 0xa8, 0xfa, 0x14, 0x2e, 0x13, 0x59, 0x73, 0x0d, 0xd4, 0x16, 0xea, 0xab, + 0x8d, 0x9a, 0xf1, 0xeb, 0x30, 0x46, 0x31, 0x68, 0x29, 0xe3, 0x18, 0xe5, 0x29, 0x3b, 0x3f, 0xe1, + 0x0f, 0x65, 0xa8, 0x14, 0x8d, 0xea, 0x31, 0xac, 0x92, 0x4e, 0x27, 0xa4, 0x3c, 0xf9, 0x6d, 0x50, + 0x57, 0xac, 0xe6, 0x38, 0x46, 0x53, 0xe9, 0x26, 0x46, 0x0f, 0xbb, 0x9e, 0x78, 0x1d, 0x39, 0x86, + 0xcb, 0xfa, 0xa6, 0xcb, 0xfa, 0x54, 0x38, 0x27, 0xa2, 0x70, 0x08, 0x87, 0x81, 0x60, 0x46, 0x4b, + 0xda, 0xed, 0x69, 0x4e, 0x7d, 0x05, 0xab, 0x41, 0xe4, 0xb4, 0x7b, 0x74, 0xa8, 0x95, 0x6b, 0xa0, + 0xbe, 0xda, 0xc0, 0xbf, 0x9d, 0xf8, 0x30, 0x72, 0x7c, 0xcf, 0x3d, 0xa0, 0x43, 0x6b, 0x7b, 0x1c, + 0x23, 0x18, 0xa4, 0x65, 0x92, 0x9c, 0xc4, 0x68, 0x63, 0x48, 0xfa, 0x7e, 0x13, 0xcf, 0x34, 0x6c, + 0x57, 0x82, 0xc8, 0x39, 0xa0, 0x43, 0x75, 0x1f, 0x2e, 0x25, 0x34, 0xb9, 0xb6, 0x90, 0x12, 0xd9, + 0x34, 0x32, 0xfa, 0x09, 0x6f, 0x23, 0xe3, 0x6d, 0x3c, 0x66, 0xde, 0xc0, 0x5a, 0xbc, 0x88, 0x51, + 0xc9, 0x96, 0xee, 0xe6, 0xbd, 0xb3, 0x73, 0x54, 0xfa, 0x78, 0x8e, 0xc0, 0xd9, 0x27, 0x04, 0xbe, + 0x7e, 0xde, 0xa9, 0x66, 0x1c, 0xf0, 0x13, 0xb8, 0x7e, 0x7b, 0x1c, 0xb5, 0x01, 0x97, 0x4e, 0x89, + 0x1f, 0xd1, 0x74, 0x03, 0xc5, 0x7a, 0x70, 0x13, 0x23, 0x4d, 0xee, 0x6b, 0xd2, 0x4e, 0x63, 0x7f, + 0x7f, 0xf7, 0x91, 0x91, 0x9b, 0x6d, 0x69, 0xc5, 0xdf, 0xca, 0xf0, 0x8e, 0xc4, 0x1b, 0x04, 0xbe, + 0xe7, 0xa6, 0x6b, 0xaa, 0x27, 0xf3, 0x88, 0x9f, 0x15, 0x10, 0x4f, 0x62, 0xb4, 0x2e, 0xb7, 0xcc, + 0x04, 0xfc, 0xcf, 0xd0, 0x2d, 0x58, 0xa0, 0x97, 0x4d, 0xfd, 0x47, 0x4c, 0x57, 0x82, 0x7c, 0xe9, + 0x3d, 0x58, 0x79, 0x43, 0x3c, 0x9f, 0x76, 0xb4, 0x85, 0x1a, 0xa8, 0x2f, 0x5b, 0xf7, 0xc7, 0x31, + 0xca, 0x94, 0x49, 0x8c, 0xd6, 0x64, 0x56, 0xd6, 0xd8, 0xce, 0x1a, 0x49, 0x88, 0x0b, 0x22, 0x22, + 0xae, 0x2d, 0xd6, 0x40, 0x7d, 0x49, 0x86, 0xa4, 0x32, 0x0b, 0xc9, 0x1a, 0xdb, 0x59, 0x43, 0xdd, + 0x86, 0x6b, 0x5c, 0x90, 0x1e, 0xed, 0xb4, 0x05, 0xeb, 0xd1, 0x01, 0xd7, 0x2a, 0x35, 0x50, 0x5f, + 0xb1, 0x15, 0x29, 0x1e, 0xa7, 0x5a, 0x73, 0x39, 0xb9, 0xae, 0x1f, 0xe7, 0x08, 0xe0, 0x2f, 0xe5, + 0xec, 0x82, 0x5e, 0x10, 0xdf, 0xeb, 0x10, 0xc1, 0xc2, 0x84, 0x6b, 0xeb, 0x7f, 0x72, 0xcd, 0x0e, + 0x6a, 0x0b, 0xae, 0xe4, 0x17, 0xfd, 0x57, 0x58, 0x67, 0xdf, 0x12, 0x9e, 0xc3, 0x0a, 0x67, 0x58, + 0x73, 0x8a, 0x78, 0x8e, 0x22, 0x9c, 0x51, 0xcc, 0xa1, 0x19, 0x50, 0x39, 0x2a, 0xf0, 0xd1, 0xaa, + 0x09, 0x33, 0xe9, 0x94, 0x14, 0xed, 0x5b, 0xfd, 0xa6, 0x32, 0xfd, 0xdc, 0x13, 0x86, 0xd6, 0xe1, + 0xc5, 0x48, 0x07, 0x97, 0x23, 0x1d, 0x5c, 0x8d, 0x74, 0xf0, 0x7d, 0xa4, 0x83, 0xf7, 0xd7, 0x7a, + 0xe9, 0xf2, 0x5a, 0x2f, 0x5d, 0x5d, 0xeb, 0xa5, 0x97, 0x8d, 0x02, 0x9c, 0xe4, 0xcf, 0xba, 0x33, + 0xa0, 0xe2, 0x2d, 0x0b, 0x7b, 0x66, 0xfe, 0x30, 0xbe, 0x9b, 0x7f, 0x1a, 0x9d, 0x4a, 0xfa, 0x6c, + 0xed, 0xfd, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xca, 0x85, 0x60, 0x2e, 0x3d, 0x05, 0x00, 0x00, +} + +func (this *MorseApplication) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MorseApplication) + if !ok { + that2, ok := that.(MorseApplication) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Address, that1.Address) { + return false + } + if !bytes.Equal(this.PublicKey, that1.PublicKey) { + return false + } + if this.Jailed != that1.Jailed { + return false + } + if this.Status != that1.Status { + return false + } + if this.StakedTokens != that1.StakedTokens { + return false + } + return true +} +func (this *MorseValidator) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MorseValidator) + if !ok { + that2, ok := that.(MorseValidator) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Address, that1.Address) { + return false + } + if !bytes.Equal(this.PublicKey, that1.PublicKey) { + return false + } + if this.Jailed != that1.Jailed { + return false + } + if this.Status != that1.Status { + return false + } + if this.StakedTokens != that1.StakedTokens { + return false + } + return true +} +func (m *MorseAccountState) 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 *MorseAccountState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseAccountState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MorseAccount) 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 *MorseAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Coins) > 0 { + for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MorsePublicKey) 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 *MorsePublicKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorsePublicKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *MorseApplication) 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 *MorseApplication) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseApplication) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StakedTokens) > 0 { + i -= len(m.StakedTokens) + copy(dAtA[i:], m.StakedTokens) + i = encodeVarintTypes(dAtA, i, uint64(len(m.StakedTokens))) + i-- + dAtA[i] = 0x32 + } + if m.Status != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x20 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintTypes(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MorseValidator) 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 *MorseValidator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StakedTokens) > 0 { + i -= len(m.StakedTokens) + copy(dAtA[i:], m.StakedTokens) + i = encodeVarintTypes(dAtA, i, uint64(len(m.StakedTokens))) + i-- + dAtA[i] = 0x3a + } + if m.Status != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x20 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintTypes(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MorseAccountState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Accounts) > 0 { + for _, e := range m.Accounts { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *MorseAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if len(m.Coins) > 0 { + for _, e := range m.Coins { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + +func (m *MorsePublicKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *MorseApplication) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Jailed { + n += 2 + } + if m.Status != 0 { + n += 1 + sovTypes(uint64(m.Status)) + } + l = len(m.StakedTokens) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *MorseValidator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Jailed { + n += 2 + } + if m.Status != 0 { + n += 1 + sovTypes(uint64(m.Status)) + } + l = len(m.StakedTokens) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MorseAccountState) 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 ErrIntOverflowTypes + } + 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: MorseAccountState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseAccountState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accounts = append(m.Accounts, &MorseAccount{}) + if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseAccount) 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 ErrIntOverflowTypes + } + 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: MorseAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubKey == nil { + m.PubKey = &MorsePublicKey{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Coins = append(m.Coins, types.Coin{}) + if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorsePublicKey) 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 ErrIntOverflowTypes + } + 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: MorsePublicKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorsePublicKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseApplication) 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 ErrIntOverflowTypes + } + 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: MorseApplication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseApplication: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseValidator) 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 ErrIntOverflowTypes + } + 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: MorseValidator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseValidator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) From 890d5b55d867b81020006c52e7834bcf47a6fdf0 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 27 Jan 2025 16:35:42 +0100 Subject: [PATCH 06/19] refactor: test & add benchmark --- cmd/poktrolld/cmd/migrate/migrate.go | 11 +- cmd/poktrolld/cmd/migrate/migrate_test.go | 315 ++++++++++------------ cmd/poktrolld/cmd/migrate/types.go | 10 +- 3 files changed, 158 insertions(+), 178 deletions(-) diff --git a/cmd/poktrolld/cmd/migrate/migrate.go b/cmd/poktrolld/cmd/migrate/migrate.go index 5fff61bf1..ae0cccddc 100644 --- a/cmd/poktrolld/cmd/migrate/migrate.go +++ b/cmd/poktrolld/cmd/migrate/migrate.go @@ -86,8 +86,6 @@ func validatePathIsFile(path string) error { // transformMorseState consolidates the Morse account balance, application stake, // and supplier stake for each account as an entry in the resulting MorseAccountState. -// -// TODO_IN_THIS_COMMIT: benchmark and consider at what point (i.e. number of accounts) does asynchronous import processing matter? func transformMorseState(inputState *migrationtypes.MorseStateExport) ([]byte, error) { morseWorkspace := &morseImportWorkspace{ addressToIdx: make(map[string]uint64), @@ -126,8 +124,13 @@ func collectInputAccountBalances(inputState *migrationtypes.MorseStateExport, mo addr := exportAccount.Value.Address.String() morseWorkspace.ensureAccount(addr, exportAccount) - // TODO_IN_THIS_COMMIT: comment... SHOULD ONLY be one denom (upokt). - coin := exportAccount.Value.Coins[0] + coins := exportAccount.Value.Coins + if len(coins) == 0 { + return nil + } + + // DEV_NOTE: SHOULD ONLY be one denom (upokt). + coin := coins[0] if coin.Denom != volatile.DenomuPOKT { return fmt.Errorf("unsupported denom %q", coin.Denom) } diff --git a/cmd/poktrolld/cmd/migrate/migrate_test.go b/cmd/poktrolld/cmd/migrate/migrate_test.go index ebd3c07f6..dee73474d 100644 --- a/cmd/poktrolld/cmd/migrate/migrate_test.go +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -1,179 +1,23 @@ package migrate import ( - "bytes" + "encoding/binary" + "fmt" + "math" + "math/rand" "os" "path/filepath" "strings" "testing" - "text/template" + cometcrypto "github.com/cometbft/cometbft/crypto/ed25519" + cmtjson "github.com/cometbft/cometbft/libs/json" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/regen-network/gocuke" "github.com/stretchr/testify/require" -) - -type morseStateInputLocals struct { - Address1Hex, - Address2Hex, - PublicKey1Hex, - PublicKey2Hex string - Account1Amount, - Account2Amount, - App1StakeAmount, - App2StakeAmount, - Supplier1StakeAmount, - Supplier2StakeAmount uint64 -} - -type morseStateOutputLocals struct { - Address1Hex, - Address2Hex, - PublicKey1Hex, - PublicKey2Hex string - Account1Amount, - Account2Amount uint64 -} - -var ( - mockMorseStateExport = template.Must(template.New("morse_state_export.json").Parse(` -{ - "app_hash": "", - "app_state": { - "application": { - "applications": [ - { - "address": "{{.Address1Hex}}", - "public_key": "{{.PublicKey1Hex}}", - "jailed": false, - "status": 2, - "staked_tokens": "{{.App1StakeAmount}}" - }, - { - "address": "{{.Address2Hex}}", - "public_key": "{{.PublicKey2Hex}}", - "jailed": false, - "status": 2, - "staked_tokens": "{{.App2StakeAmount}}" - } - ] - }, - "auth": { - "accounts": [ - { - "type": "posmint/Account", - "value": { - "address": "{{.Address1Hex}}", - "coins": [ - { - "denom": "upokt", - "amount": "{{.Account1Amount}}" - } - ], - "public_key": { - "type": "crypto/ed25519_public_key", - "value": "{{.PublicKey1Hex}}" - } - } - }, - { - "type": "posmint/Account", - "value": { - "address": "{{.Address2Hex}}", - "coins": [ - { - "denom": "upokt", - "amount": "{{.Account2Amount}}" - } - ], - "public_key": { - "type": "crypto/ed25519_public_key", - "value": "{{.PublicKey2Hex}}" - } - } - } - ] - }, - "pos": { - "validators": [ - { - "address": "{{.Address1Hex}}", - "public_key": "{{.PublicKey1Hex}}", - "jailed": false, - "status": 2, - "tokens": "{{.Supplier1StakeAmount}}" - }, - { - "address": "{{.Address2Hex}}", - "public_key": "{{.PublicKey2Hex}}", - "jailed": false, - "status": 2, - "tokens": "{{.Supplier2StakeAmount}}" - } - ] - } - } -} -`)) - expectedMorseAccountStateJSONTmpl = template.Must(template.New("morse_account_state.json").Parse(`{ - "accounts": [ - { - "address": "{{.Address1Hex}}", - "public_key": { - "value": "{{.PublicKey1Hex}}" - }, - "coins": [ - { - "denom": "upokt", - "amount": "{{.Account1Amount}}" - } - ] - }, - { - "address": "{{.Address2Hex}}", - "public_key": { - "value": "{{.PublicKey2Hex}}" - }, - "coins": [ - { - "denom": "upokt", - "amount": "{{.Account2Amount}}" - } - ] - } - ] -}`)) - - Account1Amount = uint64(2000000) - Account2Amount = uint64(2000020) - App1StakeAmount = uint64(10000000000000) - App2StakeAmount = uint64(10000000000001) - Supplier1StakeAmount = uint64(30000000) - Supplier2StakeAmount = uint64(30000300) - Address1Hex = "934066AAE79DA1E8012BACF4953985DC6BAC3371" - Address2Hex = "3145CF09E0E780A16E57DE7DB2A419CFEA45C830" - PublicKey1Hex = "f68e32d72e7f5f1c797bcd41d8d0e9a1004354c6b1c85429f2ebd7d82ccf4a70" - PublicKey2Hex = "0a825f4415213910f949b9081ee43cca105eae13ca44bb69e93aaad122f52c11" - - morseInputLocals = morseStateInputLocals{ - Address1Hex: Address1Hex, - Address2Hex: Address2Hex, - PublicKey1Hex: PublicKey1Hex, - PublicKey2Hex: PublicKey2Hex, - Account1Amount: Account1Amount, - Account2Amount: Account2Amount, - App1StakeAmount: App1StakeAmount, - App2StakeAmount: App2StakeAmount, - Supplier1StakeAmount: Supplier1StakeAmount, - Supplier2StakeAmount: Supplier2StakeAmount, - } - morseOutputLocals = morseStateOutputLocals{ - Address1Hex: Address1Hex, - Address2Hex: Address2Hex, - PublicKey1Hex: PublicKey1Hex, - PublicKey2Hex: PublicKey2Hex, - Account1Amount: App1StakeAmount + Account1Amount + Supplier1StakeAmount, - Account2Amount: App2StakeAmount + Account2Amount + Supplier2StakeAmount, - } + "github.com/pokt-network/poktroll/app/volatile" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) func TestCollectMorseAccounts(t *testing.T) { @@ -182,7 +26,8 @@ func TestCollectMorseAccounts(t *testing.T) { inputFile, err := os.CreateTemp(tmpDir, "morse-state-input.json") require.NoError(t, err) - err = mockMorseStateExport.Execute(inputFile, morseInputLocals) + morseStateExportBz, morseAccountStateBz := newMorseStateExportAndAccountState(t, 10) + _, err = inputFile.Write(morseStateExportBz) require.NoError(t, err) err = inputFile.Close() @@ -195,15 +40,145 @@ func TestCollectMorseAccounts(t *testing.T) { outputJSON, err := os.ReadFile(outputPath) require.NoError(t, err) - expectedJSONBuf := new(bytes.Buffer) - err = expectedMorseAccountStateJSONTmpl.Execute(expectedJSONBuf, morseOutputLocals) + expectedJSON := string(morseAccountStateBz) require.NoError(t, err) // Strip all whitespace from the expected JSON. - expectedJSON := expectedJSONBuf.String() expectedJSON = strings.ReplaceAll(expectedJSON, "\n", "") expectedJSON = strings.ReplaceAll(expectedJSON, " ", "") require.NoError(t, err) require.Equal(t, expectedJSON, string(outputJSON)) } + +func TestNewTestMorseStateExport(t *testing.T) { + for i := 1; i < 10; i++ { + t.Run(fmt.Sprintf("num_accounts=%d", i), func(t *testing.T) { + morseStateExport := new(migrationtypes.MorseStateExport) + stateExportBz, _ := newMorseStateExportAndAccountState(t, i) + err := cmtjson.Unmarshal(stateExportBz, morseStateExport) + require.NoError(t, err) + + exportAccounts := morseStateExport.AppState.Auth.Accounts + require.Equal(t, i, len(exportAccounts)) + + expectedShannonBalance := fmt.Sprintf("%d%d%d0%d%d%d", i, i, i, i, i, i) + morseAccountState := new(migrationtypes.MorseAccountState) + morseAccountStateBz, err := transformMorseState(morseStateExport) + require.NoError(t, err) + + err = cmtjson.Unmarshal(morseAccountStateBz, morseAccountState) + require.NoError(t, err) + + require.Equal(t, expectedShannonBalance, morseAccountState.Accounts[i-1].Coins[0].Amount.String()) + }) + } +} + +func BenchmarkTransformMorseState(b *testing.B) { + for i := 0; i < 5; i++ { + numAccounts := int(math.Pow10(i + 1)) + morseStateExport := new(migrationtypes.MorseStateExport) + morseStateExportBz, _ := newMorseStateExportAndAccountState(b, numAccounts) + err := cmtjson.Unmarshal(morseStateExportBz, morseStateExport) + require.NoError(b, err) + + b.Run(fmt.Sprintf("num_accounts=%d", numAccounts), func(b *testing.B) { + + // Call the function under test. + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err = transformMorseState(morseStateExport) + require.NoError(b, err) + } + }) + } +} + +// TODO_CONSIDERATION: Test/benchmark execution speed can be optimized by refactoring this to a pre-generate fixture. +func newMorseStateExportAndAccountState( + t gocuke.TestingT, + numAccounts int, +) (morseStateExportBz []byte, morseAccountStateBz []byte) { + morseStateExport := &migrationtypes.MorseStateExport{ + AppHash: "", + AppState: &migrationtypes.MorseAppState{ + Application: &migrationtypes.MorseApplications{}, + Auth: &migrationtypes.MorseAuth{}, + Pos: &migrationtypes.MorsePos{}, + }, + } + + morseAccountState := &migrationtypes.MorseAccountState{ + Accounts: make([]*migrationtypes.MorseAccount, numAccounts), + } + + for i := 1; i < numAccounts+1; i++ { + seedUint := rand.Uint64() + seedBz := make([]byte, 8) + binary.LittleEndian.PutUint64(seedBz, seedUint) + privKey := cometcrypto.GenPrivKeyFromSecret(seedBz) + pubKey := privKey.PubKey() + balanceAmount := int64(1e6*i + i) // i_000_00i + appStakeAmount := int64(1e5*i + (i * 10)) // i00_0i0 + supplierStakeAmount := int64(1e4*i + (i * 100)) // i0_i00 + sumAmount := balanceAmount + appStakeAmount + supplierStakeAmount // i_ii0_iii + + // Add an account. + morseStateExport.AppState.Auth.Accounts = append( + morseStateExport.AppState.Auth.Accounts, + &migrationtypes.MorseAuthAccount{ + Type: "posmint/Account", + Value: &migrationtypes.MorseAccount{ + Address: pubKey.Address(), + Coins: cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount)), + PubKey: &migrationtypes.MorsePublicKey{ + Value: pubKey.Bytes(), + }, + }, + }, + ) + + // Add an application. + morseStateExport.AppState.Application.Applications = append( + morseStateExport.AppState.Application.Applications, + &migrationtypes.MorseApplication{ + Address: pubKey.Address(), + PublicKey: pubKey.Bytes(), + Jailed: false, + Status: 2, + StakedTokens: fmt.Sprintf("%d", appStakeAmount), + }, + ) + + // Add a supplier. + morseStateExport.AppState.Pos.Validators = append( + morseStateExport.AppState.Pos.Validators, + &migrationtypes.MorseValidator{ + Address: pubKey.Address(), + PublicKey: pubKey.Bytes(), + Jailed: false, + Status: 2, + StakedTokens: fmt.Sprintf("%d", supplierStakeAmount), + }, + ) + + // Add the account to the morseAccountState. + morseAccountState.Accounts[i-1] = &migrationtypes.MorseAccount{ + Address: pubKey.Address(), + Coins: cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, sumAmount)), + PubKey: &migrationtypes.MorsePublicKey{ + Value: pubKey.Bytes(), + }, + } + } + + var err error + morseStateExportBz, err = cmtjson.Marshal(morseStateExport) + require.NoError(t, err) + + morseAccountStateBz, err = cmtjson.Marshal(morseAccountState) + require.NoError(t, err) + + return morseStateExportBz, morseAccountStateBz +} diff --git a/cmd/poktrolld/cmd/migrate/types.go b/cmd/poktrolld/cmd/migrate/types.go index a2720d563..bca52576e 100644 --- a/cmd/poktrolld/cmd/migrate/types.go +++ b/cmd/poktrolld/cmd/migrate/types.go @@ -10,9 +10,9 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -// TODO_IN_THIS_COMMIT: godoc... +// morseImportWorkspace is a helper struct that is used to consolidate the Morse account balance, +// application stake, and supplier stake for each account as an entry in the resulting MorseAccountState. type morseImportWorkspace struct { - // TODO_IN_THIS_COMMIT: godoc... addressToIdx map[string]uint64 accounts []*migrationtypes.MorseAccount } @@ -33,7 +33,9 @@ func (miw *morseImportWorkspace) hasAccount(addr string) bool { return ok } -// TODO_IN_THIS_COMMIT: godoc... +// ensureAccount ensures that the given address is present in the accounts slice +// and that its corresponding address is in the addressToIdx map. If the address +// is not present, it is added to the accounts slice and the addressToIdx map. func (miw *morseImportWorkspace) ensureAccount( addr string, exportAccount *migrationtypes.MorseAuthAccount, @@ -62,7 +64,7 @@ func (miw *morseImportWorkspace) ensureAccount( return accountIdx, balance } -// TODO_IN_THIS_COMMIT: godoc... +// addUpokt adds the given amount to the corresponding account balances in the morseWorkspace. func (miw *morseImportWorkspace) addUpokt(addr string, amount cosmosmath.Int) error { importAccountIdx, hasAccountAddr := miw.addressToIdx[addr] if !hasAccountAddr { From 95e1edfdf3598e42e6cd4be175131c9a693669d2 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 27 Jan 2025 16:55:29 +0100 Subject: [PATCH 07/19] fix: linter errors --- cmd/poktrolld/cmd/migrate/types.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmd/poktrolld/cmd/migrate/types.go b/cmd/poktrolld/cmd/migrate/types.go index bca52576e..6356fb2a7 100644 --- a/cmd/poktrolld/cmd/migrate/types.go +++ b/cmd/poktrolld/cmd/migrate/types.go @@ -22,11 +22,6 @@ func (miw *morseImportWorkspace) nextIdx() uint64 { return uint64(len(miw.accounts)) } -// lastIdx returns the last index of the accounts slice. -func (miw *morseImportWorkspace) lastIdx() uint64 { - return uint64(len(miw.accounts) - 1) -} - // hasAccount returns true if the given address is present in the accounts slice. func (miw *morseImportWorkspace) hasAccount(addr string) bool { _, ok := miw.addressToIdx[addr] @@ -44,7 +39,6 @@ func (miw *morseImportWorkspace) ensureAccount( balance = cosmostypes.NewCoin(volatile.DenomuPOKT, cosmosmath.ZeroInt()) if accountIdx, ok = miw.addressToIdx[addr]; ok { - accountIdx = accountIdx importAccount := miw.accounts[accountIdx] // TODO_IN_THIS_COMMIT: comment... SHOULD ONLY be one denom (upokt). if len(importAccount.Coins) != 0 { From 77bc6a5801c46b7df1a83675fc439b0b31e83179 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 27 Jan 2025 17:14:56 +0100 Subject: [PATCH 08/19] fix: add missing files --- api/poktroll/migration/legacy.pulsar.go | 3561 +++++++++++++++++++++++ x/migration/types/legacy.pb.go | 1450 +++++++++ 2 files changed, 5011 insertions(+) create mode 100644 api/poktroll/migration/legacy.pulsar.go create mode 100644 x/migration/types/legacy.pb.go diff --git a/api/poktroll/migration/legacy.pulsar.go b/api/poktroll/migration/legacy.pulsar.go new file mode 100644 index 000000000..0d11253c0 --- /dev/null +++ b/api/poktroll/migration/legacy.pulsar.go @@ -0,0 +1,3561 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package migration + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MorseStateExport protoreflect.MessageDescriptor + fd_MorseStateExport_app_hash protoreflect.FieldDescriptor + fd_MorseStateExport_app_state protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_legacy_proto_init() + md_MorseStateExport = File_poktroll_migration_legacy_proto.Messages().ByName("MorseStateExport") + fd_MorseStateExport_app_hash = md_MorseStateExport.Fields().ByName("app_hash") + fd_MorseStateExport_app_state = md_MorseStateExport.Fields().ByName("app_state") +} + +var _ protoreflect.Message = (*fastReflection_MorseStateExport)(nil) + +type fastReflection_MorseStateExport MorseStateExport + +func (x *MorseStateExport) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseStateExport)(x) +} + +func (x *MorseStateExport) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_legacy_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_MorseStateExport_messageType fastReflection_MorseStateExport_messageType +var _ protoreflect.MessageType = fastReflection_MorseStateExport_messageType{} + +type fastReflection_MorseStateExport_messageType struct{} + +func (x fastReflection_MorseStateExport_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseStateExport)(nil) +} +func (x fastReflection_MorseStateExport_messageType) New() protoreflect.Message { + return new(fastReflection_MorseStateExport) +} +func (x fastReflection_MorseStateExport_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseStateExport +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseStateExport) Descriptor() protoreflect.MessageDescriptor { + return md_MorseStateExport +} + +// 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_MorseStateExport) Type() protoreflect.MessageType { + return _fastReflection_MorseStateExport_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseStateExport) New() protoreflect.Message { + return new(fastReflection_MorseStateExport) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseStateExport) Interface() protoreflect.ProtoMessage { + return (*MorseStateExport)(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_MorseStateExport) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AppHash != "" { + value := protoreflect.ValueOfString(x.AppHash) + if !f(fd_MorseStateExport_app_hash, value) { + return + } + } + if x.AppState != nil { + value := protoreflect.ValueOfMessage(x.AppState.ProtoReflect()) + if !f(fd_MorseStateExport_app_state, 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_MorseStateExport) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + return x.AppHash != "" + case "poktroll.migration.MorseStateExport.app_state": + return x.AppState != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport 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_MorseStateExport) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + x.AppHash = "" + case "poktroll.migration.MorseStateExport.app_state": + x.AppState = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport 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_MorseStateExport) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + value := x.AppHash + return protoreflect.ValueOfString(value) + case "poktroll.migration.MorseStateExport.app_state": + value := x.AppState + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport 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_MorseStateExport) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + x.AppHash = value.Interface().(string) + case "poktroll.migration.MorseStateExport.app_state": + x.AppState = value.Message().Interface().(*MorseAppState) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport 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_MorseStateExport) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_state": + if x.AppState == nil { + x.AppState = new(MorseAppState) + } + return protoreflect.ValueOfMessage(x.AppState.ProtoReflect()) + case "poktroll.migration.MorseStateExport.app_hash": + panic(fmt.Errorf("field app_hash of message poktroll.migration.MorseStateExport is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport 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_MorseStateExport) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + return protoreflect.ValueOfString("") + case "poktroll.migration.MorseStateExport.app_state": + m := new(MorseAppState) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport 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_MorseStateExport) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseStateExport", 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_MorseStateExport) 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_MorseStateExport) 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_MorseStateExport) 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_MorseStateExport) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseStateExport) + 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.AppHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AppState != nil { + l = options.Size(x.AppState) + 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().(*MorseStateExport) + 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.AppState != nil { + encoded, err := options.Marshal(x.AppState) + 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.AppHash) > 0 { + i -= len(x.AppHash) + copy(dAtA[i:], x.AppHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AppHash))) + 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().(*MorseStateExport) + 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: MorseStateExport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseStateExport: 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 AppHash", 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.AppHash = 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 AppState", 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.AppState == nil { + x.AppState = &MorseAppState{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AppState); 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_MorseAppState protoreflect.MessageDescriptor + fd_MorseAppState_application protoreflect.FieldDescriptor + fd_MorseAppState_auth protoreflect.FieldDescriptor + fd_MorseAppState_pos protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_legacy_proto_init() + md_MorseAppState = File_poktroll_migration_legacy_proto.Messages().ByName("MorseAppState") + fd_MorseAppState_application = md_MorseAppState.Fields().ByName("application") + fd_MorseAppState_auth = md_MorseAppState.Fields().ByName("auth") + fd_MorseAppState_pos = md_MorseAppState.Fields().ByName("pos") +} + +var _ protoreflect.Message = (*fastReflection_MorseAppState)(nil) + +type fastReflection_MorseAppState MorseAppState + +func (x *MorseAppState) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseAppState)(x) +} + +func (x *MorseAppState) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_legacy_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MorseAppState_messageType fastReflection_MorseAppState_messageType +var _ protoreflect.MessageType = fastReflection_MorseAppState_messageType{} + +type fastReflection_MorseAppState_messageType struct{} + +func (x fastReflection_MorseAppState_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseAppState)(nil) +} +func (x fastReflection_MorseAppState_messageType) New() protoreflect.Message { + return new(fastReflection_MorseAppState) +} +func (x fastReflection_MorseAppState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAppState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseAppState) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAppState +} + +// 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_MorseAppState) Type() protoreflect.MessageType { + return _fastReflection_MorseAppState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseAppState) New() protoreflect.Message { + return new(fastReflection_MorseAppState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseAppState) Interface() protoreflect.ProtoMessage { + return (*MorseAppState)(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_MorseAppState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Application != nil { + value := protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + if !f(fd_MorseAppState_application, value) { + return + } + } + if x.Auth != nil { + value := protoreflect.ValueOfMessage(x.Auth.ProtoReflect()) + if !f(fd_MorseAppState_auth, value) { + return + } + } + if x.Pos != nil { + value := protoreflect.ValueOfMessage(x.Pos.ProtoReflect()) + if !f(fd_MorseAppState_pos, 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_MorseAppState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseAppState.application": + return x.Application != nil + case "poktroll.migration.MorseAppState.auth": + return x.Auth != nil + case "poktroll.migration.MorseAppState.pos": + return x.Pos != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAppState 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_MorseAppState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseAppState.application": + x.Application = nil + case "poktroll.migration.MorseAppState.auth": + x.Auth = nil + case "poktroll.migration.MorseAppState.pos": + x.Pos = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAppState 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_MorseAppState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseAppState.application": + value := x.Application + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MorseAppState.auth": + value := x.Auth + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MorseAppState.pos": + value := x.Pos + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAppState 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_MorseAppState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseAppState.application": + x.Application = value.Message().Interface().(*MorseApplications) + case "poktroll.migration.MorseAppState.auth": + x.Auth = value.Message().Interface().(*MorseAuth) + case "poktroll.migration.MorseAppState.pos": + x.Pos = value.Message().Interface().(*MorsePos) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAppState 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_MorseAppState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAppState.application": + if x.Application == nil { + x.Application = new(MorseApplications) + } + return protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + case "poktroll.migration.MorseAppState.auth": + if x.Auth == nil { + x.Auth = new(MorseAuth) + } + return protoreflect.ValueOfMessage(x.Auth.ProtoReflect()) + case "poktroll.migration.MorseAppState.pos": + if x.Pos == nil { + x.Pos = new(MorsePos) + } + return protoreflect.ValueOfMessage(x.Pos.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAppState 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_MorseAppState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAppState.application": + m := new(MorseApplications) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MorseAppState.auth": + m := new(MorseAuth) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MorseAppState.pos": + m := new(MorsePos) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAppState 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_MorseAppState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAppState", 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_MorseAppState) 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_MorseAppState) 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_MorseAppState) 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_MorseAppState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseAppState) + 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.Application != nil { + l = options.Size(x.Application) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Auth != nil { + l = options.Size(x.Auth) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Pos != nil { + l = options.Size(x.Pos) + 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().(*MorseAppState) + 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.Pos != nil { + encoded, err := options.Marshal(x.Pos) + 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.Auth != nil { + encoded, err := options.Marshal(x.Auth) + 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.Application != nil { + encoded, err := options.Marshal(x.Application) + 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().(*MorseAppState) + 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: MorseAppState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAppState: 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 Application", 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.Application == nil { + x.Application = &MorseApplications{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Application); 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 Auth", 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.Auth == nil { + x.Auth = &MorseAuth{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Auth); 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 Pos", 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.Pos == nil { + x.Pos = &MorsePos{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pos); 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 = (*_MorseApplications_1_list)(nil) + +type _MorseApplications_1_list struct { + list *[]*MorseApplication +} + +func (x *_MorseApplications_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorseApplications_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorseApplications_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseApplication) + (*x.list)[i] = concreteValue +} + +func (x *_MorseApplications_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseApplication) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorseApplications_1_list) AppendMutable() protoreflect.Value { + v := new(MorseApplication) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseApplications_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorseApplications_1_list) NewElement() protoreflect.Value { + v := new(MorseApplication) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseApplications_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MorseApplications protoreflect.MessageDescriptor + fd_MorseApplications_applications protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_legacy_proto_init() + md_MorseApplications = File_poktroll_migration_legacy_proto.Messages().ByName("MorseApplications") + fd_MorseApplications_applications = md_MorseApplications.Fields().ByName("applications") +} + +var _ protoreflect.Message = (*fastReflection_MorseApplications)(nil) + +type fastReflection_MorseApplications MorseApplications + +func (x *MorseApplications) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseApplications)(x) +} + +func (x *MorseApplications) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_legacy_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_MorseApplications_messageType fastReflection_MorseApplications_messageType +var _ protoreflect.MessageType = fastReflection_MorseApplications_messageType{} + +type fastReflection_MorseApplications_messageType struct{} + +func (x fastReflection_MorseApplications_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseApplications)(nil) +} +func (x fastReflection_MorseApplications_messageType) New() protoreflect.Message { + return new(fastReflection_MorseApplications) +} +func (x fastReflection_MorseApplications_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplications +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseApplications) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplications +} + +// 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_MorseApplications) Type() protoreflect.MessageType { + return _fastReflection_MorseApplications_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseApplications) New() protoreflect.Message { + return new(fastReflection_MorseApplications) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseApplications) Interface() protoreflect.ProtoMessage { + return (*MorseApplications)(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_MorseApplications) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Applications) != 0 { + value := protoreflect.ValueOfList(&_MorseApplications_1_list{list: &x.Applications}) + if !f(fd_MorseApplications_applications, 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_MorseApplications) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + return len(x.Applications) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications 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_MorseApplications) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + x.Applications = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications 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_MorseApplications) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseApplications.applications": + if len(x.Applications) == 0 { + return protoreflect.ValueOfList(&_MorseApplications_1_list{}) + } + listValue := &_MorseApplications_1_list{list: &x.Applications} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications 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_MorseApplications) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + lv := value.List() + clv := lv.(*_MorseApplications_1_list) + x.Applications = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications 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_MorseApplications) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + if x.Applications == nil { + x.Applications = []*MorseApplication{} + } + value := &_MorseApplications_1_list{list: &x.Applications} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications 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_MorseApplications) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + list := []*MorseApplication{} + return protoreflect.ValueOfList(&_MorseApplications_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications 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_MorseApplications) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseApplications", 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_MorseApplications) 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_MorseApplications) 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_MorseApplications) 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_MorseApplications) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseApplications) + 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.Applications) > 0 { + for _, e := range x.Applications { + l = options.Size(e) + 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().(*MorseApplications) + 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.Applications) > 0 { + for iNdEx := len(x.Applications) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Applications[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().(*MorseApplications) + 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: MorseApplications: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseApplications: 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 Applications", 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.Applications = append(x.Applications, &MorseApplication{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Applications[len(x.Applications)-1]); 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_MorseAuthAccount protoreflect.MessageDescriptor + fd_MorseAuthAccount_Type protoreflect.FieldDescriptor + fd_MorseAuthAccount_Value protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_legacy_proto_init() + md_MorseAuthAccount = File_poktroll_migration_legacy_proto.Messages().ByName("MorseAuthAccount") + fd_MorseAuthAccount_Type = md_MorseAuthAccount.Fields().ByName("Type") + fd_MorseAuthAccount_Value = md_MorseAuthAccount.Fields().ByName("Value") +} + +var _ protoreflect.Message = (*fastReflection_MorseAuthAccount)(nil) + +type fastReflection_MorseAuthAccount MorseAuthAccount + +func (x *MorseAuthAccount) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseAuthAccount)(x) +} + +func (x *MorseAuthAccount) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_legacy_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_MorseAuthAccount_messageType fastReflection_MorseAuthAccount_messageType +var _ protoreflect.MessageType = fastReflection_MorseAuthAccount_messageType{} + +type fastReflection_MorseAuthAccount_messageType struct{} + +func (x fastReflection_MorseAuthAccount_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseAuthAccount)(nil) +} +func (x fastReflection_MorseAuthAccount_messageType) New() protoreflect.Message { + return new(fastReflection_MorseAuthAccount) +} +func (x fastReflection_MorseAuthAccount_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuthAccount +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseAuthAccount) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuthAccount +} + +// 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_MorseAuthAccount) Type() protoreflect.MessageType { + return _fastReflection_MorseAuthAccount_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseAuthAccount) New() protoreflect.Message { + return new(fastReflection_MorseAuthAccount) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseAuthAccount) Interface() protoreflect.ProtoMessage { + return (*MorseAuthAccount)(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_MorseAuthAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Type_ != "" { + value := protoreflect.ValueOfString(x.Type_) + if !f(fd_MorseAuthAccount_Type, value) { + return + } + } + if x.Value != nil { + value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + if !f(fd_MorseAuthAccount_Value, 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_MorseAuthAccount) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.Type": + return x.Type_ != "" + case "poktroll.migration.MorseAuthAccount.Value": + return x.Value != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount 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_MorseAuthAccount) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.Type": + x.Type_ = "" + case "poktroll.migration.MorseAuthAccount.Value": + x.Value = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount 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_MorseAuthAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseAuthAccount.Type": + value := x.Type_ + return protoreflect.ValueOfString(value) + case "poktroll.migration.MorseAuthAccount.Value": + value := x.Value + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount 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_MorseAuthAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.Type": + x.Type_ = value.Interface().(string) + case "poktroll.migration.MorseAuthAccount.Value": + x.Value = value.Message().Interface().(*MorseAccount) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount 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_MorseAuthAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.Value": + if x.Value == nil { + x.Value = new(MorseAccount) + } + return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + case "poktroll.migration.MorseAuthAccount.Type": + panic(fmt.Errorf("field Type of message poktroll.migration.MorseAuthAccount is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount 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_MorseAuthAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.Type": + return protoreflect.ValueOfString("") + case "poktroll.migration.MorseAuthAccount.Value": + m := new(MorseAccount) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount 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_MorseAuthAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAuthAccount", 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_MorseAuthAccount) 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_MorseAuthAccount) 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_MorseAuthAccount) 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_MorseAuthAccount) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseAuthAccount) + 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.Type_) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Value != nil { + l = options.Size(x.Value) + 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().(*MorseAuthAccount) + 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.Value != nil { + encoded, err := options.Marshal(x.Value) + 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.Type_) > 0 { + i -= len(x.Type_) + copy(dAtA[i:], x.Type_) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Type_))) + 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().(*MorseAuthAccount) + 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: MorseAuthAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuthAccount: 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 Type_", 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.Type_ = 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 Value", 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.Value == nil { + x.Value = &MorseAccount{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Value); 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 = (*_MorseAuth_1_list)(nil) + +type _MorseAuth_1_list struct { + list *[]*MorseAuthAccount +} + +func (x *_MorseAuth_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorseAuth_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorseAuth_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAuthAccount) + (*x.list)[i] = concreteValue +} + +func (x *_MorseAuth_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAuthAccount) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorseAuth_1_list) AppendMutable() protoreflect.Value { + v := new(MorseAuthAccount) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAuth_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorseAuth_1_list) NewElement() protoreflect.Value { + v := new(MorseAuthAccount) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAuth_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MorseAuth protoreflect.MessageDescriptor + fd_MorseAuth_accounts protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_legacy_proto_init() + md_MorseAuth = File_poktroll_migration_legacy_proto.Messages().ByName("MorseAuth") + fd_MorseAuth_accounts = md_MorseAuth.Fields().ByName("accounts") +} + +var _ protoreflect.Message = (*fastReflection_MorseAuth)(nil) + +type fastReflection_MorseAuth MorseAuth + +func (x *MorseAuth) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseAuth)(x) +} + +func (x *MorseAuth) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_legacy_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_MorseAuth_messageType fastReflection_MorseAuth_messageType +var _ protoreflect.MessageType = fastReflection_MorseAuth_messageType{} + +type fastReflection_MorseAuth_messageType struct{} + +func (x fastReflection_MorseAuth_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseAuth)(nil) +} +func (x fastReflection_MorseAuth_messageType) New() protoreflect.Message { + return new(fastReflection_MorseAuth) +} +func (x fastReflection_MorseAuth_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuth +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseAuth) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuth +} + +// 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_MorseAuth) Type() protoreflect.MessageType { + return _fastReflection_MorseAuth_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseAuth) New() protoreflect.Message { + return new(fastReflection_MorseAuth) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseAuth) Interface() protoreflect.ProtoMessage { + return (*MorseAuth)(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_MorseAuth) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Accounts) != 0 { + value := protoreflect.ValueOfList(&_MorseAuth_1_list{list: &x.Accounts}) + if !f(fd_MorseAuth_accounts, 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_MorseAuth) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + return len(x.Accounts) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth 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_MorseAuth) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + x.Accounts = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth 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_MorseAuth) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseAuth.accounts": + if len(x.Accounts) == 0 { + return protoreflect.ValueOfList(&_MorseAuth_1_list{}) + } + listValue := &_MorseAuth_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth 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_MorseAuth) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + lv := value.List() + clv := lv.(*_MorseAuth_1_list) + x.Accounts = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth 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_MorseAuth) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + if x.Accounts == nil { + x.Accounts = []*MorseAuthAccount{} + } + value := &_MorseAuth_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth 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_MorseAuth) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + list := []*MorseAuthAccount{} + return protoreflect.ValueOfList(&_MorseAuth_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth 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_MorseAuth) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAuth", 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_MorseAuth) 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_MorseAuth) 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_MorseAuth) 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_MorseAuth) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseAuth) + 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.Accounts) > 0 { + for _, e := range x.Accounts { + l = options.Size(e) + 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().(*MorseAuth) + 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.Accounts) > 0 { + for iNdEx := len(x.Accounts) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Accounts[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().(*MorseAuth) + 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: MorseAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuth: 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 Accounts", 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.Accounts = append(x.Accounts, &MorseAuthAccount{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accounts[len(x.Accounts)-1]); 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 = (*_MorsePos_1_list)(nil) + +type _MorsePos_1_list struct { + list *[]*MorseValidator +} + +func (x *_MorsePos_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorsePos_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorsePos_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseValidator) + (*x.list)[i] = concreteValue +} + +func (x *_MorsePos_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseValidator) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorsePos_1_list) AppendMutable() protoreflect.Value { + v := new(MorseValidator) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorsePos_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorsePos_1_list) NewElement() protoreflect.Value { + v := new(MorseValidator) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorsePos_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MorsePos protoreflect.MessageDescriptor + fd_MorsePos_validators protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_legacy_proto_init() + md_MorsePos = File_poktroll_migration_legacy_proto.Messages().ByName("MorsePos") + fd_MorsePos_validators = md_MorsePos.Fields().ByName("validators") +} + +var _ protoreflect.Message = (*fastReflection_MorsePos)(nil) + +type fastReflection_MorsePos MorsePos + +func (x *MorsePos) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorsePos)(x) +} + +func (x *MorsePos) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_legacy_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_MorsePos_messageType fastReflection_MorsePos_messageType +var _ protoreflect.MessageType = fastReflection_MorsePos_messageType{} + +type fastReflection_MorsePos_messageType struct{} + +func (x fastReflection_MorsePos_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorsePos)(nil) +} +func (x fastReflection_MorsePos_messageType) New() protoreflect.Message { + return new(fastReflection_MorsePos) +} +func (x fastReflection_MorsePos_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorsePos +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorsePos) Descriptor() protoreflect.MessageDescriptor { + return md_MorsePos +} + +// 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_MorsePos) Type() protoreflect.MessageType { + return _fastReflection_MorsePos_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorsePos) New() protoreflect.Message { + return new(fastReflection_MorsePos) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorsePos) Interface() protoreflect.ProtoMessage { + return (*MorsePos)(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_MorsePos) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Validators) != 0 { + value := protoreflect.ValueOfList(&_MorsePos_1_list{list: &x.Validators}) + if !f(fd_MorsePos_validators, 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_MorsePos) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + return len(x.Validators) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos 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_MorsePos) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + x.Validators = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos 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_MorsePos) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorsePos.validators": + if len(x.Validators) == 0 { + return protoreflect.ValueOfList(&_MorsePos_1_list{}) + } + listValue := &_MorsePos_1_list{list: &x.Validators} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos 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_MorsePos) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + lv := value.List() + clv := lv.(*_MorsePos_1_list) + x.Validators = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos 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_MorsePos) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + if x.Validators == nil { + x.Validators = []*MorseValidator{} + } + value := &_MorsePos_1_list{list: &x.Validators} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos 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_MorsePos) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + list := []*MorseValidator{} + return protoreflect.ValueOfList(&_MorsePos_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos 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_MorsePos) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorsePos", 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_MorsePos) 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_MorsePos) 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_MorsePos) 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_MorsePos) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorsePos) + 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.Validators) > 0 { + for _, e := range x.Validators { + l = options.Size(e) + 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().(*MorsePos) + 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.Validators) > 0 { + for iNdEx := len(x.Validators) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Validators[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().(*MorsePos) + 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: MorsePos: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorsePos: 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 Validators", 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.Validators = append(x.Validators, &MorseValidator{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validators[len(x.Validators)-1]); 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: poktroll/migration/legacy.proto + +// Types in this file are ONLY present to facilitate the verifiability of the +// migration state from Morse to Shannon. These types are used by the migration +// subcommand (e.g. `poktrolld migrate collect-morse-accounts ...) to transform +// the Morse state export into the Shannon state import. They ARE NOT persisted +// on-chain at any point. + +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 MorseStateExport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AppHash string `protobuf:"bytes,1,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + AppState *MorseAppState `protobuf:"bytes,2,opt,name=app_state,json=appState,proto3" json:"app_state,omitempty"` +} + +func (x *MorseStateExport) Reset() { + *x = MorseStateExport{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_legacy_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseStateExport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseStateExport) ProtoMessage() {} + +// Deprecated: Use MorseStateExport.ProtoReflect.Descriptor instead. +func (*MorseStateExport) Descriptor() ([]byte, []int) { + return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{0} +} + +func (x *MorseStateExport) GetAppHash() string { + if x != nil { + return x.AppHash + } + return "" +} + +func (x *MorseStateExport) GetAppState() *MorseAppState { + if x != nil { + return x.AppState + } + return nil +} + +type MorseAppState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Application *MorseApplications `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` + Auth *MorseAuth `protobuf:"bytes,2,opt,name=auth,proto3" json:"auth,omitempty"` + Pos *MorsePos `protobuf:"bytes,3,opt,name=pos,proto3" json:"pos,omitempty"` +} + +func (x *MorseAppState) Reset() { + *x = MorseAppState{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_legacy_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseAppState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseAppState) ProtoMessage() {} + +// Deprecated: Use MorseAppState.ProtoReflect.Descriptor instead. +func (*MorseAppState) Descriptor() ([]byte, []int) { + return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{1} +} + +func (x *MorseAppState) GetApplication() *MorseApplications { + if x != nil { + return x.Application + } + return nil +} + +func (x *MorseAppState) GetAuth() *MorseAuth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *MorseAppState) GetPos() *MorsePos { + if x != nil { + return x.Pos + } + return nil +} + +type MorseApplications struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Applications []*MorseApplication `protobuf:"bytes,1,rep,name=applications,proto3" json:"applications,omitempty"` +} + +func (x *MorseApplications) Reset() { + *x = MorseApplications{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_legacy_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseApplications) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseApplications) ProtoMessage() {} + +// Deprecated: Use MorseApplications.ProtoReflect.Descriptor instead. +func (*MorseApplications) Descriptor() ([]byte, []int) { + return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{2} +} + +func (x *MorseApplications) GetApplications() []*MorseApplication { + if x != nil { + return x.Applications + } + return nil +} + +type MorseAuthAccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type_ string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` + Value *MorseAccount `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` +} + +func (x *MorseAuthAccount) Reset() { + *x = MorseAuthAccount{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_legacy_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseAuthAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseAuthAccount) ProtoMessage() {} + +// Deprecated: Use MorseAuthAccount.ProtoReflect.Descriptor instead. +func (*MorseAuthAccount) Descriptor() ([]byte, []int) { + return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{3} +} + +func (x *MorseAuthAccount) GetType_() string { + if x != nil { + return x.Type_ + } + return "" +} + +func (x *MorseAuthAccount) GetValue() *MorseAccount { + if x != nil { + return x.Value + } + return nil +} + +type MorseAuth struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Accounts []*MorseAuthAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (x *MorseAuth) Reset() { + *x = MorseAuth{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_legacy_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseAuth) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseAuth) ProtoMessage() {} + +// Deprecated: Use MorseAuth.ProtoReflect.Descriptor instead. +func (*MorseAuth) Descriptor() ([]byte, []int) { + return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{4} +} + +func (x *MorseAuth) GetAccounts() []*MorseAuthAccount { + if x != nil { + return x.Accounts + } + return nil +} + +type MorsePos struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Validators []*MorseValidator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` +} + +func (x *MorsePos) Reset() { + *x = MorsePos{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_legacy_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorsePos) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorsePos) ProtoMessage() {} + +// Deprecated: Use MorsePos.ProtoReflect.Descriptor instead. +func (*MorsePos) Descriptor() ([]byte, []int) { + return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{5} +} + +func (x *MorsePos) GetValidators() []*MorseValidator { + if x != nil { + return x.Validators + } + return nil +} + +var File_poktroll_migration_legacy_proto protoreflect.FileDescriptor + +var file_poktroll_migration_legacy_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x12, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x10, + 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x12, 0x27, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x4d, 0x0a, 0x09, 0x61, 0x70, 0x70, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, + 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x08, + 0x61, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0xdf, 0x01, 0x0a, 0x0d, 0x4d, 0x6f, 0x72, + 0x73, 0x65, 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x58, 0x0a, 0x0b, 0x61, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, + 0x68, 0x42, 0x08, 0xea, 0xde, 0x1f, 0x04, 0x61, 0x75, 0x74, 0x68, 0x52, 0x04, 0x61, 0x75, 0x74, + 0x68, 0x12, 0x37, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x42, 0x07, 0xea, 0xde, + 0x1f, 0x03, 0x70, 0x6f, 0x73, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x22, 0x6f, 0x0a, 0x11, 0x4d, 0x6f, + 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x5a, 0x0a, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, + 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0xea, 0xde, 0x1f, + 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0c, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x73, 0x0a, 0x10, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x1c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xea, + 0xde, 0x1f, 0x04, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, + 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x09, + 0xea, 0xde, 0x1f, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x5b, 0x0a, 0x09, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x12, 0x4e, 0x0a, + 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x5e, 0x0a, + 0x08, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x12, 0x52, 0x0a, 0x0a, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x42, 0xb7, 0x01, + 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_migration_legacy_proto_rawDescOnce sync.Once + file_poktroll_migration_legacy_proto_rawDescData = file_poktroll_migration_legacy_proto_rawDesc +) + +func file_poktroll_migration_legacy_proto_rawDescGZIP() []byte { + file_poktroll_migration_legacy_proto_rawDescOnce.Do(func() { + file_poktroll_migration_legacy_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_legacy_proto_rawDescData) + }) + return file_poktroll_migration_legacy_proto_rawDescData +} + +var file_poktroll_migration_legacy_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_poktroll_migration_legacy_proto_goTypes = []interface{}{ + (*MorseStateExport)(nil), // 0: poktroll.migration.MorseStateExport + (*MorseAppState)(nil), // 1: poktroll.migration.MorseAppState + (*MorseApplications)(nil), // 2: poktroll.migration.MorseApplications + (*MorseAuthAccount)(nil), // 3: poktroll.migration.MorseAuthAccount + (*MorseAuth)(nil), // 4: poktroll.migration.MorseAuth + (*MorsePos)(nil), // 5: poktroll.migration.MorsePos + (*MorseApplication)(nil), // 6: poktroll.migration.MorseApplication + (*MorseAccount)(nil), // 7: poktroll.migration.MorseAccount + (*MorseValidator)(nil), // 8: poktroll.migration.MorseValidator +} +var file_poktroll_migration_legacy_proto_depIdxs = []int32{ + 1, // 0: poktroll.migration.MorseStateExport.app_state:type_name -> poktroll.migration.MorseAppState + 2, // 1: poktroll.migration.MorseAppState.application:type_name -> poktroll.migration.MorseApplications + 4, // 2: poktroll.migration.MorseAppState.auth:type_name -> poktroll.migration.MorseAuth + 5, // 3: poktroll.migration.MorseAppState.pos:type_name -> poktroll.migration.MorsePos + 6, // 4: poktroll.migration.MorseApplications.applications:type_name -> poktroll.migration.MorseApplication + 7, // 5: poktroll.migration.MorseAuthAccount.Value:type_name -> poktroll.migration.MorseAccount + 3, // 6: poktroll.migration.MorseAuth.accounts:type_name -> poktroll.migration.MorseAuthAccount + 8, // 7: poktroll.migration.MorsePos.validators:type_name -> poktroll.migration.MorseValidator + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_poktroll_migration_legacy_proto_init() } +func file_poktroll_migration_legacy_proto_init() { + if File_poktroll_migration_legacy_proto != nil { + return + } + file_poktroll_migration_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_legacy_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseStateExport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_legacy_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseAppState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_legacy_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseApplications); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_legacy_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseAuthAccount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_legacy_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseAuth); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_legacy_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorsePos); 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_poktroll_migration_legacy_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_migration_legacy_proto_goTypes, + DependencyIndexes: file_poktroll_migration_legacy_proto_depIdxs, + MessageInfos: file_poktroll_migration_legacy_proto_msgTypes, + }.Build() + File_poktroll_migration_legacy_proto = out.File + file_poktroll_migration_legacy_proto_rawDesc = nil + file_poktroll_migration_legacy_proto_goTypes = nil + file_poktroll_migration_legacy_proto_depIdxs = nil +} diff --git a/x/migration/types/legacy.pb.go b/x/migration/types/legacy.pb.go new file mode 100644 index 000000000..ab8f15b5c --- /dev/null +++ b/x/migration/types/legacy.pb.go @@ -0,0 +1,1450 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/migration/legacy.proto + +// Types in this file are ONLY present to facilitate the verifiability of the +// migration state from Morse to Shannon. These types are used by the migration +// subcommand (e.g. `poktrolld migrate collect-morse-accounts ...) to transform +// the Morse state export into the Shannon state import. They ARE NOT persisted +// on-chain at any point. + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MorseStateExport struct { + AppHash string `protobuf:"bytes,1,opt,name=app_hash,json=appHash,proto3" json:"app_hash"` + AppState *MorseAppState `protobuf:"bytes,2,opt,name=app_state,json=appState,proto3" json:"app_state"` +} + +func (m *MorseStateExport) Reset() { *m = MorseStateExport{} } +func (m *MorseStateExport) String() string { return proto.CompactTextString(m) } +func (*MorseStateExport) ProtoMessage() {} +func (*MorseStateExport) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba469df9d72c7fc, []int{0} +} +func (m *MorseStateExport) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseStateExport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseStateExport) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseStateExport.Merge(m, src) +} +func (m *MorseStateExport) XXX_Size() int { + return m.Size() +} +func (m *MorseStateExport) XXX_DiscardUnknown() { + xxx_messageInfo_MorseStateExport.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseStateExport proto.InternalMessageInfo + +func (m *MorseStateExport) GetAppHash() string { + if m != nil { + return m.AppHash + } + return "" +} + +func (m *MorseStateExport) GetAppState() *MorseAppState { + if m != nil { + return m.AppState + } + return nil +} + +type MorseAppState struct { + Application *MorseApplications `protobuf:"bytes,1,opt,name=application,proto3" json:"application"` + Auth *MorseAuth `protobuf:"bytes,2,opt,name=auth,proto3" json:"auth"` + Pos *MorsePos `protobuf:"bytes,3,opt,name=pos,proto3" json:"pos"` +} + +func (m *MorseAppState) Reset() { *m = MorseAppState{} } +func (m *MorseAppState) String() string { return proto.CompactTextString(m) } +func (*MorseAppState) ProtoMessage() {} +func (*MorseAppState) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba469df9d72c7fc, []int{1} +} +func (m *MorseAppState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseAppState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseAppState) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseAppState.Merge(m, src) +} +func (m *MorseAppState) XXX_Size() int { + return m.Size() +} +func (m *MorseAppState) XXX_DiscardUnknown() { + xxx_messageInfo_MorseAppState.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseAppState proto.InternalMessageInfo + +func (m *MorseAppState) GetApplication() *MorseApplications { + if m != nil { + return m.Application + } + return nil +} + +func (m *MorseAppState) GetAuth() *MorseAuth { + if m != nil { + return m.Auth + } + return nil +} + +func (m *MorseAppState) GetPos() *MorsePos { + if m != nil { + return m.Pos + } + return nil +} + +type MorseApplications struct { + Applications []*MorseApplication `protobuf:"bytes,1,rep,name=applications,proto3" json:"applications"` +} + +func (m *MorseApplications) Reset() { *m = MorseApplications{} } +func (m *MorseApplications) String() string { return proto.CompactTextString(m) } +func (*MorseApplications) ProtoMessage() {} +func (*MorseApplications) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba469df9d72c7fc, []int{2} +} +func (m *MorseApplications) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseApplications) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseApplications) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseApplications.Merge(m, src) +} +func (m *MorseApplications) XXX_Size() int { + return m.Size() +} +func (m *MorseApplications) XXX_DiscardUnknown() { + xxx_messageInfo_MorseApplications.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseApplications proto.InternalMessageInfo + +func (m *MorseApplications) GetApplications() []*MorseApplication { + if m != nil { + return m.Applications + } + return nil +} + +type MorseAuthAccount struct { + Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"type"` + Value *MorseAccount `protobuf:"bytes,2,opt,name=Value,proto3" json:"value"` +} + +func (m *MorseAuthAccount) Reset() { *m = MorseAuthAccount{} } +func (m *MorseAuthAccount) String() string { return proto.CompactTextString(m) } +func (*MorseAuthAccount) ProtoMessage() {} +func (*MorseAuthAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba469df9d72c7fc, []int{3} +} +func (m *MorseAuthAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseAuthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseAuthAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseAuthAccount.Merge(m, src) +} +func (m *MorseAuthAccount) XXX_Size() int { + return m.Size() +} +func (m *MorseAuthAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MorseAuthAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseAuthAccount proto.InternalMessageInfo + +func (m *MorseAuthAccount) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *MorseAuthAccount) GetValue() *MorseAccount { + if m != nil { + return m.Value + } + return nil +} + +type MorseAuth struct { + Accounts []*MorseAuthAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts"` +} + +func (m *MorseAuth) Reset() { *m = MorseAuth{} } +func (m *MorseAuth) String() string { return proto.CompactTextString(m) } +func (*MorseAuth) ProtoMessage() {} +func (*MorseAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba469df9d72c7fc, []int{4} +} +func (m *MorseAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseAuth.Merge(m, src) +} +func (m *MorseAuth) XXX_Size() int { + return m.Size() +} +func (m *MorseAuth) XXX_DiscardUnknown() { + xxx_messageInfo_MorseAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseAuth proto.InternalMessageInfo + +func (m *MorseAuth) GetAccounts() []*MorseAuthAccount { + if m != nil { + return m.Accounts + } + return nil +} + +type MorsePos struct { + Validators []*MorseValidator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` +} + +func (m *MorsePos) Reset() { *m = MorsePos{} } +func (m *MorsePos) String() string { return proto.CompactTextString(m) } +func (*MorsePos) ProtoMessage() {} +func (*MorsePos) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba469df9d72c7fc, []int{5} +} +func (m *MorsePos) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorsePos) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorsePos) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorsePos.Merge(m, src) +} +func (m *MorsePos) XXX_Size() int { + return m.Size() +} +func (m *MorsePos) XXX_DiscardUnknown() { + xxx_messageInfo_MorsePos.DiscardUnknown(m) +} + +var xxx_messageInfo_MorsePos proto.InternalMessageInfo + +func (m *MorsePos) GetValidators() []*MorseValidator { + if m != nil { + return m.Validators + } + return nil +} + +func init() { + proto.RegisterType((*MorseStateExport)(nil), "poktroll.migration.MorseStateExport") + proto.RegisterType((*MorseAppState)(nil), "poktroll.migration.MorseAppState") + proto.RegisterType((*MorseApplications)(nil), "poktroll.migration.MorseApplications") + proto.RegisterType((*MorseAuthAccount)(nil), "poktroll.migration.MorseAuthAccount") + proto.RegisterType((*MorseAuth)(nil), "poktroll.migration.MorseAuth") + proto.RegisterType((*MorsePos)(nil), "poktroll.migration.MorsePos") +} + +func init() { proto.RegisterFile("poktroll/migration/legacy.proto", fileDescriptor_3ba469df9d72c7fc) } + +var fileDescriptor_3ba469df9d72c7fc = []byte{ + // 483 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0xcd, 0x92, 0x96, 0x26, 0x93, 0x16, 0xca, 0x8a, 0x43, 0x54, 0x15, 0x3b, 0x58, 0x20, 0x72, + 0xc1, 0x96, 0xc2, 0x81, 0x03, 0xa7, 0xac, 0x84, 0xc4, 0xa5, 0xa8, 0x5a, 0x50, 0x85, 0x8a, 0x04, + 0xda, 0x1a, 0xcb, 0xb6, 0xea, 0x66, 0x57, 0xde, 0x75, 0x69, 0xfe, 0x02, 0x27, 0x7e, 0x16, 0xc7, + 0x1e, 0x7b, 0x32, 0x28, 0xb9, 0xf9, 0x57, 0xa0, 0x5d, 0x7f, 0xd4, 0xa1, 0xa4, 0xea, 0xc5, 0xda, + 0x9d, 0x79, 0xef, 0xcd, 0x1b, 0xcf, 0x0e, 0xd8, 0x82, 0x9f, 0xaa, 0x94, 0x27, 0x89, 0x77, 0x16, + 0x87, 0x29, 0x53, 0x31, 0x9f, 0x79, 0x49, 0x10, 0x32, 0x7f, 0xee, 0x8a, 0x94, 0x2b, 0x8e, 0x71, + 0x0d, 0x70, 0x1b, 0xc0, 0xde, 0xe3, 0x90, 0x87, 0xdc, 0xa4, 0x3d, 0x7d, 0x2a, 0x91, 0x7b, 0xd6, + 0x7f, 0xa4, 0xd4, 0x5c, 0x04, 0xb2, 0xcc, 0x3b, 0x3f, 0x10, 0xec, 0x1e, 0xf0, 0x54, 0x06, 0x1f, + 0x14, 0x53, 0xc1, 0xdb, 0x0b, 0xc1, 0x53, 0x85, 0x5f, 0x40, 0x8f, 0x09, 0xf1, 0x35, 0x62, 0x32, + 0x1a, 0xa2, 0x11, 0x1a, 0xf7, 0xc9, 0x76, 0x91, 0xdb, 0x4d, 0x8c, 0x6e, 0x31, 0x21, 0xde, 0x31, + 0x19, 0xe1, 0x03, 0xe8, 0xeb, 0xa0, 0xd4, 0xdc, 0xe1, 0xbd, 0x11, 0x1a, 0x0f, 0x26, 0x4f, 0xdd, + 0x9b, 0xde, 0x5c, 0x53, 0x61, 0x2a, 0x84, 0x29, 0x42, 0x76, 0x8a, 0xdc, 0xbe, 0xe6, 0x51, 0xad, + 0x6b, 0x12, 0xce, 0x6f, 0x04, 0x3b, 0x2b, 0x50, 0xfc, 0x09, 0x06, 0x4c, 0x88, 0x24, 0xf6, 0x8d, + 0x8e, 0x31, 0x33, 0x98, 0x3c, 0xbf, 0xad, 0x44, 0x8d, 0x95, 0xe4, 0x61, 0x91, 0xdb, 0x6d, 0x36, + 0x6d, 0x5f, 0xf0, 0x1b, 0xd8, 0x60, 0x99, 0x8a, 0x2a, 0xd7, 0x4f, 0xd6, 0x4b, 0x66, 0x2a, 0x22, + 0xbd, 0x22, 0xb7, 0x0d, 0x9c, 0x9a, 0x2f, 0x7e, 0x0d, 0x5d, 0xc1, 0xe5, 0xb0, 0x6b, 0xb8, 0xfb, + 0x6b, 0xb9, 0x87, 0x5c, 0x92, 0xad, 0x22, 0xb7, 0x35, 0x98, 0xea, 0x8f, 0xc3, 0xe1, 0xd1, 0x0d, + 0xa3, 0xf8, 0x18, 0xb6, 0x5b, 0xce, 0xe4, 0x10, 0x8d, 0xba, 0xe3, 0xc1, 0xe4, 0xd9, 0x5d, 0xba, + 0x24, 0xbb, 0x45, 0x6e, 0xaf, 0xb0, 0xe9, 0xca, 0xcd, 0x91, 0xd5, 0x78, 0x75, 0x1b, 0x53, 0xdf, + 0xe7, 0xd9, 0x4c, 0xe1, 0x7d, 0xd8, 0xf8, 0x38, 0x17, 0x41, 0x35, 0x5a, 0xd3, 0x9b, 0x7e, 0x12, + 0xd4, 0x44, 0xf1, 0x14, 0x36, 0x8f, 0x58, 0x92, 0xd5, 0xf3, 0x1c, 0xad, 0xb7, 0x51, 0xca, 0x91, + 0x7e, 0x91, 0xdb, 0x9b, 0xe7, 0x9a, 0x42, 0x4b, 0xa6, 0xf3, 0x19, 0xfa, 0x4d, 0x51, 0xfc, 0x1e, + 0x7a, 0xac, 0x44, 0xde, 0xa1, 0xb3, 0x6b, 0x97, 0xd5, 0x93, 0xab, 0x98, 0xb4, 0x39, 0x39, 0x5f, + 0xa0, 0x57, 0xff, 0x5c, 0x4c, 0x01, 0xce, 0x59, 0x12, 0x7f, 0x63, 0x8a, 0xa7, 0xb5, 0xba, 0xb3, + 0x56, 0xfd, 0xa8, 0x86, 0x92, 0x07, 0x45, 0x6e, 0xb7, 0x98, 0xb4, 0x75, 0x26, 0x87, 0xbf, 0x16, + 0x16, 0xba, 0x5c, 0x58, 0xe8, 0x6a, 0x61, 0xa1, 0x3f, 0x0b, 0x0b, 0xfd, 0x5c, 0x5a, 0x9d, 0xcb, + 0xa5, 0xd5, 0xb9, 0x5a, 0x5a, 0x9d, 0xe3, 0x49, 0x18, 0xab, 0x28, 0x3b, 0x71, 0x7d, 0x7e, 0xe6, + 0xe9, 0x3a, 0x2f, 0x67, 0x81, 0xfa, 0xce, 0xd3, 0x53, 0xaf, 0xd9, 0xb3, 0x8b, 0x7f, 0x37, 0xed, + 0xe4, 0xbe, 0x59, 0xb5, 0x57, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xf5, 0x9c, 0x74, 0xd7, + 0x03, 0x00, 0x00, +} + +func (m *MorseStateExport) 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 *MorseStateExport) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseStateExport) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppState != nil { + { + size, err := m.AppState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintLegacy(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MorseAppState) 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 *MorseAppState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseAppState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pos != nil { + { + size, err := m.Pos.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Application != nil { + { + size, err := m.Application.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MorseApplications) 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 *MorseApplications) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseApplications) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Applications) > 0 { + for iNdEx := len(m.Applications) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Applications[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MorseAuthAccount) 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 *MorseAuthAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseAuthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintLegacy(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MorseAuth) 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 *MorseAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MorsePos) 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 *MorsePos) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorsePos) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintLegacy(dAtA []byte, offset int, v uint64) int { + offset -= sovLegacy(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MorseStateExport) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovLegacy(uint64(l)) + } + if m.AppState != nil { + l = m.AppState.Size() + n += 1 + l + sovLegacy(uint64(l)) + } + return n +} + +func (m *MorseAppState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Application != nil { + l = m.Application.Size() + n += 1 + l + sovLegacy(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovLegacy(uint64(l)) + } + if m.Pos != nil { + l = m.Pos.Size() + n += 1 + l + sovLegacy(uint64(l)) + } + return n +} + +func (m *MorseApplications) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Applications) > 0 { + for _, e := range m.Applications { + l = e.Size() + n += 1 + l + sovLegacy(uint64(l)) + } + } + return n +} + +func (m *MorseAuthAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sovLegacy(uint64(l)) + } + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovLegacy(uint64(l)) + } + return n +} + +func (m *MorseAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Accounts) > 0 { + for _, e := range m.Accounts { + l = e.Size() + n += 1 + l + sovLegacy(uint64(l)) + } + } + return n +} + +func (m *MorsePos) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovLegacy(uint64(l)) + } + } + return n +} + +func sovLegacy(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLegacy(x uint64) (n int) { + return sovLegacy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MorseStateExport) 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 ErrIntOverflowLegacy + } + 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: MorseStateExport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseStateExport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + 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 ErrInvalidLengthLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AppState == nil { + m.AppState = &MorseAppState{} + } + if err := m.AppState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseAppState) 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 ErrIntOverflowLegacy + } + 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: MorseAppState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseAppState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Application == nil { + m.Application = &MorseApplications{} + } + if err := m.Application.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &MorseAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pos == nil { + m.Pos = &MorsePos{} + } + if err := m.Pos.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseApplications) 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 ErrIntOverflowLegacy + } + 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: MorseApplications: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseApplications: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Applications", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Applications = append(m.Applications, &MorseApplication{}) + if err := m.Applications[len(m.Applications)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseAuthAccount) 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 ErrIntOverflowLegacy + } + 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: MorseAuthAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseAuthAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + 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 ErrInvalidLengthLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &MorseAccount{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseAuth) 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 ErrIntOverflowLegacy + } + 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: MorseAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accounts = append(m.Accounts, &MorseAuthAccount{}) + if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorsePos) 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 ErrIntOverflowLegacy + } + 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: MorsePos: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorsePos: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validators = append(m.Validators, &MorseValidator{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipLegacy(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, ErrIntOverflowLegacy + } + 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, ErrIntOverflowLegacy + } + 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, ErrIntOverflowLegacy + } + 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, ErrInvalidLengthLegacy + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLegacy + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthLegacy + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthLegacy = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLegacy = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLegacy = fmt.Errorf("proto: unexpected end of group") +) From 08a1dd27418056f6e3cc462c0464fcd33115c260 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 30 Jan 2025 14:29:08 +0100 Subject: [PATCH 09/19] refactor: migration keeper in cosmos app --- app/app.go | 4 +--- app/keepers/types.go | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index 6e9cff698..93b608d19 100644 --- a/app/app.go +++ b/app/app.go @@ -1,7 +1,6 @@ package app import ( - migrationmodulekeeper "github.com/pokt-network/poktroll/x/migration/keeper" // this line is used by starport scaffolding # stargate/app/moduleImport "io" "os" @@ -70,7 +69,6 @@ type App struct { // simulation manager sm *module.SimulationManager - MigrationKeeper migrationmodulekeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration // Ignite CLI adds keepers here when scaffolding new modules. Please move the created keeper to the `keepers` package. } @@ -216,7 +214,7 @@ func New( &app.Keepers.ProofKeeper, &app.Keepers.TokenomicsKeeper, &app.Keepers.SharedKeeper, - &app.MigrationKeeper, + &app.Keepers.MigrationKeeper, // this line is used by starport scaffolding # stargate/app/keeperDefinition // Ignite CLI adds keepers here when scaffolding new modules. Please move the created keeper to the `keepers` package. ); err != nil { diff --git a/app/keepers/types.go b/app/keepers/types.go index 2125523c5..f169bc7ff 100644 --- a/app/keepers/types.go +++ b/app/keepers/types.go @@ -32,6 +32,7 @@ import ( applicationmodulekeeper "github.com/pokt-network/poktroll/x/application/keeper" gatewaymodulekeeper "github.com/pokt-network/poktroll/x/gateway/keeper" + migrationmodulekeeper "github.com/pokt-network/poktroll/x/migration/keeper" proofmodulekeeper "github.com/pokt-network/poktroll/x/proof/keeper" servicemodulekeeper "github.com/pokt-network/poktroll/x/service/keeper" sessionmodulekeeper "github.com/pokt-network/poktroll/x/session/keeper" @@ -82,4 +83,5 @@ type Keepers struct { ProofKeeper proofmodulekeeper.Keeper TokenomicsKeeper tokenomicsmodulekeeper.Keeper SharedKeeper sharedmodulekeeper.Keeper + MigrationKeeper migrationmodulekeeper.Keeper } From a63ea9bda09ef1259d70292c13b8968e81155aad Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 30 Jan 2025 14:31:06 +0100 Subject: [PATCH 10/19] chore: review feedback improvements --- proto/poktroll/migration/params.proto | 2 -- 1 file changed, 2 deletions(-) diff --git a/proto/poktroll/migration/params.proto b/proto/poktroll/migration/params.proto index b20062256..9b7b71a61 100644 --- a/proto/poktroll/migration/params.proto +++ b/proto/poktroll/migration/params.proto @@ -11,6 +11,4 @@ option (gogoproto.stable_marshaler_all) = true; message Params { option (amino.name) = "poktroll/x/migration/Params"; option (gogoproto.equal) = true; - - } \ No newline at end of file From 46c87be9eb36bc2e8911a74370849ac915c3412e Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 30 Jan 2025 14:32:21 +0100 Subject: [PATCH 11/19] refactor: morse types --- api/poktroll/migration/legacy.pulsar.go | 1552 ++++++++++++++++++++++- api/poktroll/migration/types.pulsar.go | 1550 +--------------------- proto/poktroll/migration/legacy.proto | 39 + proto/poktroll/migration/types.proto | 39 - x/migration/types/legacy.pb.go | 785 +++++++++++- x/migration/types/types.pb.go | 775 +---------- 6 files changed, 2371 insertions(+), 2369 deletions(-) diff --git a/api/poktroll/migration/legacy.pulsar.go b/api/poktroll/migration/legacy.pulsar.go index 0d11253c0..8edfd8db6 100644 --- a/api/poktroll/migration/legacy.pulsar.go +++ b/api/poktroll/migration/legacy.pulsar.go @@ -3086,6 +3086,1314 @@ func (x *fastReflection_MorsePos) ProtoMethods() *protoiface.Methods { } } +var ( + md_MorseApplication protoreflect.MessageDescriptor + fd_MorseApplication_address protoreflect.FieldDescriptor + fd_MorseApplication_public_key protoreflect.FieldDescriptor + fd_MorseApplication_jailed protoreflect.FieldDescriptor + fd_MorseApplication_status protoreflect.FieldDescriptor + fd_MorseApplication_staked_tokens protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_legacy_proto_init() + md_MorseApplication = File_poktroll_migration_legacy_proto.Messages().ByName("MorseApplication") + fd_MorseApplication_address = md_MorseApplication.Fields().ByName("address") + fd_MorseApplication_public_key = md_MorseApplication.Fields().ByName("public_key") + fd_MorseApplication_jailed = md_MorseApplication.Fields().ByName("jailed") + fd_MorseApplication_status = md_MorseApplication.Fields().ByName("status") + fd_MorseApplication_staked_tokens = md_MorseApplication.Fields().ByName("staked_tokens") +} + +var _ protoreflect.Message = (*fastReflection_MorseApplication)(nil) + +type fastReflection_MorseApplication MorseApplication + +func (x *MorseApplication) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseApplication)(x) +} + +func (x *MorseApplication) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_legacy_proto_msgTypes[6] + 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_MorseApplication_messageType fastReflection_MorseApplication_messageType +var _ protoreflect.MessageType = fastReflection_MorseApplication_messageType{} + +type fastReflection_MorseApplication_messageType struct{} + +func (x fastReflection_MorseApplication_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseApplication)(nil) +} +func (x fastReflection_MorseApplication_messageType) New() protoreflect.Message { + return new(fastReflection_MorseApplication) +} +func (x fastReflection_MorseApplication_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplication +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseApplication) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplication +} + +// 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_MorseApplication) Type() protoreflect.MessageType { + return _fastReflection_MorseApplication_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseApplication) New() protoreflect.Message { + return new(fastReflection_MorseApplication) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseApplication) Interface() protoreflect.ProtoMessage { + return (*MorseApplication)(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_MorseApplication) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Address) != 0 { + value := protoreflect.ValueOfBytes(x.Address) + if !f(fd_MorseApplication_address, value) { + return + } + } + if len(x.PublicKey) != 0 { + value := protoreflect.ValueOfBytes(x.PublicKey) + if !f(fd_MorseApplication_public_key, value) { + return + } + } + if x.Jailed != false { + value := protoreflect.ValueOfBool(x.Jailed) + if !f(fd_MorseApplication_jailed, value) { + return + } + } + if x.Status != int32(0) { + value := protoreflect.ValueOfInt32(x.Status) + if !f(fd_MorseApplication_status, value) { + return + } + } + if x.StakedTokens != "" { + value := protoreflect.ValueOfString(x.StakedTokens) + if !f(fd_MorseApplication_staked_tokens, 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_MorseApplication) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + return len(x.Address) != 0 + case "poktroll.migration.MorseApplication.public_key": + return len(x.PublicKey) != 0 + case "poktroll.migration.MorseApplication.jailed": + return x.Jailed != false + case "poktroll.migration.MorseApplication.status": + return x.Status != int32(0) + case "poktroll.migration.MorseApplication.staked_tokens": + return x.StakedTokens != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + x.Address = nil + case "poktroll.migration.MorseApplication.public_key": + x.PublicKey = nil + case "poktroll.migration.MorseApplication.jailed": + x.Jailed = false + case "poktroll.migration.MorseApplication.status": + x.Status = int32(0) + case "poktroll.migration.MorseApplication.staked_tokens": + x.StakedTokens = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseApplication.address": + value := x.Address + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseApplication.public_key": + value := x.PublicKey + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseApplication.jailed": + value := x.Jailed + return protoreflect.ValueOfBool(value) + case "poktroll.migration.MorseApplication.status": + value := x.Status + return protoreflect.ValueOfInt32(value) + case "poktroll.migration.MorseApplication.staked_tokens": + value := x.StakedTokens + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + x.Address = value.Bytes() + case "poktroll.migration.MorseApplication.public_key": + x.PublicKey = value.Bytes() + case "poktroll.migration.MorseApplication.jailed": + x.Jailed = value.Bool() + case "poktroll.migration.MorseApplication.status": + x.Status = int32(value.Int()) + case "poktroll.migration.MorseApplication.staked_tokens": + x.StakedTokens = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + panic(fmt.Errorf("field address of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.public_key": + panic(fmt.Errorf("field public_key of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.jailed": + panic(fmt.Errorf("field jailed of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.status": + panic(fmt.Errorf("field status of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.staked_tokens": + panic(fmt.Errorf("field staked_tokens of message poktroll.migration.MorseApplication is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseApplication.public_key": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseApplication.jailed": + return protoreflect.ValueOfBool(false) + case "poktroll.migration.MorseApplication.status": + return protoreflect.ValueOfInt32(int32(0)) + case "poktroll.migration.MorseApplication.staked_tokens": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseApplication", 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_MorseApplication) 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_MorseApplication) 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_MorseApplication) 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_MorseApplication) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseApplication) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PublicKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Jailed { + n += 2 + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + l = len(x.StakedTokens) + 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().(*MorseApplication) + 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.StakedTokens) > 0 { + i -= len(x.StakedTokens) + copy(dAtA[i:], x.StakedTokens) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StakedTokens))) + i-- + dAtA[i] = 0x32 + } + if x.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x20 + } + if x.Jailed { + i-- + if x.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(x.PublicKey) > 0 { + i -= len(x.PublicKey) + copy(dAtA[i:], x.PublicKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseApplication) + 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: MorseApplication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseApplication: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var 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.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) + if x.Address == nil { + x.Address = []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 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if x.PublicKey == nil { + x.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", 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.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MorseValidator protoreflect.MessageDescriptor + fd_MorseValidator_Address protoreflect.FieldDescriptor + fd_MorseValidator_PublicKey protoreflect.FieldDescriptor + fd_MorseValidator_jailed protoreflect.FieldDescriptor + fd_MorseValidator_status protoreflect.FieldDescriptor + fd_MorseValidator_StakedTokens protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_legacy_proto_init() + md_MorseValidator = File_poktroll_migration_legacy_proto.Messages().ByName("MorseValidator") + fd_MorseValidator_Address = md_MorseValidator.Fields().ByName("Address") + fd_MorseValidator_PublicKey = md_MorseValidator.Fields().ByName("PublicKey") + fd_MorseValidator_jailed = md_MorseValidator.Fields().ByName("jailed") + fd_MorseValidator_status = md_MorseValidator.Fields().ByName("status") + fd_MorseValidator_StakedTokens = md_MorseValidator.Fields().ByName("StakedTokens") +} + +var _ protoreflect.Message = (*fastReflection_MorseValidator)(nil) + +type fastReflection_MorseValidator MorseValidator + +func (x *MorseValidator) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseValidator)(x) +} + +func (x *MorseValidator) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_legacy_proto_msgTypes[7] + 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_MorseValidator_messageType fastReflection_MorseValidator_messageType +var _ protoreflect.MessageType = fastReflection_MorseValidator_messageType{} + +type fastReflection_MorseValidator_messageType struct{} + +func (x fastReflection_MorseValidator_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseValidator)(nil) +} +func (x fastReflection_MorseValidator_messageType) New() protoreflect.Message { + return new(fastReflection_MorseValidator) +} +func (x fastReflection_MorseValidator_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseValidator +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseValidator) Descriptor() protoreflect.MessageDescriptor { + return md_MorseValidator +} + +// 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_MorseValidator) Type() protoreflect.MessageType { + return _fastReflection_MorseValidator_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseValidator) New() protoreflect.Message { + return new(fastReflection_MorseValidator) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseValidator) Interface() protoreflect.ProtoMessage { + return (*MorseValidator)(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_MorseValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Address) != 0 { + value := protoreflect.ValueOfBytes(x.Address) + if !f(fd_MorseValidator_Address, value) { + return + } + } + if len(x.PublicKey) != 0 { + value := protoreflect.ValueOfBytes(x.PublicKey) + if !f(fd_MorseValidator_PublicKey, value) { + return + } + } + if x.Jailed != false { + value := protoreflect.ValueOfBool(x.Jailed) + if !f(fd_MorseValidator_jailed, value) { + return + } + } + if x.Status != int32(0) { + value := protoreflect.ValueOfInt32(x.Status) + if !f(fd_MorseValidator_status, value) { + return + } + } + if x.StakedTokens != "" { + value := protoreflect.ValueOfString(x.StakedTokens) + if !f(fd_MorseValidator_StakedTokens, 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_MorseValidator) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + return len(x.Address) != 0 + case "poktroll.migration.MorseValidator.PublicKey": + return len(x.PublicKey) != 0 + case "poktroll.migration.MorseValidator.jailed": + return x.Jailed != false + case "poktroll.migration.MorseValidator.status": + return x.Status != int32(0) + case "poktroll.migration.MorseValidator.StakedTokens": + return x.StakedTokens != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + x.Address = nil + case "poktroll.migration.MorseValidator.PublicKey": + x.PublicKey = nil + case "poktroll.migration.MorseValidator.jailed": + x.Jailed = false + case "poktroll.migration.MorseValidator.status": + x.Status = int32(0) + case "poktroll.migration.MorseValidator.StakedTokens": + x.StakedTokens = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseValidator.Address": + value := x.Address + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseValidator.PublicKey": + value := x.PublicKey + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseValidator.jailed": + value := x.Jailed + return protoreflect.ValueOfBool(value) + case "poktroll.migration.MorseValidator.status": + value := x.Status + return protoreflect.ValueOfInt32(value) + case "poktroll.migration.MorseValidator.StakedTokens": + value := x.StakedTokens + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + x.Address = value.Bytes() + case "poktroll.migration.MorseValidator.PublicKey": + x.PublicKey = value.Bytes() + case "poktroll.migration.MorseValidator.jailed": + x.Jailed = value.Bool() + case "poktroll.migration.MorseValidator.status": + x.Status = int32(value.Int()) + case "poktroll.migration.MorseValidator.StakedTokens": + x.StakedTokens = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + panic(fmt.Errorf("field Address of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.PublicKey": + panic(fmt.Errorf("field PublicKey of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.jailed": + panic(fmt.Errorf("field jailed of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.status": + panic(fmt.Errorf("field status of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.StakedTokens": + panic(fmt.Errorf("field StakedTokens of message poktroll.migration.MorseValidator is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.Address": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseValidator.PublicKey": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseValidator.jailed": + return protoreflect.ValueOfBool(false) + case "poktroll.migration.MorseValidator.status": + return protoreflect.ValueOfInt32(int32(0)) + case "poktroll.migration.MorseValidator.StakedTokens": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseValidator", 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_MorseValidator) 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_MorseValidator) 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_MorseValidator) 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_MorseValidator) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseValidator) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PublicKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Jailed { + n += 2 + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + l = len(x.StakedTokens) + 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().(*MorseValidator) + 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.StakedTokens) > 0 { + i -= len(x.StakedTokens) + copy(dAtA[i:], x.StakedTokens) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StakedTokens))) + i-- + dAtA[i] = 0x3a + } + if x.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x20 + } + if x.Jailed { + i-- + if x.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(x.PublicKey) > 0 { + i -= len(x.PublicKey) + copy(dAtA[i:], x.PublicKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseValidator) + 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: MorseValidator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseValidator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var 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.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) + if x.Address == nil { + x.Address = []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 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if x.PublicKey == nil { + x.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", 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.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -3347,6 +4655,146 @@ func (x *MorsePos) GetValidators() []*MorseValidator { return nil } +// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates +// the minimum information required to import Morse applications. +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 +type MorseApplication struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` +} + +func (x *MorseApplication) Reset() { + *x = MorseApplication{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_legacy_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseApplication) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseApplication) ProtoMessage() {} + +// Deprecated: Use MorseApplication.ProtoReflect.Descriptor instead. +func (*MorseApplication) Descriptor() ([]byte, []int) { + return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{6} +} + +func (x *MorseApplication) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *MorseApplication) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *MorseApplication) GetJailed() bool { + if x != nil { + return x.Jailed + } + return false +} + +func (x *MorseApplication) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MorseApplication) GetStakedTokens() string { + if x != nil { + return x.StakedTokens + } + return "" +} + +// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the +// minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 +type MorseValidator struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` + PublicKey []byte `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + StakedTokens string `protobuf:"bytes,7,opt,name=StakedTokens,proto3" json:"StakedTokens,omitempty"` +} + +func (x *MorseValidator) Reset() { + *x = MorseValidator{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_legacy_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseValidator) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseValidator) ProtoMessage() {} + +// Deprecated: Use MorseValidator.ProtoReflect.Descriptor instead. +func (*MorseValidator) Descriptor() ([]byte, []int) { + return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{7} +} + +func (x *MorseValidator) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *MorseValidator) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *MorseValidator) GetJailed() bool { + if x != nil { + return x.Jailed + } + return false +} + +func (x *MorseValidator) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MorseValidator) GetStakedTokens() string { + if x != nil { + return x.StakedTokens + } + return "" +} + var File_poktroll_migration_legacy_proto protoreflect.FileDescriptor var file_poktroll_migration_legacy_proto_rawDesc = []byte{ @@ -3405,19 +4853,61 @@ var file_poktroll_migration_legacy_proto_rawDesc = []byte{ 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x73, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x42, 0xb7, 0x01, - 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, - 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0xd7, 0x02, + 0x0a, 0x10, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x66, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, + 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x23, + 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0xf2, 0xde, + 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0x22, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x33, + 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x1b, + 0xea, 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0xf2, 0xde, 0x1f, 0x0d, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x52, 0x06, 0x6a, 0x61, 0x69, + 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x42, 0x1b, 0xea, 0xde, 0x1f, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xf2, + 0xde, 0x1f, 0x0d, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x6b, + 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x08, 0x88, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc1, 0x02, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x66, 0x0a, 0x07, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, + 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x09, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, + 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, + 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x0c, 0x88, + 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0xb7, 0x01, 0xd8, 0xe2, + 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x4c, 0x65, 0x67, 0x61, + 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, + 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, + 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3432,7 +4922,7 @@ func file_poktroll_migration_legacy_proto_rawDescGZIP() []byte { return file_poktroll_migration_legacy_proto_rawDescData } -var file_poktroll_migration_legacy_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_poktroll_migration_legacy_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_poktroll_migration_legacy_proto_goTypes = []interface{}{ (*MorseStateExport)(nil), // 0: poktroll.migration.MorseStateExport (*MorseAppState)(nil), // 1: poktroll.migration.MorseAppState @@ -3441,8 +4931,8 @@ var file_poktroll_migration_legacy_proto_goTypes = []interface{}{ (*MorseAuth)(nil), // 4: poktroll.migration.MorseAuth (*MorsePos)(nil), // 5: poktroll.migration.MorsePos (*MorseApplication)(nil), // 6: poktroll.migration.MorseApplication - (*MorseAccount)(nil), // 7: poktroll.migration.MorseAccount - (*MorseValidator)(nil), // 8: poktroll.migration.MorseValidator + (*MorseValidator)(nil), // 7: poktroll.migration.MorseValidator + (*MorseAccount)(nil), // 8: poktroll.migration.MorseAccount } var file_poktroll_migration_legacy_proto_depIdxs = []int32{ 1, // 0: poktroll.migration.MorseStateExport.app_state:type_name -> poktroll.migration.MorseAppState @@ -3450,9 +4940,9 @@ var file_poktroll_migration_legacy_proto_depIdxs = []int32{ 4, // 2: poktroll.migration.MorseAppState.auth:type_name -> poktroll.migration.MorseAuth 5, // 3: poktroll.migration.MorseAppState.pos:type_name -> poktroll.migration.MorsePos 6, // 4: poktroll.migration.MorseApplications.applications:type_name -> poktroll.migration.MorseApplication - 7, // 5: poktroll.migration.MorseAuthAccount.Value:type_name -> poktroll.migration.MorseAccount + 8, // 5: poktroll.migration.MorseAuthAccount.Value:type_name -> poktroll.migration.MorseAccount 3, // 6: poktroll.migration.MorseAuth.accounts:type_name -> poktroll.migration.MorseAuthAccount - 8, // 7: poktroll.migration.MorsePos.validators:type_name -> poktroll.migration.MorseValidator + 7, // 7: poktroll.migration.MorsePos.validators:type_name -> poktroll.migration.MorseValidator 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name @@ -3539,6 +5029,30 @@ func file_poktroll_migration_legacy_proto_init() { return nil } } + file_poktroll_migration_legacy_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseApplication); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_legacy_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseValidator); 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{ @@ -3546,7 +5060,7 @@ func file_poktroll_migration_legacy_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_migration_legacy_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/api/poktroll/migration/types.pulsar.go b/api/poktroll/migration/types.pulsar.go index 48a6ca42a..1a1090c0a 100644 --- a/api/poktroll/migration/types.pulsar.go +++ b/api/poktroll/migration/types.pulsar.go @@ -1570,1314 +1570,6 @@ func (x *fastReflection_MorsePublicKey) ProtoMethods() *protoiface.Methods { } } -var ( - md_MorseApplication protoreflect.MessageDescriptor - fd_MorseApplication_address protoreflect.FieldDescriptor - fd_MorseApplication_public_key protoreflect.FieldDescriptor - fd_MorseApplication_jailed protoreflect.FieldDescriptor - fd_MorseApplication_status protoreflect.FieldDescriptor - fd_MorseApplication_staked_tokens protoreflect.FieldDescriptor -) - -func init() { - file_poktroll_migration_types_proto_init() - md_MorseApplication = File_poktroll_migration_types_proto.Messages().ByName("MorseApplication") - fd_MorseApplication_address = md_MorseApplication.Fields().ByName("address") - fd_MorseApplication_public_key = md_MorseApplication.Fields().ByName("public_key") - fd_MorseApplication_jailed = md_MorseApplication.Fields().ByName("jailed") - fd_MorseApplication_status = md_MorseApplication.Fields().ByName("status") - fd_MorseApplication_staked_tokens = md_MorseApplication.Fields().ByName("staked_tokens") -} - -var _ protoreflect.Message = (*fastReflection_MorseApplication)(nil) - -type fastReflection_MorseApplication MorseApplication - -func (x *MorseApplication) ProtoReflect() protoreflect.Message { - return (*fastReflection_MorseApplication)(x) -} - -func (x *MorseApplication) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_migration_types_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_MorseApplication_messageType fastReflection_MorseApplication_messageType -var _ protoreflect.MessageType = fastReflection_MorseApplication_messageType{} - -type fastReflection_MorseApplication_messageType struct{} - -func (x fastReflection_MorseApplication_messageType) Zero() protoreflect.Message { - return (*fastReflection_MorseApplication)(nil) -} -func (x fastReflection_MorseApplication_messageType) New() protoreflect.Message { - return new(fastReflection_MorseApplication) -} -func (x fastReflection_MorseApplication_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MorseApplication -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MorseApplication) Descriptor() protoreflect.MessageDescriptor { - return md_MorseApplication -} - -// 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_MorseApplication) Type() protoreflect.MessageType { - return _fastReflection_MorseApplication_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MorseApplication) New() protoreflect.Message { - return new(fastReflection_MorseApplication) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MorseApplication) Interface() protoreflect.ProtoMessage { - return (*MorseApplication)(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_MorseApplication) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Address) != 0 { - value := protoreflect.ValueOfBytes(x.Address) - if !f(fd_MorseApplication_address, value) { - return - } - } - if len(x.PublicKey) != 0 { - value := protoreflect.ValueOfBytes(x.PublicKey) - if !f(fd_MorseApplication_public_key, value) { - return - } - } - if x.Jailed != false { - value := protoreflect.ValueOfBool(x.Jailed) - if !f(fd_MorseApplication_jailed, value) { - return - } - } - if x.Status != int32(0) { - value := protoreflect.ValueOfInt32(x.Status) - if !f(fd_MorseApplication_status, value) { - return - } - } - if x.StakedTokens != "" { - value := protoreflect.ValueOfString(x.StakedTokens) - if !f(fd_MorseApplication_staked_tokens, 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_MorseApplication) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "poktroll.migration.MorseApplication.address": - return len(x.Address) != 0 - case "poktroll.migration.MorseApplication.public_key": - return len(x.PublicKey) != 0 - case "poktroll.migration.MorseApplication.jailed": - return x.Jailed != false - case "poktroll.migration.MorseApplication.status": - return x.Status != int32(0) - case "poktroll.migration.MorseApplication.staked_tokens": - return x.StakedTokens != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) - } - panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "poktroll.migration.MorseApplication.address": - x.Address = nil - case "poktroll.migration.MorseApplication.public_key": - x.PublicKey = nil - case "poktroll.migration.MorseApplication.jailed": - x.Jailed = false - case "poktroll.migration.MorseApplication.status": - x.Status = int32(0) - case "poktroll.migration.MorseApplication.staked_tokens": - x.StakedTokens = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) - } - panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "poktroll.migration.MorseApplication.address": - value := x.Address - return protoreflect.ValueOfBytes(value) - case "poktroll.migration.MorseApplication.public_key": - value := x.PublicKey - return protoreflect.ValueOfBytes(value) - case "poktroll.migration.MorseApplication.jailed": - value := x.Jailed - return protoreflect.ValueOfBool(value) - case "poktroll.migration.MorseApplication.status": - value := x.Status - return protoreflect.ValueOfInt32(value) - case "poktroll.migration.MorseApplication.staked_tokens": - value := x.StakedTokens - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) - } - panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "poktroll.migration.MorseApplication.address": - x.Address = value.Bytes() - case "poktroll.migration.MorseApplication.public_key": - x.PublicKey = value.Bytes() - case "poktroll.migration.MorseApplication.jailed": - x.Jailed = value.Bool() - case "poktroll.migration.MorseApplication.status": - x.Status = int32(value.Int()) - case "poktroll.migration.MorseApplication.staked_tokens": - x.StakedTokens = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) - } - panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.migration.MorseApplication.address": - panic(fmt.Errorf("field address of message poktroll.migration.MorseApplication is not mutable")) - case "poktroll.migration.MorseApplication.public_key": - panic(fmt.Errorf("field public_key of message poktroll.migration.MorseApplication is not mutable")) - case "poktroll.migration.MorseApplication.jailed": - panic(fmt.Errorf("field jailed of message poktroll.migration.MorseApplication is not mutable")) - case "poktroll.migration.MorseApplication.status": - panic(fmt.Errorf("field status of message poktroll.migration.MorseApplication is not mutable")) - case "poktroll.migration.MorseApplication.staked_tokens": - panic(fmt.Errorf("field staked_tokens of message poktroll.migration.MorseApplication is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) - } - panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.migration.MorseApplication.address": - return protoreflect.ValueOfBytes(nil) - case "poktroll.migration.MorseApplication.public_key": - return protoreflect.ValueOfBytes(nil) - case "poktroll.migration.MorseApplication.jailed": - return protoreflect.ValueOfBool(false) - case "poktroll.migration.MorseApplication.status": - return protoreflect.ValueOfInt32(int32(0)) - case "poktroll.migration.MorseApplication.staked_tokens": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) - } - panic(fmt.Errorf("message poktroll.migration.MorseApplication 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_MorseApplication) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseApplication", 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_MorseApplication) 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_MorseApplication) 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_MorseApplication) 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_MorseApplication) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MorseApplication) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Address) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.PublicKey) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Jailed { - n += 2 - } - if x.Status != 0 { - n += 1 + runtime.Sov(uint64(x.Status)) - } - l = len(x.StakedTokens) - 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().(*MorseApplication) - 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.StakedTokens) > 0 { - i -= len(x.StakedTokens) - copy(dAtA[i:], x.StakedTokens) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StakedTokens))) - i-- - dAtA[i] = 0x32 - } - if x.Status != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) - i-- - dAtA[i] = 0x20 - } - if x.Jailed { - i-- - if x.Jailed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(x.PublicKey) > 0 { - i -= len(x.PublicKey) - copy(dAtA[i:], x.PublicKey) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) - i-- - dAtA[i] = 0x12 - } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MorseApplication) - 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: MorseApplication: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseApplication: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var 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.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) - if x.Address == nil { - x.Address = []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 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if x.PublicKey == nil { - x.PublicKey = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Jailed = bool(v != 0) - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - x.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Status |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", 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.StakedTokens = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MorseValidator protoreflect.MessageDescriptor - fd_MorseValidator_Address protoreflect.FieldDescriptor - fd_MorseValidator_PublicKey protoreflect.FieldDescriptor - fd_MorseValidator_jailed protoreflect.FieldDescriptor - fd_MorseValidator_status protoreflect.FieldDescriptor - fd_MorseValidator_StakedTokens protoreflect.FieldDescriptor -) - -func init() { - file_poktroll_migration_types_proto_init() - md_MorseValidator = File_poktroll_migration_types_proto.Messages().ByName("MorseValidator") - fd_MorseValidator_Address = md_MorseValidator.Fields().ByName("Address") - fd_MorseValidator_PublicKey = md_MorseValidator.Fields().ByName("PublicKey") - fd_MorseValidator_jailed = md_MorseValidator.Fields().ByName("jailed") - fd_MorseValidator_status = md_MorseValidator.Fields().ByName("status") - fd_MorseValidator_StakedTokens = md_MorseValidator.Fields().ByName("StakedTokens") -} - -var _ protoreflect.Message = (*fastReflection_MorseValidator)(nil) - -type fastReflection_MorseValidator MorseValidator - -func (x *MorseValidator) ProtoReflect() protoreflect.Message { - return (*fastReflection_MorseValidator)(x) -} - -func (x *MorseValidator) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_migration_types_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_MorseValidator_messageType fastReflection_MorseValidator_messageType -var _ protoreflect.MessageType = fastReflection_MorseValidator_messageType{} - -type fastReflection_MorseValidator_messageType struct{} - -func (x fastReflection_MorseValidator_messageType) Zero() protoreflect.Message { - return (*fastReflection_MorseValidator)(nil) -} -func (x fastReflection_MorseValidator_messageType) New() protoreflect.Message { - return new(fastReflection_MorseValidator) -} -func (x fastReflection_MorseValidator_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MorseValidator -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MorseValidator) Descriptor() protoreflect.MessageDescriptor { - return md_MorseValidator -} - -// 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_MorseValidator) Type() protoreflect.MessageType { - return _fastReflection_MorseValidator_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MorseValidator) New() protoreflect.Message { - return new(fastReflection_MorseValidator) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MorseValidator) Interface() protoreflect.ProtoMessage { - return (*MorseValidator)(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_MorseValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Address) != 0 { - value := protoreflect.ValueOfBytes(x.Address) - if !f(fd_MorseValidator_Address, value) { - return - } - } - if len(x.PublicKey) != 0 { - value := protoreflect.ValueOfBytes(x.PublicKey) - if !f(fd_MorseValidator_PublicKey, value) { - return - } - } - if x.Jailed != false { - value := protoreflect.ValueOfBool(x.Jailed) - if !f(fd_MorseValidator_jailed, value) { - return - } - } - if x.Status != int32(0) { - value := protoreflect.ValueOfInt32(x.Status) - if !f(fd_MorseValidator_status, value) { - return - } - } - if x.StakedTokens != "" { - value := protoreflect.ValueOfString(x.StakedTokens) - if !f(fd_MorseValidator_StakedTokens, 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_MorseValidator) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": - return len(x.Address) != 0 - case "poktroll.migration.MorseValidator.PublicKey": - return len(x.PublicKey) != 0 - case "poktroll.migration.MorseValidator.jailed": - return x.Jailed != false - case "poktroll.migration.MorseValidator.status": - return x.Status != int32(0) - case "poktroll.migration.MorseValidator.StakedTokens": - return x.StakedTokens != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) - } - panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": - x.Address = nil - case "poktroll.migration.MorseValidator.PublicKey": - x.PublicKey = nil - case "poktroll.migration.MorseValidator.jailed": - x.Jailed = false - case "poktroll.migration.MorseValidator.status": - x.Status = int32(0) - case "poktroll.migration.MorseValidator.StakedTokens": - x.StakedTokens = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) - } - panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "poktroll.migration.MorseValidator.Address": - value := x.Address - return protoreflect.ValueOfBytes(value) - case "poktroll.migration.MorseValidator.PublicKey": - value := x.PublicKey - return protoreflect.ValueOfBytes(value) - case "poktroll.migration.MorseValidator.jailed": - value := x.Jailed - return protoreflect.ValueOfBool(value) - case "poktroll.migration.MorseValidator.status": - value := x.Status - return protoreflect.ValueOfInt32(value) - case "poktroll.migration.MorseValidator.StakedTokens": - value := x.StakedTokens - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) - } - panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": - x.Address = value.Bytes() - case "poktroll.migration.MorseValidator.PublicKey": - x.PublicKey = value.Bytes() - case "poktroll.migration.MorseValidator.jailed": - x.Jailed = value.Bool() - case "poktroll.migration.MorseValidator.status": - x.Status = int32(value.Int()) - case "poktroll.migration.MorseValidator.StakedTokens": - x.StakedTokens = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) - } - panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": - panic(fmt.Errorf("field Address of message poktroll.migration.MorseValidator is not mutable")) - case "poktroll.migration.MorseValidator.PublicKey": - panic(fmt.Errorf("field PublicKey of message poktroll.migration.MorseValidator is not mutable")) - case "poktroll.migration.MorseValidator.jailed": - panic(fmt.Errorf("field jailed of message poktroll.migration.MorseValidator is not mutable")) - case "poktroll.migration.MorseValidator.status": - panic(fmt.Errorf("field status of message poktroll.migration.MorseValidator is not mutable")) - case "poktroll.migration.MorseValidator.StakedTokens": - panic(fmt.Errorf("field StakedTokens of message poktroll.migration.MorseValidator is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) - } - panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": - return protoreflect.ValueOfBytes(nil) - case "poktroll.migration.MorseValidator.PublicKey": - return protoreflect.ValueOfBytes(nil) - case "poktroll.migration.MorseValidator.jailed": - return protoreflect.ValueOfBool(false) - case "poktroll.migration.MorseValidator.status": - return protoreflect.ValueOfInt32(int32(0)) - case "poktroll.migration.MorseValidator.StakedTokens": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) - } - panic(fmt.Errorf("message poktroll.migration.MorseValidator 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_MorseValidator) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseValidator", 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_MorseValidator) 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_MorseValidator) 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_MorseValidator) 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_MorseValidator) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MorseValidator) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Address) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.PublicKey) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Jailed { - n += 2 - } - if x.Status != 0 { - n += 1 + runtime.Sov(uint64(x.Status)) - } - l = len(x.StakedTokens) - 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().(*MorseValidator) - 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.StakedTokens) > 0 { - i -= len(x.StakedTokens) - copy(dAtA[i:], x.StakedTokens) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StakedTokens))) - i-- - dAtA[i] = 0x3a - } - if x.Status != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) - i-- - dAtA[i] = 0x20 - } - if x.Jailed { - i-- - if x.Jailed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(x.PublicKey) > 0 { - i -= len(x.PublicKey) - copy(dAtA[i:], x.PublicKey) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) - i-- - dAtA[i] = 0x12 - } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MorseValidator) - 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: MorseValidator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseValidator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var 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.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) - if x.Address == nil { - x.Address = []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 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.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if x.PublicKey == nil { - x.PublicKey = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.Jailed = bool(v != 0) - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - x.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Status |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", 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.StakedTokens = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -3018,146 +1710,6 @@ func (x *MorsePublicKey) GetValue() []byte { return nil } -// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates -// the minimum information required to import Morse applications. -// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 -type MorseApplication struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` - Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` - StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` -} - -func (x *MorseApplication) Reset() { - *x = MorseApplication{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_migration_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MorseApplication) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MorseApplication) ProtoMessage() {} - -// Deprecated: Use MorseApplication.ProtoReflect.Descriptor instead. -func (*MorseApplication) Descriptor() ([]byte, []int) { - return file_poktroll_migration_types_proto_rawDescGZIP(), []int{3} -} - -func (x *MorseApplication) GetAddress() []byte { - if x != nil { - return x.Address - } - return nil -} - -func (x *MorseApplication) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *MorseApplication) GetJailed() bool { - if x != nil { - return x.Jailed - } - return false -} - -func (x *MorseApplication) GetStatus() int32 { - if x != nil { - return x.Status - } - return 0 -} - -func (x *MorseApplication) GetStakedTokens() string { - if x != nil { - return x.StakedTokens - } - return "" -} - -// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the -// minimum information required to import Morse suppliers (aka "servicers" or "validators"). -// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 -type MorseValidator struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` - PublicKey []byte `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` - Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` - StakedTokens string `protobuf:"bytes,7,opt,name=StakedTokens,proto3" json:"StakedTokens,omitempty"` -} - -func (x *MorseValidator) Reset() { - *x = MorseValidator{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_migration_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MorseValidator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MorseValidator) ProtoMessage() {} - -// Deprecated: Use MorseValidator.ProtoReflect.Descriptor instead. -func (*MorseValidator) Descriptor() ([]byte, []int) { - return file_poktroll_migration_types_proto_rawDescGZIP(), []int{4} -} - -func (x *MorseValidator) GetAddress() []byte { - if x != nil { - return x.Address - } - return nil -} - -func (x *MorseValidator) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *MorseValidator) GetJailed() bool { - if x != nil { - return x.Jailed - } - return false -} - -func (x *MorseValidator) GetStatus() int32 { - if x != nil { - return x.Status - } - return 0 -} - -func (x *MorseValidator) GetStakedTokens() string { - if x != nil { - return x.StakedTokens - } - return "" -} - var File_poktroll_migration_types_proto protoreflect.FileDescriptor var file_poktroll_migration_types_proto_rawDesc = []byte{ @@ -3197,61 +1749,19 @@ var file_poktroll_migration_types_proto_rawDesc = []byte{ 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x1c, 0xfa, 0xde, 0x1f, 0x18, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x65, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xd7, 0x02, 0x0a, 0x10, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x66, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, - 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x09, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x1b, 0xea, 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, - 0x65, 0x64, 0xf2, 0xde, 0x1f, 0x0d, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6a, 0x61, 0x69, 0x6c, - 0x65, 0x64, 0x22, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x1b, 0xea, 0xde, 0x1f, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xf2, 0xde, 0x1f, 0x0d, 0x79, 0x61, 0x6d, 0x6c, 0x3a, - 0x22, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, - 0xc1, 0x02, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x12, 0x66, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, - 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x23, 0xea, - 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0xf2, 0xde, 0x1f, - 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x22, 0x52, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, - 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x0a, 0xea, - 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, - 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xea, 0xde, 0x1f, - 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, 0xe8, - 0xa0, 0x1f, 0x01, 0x42, 0xb6, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xb6, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, + 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3266,19 +1776,17 @@ func file_poktroll_migration_types_proto_rawDescGZIP() []byte { return file_poktroll_migration_types_proto_rawDescData } -var file_poktroll_migration_types_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_poktroll_migration_types_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_poktroll_migration_types_proto_goTypes = []interface{}{ (*MorseAccountState)(nil), // 0: poktroll.migration.MorseAccountState (*MorseAccount)(nil), // 1: poktroll.migration.MorseAccount (*MorsePublicKey)(nil), // 2: poktroll.migration.MorsePublicKey - (*MorseApplication)(nil), // 3: poktroll.migration.MorseApplication - (*MorseValidator)(nil), // 4: poktroll.migration.MorseValidator - (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin + (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin } var file_poktroll_migration_types_proto_depIdxs = []int32{ 1, // 0: poktroll.migration.MorseAccountState.accounts:type_name -> poktroll.migration.MorseAccount 2, // 1: poktroll.migration.MorseAccount.pub_key:type_name -> poktroll.migration.MorsePublicKey - 5, // 2: poktroll.migration.MorseAccount.coins:type_name -> cosmos.base.v1beta1.Coin + 3, // 2: poktroll.migration.MorseAccount.coins:type_name -> cosmos.base.v1beta1.Coin 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for extension type_name @@ -3328,30 +1836,6 @@ func file_poktroll_migration_types_proto_init() { return nil } } - file_poktroll_migration_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MorseApplication); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_poktroll_migration_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MorseValidator); 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{ @@ -3359,7 +1843,7 @@ func file_poktroll_migration_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_migration_types_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/poktroll/migration/legacy.proto b/proto/poktroll/migration/legacy.proto index 17ec0b955..c2d4da2e3 100644 --- a/proto/poktroll/migration/legacy.proto +++ b/proto/poktroll/migration/legacy.proto @@ -40,3 +40,42 @@ message MorseAuth { message MorsePos { repeated MorseValidator validators = 1 [(gogoproto.jsontag) = "validators"]; } + +// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates +// the minimum information required to import Morse applications. +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 +message MorseApplication { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + bytes address = 1 [ + (gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", + (gogoproto.jsontag) = "address", + (gogoproto.moretags) = "yaml:\"address\"" + ]; + bytes public_key = 2 [ + (gogoproto.jsontag) = "public_key", + (gogoproto.moretags) = "yaml:\"public_key\""]; + bool jailed = 3[ + (gogoproto.jsontag) = "jailed", + (gogoproto.moretags) = "yaml:\"jailed\""]; + int32 status = 4 [ + (gogoproto.jsontag) = "status", + (gogoproto.moretags) = "yaml:\"status\""]; + string staked_tokens = 6; +} + +// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the +// minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 +message MorseValidator { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + option (gogoproto.goproto_getters) = false; + + bytes Address = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; + bytes PublicKey = 2 [(gogoproto.moretags) = "yaml:\"public_key\"", (gogoproto.jsontag) = "public_key"]; + bool jailed = 3 [(gogoproto.jsontag) = "jailed"]; + int32 status = 4 [(gogoproto.jsontag) = "status"]; + string StakedTokens = 7 [(gogoproto.jsontag) = "tokens"]; +} diff --git a/proto/poktroll/migration/types.proto b/proto/poktroll/migration/types.proto index 7b1d64fcb..c978151e5 100644 --- a/proto/poktroll/migration/types.proto +++ b/proto/poktroll/migration/types.proto @@ -33,42 +33,3 @@ message MorseAccount { message MorsePublicKey { bytes value = 2 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; } - -// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates -// the minimum information required to import Morse applications. -// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 -message MorseApplication { - option (gogoproto.equal) = true; - option (gogoproto.goproto_getters) = false; - - bytes address = 1 [ - (gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", - (gogoproto.jsontag) = "address", - (gogoproto.moretags) = "yaml:\"address\"" - ]; - bytes public_key = 2 [ - (gogoproto.jsontag) = "public_key", - (gogoproto.moretags) = "yaml:\"public_key\""]; - bool jailed = 3[ - (gogoproto.jsontag) = "jailed", - (gogoproto.moretags) = "yaml:\"jailed\""]; - int32 status = 4 [ - (gogoproto.jsontag) = "status", - (gogoproto.moretags) = "yaml:\"status\""]; - string staked_tokens = 6; -} - -// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the -// minimum information required to import Morse suppliers (aka "servicers" or "validators"). -// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 -message MorseValidator { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = true; - option (gogoproto.goproto_getters) = false; - - bytes Address = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; - bytes PublicKey = 2 [(gogoproto.moretags) = "yaml:\"public_key\"", (gogoproto.jsontag) = "public_key"]; - bool jailed = 3 [(gogoproto.jsontag) = "jailed"]; - int32 status = 4 [(gogoproto.jsontag) = "status"]; - string StakedTokens = 7 [(gogoproto.jsontag) = "tokens"]; -} diff --git a/x/migration/types/legacy.pb.go b/x/migration/types/legacy.pb.go index ab8f15b5c..7d7f2e547 100644 --- a/x/migration/types/legacy.pb.go +++ b/x/migration/types/legacy.pb.go @@ -10,7 +10,9 @@ package types import ( + bytes "bytes" fmt "fmt" + github_com_cometbft_cometbft_crypto "github.com/cometbft/cometbft/crypto" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -301,6 +303,86 @@ func (m *MorsePos) GetValidators() []*MorseValidator { return nil } +// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates +// the minimum information required to import Morse applications. +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 +type MorseApplication struct { + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status" yaml:"status"` + StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` +} + +func (m *MorseApplication) Reset() { *m = MorseApplication{} } +func (m *MorseApplication) String() string { return proto.CompactTextString(m) } +func (*MorseApplication) ProtoMessage() {} +func (*MorseApplication) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba469df9d72c7fc, []int{6} +} +func (m *MorseApplication) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseApplication) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseApplication.Merge(m, src) +} +func (m *MorseApplication) XXX_Size() int { + return m.Size() +} +func (m *MorseApplication) XXX_DiscardUnknown() { + xxx_messageInfo_MorseApplication.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseApplication proto.InternalMessageInfo + +// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the +// minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 +type MorseValidator struct { + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` + PublicKey []byte `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"public_key" yaml:"public_key"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status"` + StakedTokens string `protobuf:"bytes,7,opt,name=StakedTokens,proto3" json:"tokens"` +} + +func (m *MorseValidator) Reset() { *m = MorseValidator{} } +func (m *MorseValidator) String() string { return proto.CompactTextString(m) } +func (*MorseValidator) ProtoMessage() {} +func (*MorseValidator) Descriptor() ([]byte, []int) { + return fileDescriptor_3ba469df9d72c7fc, []int{7} +} +func (m *MorseValidator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseValidator) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseValidator.Merge(m, src) +} +func (m *MorseValidator) XXX_Size() int { + return m.Size() +} +func (m *MorseValidator) XXX_DiscardUnknown() { + xxx_messageInfo_MorseValidator.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseValidator proto.InternalMessageInfo + func init() { proto.RegisterType((*MorseStateExport)(nil), "poktroll.migration.MorseStateExport") proto.RegisterType((*MorseAppState)(nil), "poktroll.migration.MorseAppState") @@ -308,45 +390,134 @@ func init() { proto.RegisterType((*MorseAuthAccount)(nil), "poktroll.migration.MorseAuthAccount") proto.RegisterType((*MorseAuth)(nil), "poktroll.migration.MorseAuth") proto.RegisterType((*MorsePos)(nil), "poktroll.migration.MorsePos") + proto.RegisterType((*MorseApplication)(nil), "poktroll.migration.MorseApplication") + proto.RegisterType((*MorseValidator)(nil), "poktroll.migration.MorseValidator") } func init() { proto.RegisterFile("poktroll/migration/legacy.proto", fileDescriptor_3ba469df9d72c7fc) } var fileDescriptor_3ba469df9d72c7fc = []byte{ - // 483 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xcd, 0x92, 0x96, 0x26, 0x93, 0x16, 0xca, 0x8a, 0x43, 0x54, 0x15, 0x3b, 0x58, 0x20, 0x72, - 0xc1, 0x96, 0xc2, 0x81, 0x03, 0xa7, 0xac, 0x84, 0xc4, 0xa5, 0xa8, 0x5a, 0x50, 0x85, 0x8a, 0x04, - 0xda, 0x1a, 0xcb, 0xb6, 0xea, 0x66, 0x57, 0xde, 0x75, 0x69, 0xfe, 0x02, 0x27, 0x7e, 0x16, 0xc7, - 0x1e, 0x7b, 0x32, 0x28, 0xb9, 0xf9, 0x57, 0xa0, 0x5d, 0x7f, 0xd4, 0xa1, 0xa4, 0xea, 0xc5, 0xda, - 0x9d, 0x79, 0xef, 0xcd, 0x1b, 0xcf, 0x0e, 0xd8, 0x82, 0x9f, 0xaa, 0x94, 0x27, 0x89, 0x77, 0x16, - 0x87, 0x29, 0x53, 0x31, 0x9f, 0x79, 0x49, 0x10, 0x32, 0x7f, 0xee, 0x8a, 0x94, 0x2b, 0x8e, 0x71, - 0x0d, 0x70, 0x1b, 0xc0, 0xde, 0xe3, 0x90, 0x87, 0xdc, 0xa4, 0x3d, 0x7d, 0x2a, 0x91, 0x7b, 0xd6, - 0x7f, 0xa4, 0xd4, 0x5c, 0x04, 0xb2, 0xcc, 0x3b, 0x3f, 0x10, 0xec, 0x1e, 0xf0, 0x54, 0x06, 0x1f, - 0x14, 0x53, 0xc1, 0xdb, 0x0b, 0xc1, 0x53, 0x85, 0x5f, 0x40, 0x8f, 0x09, 0xf1, 0x35, 0x62, 0x32, - 0x1a, 0xa2, 0x11, 0x1a, 0xf7, 0xc9, 0x76, 0x91, 0xdb, 0x4d, 0x8c, 0x6e, 0x31, 0x21, 0xde, 0x31, - 0x19, 0xe1, 0x03, 0xe8, 0xeb, 0xa0, 0xd4, 0xdc, 0xe1, 0xbd, 0x11, 0x1a, 0x0f, 0x26, 0x4f, 0xdd, - 0x9b, 0xde, 0x5c, 0x53, 0x61, 0x2a, 0x84, 0x29, 0x42, 0x76, 0x8a, 0xdc, 0xbe, 0xe6, 0x51, 0xad, - 0x6b, 0x12, 0xce, 0x6f, 0x04, 0x3b, 0x2b, 0x50, 0xfc, 0x09, 0x06, 0x4c, 0x88, 0x24, 0xf6, 0x8d, - 0x8e, 0x31, 0x33, 0x98, 0x3c, 0xbf, 0xad, 0x44, 0x8d, 0x95, 0xe4, 0x61, 0x91, 0xdb, 0x6d, 0x36, - 0x6d, 0x5f, 0xf0, 0x1b, 0xd8, 0x60, 0x99, 0x8a, 0x2a, 0xd7, 0x4f, 0xd6, 0x4b, 0x66, 0x2a, 0x22, - 0xbd, 0x22, 0xb7, 0x0d, 0x9c, 0x9a, 0x2f, 0x7e, 0x0d, 0x5d, 0xc1, 0xe5, 0xb0, 0x6b, 0xb8, 0xfb, - 0x6b, 0xb9, 0x87, 0x5c, 0x92, 0xad, 0x22, 0xb7, 0x35, 0x98, 0xea, 0x8f, 0xc3, 0xe1, 0xd1, 0x0d, - 0xa3, 0xf8, 0x18, 0xb6, 0x5b, 0xce, 0xe4, 0x10, 0x8d, 0xba, 0xe3, 0xc1, 0xe4, 0xd9, 0x5d, 0xba, - 0x24, 0xbb, 0x45, 0x6e, 0xaf, 0xb0, 0xe9, 0xca, 0xcd, 0x91, 0xd5, 0x78, 0x75, 0x1b, 0x53, 0xdf, - 0xe7, 0xd9, 0x4c, 0xe1, 0x7d, 0xd8, 0xf8, 0x38, 0x17, 0x41, 0x35, 0x5a, 0xd3, 0x9b, 0x7e, 0x12, - 0xd4, 0x44, 0xf1, 0x14, 0x36, 0x8f, 0x58, 0x92, 0xd5, 0xf3, 0x1c, 0xad, 0xb7, 0x51, 0xca, 0x91, - 0x7e, 0x91, 0xdb, 0x9b, 0xe7, 0x9a, 0x42, 0x4b, 0xa6, 0xf3, 0x19, 0xfa, 0x4d, 0x51, 0xfc, 0x1e, - 0x7a, 0xac, 0x44, 0xde, 0xa1, 0xb3, 0x6b, 0x97, 0xd5, 0x93, 0xab, 0x98, 0xb4, 0x39, 0x39, 0x5f, - 0xa0, 0x57, 0xff, 0x5c, 0x4c, 0x01, 0xce, 0x59, 0x12, 0x7f, 0x63, 0x8a, 0xa7, 0xb5, 0xba, 0xb3, - 0x56, 0xfd, 0xa8, 0x86, 0x92, 0x07, 0x45, 0x6e, 0xb7, 0x98, 0xb4, 0x75, 0x26, 0x87, 0xbf, 0x16, - 0x16, 0xba, 0x5c, 0x58, 0xe8, 0x6a, 0x61, 0xa1, 0x3f, 0x0b, 0x0b, 0xfd, 0x5c, 0x5a, 0x9d, 0xcb, - 0xa5, 0xd5, 0xb9, 0x5a, 0x5a, 0x9d, 0xe3, 0x49, 0x18, 0xab, 0x28, 0x3b, 0x71, 0x7d, 0x7e, 0xe6, - 0xe9, 0x3a, 0x2f, 0x67, 0x81, 0xfa, 0xce, 0xd3, 0x53, 0xaf, 0xd9, 0xb3, 0x8b, 0x7f, 0x37, 0xed, - 0xe4, 0xbe, 0x59, 0xb5, 0x57, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xf5, 0x9c, 0x74, 0xd7, - 0x03, 0x00, 0x00, + // 732 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xbf, 0x6f, 0x13, 0x31, + 0x14, 0xce, 0xf5, 0x57, 0x12, 0x27, 0x29, 0xad, 0xc5, 0x10, 0x95, 0x72, 0x0e, 0x2e, 0x88, 0x48, + 0x88, 0x44, 0x4a, 0x07, 0xa4, 0x32, 0xe5, 0x24, 0x24, 0x24, 0x28, 0xaa, 0xdc, 0xaa, 0x42, 0x45, + 0xa2, 0x72, 0x92, 0x6b, 0x12, 0x72, 0x89, 0xad, 0x3b, 0xa7, 0x34, 0xff, 0x01, 0x62, 0x62, 0x64, + 0xec, 0xbf, 0xc2, 0xc6, 0xd8, 0x8d, 0x4e, 0x07, 0x4a, 0x17, 0x74, 0x63, 0x47, 0x26, 0x64, 0xfb, + 0xee, 0x72, 0x69, 0x09, 0x2a, 0x03, 0xcb, 0xc9, 0xfe, 0xde, 0xf7, 0x3d, 0x3f, 0x7f, 0xef, 0x9d, + 0x0c, 0x10, 0x67, 0x3d, 0xe1, 0x32, 0xc7, 0xa9, 0xf6, 0xbb, 0x6d, 0x97, 0x8a, 0x2e, 0x1b, 0x54, + 0x1d, 0xbb, 0x4d, 0x9b, 0xa3, 0x0a, 0x77, 0x99, 0x60, 0x10, 0x46, 0x84, 0x4a, 0x4c, 0x58, 0xbb, + 0xdd, 0x66, 0x6d, 0xa6, 0xc2, 0x55, 0xb9, 0xd2, 0xcc, 0x35, 0xf3, 0x0f, 0xa9, 0xc4, 0x88, 0xdb, + 0x9e, 0x8e, 0xe3, 0x8f, 0x06, 0x58, 0xd9, 0x66, 0xae, 0x67, 0xef, 0x0a, 0x2a, 0xec, 0x67, 0x27, + 0x9c, 0xb9, 0x02, 0x3e, 0x04, 0x19, 0xca, 0xf9, 0x61, 0x87, 0x7a, 0x9d, 0xa2, 0x51, 0x32, 0xca, + 0x59, 0x2b, 0x1f, 0xf8, 0x28, 0xc6, 0x48, 0x9a, 0x72, 0xfe, 0x9c, 0x7a, 0x1d, 0xb8, 0x0d, 0xb2, + 0x12, 0xf4, 0xa4, 0xb6, 0x38, 0x57, 0x32, 0xca, 0xb9, 0xda, 0xbd, 0xca, 0xf5, 0xda, 0x2a, 0xea, + 0x84, 0x3a, 0xe7, 0xea, 0x10, 0xab, 0x10, 0xf8, 0x68, 0xa2, 0x23, 0x32, 0xaf, 0x0a, 0xe0, 0xef, + 0x06, 0x28, 0x4c, 0x51, 0xe1, 0x6b, 0x90, 0xa3, 0x9c, 0x3b, 0xdd, 0xa6, 0xca, 0xa3, 0x8a, 0xc9, + 0xd5, 0x1e, 0xfc, 0xed, 0x88, 0x88, 0xeb, 0x59, 0xb7, 0x02, 0x1f, 0x25, 0xd5, 0x24, 0xb9, 0x81, + 0x4f, 0xc1, 0x02, 0x1d, 0x8a, 0x4e, 0x58, 0xf5, 0xdd, 0xd9, 0x29, 0x87, 0xa2, 0x63, 0x65, 0x02, + 0x1f, 0x29, 0x3a, 0x51, 0x5f, 0xf8, 0x04, 0xcc, 0x73, 0xe6, 0x15, 0xe7, 0x95, 0x76, 0x7d, 0xa6, + 0x76, 0x87, 0x79, 0x56, 0x3a, 0xf0, 0x91, 0x24, 0x13, 0xf9, 0xc1, 0x0c, 0xac, 0x5e, 0x2b, 0x14, + 0x1e, 0x80, 0x7c, 0xa2, 0x32, 0xaf, 0x68, 0x94, 0xe6, 0xcb, 0xb9, 0xda, 0xfd, 0x9b, 0xdc, 0xd2, + 0x5a, 0x09, 0x7c, 0x34, 0xa5, 0x26, 0x53, 0x3b, 0xec, 0x85, 0xed, 0x95, 0xd7, 0xa8, 0x37, 0x9b, + 0x6c, 0x38, 0x10, 0x70, 0x1d, 0x2c, 0xec, 0x8d, 0xb8, 0x1d, 0xb6, 0x56, 0xdd, 0x4d, 0x8e, 0x04, + 0x51, 0x28, 0xac, 0x83, 0xc5, 0x7d, 0xea, 0x0c, 0xa3, 0x7e, 0x96, 0x66, 0x97, 0xa1, 0xd3, 0x59, + 0xd9, 0xc0, 0x47, 0x8b, 0xc7, 0x52, 0x42, 0xb4, 0x12, 0xbf, 0x01, 0xd9, 0xf8, 0x50, 0xf8, 0x0a, + 0x64, 0xa8, 0x66, 0xde, 0xe0, 0x66, 0x93, 0x2a, 0xc3, 0x91, 0x0b, 0x95, 0x24, 0x5e, 0xe1, 0xb7, + 0x20, 0x13, 0x99, 0x0b, 0x09, 0x00, 0xc7, 0xd4, 0xe9, 0xb6, 0xa8, 0x60, 0x6e, 0x94, 0x1d, 0xcf, + 0xcc, 0xbe, 0x1f, 0x51, 0xad, 0xe5, 0xc0, 0x47, 0x09, 0x25, 0x49, 0xac, 0xf1, 0xb7, 0xb9, 0xc8, + 0xb2, 0xc4, 0xb4, 0x1c, 0x81, 0x34, 0x6d, 0xb5, 0x5c, 0xdb, 0xf3, 0x94, 0x6b, 0x79, 0xeb, 0x65, + 0xe0, 0xa3, 0x08, 0xba, 0xf4, 0xd1, 0xf2, 0x88, 0xf6, 0x9d, 0x2d, 0x1c, 0x02, 0xf8, 0x97, 0x8f, + 0x1e, 0xb5, 0xbb, 0xa2, 0x33, 0x6c, 0x54, 0x9a, 0xac, 0x5f, 0x6d, 0xb2, 0xbe, 0x2d, 0x1a, 0x47, + 0x22, 0xb1, 0x70, 0x47, 0x5c, 0xb0, 0x4a, 0x5d, 0xf3, 0x49, 0x94, 0x09, 0x5a, 0x00, 0xf0, 0x61, + 0xc3, 0xe9, 0x36, 0x0f, 0x7b, 0xf6, 0x48, 0x75, 0x20, 0x6f, 0x6d, 0xc8, 0x62, 0x27, 0xe8, 0xa5, + 0x8f, 0x56, 0xf5, 0x69, 0x13, 0x0c, 0x93, 0xac, 0xde, 0xbc, 0xb0, 0x47, 0x70, 0x13, 0x2c, 0xbd, + 0xa3, 0x5d, 0xc7, 0x6e, 0xa9, 0xf9, 0xcc, 0x58, 0x77, 0x02, 0x1f, 0x85, 0xc8, 0xa5, 0x8f, 0x0a, + 0x5a, 0xab, 0xf7, 0x98, 0x84, 0x01, 0x29, 0x92, 0x7f, 0xe3, 0xd0, 0x2b, 0x2e, 0x94, 0x8c, 0xf2, + 0xa2, 0x16, 0x69, 0x64, 0x22, 0xd2, 0x7b, 0x4c, 0xc2, 0x00, 0xdc, 0x00, 0x05, 0x4f, 0xd0, 0x9e, + 0xdd, 0x3a, 0x14, 0xac, 0x67, 0x0f, 0xbc, 0xe2, 0x92, 0x9c, 0x28, 0x92, 0xd7, 0xe0, 0x9e, 0xc2, + 0xb6, 0x32, 0x1f, 0x4e, 0x51, 0xea, 0xe7, 0x29, 0x32, 0xf0, 0x97, 0x39, 0xb0, 0x3c, 0xdd, 0x08, + 0xe9, 0x6b, 0xfd, 0x7f, 0xfa, 0x1a, 0x2e, 0x60, 0x1d, 0x64, 0x77, 0x22, 0x83, 0xfe, 0xc9, 0xd6, + 0x58, 0x05, 0xf1, 0x15, 0x5b, 0xc1, 0xc4, 0xd6, 0xd8, 0x45, 0x7c, 0xc5, 0x45, 0x30, 0x71, 0x31, + 0x36, 0xad, 0x02, 0xf2, 0xbb, 0x09, 0x7f, 0x8a, 0x69, 0xf5, 0x17, 0x2a, 0xa6, 0x76, 0x91, 0x4c, + 0xc5, 0xb7, 0xf2, 0xd2, 0xbf, 0xcf, 0xa7, 0xc8, 0x90, 0x1e, 0x5a, 0x3b, 0x5f, 0xc7, 0xa6, 0x71, + 0x36, 0x36, 0x8d, 0xf3, 0xb1, 0x69, 0xfc, 0x18, 0x9b, 0xc6, 0xa7, 0x0b, 0x33, 0x75, 0x76, 0x61, + 0xa6, 0xce, 0x2f, 0xcc, 0xd4, 0x41, 0x2d, 0x61, 0x8e, 0xfc, 0x0b, 0x1e, 0x0f, 0x6c, 0xf1, 0x9e, + 0xb9, 0xbd, 0x6a, 0xfc, 0x0a, 0x9c, 0x5c, 0x7d, 0x07, 0x1a, 0x4b, 0xea, 0x21, 0xd8, 0xfc, 0x1d, + 0x00, 0x00, 0xff, 0xff, 0x02, 0x9b, 0x69, 0x70, 0x75, 0x06, 0x00, 0x00, +} + +func (this *MorseApplication) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MorseApplication) + if !ok { + that2, ok := that.(MorseApplication) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Address, that1.Address) { + return false + } + if !bytes.Equal(this.PublicKey, that1.PublicKey) { + return false + } + if this.Jailed != that1.Jailed { + return false + } + if this.Status != that1.Status { + return false + } + if this.StakedTokens != that1.StakedTokens { + return false + } + return true } +func (this *MorseValidator) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + that1, ok := that.(*MorseValidator) + if !ok { + that2, ok := that.(MorseValidator) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Address, that1.Address) { + return false + } + if !bytes.Equal(this.PublicKey, that1.PublicKey) { + return false + } + if this.Jailed != that1.Jailed { + return false + } + if this.Status != that1.Status { + return false + } + if this.StakedTokens != that1.StakedTokens { + return false + } + return true +} func (m *MorseStateExport) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -601,6 +772,124 @@ func (m *MorsePos) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MorseApplication) 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 *MorseApplication) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseApplication) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StakedTokens) > 0 { + i -= len(m.StakedTokens) + copy(dAtA[i:], m.StakedTokens) + i = encodeVarintLegacy(dAtA, i, uint64(len(m.StakedTokens))) + i-- + dAtA[i] = 0x32 + } + if m.Status != 0 { + i = encodeVarintLegacy(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x20 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintLegacy(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintLegacy(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MorseValidator) 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 *MorseValidator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StakedTokens) > 0 { + i -= len(m.StakedTokens) + copy(dAtA[i:], m.StakedTokens) + i = encodeVarintLegacy(dAtA, i, uint64(len(m.StakedTokens))) + i-- + dAtA[i] = 0x3a + } + if m.Status != 0 { + i = encodeVarintLegacy(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x20 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintLegacy(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintLegacy(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintLegacy(dAtA []byte, offset int, v uint64) int { offset -= sovLegacy(v) base := offset @@ -712,6 +1001,60 @@ func (m *MorsePos) Size() (n int) { return n } +func (m *MorseApplication) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovLegacy(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovLegacy(uint64(l)) + } + if m.Jailed { + n += 2 + } + if m.Status != 0 { + n += 1 + sovLegacy(uint64(m.Status)) + } + l = len(m.StakedTokens) + if l > 0 { + n += 1 + l + sovLegacy(uint64(l)) + } + return n +} + +func (m *MorseValidator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovLegacy(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovLegacy(uint64(l)) + } + if m.Jailed { + n += 2 + } + if m.Status != 0 { + n += 1 + sovLegacy(uint64(m.Status)) + } + l = len(m.StakedTokens) + if l > 0 { + n += 1 + l + sovLegacy(uint64(l)) + } + return n +} + func sovLegacy(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1364,6 +1707,384 @@ func (m *MorsePos) Unmarshal(dAtA []byte) error { } return nil } +func (m *MorseApplication) 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 ErrIntOverflowLegacy + } + 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: MorseApplication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseApplication: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + 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 ErrInvalidLengthLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseValidator) 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 ErrIntOverflowLegacy + } + 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: MorseValidator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseValidator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) + if m.Address == nil { + m.Address = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + 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 ErrInvalidLengthLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipLegacy(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/migration/types/types.pb.go b/x/migration/types/types.pb.go index 3d9399d1c..91a2f7d54 100644 --- a/x/migration/types/types.pb.go +++ b/x/migration/types/types.pb.go @@ -4,7 +4,6 @@ package types import ( - bytes "bytes" crypto_ed25519 "crypto/ed25519" fmt "fmt" github_com_cometbft_cometbft_crypto "github.com/cometbft/cometbft/crypto" @@ -153,212 +152,46 @@ func (m *MorsePublicKey) GetValue() crypto_ed25519.PublicKey { return nil } -// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates -// the minimum information required to import Morse applications. -// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 -type MorseApplication struct { - Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"` - Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status" yaml:"status"` - StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` -} - -func (m *MorseApplication) Reset() { *m = MorseApplication{} } -func (m *MorseApplication) String() string { return proto.CompactTextString(m) } -func (*MorseApplication) ProtoMessage() {} -func (*MorseApplication) Descriptor() ([]byte, []int) { - return fileDescriptor_7ed31f79aa0bc330, []int{3} -} -func (m *MorseApplication) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MorseApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MorseApplication) XXX_Merge(src proto.Message) { - xxx_messageInfo_MorseApplication.Merge(m, src) -} -func (m *MorseApplication) XXX_Size() int { - return m.Size() -} -func (m *MorseApplication) XXX_DiscardUnknown() { - xxx_messageInfo_MorseApplication.DiscardUnknown(m) -} - -var xxx_messageInfo_MorseApplication proto.InternalMessageInfo - -// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the -// minimum information required to import Morse suppliers (aka "servicers" or "validators"). -// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 -type MorseValidator struct { - Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` - PublicKey []byte `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"public_key" yaml:"public_key"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed"` - Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status"` - StakedTokens string `protobuf:"bytes,7,opt,name=StakedTokens,proto3" json:"tokens"` -} - -func (m *MorseValidator) Reset() { *m = MorseValidator{} } -func (m *MorseValidator) String() string { return proto.CompactTextString(m) } -func (*MorseValidator) ProtoMessage() {} -func (*MorseValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_7ed31f79aa0bc330, []int{4} -} -func (m *MorseValidator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MorseValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *MorseValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_MorseValidator.Merge(m, src) -} -func (m *MorseValidator) XXX_Size() int { - return m.Size() -} -func (m *MorseValidator) XXX_DiscardUnknown() { - xxx_messageInfo_MorseValidator.DiscardUnknown(m) -} - -var xxx_messageInfo_MorseValidator proto.InternalMessageInfo - func init() { proto.RegisterType((*MorseAccountState)(nil), "poktroll.migration.MorseAccountState") proto.RegisterType((*MorseAccount)(nil), "poktroll.migration.MorseAccount") proto.RegisterType((*MorsePublicKey)(nil), "poktroll.migration.MorsePublicKey") - proto.RegisterType((*MorseApplication)(nil), "poktroll.migration.MorseApplication") - proto.RegisterType((*MorseValidator)(nil), "poktroll.migration.MorseValidator") } func init() { proto.RegisterFile("poktroll/migration/types.proto", fileDescriptor_7ed31f79aa0bc330) } var fileDescriptor_7ed31f79aa0bc330 = []byte{ - // 639 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x73, 0x69, 0x9b, 0xb4, 0x57, 0xb7, 0xa2, 0x16, 0x12, 0x6e, 0x41, 0xbe, 0xe8, 0xba, - 0x44, 0x42, 0xb5, 0xd5, 0x54, 0x1d, 0xc8, 0x16, 0xc3, 0x44, 0x41, 0xaa, 0xdc, 0x8a, 0x81, 0x25, - 0x9c, 0x9d, 0x6b, 0x30, 0x71, 0x72, 0x96, 0xef, 0x5c, 0xc8, 0x37, 0xe8, 0xc8, 0x84, 0x18, 0x2b, - 0x3e, 0x03, 0x5f, 0x80, 0xad, 0x62, 0xea, 0x46, 0x27, 0x0b, 0xa5, 0x0b, 0xca, 0x98, 0xb1, 0x13, - 0xb2, 0xcf, 0x71, 0xdc, 0x20, 0x24, 0x40, 0x62, 0xbb, 0xf7, 0x7f, 0xff, 0x7f, 0xf4, 0xde, 0xef, - 0x9c, 0x83, 0x7a, 0xc0, 0x7a, 0x22, 0x64, 0xbe, 0x6f, 0xf6, 0xbd, 0x6e, 0x48, 0x84, 0xc7, 0x06, - 0xa6, 0x18, 0x06, 0x94, 0x1b, 0x41, 0xc8, 0x04, 0x53, 0xd5, 0x69, 0xdf, 0xc8, 0xfb, 0x5b, 0x9b, - 0x2e, 0xe3, 0x7d, 0xc6, 0xdb, 0xa9, 0xc3, 0x94, 0x85, 0xb4, 0x6f, 0xe9, 0xb2, 0x32, 0x1d, 0xc2, - 0xa9, 0x79, 0xba, 0xeb, 0x50, 0x41, 0x76, 0x4d, 0x97, 0x79, 0x83, 0xac, 0x7f, 0xb7, 0xcb, 0xba, - 0x4c, 0xe6, 0x92, 0x93, 0x54, 0x71, 0x1b, 0x6e, 0x3c, 0x67, 0x21, 0xa7, 0x2d, 0xd7, 0x65, 0xd1, - 0x40, 0x1c, 0x09, 0x22, 0xa8, 0xfa, 0x14, 0x2e, 0x13, 0x59, 0x73, 0x0d, 0xd4, 0x16, 0xea, 0xab, - 0x8d, 0x9a, 0xf1, 0xeb, 0x30, 0x46, 0x31, 0x68, 0x29, 0xe3, 0x18, 0xe5, 0x29, 0x3b, 0x3f, 0xe1, - 0x0f, 0x65, 0xa8, 0x14, 0x8d, 0xea, 0x31, 0xac, 0x92, 0x4e, 0x27, 0xa4, 0x3c, 0xf9, 0x6d, 0x50, - 0x57, 0xac, 0xe6, 0x38, 0x46, 0x53, 0xe9, 0x26, 0x46, 0x0f, 0xbb, 0x9e, 0x78, 0x1d, 0x39, 0x86, - 0xcb, 0xfa, 0xa6, 0xcb, 0xfa, 0x54, 0x38, 0x27, 0xa2, 0x70, 0x08, 0x87, 0x81, 0x60, 0x46, 0x4b, - 0xda, 0xed, 0x69, 0x4e, 0x7d, 0x05, 0xab, 0x41, 0xe4, 0xb4, 0x7b, 0x74, 0xa8, 0x95, 0x6b, 0xa0, - 0xbe, 0xda, 0xc0, 0xbf, 0x9d, 0xf8, 0x30, 0x72, 0x7c, 0xcf, 0x3d, 0xa0, 0x43, 0x6b, 0x7b, 0x1c, - 0x23, 0x18, 0xa4, 0x65, 0x92, 0x9c, 0xc4, 0x68, 0x63, 0x48, 0xfa, 0x7e, 0x13, 0xcf, 0x34, 0x6c, - 0x57, 0x82, 0xc8, 0x39, 0xa0, 0x43, 0x75, 0x1f, 0x2e, 0x25, 0x34, 0xb9, 0xb6, 0x90, 0x12, 0xd9, - 0x34, 0x32, 0xfa, 0x09, 0x6f, 0x23, 0xe3, 0x6d, 0x3c, 0x66, 0xde, 0xc0, 0x5a, 0xbc, 0x88, 0x51, - 0xc9, 0x96, 0xee, 0xe6, 0xbd, 0xb3, 0x73, 0x54, 0xfa, 0x78, 0x8e, 0xc0, 0xd9, 0x27, 0x04, 0xbe, - 0x7e, 0xde, 0xa9, 0x66, 0x1c, 0xf0, 0x13, 0xb8, 0x7e, 0x7b, 0x1c, 0xb5, 0x01, 0x97, 0x4e, 0x89, - 0x1f, 0xd1, 0x74, 0x03, 0xc5, 0x7a, 0x70, 0x13, 0x23, 0x4d, 0xee, 0x6b, 0xd2, 0x4e, 0x63, 0x7f, - 0x7f, 0xf7, 0x91, 0x91, 0x9b, 0x6d, 0x69, 0xc5, 0xdf, 0xca, 0xf0, 0x8e, 0xc4, 0x1b, 0x04, 0xbe, - 0xe7, 0xa6, 0x6b, 0xaa, 0x27, 0xf3, 0x88, 0x9f, 0x15, 0x10, 0x4f, 0x62, 0xb4, 0x2e, 0xb7, 0xcc, - 0x04, 0xfc, 0xcf, 0xd0, 0x2d, 0x58, 0xa0, 0x97, 0x4d, 0xfd, 0x47, 0x4c, 0x57, 0x82, 0x7c, 0xe9, - 0x3d, 0x58, 0x79, 0x43, 0x3c, 0x9f, 0x76, 0xb4, 0x85, 0x1a, 0xa8, 0x2f, 0x5b, 0xf7, 0xc7, 0x31, - 0xca, 0x94, 0x49, 0x8c, 0xd6, 0x64, 0x56, 0xd6, 0xd8, 0xce, 0x1a, 0x49, 0x88, 0x0b, 0x22, 0x22, - 0xae, 0x2d, 0xd6, 0x40, 0x7d, 0x49, 0x86, 0xa4, 0x32, 0x0b, 0xc9, 0x1a, 0xdb, 0x59, 0x43, 0xdd, - 0x86, 0x6b, 0x5c, 0x90, 0x1e, 0xed, 0xb4, 0x05, 0xeb, 0xd1, 0x01, 0xd7, 0x2a, 0x35, 0x50, 0x5f, - 0xb1, 0x15, 0x29, 0x1e, 0xa7, 0x5a, 0x73, 0x39, 0xb9, 0xae, 0x1f, 0xe7, 0x08, 0xe0, 0x2f, 0xe5, - 0xec, 0x82, 0x5e, 0x10, 0xdf, 0xeb, 0x10, 0xc1, 0xc2, 0x84, 0x6b, 0xeb, 0x7f, 0x72, 0xcd, 0x0e, - 0x6a, 0x0b, 0xae, 0xe4, 0x17, 0xfd, 0x57, 0x58, 0x67, 0xdf, 0x12, 0x9e, 0xc3, 0x0a, 0x67, 0x58, - 0x73, 0x8a, 0x78, 0x8e, 0x22, 0x9c, 0x51, 0xcc, 0xa1, 0x19, 0x50, 0x39, 0x2a, 0xf0, 0xd1, 0xaa, - 0x09, 0x33, 0xe9, 0x94, 0x14, 0xed, 0x5b, 0xfd, 0xa6, 0x32, 0xfd, 0xdc, 0x13, 0x86, 0xd6, 0xe1, - 0xc5, 0x48, 0x07, 0x97, 0x23, 0x1d, 0x5c, 0x8d, 0x74, 0xf0, 0x7d, 0xa4, 0x83, 0xf7, 0xd7, 0x7a, - 0xe9, 0xf2, 0x5a, 0x2f, 0x5d, 0x5d, 0xeb, 0xa5, 0x97, 0x8d, 0x02, 0x9c, 0xe4, 0xcf, 0xba, 0x33, - 0xa0, 0xe2, 0x2d, 0x0b, 0x7b, 0x66, 0xfe, 0x30, 0xbe, 0x9b, 0x7f, 0x1a, 0x9d, 0x4a, 0xfa, 0x6c, - 0xed, 0xfd, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xca, 0x85, 0x60, 0x2e, 0x3d, 0x05, 0x00, 0x00, + // 444 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x7d, 0x2d, 0x6d, 0xd0, 0x35, 0x42, 0xaa, 0x85, 0x44, 0x5a, 0xa1, 0xbb, 0xc8, 0x2c, + 0x91, 0x50, 0xef, 0x14, 0xa3, 0x0c, 0x64, 0xab, 0x61, 0xa2, 0x42, 0xaa, 0x0c, 0x13, 0x4b, 0xb0, + 0x9d, 0x23, 0x58, 0xb1, 0xfd, 0x2c, 0xdf, 0xb9, 0xe0, 0x6f, 0xd0, 0x91, 0x09, 0x31, 0x56, 0x7c, + 0x06, 0x3e, 0x44, 0xc5, 0xd4, 0xb1, 0x93, 0x85, 0x92, 0x2d, 0x23, 0x63, 0x26, 0x64, 0x5f, 0x62, + 0x0c, 0x88, 0xed, 0xfd, 0xdf, 0xfb, 0xff, 0x4f, 0xef, 0x7e, 0x7a, 0x98, 0xa4, 0x30, 0x57, 0x19, + 0x44, 0x11, 0x8f, 0xc3, 0x59, 0xe6, 0xa9, 0x10, 0x12, 0xae, 0x8a, 0x54, 0x48, 0x96, 0x66, 0xa0, + 0xc0, 0x34, 0xb7, 0x73, 0xd6, 0xcc, 0x8f, 0x8f, 0x02, 0x90, 0x31, 0xc8, 0x49, 0xed, 0xe0, 0x5a, + 0x68, 0xfb, 0x31, 0xd1, 0x8a, 0xfb, 0x9e, 0x14, 0xfc, 0x62, 0xe8, 0x0b, 0xe5, 0x0d, 0x79, 0x00, + 0x61, 0xb2, 0x99, 0xdf, 0x9f, 0xc1, 0x0c, 0x74, 0xae, 0xaa, 0x74, 0xd7, 0x9a, 0xe0, 0xc3, 0x97, + 0x90, 0x49, 0x71, 0x1a, 0x04, 0x90, 0x27, 0xea, 0x95, 0xf2, 0x94, 0x30, 0x5f, 0xe0, 0xbb, 0x9e, + 0xd6, 0xb2, 0x87, 0xfa, 0xbb, 0x83, 0x03, 0xbb, 0xcf, 0xfe, 0x5d, 0x86, 0xb5, 0x83, 0x4e, 0x77, + 0x55, 0xd2, 0x26, 0xe5, 0x36, 0x95, 0xf5, 0x79, 0x07, 0x77, 0xdb, 0x46, 0xf3, 0x35, 0xee, 0x78, + 0xd3, 0x69, 0x26, 0x64, 0xf5, 0x36, 0x1a, 0x74, 0x9d, 0xf1, 0xaa, 0xa4, 0xdb, 0xd6, 0xba, 0xa4, + 0x8f, 0x67, 0xa1, 0x7a, 0x9f, 0xfb, 0x2c, 0x80, 0x98, 0x07, 0x10, 0x0b, 0xe5, 0xbf, 0x53, 0xad, + 0x22, 0x2b, 0x52, 0x05, 0xec, 0x54, 0xdb, 0xdd, 0x6d, 0xce, 0x7c, 0x8b, 0x3b, 0x69, 0xee, 0x4f, + 0xe6, 0xa2, 0xe8, 0xed, 0xf4, 0xd1, 0xe0, 0xc0, 0xb6, 0xfe, 0xbb, 0xf1, 0x79, 0xee, 0x47, 0x61, + 0x70, 0x26, 0x0a, 0xe7, 0xd1, 0xaa, 0xa4, 0x38, 0xad, 0x65, 0x95, 0xfc, 0x59, 0xd2, 0xc3, 0xc2, + 0x8b, 0xa3, 0xb1, 0xf5, 0xbb, 0x67, 0xb9, 0xfb, 0x69, 0xee, 0x9f, 0x89, 0xc2, 0x1c, 0xe1, 0xbd, + 0x8a, 0xa6, 0xec, 0xed, 0xd6, 0x44, 0x8e, 0xd8, 0x86, 0x7e, 0xc5, 0x9b, 0x6d, 0x78, 0xb3, 0x67, + 0x10, 0x26, 0xce, 0x9d, 0xeb, 0x92, 0x1a, 0xae, 0x76, 0x8f, 0x1f, 0x5c, 0x5e, 0x51, 0xe3, 0xcb, + 0x15, 0x45, 0x97, 0x5f, 0x29, 0xfa, 0xfe, 0xed, 0xa4, 0xb3, 0xe1, 0x60, 0x3d, 0xc7, 0xf7, 0xfe, + 0x5c, 0xc7, 0xb4, 0xf1, 0xde, 0x85, 0x17, 0xe5, 0xa2, 0xfe, 0x41, 0xd7, 0x79, 0xb8, 0x2e, 0x69, + 0x4f, 0xff, 0x97, 0x8b, 0xa9, 0x3d, 0x1a, 0x0d, 0x9f, 0xb2, 0xc6, 0xec, 0x6a, 0xab, 0x73, 0x7e, + 0xbd, 0x20, 0xe8, 0x66, 0x41, 0xd0, 0xed, 0x82, 0xa0, 0x1f, 0x0b, 0x82, 0x3e, 0x2d, 0x89, 0x71, + 0xb3, 0x24, 0xc6, 0xed, 0x92, 0x18, 0x6f, 0xec, 0x16, 0xcb, 0x0a, 0xc7, 0x49, 0x22, 0xd4, 0x07, + 0xc8, 0xe6, 0xbc, 0x39, 0xbd, 0x8f, 0x7f, 0x1f, 0x9f, 0xbf, 0x5f, 0x1f, 0xc6, 0x93, 0x5f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xd9, 0x80, 0x8f, 0x0e, 0x9f, 0x02, 0x00, 0x00, } -func (this *MorseApplication) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MorseApplication) - if !ok { - that2, ok := that.(MorseApplication) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Address, that1.Address) { - return false - } - if !bytes.Equal(this.PublicKey, that1.PublicKey) { - return false - } - if this.Jailed != that1.Jailed { - return false - } - if this.Status != that1.Status { - return false - } - if this.StakedTokens != that1.StakedTokens { - return false - } - return true -} -func (this *MorseValidator) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MorseValidator) - if !ok { - that2, ok := that.(MorseValidator) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Address, that1.Address) { - return false - } - if !bytes.Equal(this.PublicKey, that1.PublicKey) { - return false - } - if this.Jailed != that1.Jailed { - return false - } - if this.Status != that1.Status { - return false - } - if this.StakedTokens != that1.StakedTokens { - return false - } - return true -} func (m *MorseAccountState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -482,124 +315,6 @@ func (m *MorsePublicKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MorseApplication) 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 *MorseApplication) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MorseApplication) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.StakedTokens) > 0 { - i -= len(m.StakedTokens) - copy(dAtA[i:], m.StakedTokens) - i = encodeVarintTypes(dAtA, i, uint64(len(m.StakedTokens))) - i-- - dAtA[i] = 0x32 - } - if m.Status != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x20 - } - if m.Jailed { - i-- - if m.Jailed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.PublicKey) > 0 { - i -= len(m.PublicKey) - copy(dAtA[i:], m.PublicKey) - i = encodeVarintTypes(dAtA, i, uint64(len(m.PublicKey))) - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MorseValidator) 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 *MorseValidator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MorseValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.StakedTokens) > 0 { - i -= len(m.StakedTokens) - copy(dAtA[i:], m.StakedTokens) - i = encodeVarintTypes(dAtA, i, uint64(len(m.StakedTokens))) - i-- - dAtA[i] = 0x3a - } - if m.Status != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x20 - } - if m.Jailed { - i-- - if m.Jailed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.PublicKey) > 0 { - i -= len(m.PublicKey) - copy(dAtA[i:], m.PublicKey) - i = encodeVarintTypes(dAtA, i, uint64(len(m.PublicKey))) - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -662,60 +377,6 @@ func (m *MorsePublicKey) Size() (n int) { return n } -func (m *MorseApplication) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.PublicKey) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Jailed { - n += 2 - } - if m.Status != 0 { - n += 1 + sovTypes(uint64(m.Status)) - } - l = len(m.StakedTokens) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *MorseValidator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.PublicKey) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Jailed { - n += 2 - } - if m.Status != 0 { - n += 1 + sovTypes(uint64(m.Status)) - } - l = len(m.StakedTokens) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1044,384 +705,6 @@ func (m *MorsePublicKey) Unmarshal(dAtA []byte) error { } return nil } -func (m *MorseApplication) 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 ErrIntOverflowTypes - } - 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: MorseApplication: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MorseApplication: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) - if m.Address == nil { - m.Address = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKey == nil { - m.PublicKey = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Jailed = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StakedTokens = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MorseValidator) 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 ErrIntOverflowTypes - } - 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: MorseValidator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MorseValidator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) - if m.Address == nil { - m.Address = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKey == nil { - m.PublicKey = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Jailed = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StakedTokens = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From 178ded8c70177eb874f022917133f6cc4069f0d9 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 31 Jan 2025 15:19:45 +0100 Subject: [PATCH 12/19] chore: review feedback improvements --- api/poktroll/migration/legacy.pulsar.go | 842 +++++++++++----------- cmd/poktrolld/cmd/migrate/errors.go | 14 + cmd/poktrolld/cmd/migrate/migrate.go | 205 ++++-- cmd/poktrolld/cmd/migrate/migrate_test.go | 21 +- cmd/poktrolld/cmd/migrate/types.go | 146 +++- e2e/tests/update_params_test.go | 16 +- proto/poktroll/migration/legacy.proto | 49 +- x/migration/types/legacy.pb.go | 413 ++++++----- x/migration/types/morse_account_state.go | 19 + 9 files changed, 1032 insertions(+), 693 deletions(-) create mode 100644 cmd/poktrolld/cmd/migrate/errors.go create mode 100644 x/migration/types/morse_account_state.go diff --git a/api/poktroll/migration/legacy.pulsar.go b/api/poktroll/migration/legacy.pulsar.go index 8edfd8db6..4d77f6a6a 100644 --- a/api/poktroll/migration/legacy.pulsar.go +++ b/api/poktroll/migration/legacy.pulsar.go @@ -1599,28 +1599,77 @@ func (x *fastReflection_MorseApplications) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_MorseAuth_1_list)(nil) + +type _MorseAuth_1_list struct { + list *[]*MorseAuthAccount +} + +func (x *_MorseAuth_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorseAuth_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorseAuth_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAuthAccount) + (*x.list)[i] = concreteValue +} + +func (x *_MorseAuth_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAuthAccount) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorseAuth_1_list) AppendMutable() protoreflect.Value { + v := new(MorseAuthAccount) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAuth_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorseAuth_1_list) NewElement() protoreflect.Value { + v := new(MorseAuthAccount) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAuth_1_list) IsValid() bool { + return x.list != nil +} + var ( - md_MorseAuthAccount protoreflect.MessageDescriptor - fd_MorseAuthAccount_Type protoreflect.FieldDescriptor - fd_MorseAuthAccount_Value protoreflect.FieldDescriptor + md_MorseAuth protoreflect.MessageDescriptor + fd_MorseAuth_accounts protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_legacy_proto_init() - md_MorseAuthAccount = File_poktroll_migration_legacy_proto.Messages().ByName("MorseAuthAccount") - fd_MorseAuthAccount_Type = md_MorseAuthAccount.Fields().ByName("Type") - fd_MorseAuthAccount_Value = md_MorseAuthAccount.Fields().ByName("Value") + md_MorseAuth = File_poktroll_migration_legacy_proto.Messages().ByName("MorseAuth") + fd_MorseAuth_accounts = md_MorseAuth.Fields().ByName("accounts") } -var _ protoreflect.Message = (*fastReflection_MorseAuthAccount)(nil) +var _ protoreflect.Message = (*fastReflection_MorseAuth)(nil) -type fastReflection_MorseAuthAccount MorseAuthAccount +type fastReflection_MorseAuth MorseAuth -func (x *MorseAuthAccount) ProtoReflect() protoreflect.Message { - return (*fastReflection_MorseAuthAccount)(x) +func (x *MorseAuth) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseAuth)(x) } -func (x *MorseAuthAccount) slowProtoReflect() protoreflect.Message { +func (x *MorseAuth) slowProtoReflect() protoreflect.Message { mi := &file_poktroll_migration_legacy_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1632,43 +1681,43 @@ func (x *MorseAuthAccount) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MorseAuthAccount_messageType fastReflection_MorseAuthAccount_messageType -var _ protoreflect.MessageType = fastReflection_MorseAuthAccount_messageType{} +var _fastReflection_MorseAuth_messageType fastReflection_MorseAuth_messageType +var _ protoreflect.MessageType = fastReflection_MorseAuth_messageType{} -type fastReflection_MorseAuthAccount_messageType struct{} +type fastReflection_MorseAuth_messageType struct{} -func (x fastReflection_MorseAuthAccount_messageType) Zero() protoreflect.Message { - return (*fastReflection_MorseAuthAccount)(nil) +func (x fastReflection_MorseAuth_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseAuth)(nil) } -func (x fastReflection_MorseAuthAccount_messageType) New() protoreflect.Message { - return new(fastReflection_MorseAuthAccount) +func (x fastReflection_MorseAuth_messageType) New() protoreflect.Message { + return new(fastReflection_MorseAuth) } -func (x fastReflection_MorseAuthAccount_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MorseAuthAccount +func (x fastReflection_MorseAuth_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuth } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MorseAuthAccount) Descriptor() protoreflect.MessageDescriptor { - return md_MorseAuthAccount +func (x *fastReflection_MorseAuth) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuth } // 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_MorseAuthAccount) Type() protoreflect.MessageType { - return _fastReflection_MorseAuthAccount_messageType +func (x *fastReflection_MorseAuth) Type() protoreflect.MessageType { + return _fastReflection_MorseAuth_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MorseAuthAccount) New() protoreflect.Message { - return new(fastReflection_MorseAuthAccount) +func (x *fastReflection_MorseAuth) New() protoreflect.Message { + return new(fastReflection_MorseAuth) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MorseAuthAccount) Interface() protoreflect.ProtoMessage { - return (*MorseAuthAccount)(x) +func (x *fastReflection_MorseAuth) Interface() protoreflect.ProtoMessage { + return (*MorseAuth)(x) } // Range iterates over every populated field in an undefined order, @@ -1676,16 +1725,10 @@ func (x *fastReflection_MorseAuthAccount) Interface() protoreflect.ProtoMessage // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MorseAuthAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Type_ != "" { - value := protoreflect.ValueOfString(x.Type_) - if !f(fd_MorseAuthAccount_Type, value) { - return - } - } - if x.Value != nil { - value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) - if !f(fd_MorseAuthAccount_Value, value) { +func (x *fastReflection_MorseAuth) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Accounts) != 0 { + value := protoreflect.ValueOfList(&_MorseAuth_1_list{list: &x.Accounts}) + if !f(fd_MorseAuth_accounts, value) { return } } @@ -1702,17 +1745,15 @@ func (x *fastReflection_MorseAuthAccount) Range(f func(protoreflect.FieldDescrip // 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_MorseAuthAccount) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MorseAuth) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": - return x.Type_ != "" - case "poktroll.migration.MorseAuthAccount.Value": - return x.Value != nil + case "poktroll.migration.MorseAuth.accounts": + return len(x.Accounts) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) } } @@ -1722,17 +1763,15 @@ func (x *fastReflection_MorseAuthAccount) Has(fd protoreflect.FieldDescriptor) b // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MorseAuthAccount) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MorseAuth) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": - x.Type_ = "" - case "poktroll.migration.MorseAuthAccount.Value": - x.Value = nil + case "poktroll.migration.MorseAuth.accounts": + x.Accounts = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) } } @@ -1742,19 +1781,19 @@ func (x *fastReflection_MorseAuthAccount) Clear(fd protoreflect.FieldDescriptor) // 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_MorseAuthAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MorseAuth) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": - value := x.Type_ - return protoreflect.ValueOfString(value) - case "poktroll.migration.MorseAuthAccount.Value": - value := x.Value - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MorseAuth.accounts": + if len(x.Accounts) == 0 { + return protoreflect.ValueOfList(&_MorseAuth_1_list{}) + } + listValue := &_MorseAuth_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", descriptor.FullName())) } } @@ -1768,17 +1807,17 @@ func (x *fastReflection_MorseAuthAccount) Get(descriptor protoreflect.FieldDescr // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MorseAuthAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MorseAuth) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": - x.Type_ = value.Interface().(string) - case "poktroll.migration.MorseAuthAccount.Value": - x.Value = value.Message().Interface().(*MorseAccount) + case "poktroll.migration.MorseAuth.accounts": + lv := value.List() + clv := lv.(*_MorseAuth_1_list) + x.Accounts = *clv.list default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) } } @@ -1792,48 +1831,45 @@ func (x *fastReflection_MorseAuthAccount) Set(fd protoreflect.FieldDescriptor, v // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MorseAuthAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MorseAuth) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Value": - if x.Value == nil { - x.Value = new(MorseAccount) + case "poktroll.migration.MorseAuth.accounts": + if x.Accounts == nil { + x.Accounts = []*MorseAuthAccount{} } - return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) - case "poktroll.migration.MorseAuthAccount.Type": - panic(fmt.Errorf("field Type of message poktroll.migration.MorseAuthAccount is not mutable")) + value := &_MorseAuth_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuth 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_MorseAuthAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MorseAuth) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": - return protoreflect.ValueOfString("") - case "poktroll.migration.MorseAuthAccount.Value": - m := new(MorseAccount) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MorseAuth.accounts": + list := []*MorseAuthAccount{} + return protoreflect.ValueOfList(&_MorseAuth_1_list{list: &list}) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuth 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_MorseAuthAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MorseAuth) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAuthAccount", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAuth", d.FullName())) } panic("unreachable") } @@ -1841,7 +1877,7 @@ func (x *fastReflection_MorseAuthAccount) WhichOneof(d protoreflect.OneofDescrip // 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_MorseAuthAccount) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MorseAuth) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1852,7 +1888,7 @@ func (x *fastReflection_MorseAuthAccount) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MorseAuthAccount) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MorseAuth) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1864,7 +1900,7 @@ func (x *fastReflection_MorseAuthAccount) SetUnknown(fields protoreflect.RawFiel // 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_MorseAuthAccount) IsValid() bool { +func (x *fastReflection_MorseAuth) IsValid() bool { return x != nil } @@ -1874,9 +1910,9 @@ func (x *fastReflection_MorseAuthAccount) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MorseAuthAccount) + x := input.Message.Interface().(*MorseAuth) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1888,13 +1924,11 @@ func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Type_) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Value != nil { - l = options.Size(x.Value) - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.Accounts) > 0 { + for _, e := range x.Accounts { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1906,7 +1940,7 @@ func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MorseAuthAccount) + x := input.Message.Interface().(*MorseAuth) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1925,26 +1959,21 @@ func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Value != nil { - encoded, err := options.Marshal(x.Value) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err + if len(x.Accounts) > 0 { + for iNdEx := len(x.Accounts) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Accounts[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 } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if len(x.Type_) > 0 { - i -= len(x.Type_) - copy(dAtA[i:], x.Type_) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Type_))) - i-- - dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -1957,7 +1986,7 @@ func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MorseAuthAccount) + x := input.Message.Interface().(*MorseAuth) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1989,47 +2018,15 @@ func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuthAccount: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuth: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuthAccount: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuth: 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 Type_", 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.Type_ = 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 Value", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2056,10 +2053,8 @@ func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Value == nil { - x.Value = &MorseAccount{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Value); err != nil { + x.Accounts = append(x.Accounts, &MorseAuthAccount{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accounts[len(x.Accounts)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -2098,77 +2093,28 @@ func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_MorseAuth_1_list)(nil) - -type _MorseAuth_1_list struct { - list *[]*MorseAuthAccount -} - -func (x *_MorseAuth_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MorseAuth_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MorseAuth_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*MorseAuthAccount) - (*x.list)[i] = concreteValue -} - -func (x *_MorseAuth_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*MorseAuthAccount) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MorseAuth_1_list) AppendMutable() protoreflect.Value { - v := new(MorseAuthAccount) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MorseAuth_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MorseAuth_1_list) NewElement() protoreflect.Value { - v := new(MorseAuthAccount) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MorseAuth_1_list) IsValid() bool { - return x.list != nil -} - var ( - md_MorseAuth protoreflect.MessageDescriptor - fd_MorseAuth_accounts protoreflect.FieldDescriptor + md_MorseAuthAccount protoreflect.MessageDescriptor + fd_MorseAuthAccount_Type protoreflect.FieldDescriptor + fd_MorseAuthAccount_Value protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_legacy_proto_init() - md_MorseAuth = File_poktroll_migration_legacy_proto.Messages().ByName("MorseAuth") - fd_MorseAuth_accounts = md_MorseAuth.Fields().ByName("accounts") + md_MorseAuthAccount = File_poktroll_migration_legacy_proto.Messages().ByName("MorseAuthAccount") + fd_MorseAuthAccount_Type = md_MorseAuthAccount.Fields().ByName("Type") + fd_MorseAuthAccount_Value = md_MorseAuthAccount.Fields().ByName("Value") } -var _ protoreflect.Message = (*fastReflection_MorseAuth)(nil) +var _ protoreflect.Message = (*fastReflection_MorseAuthAccount)(nil) -type fastReflection_MorseAuth MorseAuth +type fastReflection_MorseAuthAccount MorseAuthAccount -func (x *MorseAuth) ProtoReflect() protoreflect.Message { - return (*fastReflection_MorseAuth)(x) +func (x *MorseAuthAccount) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseAuthAccount)(x) } -func (x *MorseAuth) slowProtoReflect() protoreflect.Message { +func (x *MorseAuthAccount) slowProtoReflect() protoreflect.Message { mi := &file_poktroll_migration_legacy_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2180,43 +2126,43 @@ func (x *MorseAuth) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MorseAuth_messageType fastReflection_MorseAuth_messageType -var _ protoreflect.MessageType = fastReflection_MorseAuth_messageType{} +var _fastReflection_MorseAuthAccount_messageType fastReflection_MorseAuthAccount_messageType +var _ protoreflect.MessageType = fastReflection_MorseAuthAccount_messageType{} -type fastReflection_MorseAuth_messageType struct{} +type fastReflection_MorseAuthAccount_messageType struct{} -func (x fastReflection_MorseAuth_messageType) Zero() protoreflect.Message { - return (*fastReflection_MorseAuth)(nil) +func (x fastReflection_MorseAuthAccount_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseAuthAccount)(nil) } -func (x fastReflection_MorseAuth_messageType) New() protoreflect.Message { - return new(fastReflection_MorseAuth) +func (x fastReflection_MorseAuthAccount_messageType) New() protoreflect.Message { + return new(fastReflection_MorseAuthAccount) } -func (x fastReflection_MorseAuth_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MorseAuth +func (x fastReflection_MorseAuthAccount_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuthAccount } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MorseAuth) Descriptor() protoreflect.MessageDescriptor { - return md_MorseAuth +func (x *fastReflection_MorseAuthAccount) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuthAccount } // 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_MorseAuth) Type() protoreflect.MessageType { - return _fastReflection_MorseAuth_messageType +func (x *fastReflection_MorseAuthAccount) Type() protoreflect.MessageType { + return _fastReflection_MorseAuthAccount_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MorseAuth) New() protoreflect.Message { - return new(fastReflection_MorseAuth) +func (x *fastReflection_MorseAuthAccount) New() protoreflect.Message { + return new(fastReflection_MorseAuthAccount) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MorseAuth) Interface() protoreflect.ProtoMessage { - return (*MorseAuth)(x) +func (x *fastReflection_MorseAuthAccount) Interface() protoreflect.ProtoMessage { + return (*MorseAuthAccount)(x) } // Range iterates over every populated field in an undefined order, @@ -2224,10 +2170,16 @@ func (x *fastReflection_MorseAuth) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MorseAuth) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Accounts) != 0 { - value := protoreflect.ValueOfList(&_MorseAuth_1_list{list: &x.Accounts}) - if !f(fd_MorseAuth_accounts, value) { +func (x *fastReflection_MorseAuthAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Type_ != "" { + value := protoreflect.ValueOfString(x.Type_) + if !f(fd_MorseAuthAccount_Type, value) { + return + } + } + if x.Value != nil { + value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + if !f(fd_MorseAuthAccount_Value, value) { return } } @@ -2244,15 +2196,17 @@ func (x *fastReflection_MorseAuth) Range(f func(protoreflect.FieldDescriptor, pr // 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_MorseAuth) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MorseAuthAccount) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.MorseAuth.accounts": - return len(x.Accounts) != 0 + case "poktroll.migration.MorseAuthAccount.Type": + return x.Type_ != "" + case "poktroll.migration.MorseAuthAccount.Value": + return x.Value != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) } } @@ -2262,15 +2216,17 @@ func (x *fastReflection_MorseAuth) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MorseAuth) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MorseAuthAccount) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.MorseAuth.accounts": - x.Accounts = nil + case "poktroll.migration.MorseAuthAccount.Type": + x.Type_ = "" + case "poktroll.migration.MorseAuthAccount.Value": + x.Value = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) } } @@ -2280,19 +2236,19 @@ func (x *fastReflection_MorseAuth) Clear(fd protoreflect.FieldDescriptor) { // 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_MorseAuth) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MorseAuthAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.MorseAuth.accounts": - if len(x.Accounts) == 0 { - return protoreflect.ValueOfList(&_MorseAuth_1_list{}) - } - listValue := &_MorseAuth_1_list{list: &x.Accounts} - return protoreflect.ValueOfList(listValue) + case "poktroll.migration.MorseAuthAccount.Type": + value := x.Type_ + return protoreflect.ValueOfString(value) + case "poktroll.migration.MorseAuthAccount.Value": + value := x.Value + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", descriptor.FullName())) } } @@ -2306,17 +2262,17 @@ func (x *fastReflection_MorseAuth) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MorseAuth) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MorseAuthAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.MorseAuth.accounts": - lv := value.List() - clv := lv.(*_MorseAuth_1_list) - x.Accounts = *clv.list + case "poktroll.migration.MorseAuthAccount.Type": + x.Type_ = value.Interface().(string) + case "poktroll.migration.MorseAuthAccount.Value": + x.Value = value.Message().Interface().(*MorseAccount) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) } } @@ -2330,45 +2286,48 @@ func (x *fastReflection_MorseAuth) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MorseAuth) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MorseAuthAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MorseAuth.accounts": - if x.Accounts == nil { - x.Accounts = []*MorseAuthAccount{} + case "poktroll.migration.MorseAuthAccount.Value": + if x.Value == nil { + x.Value = new(MorseAccount) } - value := &_MorseAuth_1_list{list: &x.Accounts} - return protoreflect.ValueOfList(value) + return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + case "poktroll.migration.MorseAuthAccount.Type": + panic(fmt.Errorf("field Type of message poktroll.migration.MorseAuthAccount is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount 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_MorseAuth) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MorseAuthAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MorseAuth.accounts": - list := []*MorseAuthAccount{} - return protoreflect.ValueOfList(&_MorseAuth_1_list{list: &list}) + case "poktroll.migration.MorseAuthAccount.Type": + return protoreflect.ValueOfString("") + case "poktroll.migration.MorseAuthAccount.Value": + m := new(MorseAccount) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) } - panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount 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_MorseAuth) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MorseAuthAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAuth", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAuthAccount", d.FullName())) } panic("unreachable") } @@ -2376,7 +2335,7 @@ func (x *fastReflection_MorseAuth) WhichOneof(d protoreflect.OneofDescriptor) pr // 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_MorseAuth) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MorseAuthAccount) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2387,7 +2346,7 @@ func (x *fastReflection_MorseAuth) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MorseAuth) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MorseAuthAccount) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2399,7 +2358,7 @@ func (x *fastReflection_MorseAuth) SetUnknown(fields protoreflect.RawFields) { // 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_MorseAuth) IsValid() bool { +func (x *fastReflection_MorseAuthAccount) IsValid() bool { return x != nil } @@ -2409,9 +2368,9 @@ func (x *fastReflection_MorseAuth) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MorseAuth) + x := input.Message.Interface().(*MorseAuthAccount) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2423,11 +2382,13 @@ func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if len(x.Accounts) > 0 { - for _, e := range x.Accounts { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } + l = len(x.Type_) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Value != nil { + l = options.Size(x.Value) + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -2439,7 +2400,7 @@ func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MorseAuth) + x := input.Message.Interface().(*MorseAuthAccount) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2458,21 +2419,26 @@ func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Accounts) > 0 { - for iNdEx := len(x.Accounts) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Accounts[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 x.Value != nil { + encoded, err := options.Marshal(x.Value) + 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.Type_) > 0 { + i -= len(x.Type_) + copy(dAtA[i:], x.Type_) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Type_))) + i-- + dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -2485,7 +2451,7 @@ func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MorseAuth) + x := input.Message.Interface().(*MorseAuthAccount) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2517,15 +2483,47 @@ func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuth: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuthAccount: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuth: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuthAccount: 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 Accounts", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Type_", 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.Type_ = 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 Value", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2552,8 +2550,10 @@ func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Accounts = append(x.Accounts, &MorseAuthAccount{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accounts[len(x.Accounts)-1]); err != nil { + if x.Value == nil { + x.Value = &MorseAccount{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Value); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -4401,10 +4401,13 @@ func (x *fastReflection_MorseValidator) ProtoMethods() *protoiface.Methods { // source: poktroll/migration/legacy.proto // Types in this file are ONLY present to facilitate the verifiability of the -// migration state from Morse to Shannon. These types are used by the migration -// subcommand (e.g. `poktrolld migrate collect-morse-accounts ...) to transform -// the Morse state export into the Shannon state import. They ARE NOT persisted -// on-chain at any point. +// migration state from Morse to Shannon. +// +// These types are used by the migration subcommand to transform +// the Morse state export into the Shannon state import. +// Ref: `poktrolld migrate collect-morse-accounts ...` +// +// They ARE NOT persisted on-chain at any point.package poktroll.migration; const ( // Verify that this generated code is sufficiently up-to-date. @@ -4413,12 +4416,17 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// MorseStateExport is the data structure that is serialized and output when running +// `pocket utils export-genesis-for-reset`. +// See: https://editor.swagger.io/?url=https://raw.githubusercontent.com/pokt-network/pocket-core/staging/doc/specs/rpc-spec.yaml#operations-query-post_query_state type MorseStateExport struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AppHash string `protobuf:"bytes,1,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + // app_hash is the Morse tendermint state hash. + AppHash string `protobuf:"bytes,1,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + // app_state is the entire Morse tendermint application state. AppState *MorseAppState `protobuf:"bytes,2,opt,name=app_state,json=appState,proto3" json:"app_state,omitempty"` } @@ -4456,6 +4464,8 @@ func (x *MorseStateExport) GetAppState() *MorseAppState { return nil } +// MorseAppState is the tendermint application state for the Morse tendermint +// application; not to be confused with the pokt protocol actor. type MorseAppState struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4507,6 +4517,7 @@ func (x *MorseAppState) GetPos() *MorsePos { return nil } +// A wrapper around the list of MorseApplications, necessary in order to conform to the Morse genesis structure. type MorseApplications struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4542,17 +4553,17 @@ func (x *MorseApplications) GetApplications() []*MorseApplication { return nil } -type MorseAuthAccount struct { +// A wrapper around a list of Morse accounts. +type MorseAuth struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type_ string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` - Value *MorseAccount `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` + Accounts []*MorseAuthAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` } -func (x *MorseAuthAccount) Reset() { - *x = MorseAuthAccount{} +func (x *MorseAuth) Reset() { + *x = MorseAuth{} if protoimpl.UnsafeEnabled { mi := &file_poktroll_migration_legacy_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4560,41 +4571,41 @@ func (x *MorseAuthAccount) Reset() { } } -func (x *MorseAuthAccount) String() string { +func (x *MorseAuth) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MorseAuthAccount) ProtoMessage() {} +func (*MorseAuth) ProtoMessage() {} -// Deprecated: Use MorseAuthAccount.ProtoReflect.Descriptor instead. -func (*MorseAuthAccount) Descriptor() ([]byte, []int) { +// Deprecated: Use MorseAuth.ProtoReflect.Descriptor instead. +func (*MorseAuth) Descriptor() ([]byte, []int) { return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{3} } -func (x *MorseAuthAccount) GetType_() string { - if x != nil { - return x.Type_ - } - return "" -} - -func (x *MorseAuthAccount) GetValue() *MorseAccount { +func (x *MorseAuth) GetAccounts() []*MorseAuthAccount { if x != nil { - return x.Value + return x.Accounts } return nil } -type MorseAuth struct { +// A wrapper around Morse account information, necessary in order to to confirm to the Morse genesis +// structure. Morse originally serialized accounts as pb.Any types in order to support multiple +// account types. For the purposes of the Morse -> Shannon migration, we're only concerned with +// externally owned accounts (as opposed to module accounts). As a result, we're simplifying its +// representation in Shannon by avoiding usage of pb.Any. It is necessary in order too conform to +// the Morse genesis structure. +type MorseAuthAccount struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Accounts []*MorseAuthAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + Type_ string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` + Value *MorseAccount `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` } -func (x *MorseAuth) Reset() { - *x = MorseAuth{} +func (x *MorseAuthAccount) Reset() { + *x = MorseAuthAccount{} if protoimpl.UnsafeEnabled { mi := &file_poktroll_migration_legacy_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4602,24 +4613,33 @@ func (x *MorseAuth) Reset() { } } -func (x *MorseAuth) String() string { +func (x *MorseAuthAccount) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MorseAuth) ProtoMessage() {} +func (*MorseAuthAccount) ProtoMessage() {} -// Deprecated: Use MorseAuth.ProtoReflect.Descriptor instead. -func (*MorseAuth) Descriptor() ([]byte, []int) { +// Deprecated: Use MorseAuthAccount.ProtoReflect.Descriptor instead. +func (*MorseAuthAccount) Descriptor() ([]byte, []int) { return file_poktroll_migration_legacy_proto_rawDescGZIP(), []int{4} } -func (x *MorseAuth) GetAccounts() []*MorseAuthAccount { +func (x *MorseAuthAccount) GetType_() string { if x != nil { - return x.Accounts + return x.Type_ + } + return "" +} + +func (x *MorseAuthAccount) GetValue() *MorseAccount { + if x != nil { + return x.Value } return nil } +// A wrapper around the list of Morse suppliers (aka "validators", "nodes", of "servicers"). +// It is necessary to conform to the Morse genesis structure. type MorsePos struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4655,15 +4675,18 @@ func (x *MorsePos) GetValidators() []*MorseValidator { return nil } -// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates -// the minimum information required to import Morse applications. +// MorseApplication is a subset of the Morse ProtoApplication type. +// It encapsulates the minimum information required to import Morse applications. // See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 type MorseApplication struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Address is a hex-encoded string representation of the address corresponding + // to a Morse application's ed25519 public key. + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // PublicKey is the binary representation of a Morse application's ed25519 public key. PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` @@ -4725,8 +4748,8 @@ func (x *MorseApplication) GetStakedTokens() string { return "" } -// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the -// minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// MorseValidator is a subset of the Morse ProtoValidator type. +// It encapsulates the minimum information required to import Morse suppliers (aka "servicers" or "validators"). // See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 type MorseValidator struct { state protoimpl.MessageState @@ -4834,26 +4857,26 @@ var file_poktroll_migration_legacy_proto_rawDesc = []byte{ 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0xea, 0xde, 0x1f, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0c, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x73, 0x0a, 0x10, 0x4d, - 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x1c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xea, - 0xde, 0x1f, 0x04, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, - 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x09, - 0xea, 0xde, 0x1f, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0x5b, 0x0a, 0x09, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x12, 0x4e, 0x0a, - 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x5e, 0x0a, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5b, 0x0a, 0x09, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x12, 0x4e, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x08, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x73, 0x0a, 0x10, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x04, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xea, 0xde, 0x1f, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x05, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x09, 0xea, 0xde, 0x1f, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5e, 0x0a, 0x08, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x12, 0x52, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x73, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0xd7, 0x02, + 0x73, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0xe3, 0x02, 0x0a, 0x10, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x66, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, @@ -4872,42 +4895,43 @@ var file_poktroll_migration_legacy_proto_rawDesc = []byte{ 0x6c, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x1b, 0xea, 0xde, 0x1f, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0xf2, 0xde, 0x1f, 0x0d, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x6b, - 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x08, 0x88, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc1, 0x02, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, - 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x66, 0x0a, 0x07, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, - 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x09, 0x50, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, - 0x64, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, - 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, - 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x0c, 0x88, - 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0xb7, 0x01, 0xd8, 0xe2, - 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, - 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, - 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x6b, + 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x0c, 0x73, 0x74, 0x61, + 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, + 0xa0, 0x1f, 0x01, 0x22, 0xc1, 0x02, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x66, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, + 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, + 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x12, 0x22, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x06, 0x6a, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x0c, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x0c, 0x53, 0x74, 0x61, + 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, 0x00, 0x98, + 0xa0, 0x1f, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0xb7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, + 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4927,8 +4951,8 @@ var file_poktroll_migration_legacy_proto_goTypes = []interface{}{ (*MorseStateExport)(nil), // 0: poktroll.migration.MorseStateExport (*MorseAppState)(nil), // 1: poktroll.migration.MorseAppState (*MorseApplications)(nil), // 2: poktroll.migration.MorseApplications - (*MorseAuthAccount)(nil), // 3: poktroll.migration.MorseAuthAccount - (*MorseAuth)(nil), // 4: poktroll.migration.MorseAuth + (*MorseAuth)(nil), // 3: poktroll.migration.MorseAuth + (*MorseAuthAccount)(nil), // 4: poktroll.migration.MorseAuthAccount (*MorsePos)(nil), // 5: poktroll.migration.MorsePos (*MorseApplication)(nil), // 6: poktroll.migration.MorseApplication (*MorseValidator)(nil), // 7: poktroll.migration.MorseValidator @@ -4937,11 +4961,11 @@ var file_poktroll_migration_legacy_proto_goTypes = []interface{}{ var file_poktroll_migration_legacy_proto_depIdxs = []int32{ 1, // 0: poktroll.migration.MorseStateExport.app_state:type_name -> poktroll.migration.MorseAppState 2, // 1: poktroll.migration.MorseAppState.application:type_name -> poktroll.migration.MorseApplications - 4, // 2: poktroll.migration.MorseAppState.auth:type_name -> poktroll.migration.MorseAuth + 3, // 2: poktroll.migration.MorseAppState.auth:type_name -> poktroll.migration.MorseAuth 5, // 3: poktroll.migration.MorseAppState.pos:type_name -> poktroll.migration.MorsePos 6, // 4: poktroll.migration.MorseApplications.applications:type_name -> poktroll.migration.MorseApplication - 8, // 5: poktroll.migration.MorseAuthAccount.Value:type_name -> poktroll.migration.MorseAccount - 3, // 6: poktroll.migration.MorseAuth.accounts:type_name -> poktroll.migration.MorseAuthAccount + 4, // 5: poktroll.migration.MorseAuth.accounts:type_name -> poktroll.migration.MorseAuthAccount + 8, // 6: poktroll.migration.MorseAuthAccount.Value:type_name -> poktroll.migration.MorseAccount 7, // 7: poktroll.migration.MorsePos.validators:type_name -> poktroll.migration.MorseValidator 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type @@ -4994,7 +5018,7 @@ func file_poktroll_migration_legacy_proto_init() { } } file_poktroll_migration_legacy_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MorseAuthAccount); i { + switch v := v.(*MorseAuth); i { case 0: return &v.state case 1: @@ -5006,7 +5030,7 @@ func file_poktroll_migration_legacy_proto_init() { } } file_poktroll_migration_legacy_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MorseAuth); i { + switch v := v.(*MorseAuthAccount); i { case 0: return &v.state case 1: diff --git a/cmd/poktrolld/cmd/migrate/errors.go b/cmd/poktrolld/cmd/migrate/errors.go new file mode 100644 index 000000000..dc21a7f0c --- /dev/null +++ b/cmd/poktrolld/cmd/migrate/errors.go @@ -0,0 +1,14 @@ +package migrate + +import sdkerrors "cosmossdk.io/errors" + +const codespace = "poktrolld/migrate" + +var ( + // ErrInvalidUsage usage is returned when the CLI arguments are invalid. + ErrInvalidUsage = sdkerrors.Register(codespace, 1100, "invalid usage") + // ErrMorseExportState is returned with the JSON generated from `pocket util export-genesis-for-reset` is invalid. + ErrMorseExportState = sdkerrors.Register(codespace, 1101, "morse export state") + // ErrMorseStateTransform is returned upon general failure when transforming the MorseExportState into the MorseAccountState. + ErrMorseStateTransform = sdkerrors.Register(codespace, 1102, "morse state transform") +) diff --git a/cmd/poktrolld/cmd/migrate/migrate.go b/cmd/poktrolld/cmd/migrate/migrate.go index ae0cccddc..035e4bdab 100644 --- a/cmd/poktrolld/cmd/migrate/migrate.go +++ b/cmd/poktrolld/cmd/migrate/migrate.go @@ -2,6 +2,7 @@ package migrate import ( "fmt" + "io" "os" cosmosmath "cosmossdk.io/math" @@ -9,65 +10,116 @@ import ( "github.com/spf13/cobra" "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/pkg/polylog" + "github.com/pokt-network/poktroll/pkg/polylog/polyzero" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) -var collectMorseAccountsCmd = &cobra.Command{ - Use: "collect-morse-accounts [morse-state-path] [morse-accounts-path]", - Args: cobra.ExactArgs(2), - Short: "Collect all account balances and corresponding stakes from the JSON file at [morse-state-path] and outputs them as JSON to [morse-accounts-path]", - Long: `Collects the account balances and corresponding stakes from the MorseStateExport JSON file at morse-state-path +var ( + flagDebugAccountsPerLog int + flagLogLevel string + flagLogOutput string + logger polylog.Logger + + collectMorseAccountsCmd = &cobra.Command{ + Use: "collect-morse-accounts [morse-state-export-path] [morse-account-state-path]", + Args: cobra.ExactArgs(2), + Short: "Collect all account balances and corresponding stakes from the JSON file at [morse-state-export-path] and outputs them as JSON to [morse-account-state-path]", + Long: `Collects the account balances and corresponding stakes from the MorseStateExport JSON file at morse-state-path and outputs them as a MorseAccountState JSON to morse-accounts-path for use with Shannon's MsgUploadMorseState. The Morse state export is generated via the Morse CLI: pocket util export-genesis-for-reset [height] [new-chain-id] > morse-state-export.json`, - RunE: runCollectMorseAccounts, -} + PreRunE: func(cmd *cobra.Command, args []string) error { + var ( + logOutput io.Writer + err error + ) + logLevel := polyzero.ParseLevel(flagLogLevel) + if flagLogOutput == "-" { + logOutput = os.Stderr + } else { + logOutput, err = os.Open(flagLogOutput) + if err != nil { + return err + } + } + + logger = polyzero.NewLogger( + polyzero.WithLevel(logLevel), + polyzero.WithOutput(logOutput), + ).With("cmd", "migrate") + return nil + }, + RunE: runCollectMorseAccounts, + } +) func MigrateCmd() *cobra.Command { - cmd := &cobra.Command{ + migrateCmd := &cobra.Command{ Use: "migrate", Short: "Migration commands", } - cmd.AddCommand(collectMorseAccountsCmd) + migrateCmd.AddCommand(collectMorseAccountsCmd) + migrateCmd.PersistentFlags().StringVar(&flagLogLevel, "log-level", "info", "The logging level (debug|info|warn|error)") + migrateCmd.PersistentFlags().StringVar(&flagLogOutput, "log-output", "-", "The logging output (file path); defaults to stdout") + + collectMorseAccountsCmd.Flags().IntVar(&flagDebugAccountsPerLog, "debug-accounts-per-log", 0, "The number of accounts to log per debug message") - return cmd + return migrateCmd } // runCollectedMorseAccounts is run by the `poktrolld migrate collect-morse-accounts` command. -func runCollectMorseAccounts(cmd *cobra.Command, args []string) error { - inputPath := args[0] - outputPath := args[1] +func runCollectMorseAccounts(_ *cobra.Command, args []string) error { + // DEV_NOTE: No need to check args length due to cobra.ExactArgs(2). + morseStateExportPath := args[0] + morseAccountStatePath := args[1] - return collectMorseAccounts(inputPath, outputPath) -} + logger.Info(). + Str("morse_state_export_path", morseStateExportPath). + Str("morse_account_state_path", morseAccountStatePath). + Msg("collecting Morse accounts...") -// collectMorseAccounts transforms the JSON serialized MorseStateExport at -// inputStatePath into a JSON serialized MorseAccountState at outputStatePath. -func collectMorseAccounts(inputStatePath, outputStatePath string) error { - if err := validatePathIsFile(inputStatePath); err != nil { + morseWorkspace, err := collectMorseAccounts(morseStateExportPath, morseAccountStatePath) + if err != nil { return err } - inputStateJSON, err := os.ReadFile(inputStatePath) + return morseWorkspace.infoLogComplete() +} + +// collectMorseAccounts reads and transforms the JSON serialized MorseStateExport +// at morseStateExportPath into a JSON serialized MorseAccountState, and then writes +// it to morseAccountStatePath. +func collectMorseAccounts(morseStateExportPath, morseAccountStatePath string) (*morseImportWorkspace, error) { + if err := validatePathIsFile(morseStateExportPath); err != nil { + return nil, err + } + + inputStateJSON, err := os.ReadFile(morseStateExportPath) if err != nil { - return err + return nil, err } inputState := new(migrationtypes.MorseStateExport) if err = cmtjson.Unmarshal(inputStateJSON, inputState); err != nil { - return err + return nil, err + } + + morseWorkspace := newMorseImportWorkspace() + if err := transformMorseState(inputState, morseWorkspace); err != nil { + return nil, err } - outputStateJSON, err := transformMorseState(inputState) + outputStateJSONBz, err := cmtjson.Marshal(morseWorkspace.accountState) if err != nil { - return err + return nil, err } - if err = os.WriteFile(outputStatePath, outputStateJSON, 0644); err != nil { - return err + if err = os.WriteFile(morseAccountStatePath, outputStateJSONBz, 0644); err != nil { + return nil, err } - return nil + return morseWorkspace, nil } // validatePathIsFile returns an error if the given path does not exist or is not a file. @@ -78,51 +130,62 @@ func validatePathIsFile(path string) error { } if info.IsDir() { - return fmt.Errorf("[morse-JSON-input-path] cannot be a directory") + return ErrInvalidUsage.Wrapf("[morse-JSON-input-path] cannot be a directory: %s", path) } - return nil } // transformMorseState consolidates the Morse account balance, application stake, // and supplier stake for each account as an entry in the resulting MorseAccountState. -func transformMorseState(inputState *migrationtypes.MorseStateExport) ([]byte, error) { - morseWorkspace := &morseImportWorkspace{ - addressToIdx: make(map[string]uint64), - accounts: make([]*migrationtypes.MorseAccount, 0), - } - +func transformMorseState( + inputState *migrationtypes.MorseStateExport, + morseWorkspace *morseImportWorkspace, +) error { // Iterate over accounts and copy the balances. + logger.Info().Msg("collecting account balances...") if err := collectInputAccountBalances(inputState, morseWorkspace); err != nil { - return nil, err + return err } // Iterate over applications and add the stakes to the corresponding account balances. + logger.Info().Msg("collecting application stakes...") if err := collectInputApplicationStakes(inputState, morseWorkspace); err != nil { - return nil, err + return err } // Iterate over suppliers and add the stakes to the corresponding account balances. + logger.Info().Msg("collecting supplier stakes...") err := collectInputSupplierStakes(inputState, morseWorkspace) if err != nil { - return nil, err + return err } - morseAccountState := &migrationtypes.MorseAccountState{Accounts: morseWorkspace.accounts} - return cmtjson.Marshal(morseAccountState) + morseWorkspace.accountState = &migrationtypes.MorseAccountState{Accounts: morseWorkspace.accounts} + return nil } // collectInputAccountBalances iterates over the accounts in the inputState and // adds the balances to the corresponding account balances in the morseWorkspace. func collectInputAccountBalances(inputState *migrationtypes.MorseStateExport, morseWorkspace *morseImportWorkspace) error { - for _, exportAccount := range inputState.AppState.Auth.Accounts { + for exportAccountIdx, exportAccount := range inputState.AppState.Auth.Accounts { + if shouldDebugLogProgress(exportAccountIdx) { + morseWorkspace.debugLogProgress(exportAccountIdx) + } + // DEV_NOTE: Ignore module accounts. if exportAccount.Type != "posmint/Account" { + logger.Warn(). + Str("type", exportAccount.Type). + Str("address", exportAccount.Value.Address.String()). + Str("coins", fmt.Sprintf("%s", exportAccount.Value.Coins)). + Msg("ignoring non-EOA account") continue } addr := exportAccount.Value.Address.String() - morseWorkspace.ensureAccount(addr, exportAccount) + if _, _, err := morseWorkspace.ensureAccount(addr, exportAccount); err != nil { + return err + } coins := exportAccount.Value.Coins if len(coins) == 0 { @@ -130,18 +193,52 @@ func collectInputAccountBalances(inputState *migrationtypes.MorseStateExport, mo } // DEV_NOTE: SHOULD ONLY be one denom (upokt). + if len(coins) != 1 { + return ErrMorseExportState.Wrapf( + "account %q has %d token denominations, expected upokt only: %s", + addr, len(coins), coins, + ) + } + coin := coins[0] if coin.Denom != volatile.DenomuPOKT { - return fmt.Errorf("unsupported denom %q", coin.Denom) + return ErrMorseExportState.Wrapf("unsupported denom %q", coin.Denom) } if err := morseWorkspace.addUpokt(addr, coin.Amount); err != nil { - return err + return fmt.Errorf( + "adding morse account balance (%s) to account balance of address %q: %w", + coin, addr, err, + ) } } return nil } +// shouldDebugLogProgress returns true if the given exportAccountIdx should be logged +// via debugLogProgress. +func shouldDebugLogProgress(exportAccountIdx int) bool { + return flagDebugAccountsPerLog > 0 && + exportAccountIdx%flagDebugAccountsPerLog == 0 +} + +// debugLogProgress logs the total balances, app stakes, and supplier stakes of +// all accounts that have been processed. +func debugLogProgress(exportAccountIdx int, morseWorkspace *morseImportWorkspace) { + totalBalance := morseWorkspace.totalBalance() + totalAppStake := morseWorkspace.totalAppStake() + totalSupplierStake := morseWorkspace.totalSupplierStake() + grandTotal := totalBalance.Add(totalAppStake).Add(totalSupplierStake) + + logger.Debug(). + Int("account_idx", exportAccountIdx). + Str("total_balance", totalBalance.String()). + Str("total_app_stake", totalAppStake.String()). + Str("total_supplier_stake", totalSupplierStake.String()). + Str("grand_total", grandTotal.String()). + Msg("processing accounts...") +} + // collectInputApplicationStakes iterates over the applications in the inputState and // adds the stake to the corresponding account balances in the morseWorkspace. func collectInputApplicationStakes(inputState *migrationtypes.MorseStateExport, morseWorkspace *morseImportWorkspace) error { @@ -150,17 +247,19 @@ func collectInputApplicationStakes(inputState *migrationtypes.MorseStateExport, // DEV_NOTE: An account SHOULD exist for each actor. if !morseWorkspace.hasAccount(addr) { - // TODO_IN_THIS_COMMIT: consolidate error types... - return fmt.Errorf("account %q not found", addr) + return ErrMorseExportState.Wrapf("account not found corresponding to application with address %q", addr) } appStakeAmtUpokt, ok := cosmosmath.NewIntFromString(exportApplication.StakedTokens) if !ok { - return fmt.Errorf("failed to parse application stake amount %q", exportApplication.StakedTokens) + return ErrMorseExportState.Wrapf("failed to parse application stake amount %q", exportApplication.StakedTokens) } if err := morseWorkspace.addUpokt(addr, appStakeAmtUpokt); err != nil { - return err + return fmt.Errorf( + "adding application stake amount to account balance of address %q: %w", + addr, err, + ) } } return nil @@ -174,17 +273,19 @@ func collectInputSupplierStakes(inputState *migrationtypes.MorseStateExport, mor // DEV_NOTE: An account SHOULD exist for each actor. if !morseWorkspace.hasAccount(addr) { - // TODO_IN_THIS_COMMIT: consolidate error types... - return fmt.Errorf("account %q not found", addr) + return ErrMorseExportState.Wrapf("account not found corresponding to supplier with address %q", addr) } supplierStakeAmtUpokt, ok := cosmosmath.NewIntFromString(exportSupplier.StakedTokens) if !ok { - return fmt.Errorf("failed to parse supplier stake amount %q", exportSupplier.StakedTokens) + return ErrMorseExportState.Wrapf("failed to parse supplier stake amount %q", exportSupplier.StakedTokens) } if err := morseWorkspace.addUpokt(addr, supplierStakeAmtUpokt); err != nil { - return err + return fmt.Errorf( + "adding supplier stake amount to account balance of address %q: %w", + addr, err, + ) } } return nil diff --git a/cmd/poktrolld/cmd/migrate/migrate_test.go b/cmd/poktrolld/cmd/migrate/migrate_test.go index dee73474d..27c453ac8 100644 --- a/cmd/poktrolld/cmd/migrate/migrate_test.go +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -17,9 +17,15 @@ import ( "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/pkg/polylog/polyzero" migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) +func init() { + logger = polyzero.NewLogger(polyzero.WithLevel(polyzero.DebugLevel)) + flagDebugAccountsPerLog = 1 +} + func TestCollectMorseAccounts(t *testing.T) { tmpDir := t.TempDir() outputPath := filepath.Join(tmpDir, "morse-state-output.json") @@ -34,7 +40,7 @@ func TestCollectMorseAccounts(t *testing.T) { require.NoError(t, err) // Call the function under test. - err = collectMorseAccounts(inputFile.Name(), outputPath) + _, err = collectMorseAccounts(inputFile.Name(), outputPath) require.NoError(t, err) outputJSON, err := os.ReadFile(outputPath) @@ -63,14 +69,12 @@ func TestNewTestMorseStateExport(t *testing.T) { require.Equal(t, i, len(exportAccounts)) expectedShannonBalance := fmt.Sprintf("%d%d%d0%d%d%d", i, i, i, i, i, i) - morseAccountState := new(migrationtypes.MorseAccountState) - morseAccountStateBz, err := transformMorseState(morseStateExport) - require.NoError(t, err) - - err = cmtjson.Unmarshal(morseAccountStateBz, morseAccountState) + morseWorkspace := newMorseImportWorkspace() + err = transformMorseState(morseStateExport, morseWorkspace) require.NoError(t, err) - require.Equal(t, expectedShannonBalance, morseAccountState.Accounts[i-1].Coins[0].Amount.String()) + morseAccounts := morseWorkspace.accountState.Accounts[i-1] + require.Equal(t, expectedShannonBalance, morseAccounts.Coins[0].Amount.String()) }) } } @@ -84,11 +88,12 @@ func BenchmarkTransformMorseState(b *testing.B) { require.NoError(b, err) b.Run(fmt.Sprintf("num_accounts=%d", numAccounts), func(b *testing.B) { + morseWorkspace := newMorseImportWorkspace() // Call the function under test. b.ResetTimer() for i := 0; i < b.N; i++ { - _, err = transformMorseState(morseStateExport) + err = transformMorseState(morseStateExport, morseWorkspace) require.NoError(b, err) } }) diff --git a/cmd/poktrolld/cmd/migrate/types.go b/cmd/poktrolld/cmd/migrate/types.go index 6356fb2a7..828137ce4 100644 --- a/cmd/poktrolld/cmd/migrate/types.go +++ b/cmd/poktrolld/cmd/migrate/types.go @@ -10,11 +10,49 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) +// newMorseImportWorkspace returns a new morseImportWorkspace with fields initialized to their zero values. +func newMorseImportWorkspace() *morseImportWorkspace { + return &morseImportWorkspace{ + addressToIdx: make(map[string]uint64), + accounts: make([]*migrationtypes.MorseAccount, 0), + lastAccTotalBalance: cosmosmath.ZeroInt(), + lastAccTotalAppStake: cosmosmath.ZeroInt(), + lastAccTotalSupplierStake: cosmosmath.ZeroInt(), + } +} + // morseImportWorkspace is a helper struct that is used to consolidate the Morse account balance, // application stake, and supplier stake for each account as an entry in the resulting MorseAccountState. type morseImportWorkspace struct { + // addressToIdx is a map from the Shannon bech32 address to the index of the + // corresponding MorseAccount in the accounts slice. addressToIdx map[string]uint64 - accounts []*migrationtypes.MorseAccount + // accounts is a slice of MorseAccount objects that, when populated, will be + // used to construct the final MorseAccountState. + accounts []*migrationtypes.MorseAccount + + // accountState is the final MorseAccountState that will be imported into Shannon. + accountState *migrationtypes.MorseAccountState + + // lastAccAccountIdx is the index at which the most recent accumulation/totaling + // (of actor counts, balances, and stakes) was performed such that the next + // accumulation/totaling operation may reuse previous accumulations values. + lastAccAccountIdx uint64 + // lastAccTotalBalance is the most recently accumulated balances of all Morse + // accounts which have been processed. + lastAccTotalBalance cosmosmath.Int + // lastAccTotalAppStake is the most recently accumulated application stakes of + // all Morse accounts which have been processed. + lastAccTotalAppStake cosmosmath.Int + // lastAccTotalSupplierStake is the most recently accumulated supplier stakes of + // all Morse accounts which have been processed. + lastAccTotalSupplierStake cosmosmath.Int + // numAccounts is the number of accounts that have been processed. + numAccounts uint64 + // numApplications is the number of applications that have been processed. + numApplications uint64 + // numSuppliers is the number of suppliers that have been processed. + numSuppliers uint64 } // nextIdx returns the next index to be used when appending a new account to the accounts slice. @@ -28,22 +66,100 @@ func (miw *morseImportWorkspace) hasAccount(addr string) bool { return ok } +// TODO_IN_THIS_COMMIT: godoc... +func (miw *morseImportWorkspace) debugLogProgress(accountIdx int) { + totalBalance := miw.totalBalance() + totalAppStake := miw.totalAppStake() + totalSupplierStake := miw.totalSupplierStake() + grandTotal := totalBalance.Add(totalAppStake).Add(totalSupplierStake) + + logger.Debug(). + Int("account_idx", accountIdx). + Uint64("num_accounts", miw.numAccounts). + Uint64("num_applications", miw.numApplications). + Uint64("num_suppliers", miw.numSuppliers). + Str("total_balance", totalBalance.String()). + Str("total_app_stake", totalAppStake.String()). + Str("total_supplier_stake", totalSupplierStake.String()). + Str("grand_total", grandTotal.String()). + Msg("processing accounts...") +} + +// TODO_IN_THIS_COMMIT: godoc... +func (miw *morseImportWorkspace) infoLogComplete() error { + accountStateHash, err := miw.accountState.GetHash() + if err != nil { + return err + } + + logger.Info(). + Uint64("num_accounts", miw.numAccounts). + Uint64("num_applications", miw.numApplications). + Uint64("num_suppliers", miw.numSuppliers). + Str("total_balance", miw.totalBalance().String()). + Str("total_app_stake", miw.totalAppStake().String()). + Str("total_supplier_stake", miw.totalSupplierStake().String()). + Str("grand_total", miw.grandTotal().String()). + Str("morse_account_state_hash", fmt.Sprintf("%x", accountStateHash)). + Msg("processing accounts...") + return nil +} + +// TODO_IN_THIS_COMMIT: godoc... +func (miw *morseImportWorkspace) totalBalance() cosmosmath.Int { + miw.accumulateTotals() + return miw.lastAccTotalBalance +} + +// TODO_IN_THIS_COMMIT: godoc... +func (miw *morseImportWorkspace) totalAppStake() cosmosmath.Int { + miw.accumulateTotals() + return miw.lastAccTotalAppStake +} + +// TODO_IN_THIS_COMMIT: godoc... +func (miw *morseImportWorkspace) totalSupplierStake() cosmosmath.Int { + miw.accumulateTotals() + return miw.lastAccTotalSupplierStake +} + +// TODO_IN_THIS_COMMIT: godoc... +func (miw *morseImportWorkspace) grandTotal() cosmosmath.Int { + return miw.totalBalance(). + Add(miw.totalAppStake()). + Add(miw.totalSupplierStake()) +} + +// TODO_IN_THIS_COMMIT: godoc... +func (miw *morseImportWorkspace) accumulateTotals() { + for idx, account := range miw.accounts[miw.lastAccAccountIdx:] { + miw.lastAccTotalBalance = miw.lastAccTotalBalance.Add(account.Coins[0].Amount) + miw.lastAccTotalAppStake = miw.lastAccTotalAppStake.Add(account.Coins[0].Amount) + miw.lastAccTotalSupplierStake = miw.lastAccTotalSupplierStake.Add(account.Coins[0].Amount) + miw.lastAccAccountIdx = uint64(idx) + } +} + // ensureAccount ensures that the given address is present in the accounts slice // and that its corresponding address is in the addressToIdx map. If the address // is not present, it is added to the accounts slice and the addressToIdx map. func (miw *morseImportWorkspace) ensureAccount( addr string, exportAccount *migrationtypes.MorseAuthAccount, -) (accountIdx uint64, balance cosmostypes.Coin) { +) (accountIdx uint64, balance cosmostypes.Coin, err error) { var ok bool balance = cosmostypes.NewCoin(volatile.DenomuPOKT, cosmosmath.ZeroInt()) if accountIdx, ok = miw.addressToIdx[addr]; ok { + logger.Warn().Str("address", addr).Msg("unexpected workspace state: account already exists") + importAccount := miw.accounts[accountIdx] - // TODO_IN_THIS_COMMIT: comment... SHOULD ONLY be one denom (upokt). - if len(importAccount.Coins) != 0 { - balance = importAccount.Coins[0] + // Each account should have EXACTLY one token denomination. + if len(importAccount.Coins) != 1 { + err := ErrMorseStateTransform.Wrapf("account %q has multiple token denominations: %s", addr, importAccount.Coins) + return 0, cosmostypes.Coin{}, err } + balance = importAccount.Coins[0] } else { accountIdx = miw.nextIdx() importAccount := &migrationtypes.MorseAccount{ @@ -55,18 +171,32 @@ func (miw *morseImportWorkspace) ensureAccount( miw.addressToIdx[addr] = accountIdx } - return accountIdx, balance + return accountIdx, balance, nil } // addUpokt adds the given amount to the corresponding account balances in the morseWorkspace. func (miw *morseImportWorkspace) addUpokt(addr string, amount cosmosmath.Int) error { importAccountIdx, hasAccountAddr := miw.addressToIdx[addr] if !hasAccountAddr { - return fmt.Errorf("account %q not found", addr) + return ErrMorseStateTransform.Wrapf("account %q not found", addr) } account := miw.accounts[importAccountIdx] - account.Coins[0].Amount = account.Coins[0].Amount.Add(amount) + if len(account.Coins) != 1 { + return ErrMorseStateTransform.Wrapf( + "account %q has %d token denominations, expected upokt only: %s", + addr, len(account.Coins), account.Coins, + ) + } + upoktCoins := account.Coins[0] + if upoktCoins.Denom != volatile.DenomuPOKT { + return fmt.Errorf( + "account %q has %s token denomination, expected upokt only: %s", + addr, upoktCoins.Denom, account.Coins, + ) + } + + account.Coins[0].Amount = account.Coins[0].Amount.Add(amount) return nil } diff --git a/e2e/tests/update_params_test.go b/e2e/tests/update_params_test.go index 27c0be4d0..7c08a182b 100644 --- a/e2e/tests/update_params_test.go +++ b/e2e/tests/update_params_test.go @@ -15,14 +15,14 @@ import ( "github.com/regen-network/gocuke" "github.com/stretchr/testify/require" - "github.com/pokt-network/poktroll/api/poktroll/application" - "github.com/pokt-network/poktroll/api/poktroll/gateway" - "github.com/pokt-network/poktroll/api/poktroll/proof" - "github.com/pokt-network/poktroll/api/poktroll/service" - "github.com/pokt-network/poktroll/api/poktroll/session" - "github.com/pokt-network/poktroll/api/poktroll/shared" - "github.com/pokt-network/poktroll/api/poktroll/supplier" - "github.com/pokt-network/poktroll/api/poktroll/tokenomics" + /// "github.com/pokt-network/poktroll/api/poktroll/application" + /// "github.com/pokt-network/poktroll/api/poktroll/gateway" + /// "github.com/pokt-network/poktroll/api/poktroll/proof" + /// "github.com/pokt-network/poktroll/api/poktroll/service" + /// "github.com/pokt-network/poktroll/api/poktroll/session" + /// "github.com/pokt-network/poktroll/api/poktroll/shared" + /// "github.com/pokt-network/poktroll/api/poktroll/supplier" + /// "github.com/pokt-network/poktroll/api/poktroll/tokenomics" apptypes "github.com/pokt-network/poktroll/x/application/types" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" diff --git a/proto/poktroll/migration/legacy.proto b/proto/poktroll/migration/legacy.proto index c2d4da2e3..421aa3f52 100644 --- a/proto/poktroll/migration/legacy.proto +++ b/proto/poktroll/migration/legacy.proto @@ -1,10 +1,13 @@ syntax = "proto3"; // Types in this file are ONLY present to facilitate the verifiability of the -// migration state from Morse to Shannon. These types are used by the migration -// subcommand (e.g. `poktrolld migrate collect-morse-accounts ...) to transform -// the Morse state export into the Shannon state import. They ARE NOT persisted -// on-chain at any point. +// migration state from Morse to Shannon. +// +// These types are used by the migration subcommand to transform +// the Morse state export into the Shannon state import. +// Ref: `poktrolld migrate collect-morse-accounts ...` +// +// They ARE NOT persisted on-chain at any point.package poktroll.migration; package poktroll.migration; import "gogoproto/gogo.proto"; @@ -13,46 +16,66 @@ import "poktroll/migration/types.proto"; option go_package = "github.com/pokt-network/poktroll/x/migration/types"; option (gogoproto.stable_marshaler_all) = true; +// MorseStateExport is the data structure that is serialized and output when running +// `pocket utils export-genesis-for-reset`. +// See: https://editor.swagger.io/?url=https://raw.githubusercontent.com/pokt-network/pocket-core/staging/doc/specs/rpc-spec.yaml#operations-query-post_query_state message MorseStateExport { + // app_hash is the Morse tendermint state hash. string app_hash = 1 [(gogoproto.jsontag) = "app_hash"]; + // app_state is the entire Morse tendermint application state. MorseAppState app_state = 2 [(gogoproto.jsontag) = "app_state"]; } +// MorseAppState is the tendermint application state for the Morse tendermint +// application; not to be confused with the pokt protocol actor. message MorseAppState { MorseApplications application = 1 [(gogoproto.jsontag) = "application"]; MorseAuth auth = 2 [(gogoproto.jsontag) = "auth"]; MorsePos pos = 3 [(gogoproto.jsontag) = "pos"]; } +// A wrapper around the list of MorseApplications, necessary in order to conform to the Morse genesis structure. message MorseApplications { repeated MorseApplication applications = 1 [(gogoproto.jsontag) = "applications"]; } +// A wrapper around a list of Morse accounts. +message MorseAuth { + repeated MorseAuthAccount accounts = 1 [(gogoproto.jsontag) = "accounts"]; +} + +// A wrapper around Morse account information, necessary in order to to confirm to the Morse genesis +// structure. Morse originally serialized accounts as pb.Any types in order to support multiple +// account types. For the purposes of the Morse -> Shannon migration, we're only concerned with +// externally owned accounts (as opposed to module accounts). As a result, we're simplifying its +// representation in Shannon by avoiding usage of pb.Any. It is necessary in order too conform to +// the Morse genesis structure. message MorseAuthAccount { string Type = 1 [(gogoproto.jsontag) = "type"]; MorseAccount Value = 2 [(gogoproto.jsontag) = "value"]; } -message MorseAuth { - repeated MorseAuthAccount accounts = 1 [(gogoproto.jsontag) = "accounts"]; -} - +// A wrapper around the list of Morse suppliers (aka "validators", "nodes", of "servicers"). +// It is necessary to conform to the Morse genesis structure. message MorsePos { repeated MorseValidator validators = 1 [(gogoproto.jsontag) = "validators"]; } -// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates -// the minimum information required to import Morse applications. +// MorseApplication is a subset of the Morse ProtoApplication type. +// It encapsulates the minimum information required to import Morse applications. // See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 message MorseApplication { option (gogoproto.equal) = true; option (gogoproto.goproto_getters) = false; + // Address is a hex-encoded string representation of the address corresponding + // to a Morse application's ed25519 public key. bytes address = 1 [ (gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.jsontag) = "address", (gogoproto.moretags) = "yaml:\"address\"" ]; + // PublicKey is the binary representation of a Morse application's ed25519 public key. bytes public_key = 2 [ (gogoproto.jsontag) = "public_key", (gogoproto.moretags) = "yaml:\"public_key\""]; @@ -62,11 +85,11 @@ message MorseApplication { int32 status = 4 [ (gogoproto.jsontag) = "status", (gogoproto.moretags) = "yaml:\"status\""]; - string staked_tokens = 6; + string staked_tokens = 6 [(gogoproto.jsontag) = "tokens"]; } -// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the -// minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// MorseValidator is a subset of the Morse ProtoValidator type. +// It encapsulates the minimum information required to import Morse suppliers (aka "servicers" or "validators"). // See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 message MorseValidator { option (gogoproto.equal) = true; diff --git a/x/migration/types/legacy.pb.go b/x/migration/types/legacy.pb.go index 7d7f2e547..302a8614a 100644 --- a/x/migration/types/legacy.pb.go +++ b/x/migration/types/legacy.pb.go @@ -2,10 +2,13 @@ // source: poktroll/migration/legacy.proto // Types in this file are ONLY present to facilitate the verifiability of the -// migration state from Morse to Shannon. These types are used by the migration -// subcommand (e.g. `poktrolld migrate collect-morse-accounts ...) to transform -// the Morse state export into the Shannon state import. They ARE NOT persisted -// on-chain at any point. +// migration state from Morse to Shannon. +// +// These types are used by the migration subcommand to transform +// the Morse state export into the Shannon state import. +// Ref: `poktrolld migrate collect-morse-accounts ...` +// +// They ARE NOT persisted on-chain at any point.package poktroll.migration; package types @@ -31,8 +34,13 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// MorseStateExport is the data structure that is serialized and output when running +// `pocket utils export-genesis-for-reset`. +// See: https://editor.swagger.io/?url=https://raw.githubusercontent.com/pokt-network/pocket-core/staging/doc/specs/rpc-spec.yaml#operations-query-post_query_state type MorseStateExport struct { - AppHash string `protobuf:"bytes,1,opt,name=app_hash,json=appHash,proto3" json:"app_hash"` + // app_hash is the Morse tendermint state hash. + AppHash string `protobuf:"bytes,1,opt,name=app_hash,json=appHash,proto3" json:"app_hash"` + // app_state is the entire Morse tendermint application state. AppState *MorseAppState `protobuf:"bytes,2,opt,name=app_state,json=appState,proto3" json:"app_state"` } @@ -79,6 +87,8 @@ func (m *MorseStateExport) GetAppState() *MorseAppState { return nil } +// MorseAppState is the tendermint application state for the Morse tendermint +// application; not to be confused with the pokt protocol actor. type MorseAppState struct { Application *MorseApplications `protobuf:"bytes,1,opt,name=application,proto3" json:"application"` Auth *MorseAuth `protobuf:"bytes,2,opt,name=auth,proto3" json:"auth"` @@ -135,6 +145,7 @@ func (m *MorseAppState) GetPos() *MorsePos { return nil } +// A wrapper around the list of MorseApplications, necessary in order to conform to the Morse genesis structure. type MorseApplications struct { Applications []*MorseApplication `protobuf:"bytes,1,rep,name=applications,proto3" json:"applications"` } @@ -175,21 +186,21 @@ func (m *MorseApplications) GetApplications() []*MorseApplication { return nil } -type MorseAuthAccount struct { - Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"type"` - Value *MorseAccount `protobuf:"bytes,2,opt,name=Value,proto3" json:"value"` +// A wrapper around a list of Morse accounts. +type MorseAuth struct { + Accounts []*MorseAuthAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts"` } -func (m *MorseAuthAccount) Reset() { *m = MorseAuthAccount{} } -func (m *MorseAuthAccount) String() string { return proto.CompactTextString(m) } -func (*MorseAuthAccount) ProtoMessage() {} -func (*MorseAuthAccount) Descriptor() ([]byte, []int) { +func (m *MorseAuth) Reset() { *m = MorseAuth{} } +func (m *MorseAuth) String() string { return proto.CompactTextString(m) } +func (*MorseAuth) ProtoMessage() {} +func (*MorseAuth) Descriptor() ([]byte, []int) { return fileDescriptor_3ba469df9d72c7fc, []int{3} } -func (m *MorseAuthAccount) XXX_Unmarshal(b []byte) error { +func (m *MorseAuth) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MorseAuthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MorseAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -197,46 +208,46 @@ func (m *MorseAuthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, er } return b[:n], nil } -func (m *MorseAuthAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_MorseAuthAccount.Merge(m, src) +func (m *MorseAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseAuth.Merge(m, src) } -func (m *MorseAuthAccount) XXX_Size() int { +func (m *MorseAuth) XXX_Size() int { return m.Size() } -func (m *MorseAuthAccount) XXX_DiscardUnknown() { - xxx_messageInfo_MorseAuthAccount.DiscardUnknown(m) +func (m *MorseAuth) XXX_DiscardUnknown() { + xxx_messageInfo_MorseAuth.DiscardUnknown(m) } -var xxx_messageInfo_MorseAuthAccount proto.InternalMessageInfo - -func (m *MorseAuthAccount) GetType() string { - if m != nil { - return m.Type - } - return "" -} +var xxx_messageInfo_MorseAuth proto.InternalMessageInfo -func (m *MorseAuthAccount) GetValue() *MorseAccount { +func (m *MorseAuth) GetAccounts() []*MorseAuthAccount { if m != nil { - return m.Value + return m.Accounts } return nil } -type MorseAuth struct { - Accounts []*MorseAuthAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts"` +// A wrapper around Morse account information, necessary in order to to confirm to the Morse genesis +// structure. Morse originally serialized accounts as pb.Any types in order to support multiple +// account types. For the purposes of the Morse -> Shannon migration, we're only concerned with +// externally owned accounts (as opposed to module accounts). As a result, we're simplifying its +// representation in Shannon by avoiding usage of pb.Any. It is necessary in order too conform to +// the Morse genesis structure. +type MorseAuthAccount struct { + Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"type"` + Value *MorseAccount `protobuf:"bytes,2,opt,name=Value,proto3" json:"value"` } -func (m *MorseAuth) Reset() { *m = MorseAuth{} } -func (m *MorseAuth) String() string { return proto.CompactTextString(m) } -func (*MorseAuth) ProtoMessage() {} -func (*MorseAuth) Descriptor() ([]byte, []int) { +func (m *MorseAuthAccount) Reset() { *m = MorseAuthAccount{} } +func (m *MorseAuthAccount) String() string { return proto.CompactTextString(m) } +func (*MorseAuthAccount) ProtoMessage() {} +func (*MorseAuthAccount) Descriptor() ([]byte, []int) { return fileDescriptor_3ba469df9d72c7fc, []int{4} } -func (m *MorseAuth) XXX_Unmarshal(b []byte) error { +func (m *MorseAuthAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MorseAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MorseAuthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { @@ -244,25 +255,34 @@ func (m *MorseAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } -func (m *MorseAuth) XXX_Merge(src proto.Message) { - xxx_messageInfo_MorseAuth.Merge(m, src) +func (m *MorseAuthAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseAuthAccount.Merge(m, src) } -func (m *MorseAuth) XXX_Size() int { +func (m *MorseAuthAccount) XXX_Size() int { return m.Size() } -func (m *MorseAuth) XXX_DiscardUnknown() { - xxx_messageInfo_MorseAuth.DiscardUnknown(m) +func (m *MorseAuthAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MorseAuthAccount.DiscardUnknown(m) } -var xxx_messageInfo_MorseAuth proto.InternalMessageInfo +var xxx_messageInfo_MorseAuthAccount proto.InternalMessageInfo -func (m *MorseAuth) GetAccounts() []*MorseAuthAccount { +func (m *MorseAuthAccount) GetType() string { if m != nil { - return m.Accounts + return m.Type + } + return "" +} + +func (m *MorseAuthAccount) GetValue() *MorseAccount { + if m != nil { + return m.Value } return nil } +// A wrapper around the list of Morse suppliers (aka "validators", "nodes", of "servicers"). +// It is necessary to conform to the Morse genesis structure. type MorsePos struct { Validators []*MorseValidator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` } @@ -303,15 +323,18 @@ func (m *MorsePos) GetValidators() []*MorseValidator { return nil } -// MorseApplication is a subset of the Morse ProtoApplication type. It encapsulates -// the minimum information required to import Morse applications. +// MorseApplication is a subset of the Morse ProtoApplication type. +// It encapsulates the minimum information required to import Morse applications. // See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 type MorseApplication struct { - Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"` - Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status" yaml:"status"` - StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` + // Address is a hex-encoded string representation of the address corresponding + // to a Morse application's ed25519 public key. + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` + // PublicKey is the binary representation of a Morse application's ed25519 public key. + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status" yaml:"status"` + StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"tokens"` } func (m *MorseApplication) Reset() { *m = MorseApplication{} } @@ -343,8 +366,8 @@ func (m *MorseApplication) XXX_DiscardUnknown() { var xxx_messageInfo_MorseApplication proto.InternalMessageInfo -// MorseValidator is a subset of the Morse ProtoValidator type. It encapsulates the -// minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// MorseValidator is a subset of the Morse ProtoValidator type. +// It encapsulates the minimum information required to import Morse suppliers (aka "servicers" or "validators"). // See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 type MorseValidator struct { Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` @@ -387,8 +410,8 @@ func init() { proto.RegisterType((*MorseStateExport)(nil), "poktroll.migration.MorseStateExport") proto.RegisterType((*MorseAppState)(nil), "poktroll.migration.MorseAppState") proto.RegisterType((*MorseApplications)(nil), "poktroll.migration.MorseApplications") - proto.RegisterType((*MorseAuthAccount)(nil), "poktroll.migration.MorseAuthAccount") proto.RegisterType((*MorseAuth)(nil), "poktroll.migration.MorseAuth") + proto.RegisterType((*MorseAuthAccount)(nil), "poktroll.migration.MorseAuthAccount") proto.RegisterType((*MorsePos)(nil), "poktroll.migration.MorsePos") proto.RegisterType((*MorseApplication)(nil), "poktroll.migration.MorseApplication") proto.RegisterType((*MorseValidator)(nil), "poktroll.migration.MorseValidator") @@ -397,53 +420,53 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/legacy.proto", fileDescriptor_3ba469df9d72c7fc) } var fileDescriptor_3ba469df9d72c7fc = []byte{ - // 732 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xbf, 0x6f, 0x13, 0x31, - 0x14, 0xce, 0xf5, 0x57, 0x12, 0x27, 0x29, 0xad, 0xc5, 0x10, 0x95, 0x72, 0x0e, 0x2e, 0x88, 0x48, - 0x88, 0x44, 0x4a, 0x07, 0xa4, 0x32, 0xe5, 0x24, 0x24, 0x24, 0x28, 0xaa, 0xdc, 0xaa, 0x42, 0x45, - 0xa2, 0x72, 0x92, 0x6b, 0x12, 0x72, 0x89, 0xad, 0x3b, 0xa7, 0x34, 0xff, 0x01, 0x62, 0x62, 0x64, - 0xec, 0xbf, 0xc2, 0xc6, 0xd8, 0x8d, 0x4e, 0x07, 0x4a, 0x17, 0x74, 0x63, 0x47, 0x26, 0x64, 0xfb, - 0xee, 0x72, 0x69, 0x09, 0x2a, 0x03, 0xcb, 0xc9, 0xfe, 0xde, 0xf7, 0x3d, 0x3f, 0x7f, 0xef, 0x9d, - 0x0c, 0x10, 0x67, 0x3d, 0xe1, 0x32, 0xc7, 0xa9, 0xf6, 0xbb, 0x6d, 0x97, 0x8a, 0x2e, 0x1b, 0x54, - 0x1d, 0xbb, 0x4d, 0x9b, 0xa3, 0x0a, 0x77, 0x99, 0x60, 0x10, 0x46, 0x84, 0x4a, 0x4c, 0x58, 0xbb, - 0xdd, 0x66, 0x6d, 0xa6, 0xc2, 0x55, 0xb9, 0xd2, 0xcc, 0x35, 0xf3, 0x0f, 0xa9, 0xc4, 0x88, 0xdb, - 0x9e, 0x8e, 0xe3, 0x8f, 0x06, 0x58, 0xd9, 0x66, 0xae, 0x67, 0xef, 0x0a, 0x2a, 0xec, 0x67, 0x27, - 0x9c, 0xb9, 0x02, 0x3e, 0x04, 0x19, 0xca, 0xf9, 0x61, 0x87, 0x7a, 0x9d, 0xa2, 0x51, 0x32, 0xca, - 0x59, 0x2b, 0x1f, 0xf8, 0x28, 0xc6, 0x48, 0x9a, 0x72, 0xfe, 0x9c, 0x7a, 0x1d, 0xb8, 0x0d, 0xb2, - 0x12, 0xf4, 0xa4, 0xb6, 0x38, 0x57, 0x32, 0xca, 0xb9, 0xda, 0xbd, 0xca, 0xf5, 0xda, 0x2a, 0xea, - 0x84, 0x3a, 0xe7, 0xea, 0x10, 0xab, 0x10, 0xf8, 0x68, 0xa2, 0x23, 0x32, 0xaf, 0x0a, 0xe0, 0xef, - 0x06, 0x28, 0x4c, 0x51, 0xe1, 0x6b, 0x90, 0xa3, 0x9c, 0x3b, 0xdd, 0xa6, 0xca, 0xa3, 0x8a, 0xc9, - 0xd5, 0x1e, 0xfc, 0xed, 0x88, 0x88, 0xeb, 0x59, 0xb7, 0x02, 0x1f, 0x25, 0xd5, 0x24, 0xb9, 0x81, - 0x4f, 0xc1, 0x02, 0x1d, 0x8a, 0x4e, 0x58, 0xf5, 0xdd, 0xd9, 0x29, 0x87, 0xa2, 0x63, 0x65, 0x02, - 0x1f, 0x29, 0x3a, 0x51, 0x5f, 0xf8, 0x04, 0xcc, 0x73, 0xe6, 0x15, 0xe7, 0x95, 0x76, 0x7d, 0xa6, - 0x76, 0x87, 0x79, 0x56, 0x3a, 0xf0, 0x91, 0x24, 0x13, 0xf9, 0xc1, 0x0c, 0xac, 0x5e, 0x2b, 0x14, - 0x1e, 0x80, 0x7c, 0xa2, 0x32, 0xaf, 0x68, 0x94, 0xe6, 0xcb, 0xb9, 0xda, 0xfd, 0x9b, 0xdc, 0xd2, - 0x5a, 0x09, 0x7c, 0x34, 0xa5, 0x26, 0x53, 0x3b, 0xec, 0x85, 0xed, 0x95, 0xd7, 0xa8, 0x37, 0x9b, - 0x6c, 0x38, 0x10, 0x70, 0x1d, 0x2c, 0xec, 0x8d, 0xb8, 0x1d, 0xb6, 0x56, 0xdd, 0x4d, 0x8e, 0x04, - 0x51, 0x28, 0xac, 0x83, 0xc5, 0x7d, 0xea, 0x0c, 0xa3, 0x7e, 0x96, 0x66, 0x97, 0xa1, 0xd3, 0x59, - 0xd9, 0xc0, 0x47, 0x8b, 0xc7, 0x52, 0x42, 0xb4, 0x12, 0xbf, 0x01, 0xd9, 0xf8, 0x50, 0xf8, 0x0a, - 0x64, 0xa8, 0x66, 0xde, 0xe0, 0x66, 0x93, 0x2a, 0xc3, 0x91, 0x0b, 0x95, 0x24, 0x5e, 0xe1, 0xb7, - 0x20, 0x13, 0x99, 0x0b, 0x09, 0x00, 0xc7, 0xd4, 0xe9, 0xb6, 0xa8, 0x60, 0x6e, 0x94, 0x1d, 0xcf, - 0xcc, 0xbe, 0x1f, 0x51, 0xad, 0xe5, 0xc0, 0x47, 0x09, 0x25, 0x49, 0xac, 0xf1, 0xb7, 0xb9, 0xc8, - 0xb2, 0xc4, 0xb4, 0x1c, 0x81, 0x34, 0x6d, 0xb5, 0x5c, 0xdb, 0xf3, 0x94, 0x6b, 0x79, 0xeb, 0x65, - 0xe0, 0xa3, 0x08, 0xba, 0xf4, 0xd1, 0xf2, 0x88, 0xf6, 0x9d, 0x2d, 0x1c, 0x02, 0xf8, 0x97, 0x8f, - 0x1e, 0xb5, 0xbb, 0xa2, 0x33, 0x6c, 0x54, 0x9a, 0xac, 0x5f, 0x6d, 0xb2, 0xbe, 0x2d, 0x1a, 0x47, - 0x22, 0xb1, 0x70, 0x47, 0x5c, 0xb0, 0x4a, 0x5d, 0xf3, 0x49, 0x94, 0x09, 0x5a, 0x00, 0xf0, 0x61, - 0xc3, 0xe9, 0x36, 0x0f, 0x7b, 0xf6, 0x48, 0x75, 0x20, 0x6f, 0x6d, 0xc8, 0x62, 0x27, 0xe8, 0xa5, - 0x8f, 0x56, 0xf5, 0x69, 0x13, 0x0c, 0x93, 0xac, 0xde, 0xbc, 0xb0, 0x47, 0x70, 0x13, 0x2c, 0xbd, - 0xa3, 0x5d, 0xc7, 0x6e, 0xa9, 0xf9, 0xcc, 0x58, 0x77, 0x02, 0x1f, 0x85, 0xc8, 0xa5, 0x8f, 0x0a, - 0x5a, 0xab, 0xf7, 0x98, 0x84, 0x01, 0x29, 0x92, 0x7f, 0xe3, 0xd0, 0x2b, 0x2e, 0x94, 0x8c, 0xf2, - 0xa2, 0x16, 0x69, 0x64, 0x22, 0xd2, 0x7b, 0x4c, 0xc2, 0x00, 0xdc, 0x00, 0x05, 0x4f, 0xd0, 0x9e, - 0xdd, 0x3a, 0x14, 0xac, 0x67, 0x0f, 0xbc, 0xe2, 0x92, 0x9c, 0x28, 0x92, 0xd7, 0xe0, 0x9e, 0xc2, - 0xb6, 0x32, 0x1f, 0x4e, 0x51, 0xea, 0xe7, 0x29, 0x32, 0xf0, 0x97, 0x39, 0xb0, 0x3c, 0xdd, 0x08, - 0xe9, 0x6b, 0xfd, 0x7f, 0xfa, 0x1a, 0x2e, 0x60, 0x1d, 0x64, 0x77, 0x22, 0x83, 0xfe, 0xc9, 0xd6, - 0x58, 0x05, 0xf1, 0x15, 0x5b, 0xc1, 0xc4, 0xd6, 0xd8, 0x45, 0x7c, 0xc5, 0x45, 0x30, 0x71, 0x31, - 0x36, 0xad, 0x02, 0xf2, 0xbb, 0x09, 0x7f, 0x8a, 0x69, 0xf5, 0x17, 0x2a, 0xa6, 0x76, 0x91, 0x4c, - 0xc5, 0xb7, 0xf2, 0xd2, 0xbf, 0xcf, 0xa7, 0xc8, 0x90, 0x1e, 0x5a, 0x3b, 0x5f, 0xc7, 0xa6, 0x71, - 0x36, 0x36, 0x8d, 0xf3, 0xb1, 0x69, 0xfc, 0x18, 0x9b, 0xc6, 0xa7, 0x0b, 0x33, 0x75, 0x76, 0x61, - 0xa6, 0xce, 0x2f, 0xcc, 0xd4, 0x41, 0x2d, 0x61, 0x8e, 0xfc, 0x0b, 0x1e, 0x0f, 0x6c, 0xf1, 0x9e, - 0xb9, 0xbd, 0x6a, 0xfc, 0x0a, 0x9c, 0x5c, 0x7d, 0x07, 0x1a, 0x4b, 0xea, 0x21, 0xd8, 0xfc, 0x1d, - 0x00, 0x00, 0xff, 0xff, 0x02, 0x9b, 0x69, 0x70, 0x75, 0x06, 0x00, 0x00, + // 733 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xbd, 0x6b, 0x1b, 0x49, + 0x14, 0xd7, 0xfa, 0x4b, 0xd2, 0x48, 0xf2, 0xd9, 0xc3, 0x15, 0xc2, 0xe7, 0xdb, 0xd1, 0xcd, 0xdd, + 0x11, 0x41, 0x88, 0x04, 0x72, 0x11, 0x70, 0x2a, 0x2d, 0x04, 0x02, 0x89, 0x83, 0x19, 0x1b, 0x13, + 0x1c, 0x88, 0x19, 0x49, 0x6b, 0x49, 0xd1, 0x4a, 0x33, 0xec, 0xcc, 0x3a, 0xd6, 0x7f, 0x10, 0x52, + 0xa5, 0x4c, 0xe9, 0x7f, 0x25, 0x5d, 0x4a, 0x97, 0xae, 0x36, 0x41, 0x6a, 0xc2, 0x96, 0x2e, 0x53, + 0x85, 0x99, 0xfd, 0xd0, 0xca, 0x8e, 0x82, 0x53, 0xa4, 0x59, 0xe6, 0xbd, 0xf7, 0xfb, 0xbd, 0x8f, + 0xdf, 0xbc, 0x65, 0x00, 0xe2, 0x6c, 0x20, 0x5d, 0xe6, 0x38, 0xf5, 0x61, 0xbf, 0xeb, 0x52, 0xd9, + 0x67, 0xa3, 0xba, 0x63, 0x77, 0x69, 0x7b, 0x5c, 0xe3, 0x2e, 0x93, 0x0c, 0xc2, 0x18, 0x50, 0x4b, + 0x00, 0x5b, 0x7f, 0x76, 0x59, 0x97, 0xe9, 0x70, 0x5d, 0x9d, 0x42, 0xe4, 0x96, 0xf9, 0x83, 0x54, + 0x72, 0xcc, 0x6d, 0x11, 0xc6, 0xf1, 0x3b, 0x03, 0x6c, 0xec, 0x31, 0x57, 0xd8, 0x07, 0x92, 0x4a, + 0xfb, 0xf1, 0x39, 0x67, 0xae, 0x84, 0xf7, 0x40, 0x8e, 0x72, 0x7e, 0xd2, 0xa3, 0xa2, 0x57, 0x36, + 0x2a, 0x46, 0x35, 0x6f, 0x15, 0x03, 0x1f, 0x25, 0x3e, 0x92, 0xa5, 0x9c, 0x3f, 0xa1, 0xa2, 0x07, + 0xf7, 0x40, 0x5e, 0x39, 0x85, 0xe2, 0x96, 0x97, 0x2a, 0x46, 0xb5, 0xd0, 0xf8, 0xa7, 0x76, 0xbb, + 0xb7, 0x9a, 0xae, 0xd0, 0xe4, 0x5c, 0x17, 0xb1, 0x4a, 0x81, 0x8f, 0x66, 0x3c, 0xa2, 0xf2, 0xea, + 0x00, 0xfe, 0x6c, 0x80, 0xd2, 0x1c, 0x14, 0xbe, 0x00, 0x05, 0xca, 0xb9, 0xd3, 0x6f, 0xeb, 0x3c, + 0xba, 0x99, 0x42, 0xe3, 0xff, 0x9f, 0x95, 0x88, 0xb1, 0xc2, 0xfa, 0x23, 0xf0, 0x51, 0x9a, 0x4d, + 0xd2, 0x06, 0x7c, 0x04, 0x56, 0xa8, 0x27, 0x7b, 0x51, 0xd7, 0x7f, 0x2f, 0x4e, 0xe9, 0xc9, 0x9e, + 0x95, 0x0b, 0x7c, 0xa4, 0xe1, 0x44, 0x7f, 0xe1, 0x43, 0xb0, 0xcc, 0x99, 0x28, 0x2f, 0x6b, 0xee, + 0xf6, 0x42, 0xee, 0x3e, 0x13, 0x56, 0x36, 0xf0, 0x91, 0x02, 0x13, 0xf5, 0xc1, 0x0c, 0x6c, 0xde, + 0x6a, 0x14, 0x1e, 0x83, 0x62, 0xaa, 0x33, 0x51, 0x36, 0x2a, 0xcb, 0xd5, 0x42, 0xe3, 0xbf, 0xbb, + 0x4c, 0x69, 0x6d, 0x04, 0x3e, 0x9a, 0x63, 0x93, 0x39, 0x0b, 0xbf, 0x04, 0xf9, 0x64, 0x0c, 0xf8, + 0x1c, 0xe4, 0x68, 0xbb, 0xcd, 0xbc, 0x91, 0xbc, 0x43, 0x11, 0x4f, 0xf6, 0x9a, 0x21, 0x38, 0xba, + 0xfd, 0x88, 0x49, 0x92, 0x13, 0x16, 0xd1, 0xee, 0xa4, 0xb0, 0x70, 0x1b, 0xac, 0x1c, 0x8e, 0xb9, + 0x1d, 0xed, 0x8d, 0x16, 0x4e, 0xed, 0x1b, 0xd1, 0x5e, 0xd8, 0x04, 0xab, 0x47, 0xd4, 0xf1, 0xe2, + 0x65, 0xa9, 0x2c, 0x2e, 0x1f, 0x95, 0xce, 0x07, 0x3e, 0x5a, 0x3d, 0x53, 0x14, 0x12, 0x32, 0xf1, + 0x2b, 0x90, 0x8b, 0xc5, 0x85, 0x04, 0x80, 0x33, 0xea, 0xf4, 0x3b, 0x54, 0x32, 0x37, 0x1e, 0x09, + 0x2f, 0xcc, 0x79, 0x14, 0x43, 0xad, 0xf5, 0xc0, 0x47, 0x29, 0x26, 0x49, 0x9d, 0xf1, 0x74, 0x29, + 0x9e, 0x2a, 0xb5, 0x2d, 0xa7, 0x20, 0x4b, 0x3b, 0x1d, 0xd7, 0x16, 0x42, 0x0f, 0x56, 0xb4, 0x9e, + 0x05, 0x3e, 0x8a, 0x5d, 0xd7, 0x3e, 0x5a, 0x1f, 0xd3, 0xa1, 0xb3, 0x8b, 0x23, 0x07, 0xfe, 0xe6, + 0xa3, 0xfb, 0xdd, 0xbe, 0xec, 0x79, 0xad, 0x5a, 0x9b, 0x0d, 0xeb, 0x6d, 0x36, 0xb4, 0x65, 0xeb, + 0x54, 0xa6, 0x0e, 0xee, 0x98, 0x4b, 0x56, 0x6b, 0x86, 0x78, 0x12, 0x67, 0x82, 0x16, 0x00, 0xdc, + 0x6b, 0x39, 0xfd, 0xf6, 0xc9, 0xc0, 0x1e, 0x6b, 0x91, 0x8a, 0xd6, 0xbf, 0xaa, 0xd9, 0x99, 0xf7, + 0xda, 0x47, 0x9b, 0x61, 0xb5, 0x99, 0x0f, 0x93, 0x7c, 0x68, 0x3c, 0xb5, 0xc7, 0x70, 0x07, 0xac, + 0xbd, 0xa6, 0x7d, 0xc7, 0xee, 0xe8, 0xfd, 0xcc, 0x59, 0x7f, 0x05, 0x3e, 0x8a, 0x3c, 0xd7, 0x3e, + 0x2a, 0x85, 0xdc, 0xd0, 0xc6, 0x24, 0x0a, 0x28, 0x92, 0xfa, 0x1b, 0x3d, 0x51, 0x5e, 0xa9, 0x18, + 0xd5, 0xd5, 0x90, 0x14, 0x7a, 0x66, 0xa4, 0xd0, 0xc6, 0x24, 0x0a, 0xc0, 0x3a, 0x28, 0x09, 0x49, + 0x07, 0x76, 0xe7, 0x44, 0xb2, 0x81, 0x3d, 0x12, 0xe5, 0x35, 0x7d, 0xe9, 0x40, 0x71, 0x43, 0x0f, + 0x29, 0x86, 0x80, 0x43, 0x6d, 0xed, 0xe6, 0xde, 0x5e, 0xa0, 0xcc, 0xd7, 0x0b, 0x64, 0xe0, 0x8f, + 0x4b, 0x60, 0x7d, 0xfe, 0x52, 0x94, 0xc6, 0xcd, 0xdf, 0xa9, 0x71, 0x74, 0x80, 0x4d, 0x90, 0xdf, + 0x8f, 0xc5, 0xfa, 0x25, 0x89, 0x13, 0x16, 0xc4, 0x37, 0x24, 0x06, 0x33, 0x89, 0x13, 0x45, 0xf1, + 0x0d, 0x45, 0xc1, 0x4c, 0xd1, 0x44, 0xc0, 0x1a, 0x28, 0x1e, 0xa4, 0xf4, 0x29, 0x67, 0x6f, 0xeb, + 0x97, 0x8e, 0xef, 0x16, 0x95, 0x7e, 0x1f, 0x2e, 0x90, 0xa1, 0x34, 0xb4, 0xf6, 0x3f, 0x4d, 0x4c, + 0xe3, 0x72, 0x62, 0x1a, 0x57, 0x13, 0xd3, 0xf8, 0x32, 0x31, 0x8d, 0xf7, 0x53, 0x33, 0x73, 0x39, + 0x35, 0x33, 0x57, 0x53, 0x33, 0x73, 0xdc, 0x48, 0x89, 0xa3, 0xfe, 0x88, 0x07, 0x23, 0x5b, 0xbe, + 0x61, 0xee, 0xa0, 0x9e, 0xbc, 0x08, 0xe7, 0x37, 0xdf, 0x84, 0xd6, 0x9a, 0x7e, 0x14, 0x76, 0xbe, + 0x07, 0x00, 0x00, 0xff, 0xff, 0x70, 0x19, 0x49, 0x20, 0x81, 0x06, 0x00, 0x00, } func (this *MorseApplication) Equal(that interface{}) bool { @@ -656,7 +679,7 @@ func (m *MorseApplications) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MorseAuthAccount) Marshal() (dAtA []byte, err error) { +func (m *MorseAuth) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -666,39 +689,34 @@ func (m *MorseAuthAccount) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MorseAuthAccount) MarshalTo(dAtA []byte) (int, error) { +func (m *MorseAuth) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MorseAuthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MorseAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Value != nil { - { - size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintLegacy(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0x12 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintLegacy(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MorseAuth) Marshal() (dAtA []byte, err error) { +func (m *MorseAuthAccount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -708,29 +726,34 @@ func (m *MorseAuth) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MorseAuth) MarshalTo(dAtA []byte) (int, error) { +func (m *MorseAuthAccount) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MorseAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MorseAuthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Accounts) > 0 { - for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLegacy(dAtA, i, uint64(size)) + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintLegacy(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintLegacy(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -954,34 +977,34 @@ func (m *MorseApplications) Size() (n int) { return n } -func (m *MorseAuthAccount) Size() (n int) { +func (m *MorseAuth) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovLegacy(uint64(l)) - } - if m.Value != nil { - l = m.Value.Size() - n += 1 + l + sovLegacy(uint64(l)) + if len(m.Accounts) > 0 { + for _, e := range m.Accounts { + l = e.Size() + n += 1 + l + sovLegacy(uint64(l)) + } } return n } -func (m *MorseAuth) Size() (n int) { +func (m *MorseAuthAccount) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Accounts) > 0 { - for _, e := range m.Accounts { - l = e.Size() - n += 1 + l + sovLegacy(uint64(l)) - } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovLegacy(uint64(l)) + } + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovLegacy(uint64(l)) } return n } @@ -1421,7 +1444,7 @@ func (m *MorseApplications) Unmarshal(dAtA []byte) error { } return nil } -func (m *MorseAuthAccount) Unmarshal(dAtA []byte) error { +func (m *MorseAuth) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1444,47 +1467,15 @@ func (m *MorseAuthAccount) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MorseAuthAccount: wiretype end group for non-group") + return fmt.Errorf("proto: MorseAuth: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MorseAuthAccount: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MorseAuth: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLegacy - } - 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 ErrInvalidLengthLegacy - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLegacy - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1511,10 +1502,8 @@ func (m *MorseAuthAccount) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Value == nil { - m.Value = &MorseAccount{} - } - if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Accounts = append(m.Accounts, &MorseAuthAccount{}) + if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1539,7 +1528,7 @@ func (m *MorseAuthAccount) Unmarshal(dAtA []byte) error { } return nil } -func (m *MorseAuth) Unmarshal(dAtA []byte) error { +func (m *MorseAuthAccount) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1562,15 +1551,47 @@ func (m *MorseAuth) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MorseAuth: wiretype end group for non-group") + return fmt.Errorf("proto: MorseAuthAccount: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MorseAuth: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MorseAuthAccount: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLegacy + } + 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 ErrInvalidLengthLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1597,8 +1618,10 @@ func (m *MorseAuth) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Accounts = append(m.Accounts, &MorseAuthAccount{}) - if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Value == nil { + m.Value = &MorseAccount{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/migration/types/morse_account_state.go b/x/migration/types/morse_account_state.go new file mode 100644 index 000000000..da5dca020 --- /dev/null +++ b/x/migration/types/morse_account_state.go @@ -0,0 +1,19 @@ +package types + +import ( + "crypto/sha256" + + "github.com/cosmos/gogoproto/proto" +) + +// GetHash calculates the sha256 hash of the MorseAccountState. +// It is intended to be used to verify the integrity of the MorseAccountState. +func (m MorseAccountState) GetHash() ([]byte, error) { + accountStateBz, err := proto.Marshal(&m) + if err != nil { + return nil, err + } + + hash := sha256.Sum256(accountStateBz) + return hash[:], nil +} From c2cca357ae23c63cb86fa4b8c45e5666d3776548 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 31 Jan 2025 16:33:03 +0100 Subject: [PATCH 13/19] fix: linter error --- cmd/poktrolld/cmd/migrate/migrate.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/cmd/poktrolld/cmd/migrate/migrate.go b/cmd/poktrolld/cmd/migrate/migrate.go index 035e4bdab..48c139ae0 100644 --- a/cmd/poktrolld/cmd/migrate/migrate.go +++ b/cmd/poktrolld/cmd/migrate/migrate.go @@ -106,7 +106,7 @@ func collectMorseAccounts(morseStateExportPath, morseAccountStatePath string) (* } morseWorkspace := newMorseImportWorkspace() - if err := transformMorseState(inputState, morseWorkspace); err != nil { + if err = transformMorseState(inputState, morseWorkspace); err != nil { return nil, err } @@ -222,23 +222,6 @@ func shouldDebugLogProgress(exportAccountIdx int) bool { exportAccountIdx%flagDebugAccountsPerLog == 0 } -// debugLogProgress logs the total balances, app stakes, and supplier stakes of -// all accounts that have been processed. -func debugLogProgress(exportAccountIdx int, morseWorkspace *morseImportWorkspace) { - totalBalance := morseWorkspace.totalBalance() - totalAppStake := morseWorkspace.totalAppStake() - totalSupplierStake := morseWorkspace.totalSupplierStake() - grandTotal := totalBalance.Add(totalAppStake).Add(totalSupplierStake) - - logger.Debug(). - Int("account_idx", exportAccountIdx). - Str("total_balance", totalBalance.String()). - Str("total_app_stake", totalAppStake.String()). - Str("total_supplier_stake", totalSupplierStake.String()). - Str("grand_total", grandTotal.String()). - Msg("processing accounts...") -} - // collectInputApplicationStakes iterates over the applications in the inputState and // adds the stake to the corresponding account balances in the morseWorkspace. func collectInputApplicationStakes(inputState *migrationtypes.MorseStateExport, morseWorkspace *morseImportWorkspace) error { From 54fabd92bb77bdb926742cabbc8f336768d55143 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 31 Jan 2025 17:05:01 +0100 Subject: [PATCH 14/19] chore: review feedback improvements --- cmd/poktrolld/cmd/migrate/migrate.go | 30 +++++++++++++-------------- proto/poktroll/migration/legacy.proto | 18 ++++------------ 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/cmd/poktrolld/cmd/migrate/migrate.go b/cmd/poktrolld/cmd/migrate/migrate.go index 48c139ae0..cd803a304 100644 --- a/cmd/poktrolld/cmd/migrate/migrate.go +++ b/cmd/poktrolld/cmd/migrate/migrate.go @@ -182,8 +182,8 @@ func collectInputAccountBalances(inputState *migrationtypes.MorseStateExport, mo continue } - addr := exportAccount.Value.Address.String() - if _, _, err := morseWorkspace.ensureAccount(addr, exportAccount); err != nil { + accountAddr := exportAccount.Value.Address.String() + if _, _, err := morseWorkspace.ensureAccount(accountAddr, exportAccount); err != nil { return err } @@ -196,7 +196,7 @@ func collectInputAccountBalances(inputState *migrationtypes.MorseStateExport, mo if len(coins) != 1 { return ErrMorseExportState.Wrapf( "account %q has %d token denominations, expected upokt only: %s", - addr, len(coins), coins, + accountAddr, len(coins), coins, ) } @@ -205,10 +205,10 @@ func collectInputAccountBalances(inputState *migrationtypes.MorseStateExport, mo return ErrMorseExportState.Wrapf("unsupported denom %q", coin.Denom) } - if err := morseWorkspace.addUpokt(addr, coin.Amount); err != nil { + if err := morseWorkspace.addUpokt(accountAddr, coin.Amount); err != nil { return fmt.Errorf( "adding morse account balance (%s) to account balance of address %q: %w", - coin, addr, err, + coin, accountAddr, err, ) } } @@ -226,11 +226,11 @@ func shouldDebugLogProgress(exportAccountIdx int) bool { // adds the stake to the corresponding account balances in the morseWorkspace. func collectInputApplicationStakes(inputState *migrationtypes.MorseStateExport, morseWorkspace *morseImportWorkspace) error { for _, exportApplication := range inputState.AppState.Application.Applications { - addr := exportApplication.Address.String() + appAddr := exportApplication.Address.String() // DEV_NOTE: An account SHOULD exist for each actor. - if !morseWorkspace.hasAccount(addr) { - return ErrMorseExportState.Wrapf("account not found corresponding to application with address %q", addr) + if !morseWorkspace.hasAccount(appAddr) { + return ErrMorseExportState.Wrapf("account not found corresponding to application with address %q", appAddr) } appStakeAmtUpokt, ok := cosmosmath.NewIntFromString(exportApplication.StakedTokens) @@ -238,10 +238,10 @@ func collectInputApplicationStakes(inputState *migrationtypes.MorseStateExport, return ErrMorseExportState.Wrapf("failed to parse application stake amount %q", exportApplication.StakedTokens) } - if err := morseWorkspace.addUpokt(addr, appStakeAmtUpokt); err != nil { + if err := morseWorkspace.addUpokt(appAddr, appStakeAmtUpokt); err != nil { return fmt.Errorf( "adding application stake amount to account balance of address %q: %w", - addr, err, + appAddr, err, ) } } @@ -252,11 +252,11 @@ func collectInputApplicationStakes(inputState *migrationtypes.MorseStateExport, // adds the stake to the corresponding account balances in the morseWorkspace. func collectInputSupplierStakes(inputState *migrationtypes.MorseStateExport, morseWorkspace *morseImportWorkspace) error { for _, exportSupplier := range inputState.AppState.Pos.Validators { - addr := exportSupplier.Address.String() + supplierAddr := exportSupplier.Address.String() // DEV_NOTE: An account SHOULD exist for each actor. - if !morseWorkspace.hasAccount(addr) { - return ErrMorseExportState.Wrapf("account not found corresponding to supplier with address %q", addr) + if !morseWorkspace.hasAccount(supplierAddr) { + return ErrMorseExportState.Wrapf("account not found corresponding to supplier with address %q", supplierAddr) } supplierStakeAmtUpokt, ok := cosmosmath.NewIntFromString(exportSupplier.StakedTokens) @@ -264,10 +264,10 @@ func collectInputSupplierStakes(inputState *migrationtypes.MorseStateExport, mor return ErrMorseExportState.Wrapf("failed to parse supplier stake amount %q", exportSupplier.StakedTokens) } - if err := morseWorkspace.addUpokt(addr, supplierStakeAmtUpokt); err != nil { + if err := morseWorkspace.addUpokt(supplierAddr, supplierStakeAmtUpokt); err != nil { return fmt.Errorf( "adding supplier stake amount to account balance of address %q: %w", - addr, err, + supplierAddr, err, ) } } diff --git a/proto/poktroll/migration/legacy.proto b/proto/poktroll/migration/legacy.proto index 421aa3f52..23dafcbea 100644 --- a/proto/poktroll/migration/legacy.proto +++ b/proto/poktroll/migration/legacy.proto @@ -70,21 +70,11 @@ message MorseApplication { // Address is a hex-encoded string representation of the address corresponding // to a Morse application's ed25519 public key. - bytes address = 1 [ - (gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", - (gogoproto.jsontag) = "address", - (gogoproto.moretags) = "yaml:\"address\"" - ]; + bytes address = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.jsontag) = "address", (gogoproto.moretags) = "yaml:\"address\""]; // PublicKey is the binary representation of a Morse application's ed25519 public key. - bytes public_key = 2 [ - (gogoproto.jsontag) = "public_key", - (gogoproto.moretags) = "yaml:\"public_key\""]; - bool jailed = 3[ - (gogoproto.jsontag) = "jailed", - (gogoproto.moretags) = "yaml:\"jailed\""]; - int32 status = 4 [ - (gogoproto.jsontag) = "status", - (gogoproto.moretags) = "yaml:\"status\""]; + bytes public_key = 2 [(gogoproto.jsontag) = "public_key", (gogoproto.moretags) = "yaml:\"public_key\""]; + bool jailed = 3[(gogoproto.jsontag) = "jailed", (gogoproto.moretags) = "yaml:\"jailed\""]; + int32 status = 4 [(gogoproto.jsontag) = "status", (gogoproto.moretags) = "yaml:\"status\""]; string staked_tokens = 6 [(gogoproto.jsontag) = "tokens"]; } From c7d725aead7e4d4af95b65078d4a2832a7136340 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Tue, 4 Feb 2025 12:11:10 +0100 Subject: [PATCH 15/19] chore: review improvements --- app/app.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 93b608d19..7a9100f29 100644 --- a/app/app.go +++ b/app/app.go @@ -70,7 +70,8 @@ type App struct { sm *module.SimulationManager // this line is used by starport scaffolding # stargate/app/keeperDeclaration - // Ignite CLI adds keepers here when scaffolding new modules. Please move the created keeper to the `keepers` package. + // MUST_READ_DEV_NOTE: Ignite CLI adds keepers here when scaffolding new modules. + // MUST_READ_DEV_ACTION_ITEM: Please move the created keeper to the `keepers` package. } func init() { @@ -216,7 +217,8 @@ func New( &app.Keepers.SharedKeeper, &app.Keepers.MigrationKeeper, // this line is used by starport scaffolding # stargate/app/keeperDefinition - // Ignite CLI adds keepers here when scaffolding new modules. Please move the created keeper to the `keepers` package. + // MUST_READ_DEV_NOTE: Ignite CLI adds keepers here when scaffolding new modules. + // MUST_READ_DEV_ACTION_ITEM: Please move the created keeper to the `keepers` package. ); err != nil { panic(err) } From 5d473f091af157e267df4aaff885db9e06f89349 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Tue, 4 Feb 2025 09:54:50 -0800 Subject: [PATCH 16/19] Add a couple TODO_UPNEXT --- x/migration/module/autocli.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/migration/module/autocli.go b/x/migration/module/autocli.go index 96169a21d..80b4d488c 100644 --- a/x/migration/module/autocli.go +++ b/x/migration/module/autocli.go @@ -6,6 +6,10 @@ import ( modulev1 "github.com/pokt-network/poktroll/api/poktroll/migration" ) +// TODO_UPNEXT(@bryanchriswhite, #1046): Add `MsgClaimMorsePOKT` to the autocli. +// TODO_UPNEXT(@bryanchriswhite, #1047): Make sure to document why the autocli is +// not used for transactions requiring auth signatures. + // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { return &autocliv1.ModuleOptions{ From 7b25a9aa7e9f2a43a379d22a7248b449d84f2b7a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Feb 2025 11:22:31 +0100 Subject: [PATCH 17/19] chore: review feedback improvements Co-authored-by: red-0ne --- api/poktroll/migration/legacy.pulsar.go | 202 ++++++++++++------------ api/poktroll/migration/types.pulsar.go | 44 +++--- cmd/poktrolld/cmd/migrate/migrate.go | 22 +-- cmd/poktrolld/cmd/migrate/types.go | 24 +-- e2e/tests/update_params_test.go | 16 +- proto/poktroll/migration/legacy.proto | 24 +-- proto/poktroll/migration/types.proto | 2 +- x/migration/types/legacy.pb.go | 127 +++++++-------- x/migration/types/types.pb.go | 57 +++---- 9 files changed, 265 insertions(+), 253 deletions(-) diff --git a/api/poktroll/migration/legacy.pulsar.go b/api/poktroll/migration/legacy.pulsar.go index 4d77f6a6a..413b53649 100644 --- a/api/poktroll/migration/legacy.pulsar.go +++ b/api/poktroll/migration/legacy.pulsar.go @@ -2095,15 +2095,15 @@ func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { var ( md_MorseAuthAccount protoreflect.MessageDescriptor - fd_MorseAuthAccount_Type protoreflect.FieldDescriptor - fd_MorseAuthAccount_Value protoreflect.FieldDescriptor + fd_MorseAuthAccount_type protoreflect.FieldDescriptor + fd_MorseAuthAccount_value protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_legacy_proto_init() md_MorseAuthAccount = File_poktroll_migration_legacy_proto.Messages().ByName("MorseAuthAccount") - fd_MorseAuthAccount_Type = md_MorseAuthAccount.Fields().ByName("Type") - fd_MorseAuthAccount_Value = md_MorseAuthAccount.Fields().ByName("Value") + fd_MorseAuthAccount_type = md_MorseAuthAccount.Fields().ByName("type") + fd_MorseAuthAccount_value = md_MorseAuthAccount.Fields().ByName("value") } var _ protoreflect.Message = (*fastReflection_MorseAuthAccount)(nil) @@ -2173,13 +2173,13 @@ func (x *fastReflection_MorseAuthAccount) Interface() protoreflect.ProtoMessage func (x *fastReflection_MorseAuthAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Type_ != "" { value := protoreflect.ValueOfString(x.Type_) - if !f(fd_MorseAuthAccount_Type, value) { + if !f(fd_MorseAuthAccount_type, value) { return } } if x.Value != nil { value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) - if !f(fd_MorseAuthAccount_Value, value) { + if !f(fd_MorseAuthAccount_value, value) { return } } @@ -2198,9 +2198,9 @@ func (x *fastReflection_MorseAuthAccount) Range(f func(protoreflect.FieldDescrip // a repeated field is populated if it is non-empty. func (x *fastReflection_MorseAuthAccount) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": + case "poktroll.migration.MorseAuthAccount.type": return x.Type_ != "" - case "poktroll.migration.MorseAuthAccount.Value": + case "poktroll.migration.MorseAuthAccount.value": return x.Value != nil default: if fd.IsExtension() { @@ -2218,9 +2218,9 @@ func (x *fastReflection_MorseAuthAccount) Has(fd protoreflect.FieldDescriptor) b // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MorseAuthAccount) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": + case "poktroll.migration.MorseAuthAccount.type": x.Type_ = "" - case "poktroll.migration.MorseAuthAccount.Value": + case "poktroll.migration.MorseAuthAccount.value": x.Value = nil default: if fd.IsExtension() { @@ -2238,10 +2238,10 @@ func (x *fastReflection_MorseAuthAccount) Clear(fd protoreflect.FieldDescriptor) // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MorseAuthAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": + case "poktroll.migration.MorseAuthAccount.type": value := x.Type_ return protoreflect.ValueOfString(value) - case "poktroll.migration.MorseAuthAccount.Value": + case "poktroll.migration.MorseAuthAccount.value": value := x.Value return protoreflect.ValueOfMessage(value.ProtoReflect()) default: @@ -2264,9 +2264,9 @@ func (x *fastReflection_MorseAuthAccount) Get(descriptor protoreflect.FieldDescr // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MorseAuthAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": + case "poktroll.migration.MorseAuthAccount.type": x.Type_ = value.Interface().(string) - case "poktroll.migration.MorseAuthAccount.Value": + case "poktroll.migration.MorseAuthAccount.value": x.Value = value.Message().Interface().(*MorseAccount) default: if fd.IsExtension() { @@ -2288,13 +2288,13 @@ func (x *fastReflection_MorseAuthAccount) Set(fd protoreflect.FieldDescriptor, v // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MorseAuthAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Value": + case "poktroll.migration.MorseAuthAccount.value": if x.Value == nil { x.Value = new(MorseAccount) } return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) - case "poktroll.migration.MorseAuthAccount.Type": - panic(fmt.Errorf("field Type of message poktroll.migration.MorseAuthAccount is not mutable")) + case "poktroll.migration.MorseAuthAccount.type": + panic(fmt.Errorf("field type of message poktroll.migration.MorseAuthAccount is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) @@ -2308,9 +2308,9 @@ func (x *fastReflection_MorseAuthAccount) Mutable(fd protoreflect.FieldDescripto // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MorseAuthAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MorseAuthAccount.Type": + case "poktroll.migration.MorseAuthAccount.type": return protoreflect.ValueOfString("") - case "poktroll.migration.MorseAuthAccount.Value": + case "poktroll.migration.MorseAuthAccount.value": m := new(MorseAccount) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -3741,22 +3741,22 @@ func (x *fastReflection_MorseApplication) ProtoMethods() *protoiface.Methods { } var ( - md_MorseValidator protoreflect.MessageDescriptor - fd_MorseValidator_Address protoreflect.FieldDescriptor - fd_MorseValidator_PublicKey protoreflect.FieldDescriptor - fd_MorseValidator_jailed protoreflect.FieldDescriptor - fd_MorseValidator_status protoreflect.FieldDescriptor - fd_MorseValidator_StakedTokens protoreflect.FieldDescriptor + md_MorseValidator protoreflect.MessageDescriptor + fd_MorseValidator_address protoreflect.FieldDescriptor + fd_MorseValidator_public_key protoreflect.FieldDescriptor + fd_MorseValidator_jailed protoreflect.FieldDescriptor + fd_MorseValidator_status protoreflect.FieldDescriptor + fd_MorseValidator_staked_tokens protoreflect.FieldDescriptor ) func init() { file_poktroll_migration_legacy_proto_init() md_MorseValidator = File_poktroll_migration_legacy_proto.Messages().ByName("MorseValidator") - fd_MorseValidator_Address = md_MorseValidator.Fields().ByName("Address") - fd_MorseValidator_PublicKey = md_MorseValidator.Fields().ByName("PublicKey") + fd_MorseValidator_address = md_MorseValidator.Fields().ByName("address") + fd_MorseValidator_public_key = md_MorseValidator.Fields().ByName("public_key") fd_MorseValidator_jailed = md_MorseValidator.Fields().ByName("jailed") fd_MorseValidator_status = md_MorseValidator.Fields().ByName("status") - fd_MorseValidator_StakedTokens = md_MorseValidator.Fields().ByName("StakedTokens") + fd_MorseValidator_staked_tokens = md_MorseValidator.Fields().ByName("staked_tokens") } var _ protoreflect.Message = (*fastReflection_MorseValidator)(nil) @@ -3826,13 +3826,13 @@ func (x *fastReflection_MorseValidator) Interface() protoreflect.ProtoMessage { func (x *fastReflection_MorseValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if len(x.Address) != 0 { value := protoreflect.ValueOfBytes(x.Address) - if !f(fd_MorseValidator_Address, value) { + if !f(fd_MorseValidator_address, value) { return } } if len(x.PublicKey) != 0 { value := protoreflect.ValueOfBytes(x.PublicKey) - if !f(fd_MorseValidator_PublicKey, value) { + if !f(fd_MorseValidator_public_key, value) { return } } @@ -3850,7 +3850,7 @@ func (x *fastReflection_MorseValidator) Range(f func(protoreflect.FieldDescripto } if x.StakedTokens != "" { value := protoreflect.ValueOfString(x.StakedTokens) - if !f(fd_MorseValidator_StakedTokens, value) { + if !f(fd_MorseValidator_staked_tokens, value) { return } } @@ -3869,15 +3869,15 @@ func (x *fastReflection_MorseValidator) Range(f func(protoreflect.FieldDescripto // a repeated field is populated if it is non-empty. func (x *fastReflection_MorseValidator) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": + case "poktroll.migration.MorseValidator.address": return len(x.Address) != 0 - case "poktroll.migration.MorseValidator.PublicKey": + case "poktroll.migration.MorseValidator.public_key": return len(x.PublicKey) != 0 case "poktroll.migration.MorseValidator.jailed": return x.Jailed != false case "poktroll.migration.MorseValidator.status": return x.Status != int32(0) - case "poktroll.migration.MorseValidator.StakedTokens": + case "poktroll.migration.MorseValidator.staked_tokens": return x.StakedTokens != "" default: if fd.IsExtension() { @@ -3895,15 +3895,15 @@ func (x *fastReflection_MorseValidator) Has(fd protoreflect.FieldDescriptor) boo // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MorseValidator) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": + case "poktroll.migration.MorseValidator.address": x.Address = nil - case "poktroll.migration.MorseValidator.PublicKey": + case "poktroll.migration.MorseValidator.public_key": x.PublicKey = nil case "poktroll.migration.MorseValidator.jailed": x.Jailed = false case "poktroll.migration.MorseValidator.status": x.Status = int32(0) - case "poktroll.migration.MorseValidator.StakedTokens": + case "poktroll.migration.MorseValidator.staked_tokens": x.StakedTokens = "" default: if fd.IsExtension() { @@ -3921,10 +3921,10 @@ func (x *fastReflection_MorseValidator) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MorseValidator) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.migration.MorseValidator.Address": + case "poktroll.migration.MorseValidator.address": value := x.Address return protoreflect.ValueOfBytes(value) - case "poktroll.migration.MorseValidator.PublicKey": + case "poktroll.migration.MorseValidator.public_key": value := x.PublicKey return protoreflect.ValueOfBytes(value) case "poktroll.migration.MorseValidator.jailed": @@ -3933,7 +3933,7 @@ func (x *fastReflection_MorseValidator) Get(descriptor protoreflect.FieldDescrip case "poktroll.migration.MorseValidator.status": value := x.Status return protoreflect.ValueOfInt32(value) - case "poktroll.migration.MorseValidator.StakedTokens": + case "poktroll.migration.MorseValidator.staked_tokens": value := x.StakedTokens return protoreflect.ValueOfString(value) default: @@ -3956,15 +3956,15 @@ func (x *fastReflection_MorseValidator) Get(descriptor protoreflect.FieldDescrip // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MorseValidator) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": + case "poktroll.migration.MorseValidator.address": x.Address = value.Bytes() - case "poktroll.migration.MorseValidator.PublicKey": + case "poktroll.migration.MorseValidator.public_key": x.PublicKey = value.Bytes() case "poktroll.migration.MorseValidator.jailed": x.Jailed = value.Bool() case "poktroll.migration.MorseValidator.status": x.Status = int32(value.Int()) - case "poktroll.migration.MorseValidator.StakedTokens": + case "poktroll.migration.MorseValidator.staked_tokens": x.StakedTokens = value.Interface().(string) default: if fd.IsExtension() { @@ -3986,16 +3986,16 @@ func (x *fastReflection_MorseValidator) Set(fd protoreflect.FieldDescriptor, val // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MorseValidator) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": - panic(fmt.Errorf("field Address of message poktroll.migration.MorseValidator is not mutable")) - case "poktroll.migration.MorseValidator.PublicKey": - panic(fmt.Errorf("field PublicKey of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.address": + panic(fmt.Errorf("field address of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.public_key": + panic(fmt.Errorf("field public_key of message poktroll.migration.MorseValidator is not mutable")) case "poktroll.migration.MorseValidator.jailed": panic(fmt.Errorf("field jailed of message poktroll.migration.MorseValidator is not mutable")) case "poktroll.migration.MorseValidator.status": panic(fmt.Errorf("field status of message poktroll.migration.MorseValidator is not mutable")) - case "poktroll.migration.MorseValidator.StakedTokens": - panic(fmt.Errorf("field StakedTokens of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.staked_tokens": + panic(fmt.Errorf("field staked_tokens of message poktroll.migration.MorseValidator is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) @@ -4009,15 +4009,15 @@ func (x *fastReflection_MorseValidator) Mutable(fd protoreflect.FieldDescriptor) // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MorseValidator) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.migration.MorseValidator.Address": + case "poktroll.migration.MorseValidator.address": return protoreflect.ValueOfBytes(nil) - case "poktroll.migration.MorseValidator.PublicKey": + case "poktroll.migration.MorseValidator.public_key": return protoreflect.ValueOfBytes(nil) case "poktroll.migration.MorseValidator.jailed": return protoreflect.ValueOfBool(false) case "poktroll.migration.MorseValidator.status": return protoreflect.ValueOfInt32(int32(0)) - case "poktroll.migration.MorseValidator.StakedTokens": + case "poktroll.migration.MorseValidator.staked_tokens": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -4403,11 +4403,11 @@ func (x *fastReflection_MorseValidator) ProtoMethods() *protoiface.Methods { // Types in this file are ONLY present to facilitate the verifiability of the // migration state from Morse to Shannon. // -// These types are used by the migration subcommand to transform +// These types are used by the migration subcommand to transform // the Morse state export into the Shannon state import. // Ref: `poktrolld migrate collect-morse-accounts ...` // -// They ARE NOT persisted on-chain at any point.package poktroll.migration; +// They ARE NOT persisted on-chain at any point. const ( // Verify that this generated code is sufficiently up-to-date. @@ -4589,19 +4589,19 @@ func (x *MorseAuth) GetAccounts() []*MorseAuthAccount { return nil } -// A wrapper around Morse account information, necessary in order to to confirm to the Morse genesis +// A wrapper around Morse account information, necessary in order to to conform to the Morse genesis // structure. Morse originally serialized accounts as pb.Any types in order to support multiple // account types. For the purposes of the Morse -> Shannon migration, we're only concerned with // externally owned accounts (as opposed to module accounts). As a result, we're simplifying its -// representation in Shannon by avoiding usage of pb.Any. It is necessary in order too conform to +// representation in Shannon by avoiding usage of pb.Any. It is necessary in order to conform to // the Morse genesis structure. type MorseAuthAccount struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type_ string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"` - Value *MorseAccount `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` + Type_ string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Value *MorseAccount `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *MorseAuthAccount) Reset() { @@ -4683,13 +4683,14 @@ type MorseApplication struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Address is a hex-encoded string representation of the address corresponding + // Address is a binary representation of the address corresponding // to a Morse application's ed25519 public key. Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // PublicKey is the binary representation of a Morse application's ed25519 public key. - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` - Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + // The string representation of the BigInt amount of upokt. StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` } @@ -4756,11 +4757,14 @@ type MorseValidator struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address []byte `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` - PublicKey []byte `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` - Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` - StakedTokens string `protobuf:"bytes,7,opt,name=StakedTokens,proto3" json:"StakedTokens,omitempty"` + // A binary representation of the address corresponding to a Morse application's ed25519 public key. + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // The binary representation of a Morse application's ed25519 public key. + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + // The string representation of the BigInt amount of upokt. + StakedTokens string `protobuf:"bytes,7,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` } func (x *MorseValidator) Reset() { @@ -4865,12 +4869,12 @@ var file_poktroll_migration_legacy_proto_rawDesc = []byte{ 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x73, 0x0a, 0x10, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x04, - 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xea, 0xde, 0x1f, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x05, 0x56, 0x61, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xea, 0xde, 0x1f, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x09, 0xea, 0xde, 0x1f, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5e, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5e, 0x0a, 0x08, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x12, 0x52, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, @@ -4899,39 +4903,39 @@ var file_poktroll_migration_legacy_proto_rawDesc = []byte{ 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, - 0xa0, 0x1f, 0x01, 0x22, 0xc1, 0x02, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x66, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0xa0, 0x1f, 0x01, 0x22, 0xc3, 0x02, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x66, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, - 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x12, 0x22, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x06, 0x6a, - 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x0c, 0x53, 0x74, 0x61, - 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x0c, 0x53, 0x74, 0x61, - 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, 0x00, 0x98, - 0xa0, 0x1f, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0xb7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, - 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, - 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x42, + 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x22, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x06, + 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, 0x0a, 0x0d, 0x73, 0x74, + 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x0c, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x0c, 0x88, 0xa0, 0x1f, + 0x00, 0x98, 0xa0, 0x1f, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0xb7, 0x01, 0xd8, 0xe2, 0x1e, 0x01, + 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, + 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4965,7 +4969,7 @@ var file_poktroll_migration_legacy_proto_depIdxs = []int32{ 5, // 3: poktroll.migration.MorseAppState.pos:type_name -> poktroll.migration.MorsePos 6, // 4: poktroll.migration.MorseApplications.applications:type_name -> poktroll.migration.MorseApplication 4, // 5: poktroll.migration.MorseAuth.accounts:type_name -> poktroll.migration.MorseAuthAccount - 8, // 6: poktroll.migration.MorseAuthAccount.Value:type_name -> poktroll.migration.MorseAccount + 8, // 6: poktroll.migration.MorseAuthAccount.value:type_name -> poktroll.migration.MorseAccount 7, // 7: poktroll.migration.MorsePos.validators:type_name -> poktroll.migration.MorseValidator 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type diff --git a/api/poktroll/migration/types.pulsar.go b/api/poktroll/migration/types.pulsar.go index 1a1090c0a..fe64423be 100644 --- a/api/poktroll/migration/types.pulsar.go +++ b/api/poktroll/migration/types.pulsar.go @@ -1727,7 +1727,7 @@ var file_poktroll_migration_types_proto_rawDesc = []byte{ 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x08, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x96, 0x02, 0x0a, 0x0c, 0x4d, 0x6f, 0x72, 0x73, 0x65, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x9f, 0x02, 0x0a, 0x0c, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x54, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3a, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, @@ -1740,28 +1740,28 @@ var file_poktroll_migration_types_proto_rawDesc = []byte{ 0x65, 0x79, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, - 0x35, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, + 0x3e, 0x0a, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, - 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x17, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, - 0x88, 0xa2, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, - 0x44, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, - 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x1c, 0xfa, 0xde, 0x1f, 0x18, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x65, 0x64, 0x32, - 0x35, 0x35, 0x31, 0x39, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xb6, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, - 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, - 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, - 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, - 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0xea, + 0xde, 0x1f, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, + 0x17, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, 0x88, 0xa2, 0x1f, 0x01, 0xca, 0xb4, 0x2d, + 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x44, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x1c, 0xfa, 0xde, 0x1f, 0x18, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x65, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x2e, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xb6, + 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0a, 0x54, + 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0xa2, 0x02, 0x03, 0x50, 0x4d, 0x58, 0xaa, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xca, 0x02, 0x12, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0xe2, 0x02, 0x1e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x4d, 0x69, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x4d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/cmd/poktrolld/cmd/migrate/migrate.go b/cmd/poktrolld/cmd/migrate/migrate.go index cd803a304..8c7eaff05 100644 --- a/cmd/poktrolld/cmd/migrate/migrate.go +++ b/cmd/poktrolld/cmd/migrate/migrate.go @@ -15,6 +15,8 @@ import ( migrationtypes "github.com/pokt-network/poktroll/x/migration/types" ) +const defaultLogOutput = "-" + var ( flagDebugAccountsPerLog int flagLogLevel string @@ -35,8 +37,8 @@ pocket util export-genesis-for-reset [height] [new-chain-id] > morse-state-expor err error ) logLevel := polyzero.ParseLevel(flagLogLevel) - if flagLogOutput == "-" { - logOutput = os.Stderr + if flagLogOutput == defaultLogOutput { + logOutput = os.Stdout } else { logOutput, err = os.Open(flagLogOutput) if err != nil { @@ -61,7 +63,7 @@ func MigrateCmd() *cobra.Command { } migrateCmd.AddCommand(collectMorseAccountsCmd) migrateCmd.PersistentFlags().StringVar(&flagLogLevel, "log-level", "info", "The logging level (debug|info|warn|error)") - migrateCmd.PersistentFlags().StringVar(&flagLogOutput, "log-output", "-", "The logging output (file path); defaults to stdout") + migrateCmd.PersistentFlags().StringVar(&flagLogOutput, "log-output", defaultLogOutput, "The logging output (file path); defaults to stdout") collectMorseAccountsCmd.Flags().IntVar(&flagDebugAccountsPerLog, "debug-accounts-per-log", 0, "The number of accounts to log per debug message") @@ -155,13 +157,7 @@ func transformMorseState( // Iterate over suppliers and add the stakes to the corresponding account balances. logger.Info().Msg("collecting supplier stakes...") - err := collectInputSupplierStakes(inputState, morseWorkspace) - if err != nil { - return err - } - - morseWorkspace.accountState = &migrationtypes.MorseAccountState{Accounts: morseWorkspace.accounts} - return nil + return collectInputSupplierStakes(inputState, morseWorkspace) } // collectInputAccountBalances iterates over the accounts in the inputState and @@ -188,12 +184,16 @@ func collectInputAccountBalances(inputState *migrationtypes.MorseStateExport, mo } coins := exportAccount.Value.Coins + + // If, for whatever reason, the account has no coins, skip it. + // DEV_NOTE: This is NEVER expected to happen, but is technically possible. if len(coins) == 0 { + logger.Warn().Str("address", accountAddr).Msg("account has no coins; skipping") return nil } // DEV_NOTE: SHOULD ONLY be one denom (upokt). - if len(coins) != 1 { + if len(coins) > 1 { return ErrMorseExportState.Wrapf( "account %q has %d token denominations, expected upokt only: %s", accountAddr, len(coins), coins, diff --git a/cmd/poktrolld/cmd/migrate/types.go b/cmd/poktrolld/cmd/migrate/types.go index 828137ce4..50d660b72 100644 --- a/cmd/poktrolld/cmd/migrate/types.go +++ b/cmd/poktrolld/cmd/migrate/types.go @@ -13,8 +13,10 @@ import ( // newMorseImportWorkspace returns a new morseImportWorkspace with fields initialized to their zero values. func newMorseImportWorkspace() *morseImportWorkspace { return &morseImportWorkspace{ - addressToIdx: make(map[string]uint64), - accounts: make([]*migrationtypes.MorseAccount, 0), + addressToIdx: make(map[string]uint64), + accountState: &migrationtypes.MorseAccountState{ + Accounts: make([]*migrationtypes.MorseAccount, 0), + }, lastAccTotalBalance: cosmosmath.ZeroInt(), lastAccTotalAppStake: cosmosmath.ZeroInt(), lastAccTotalSupplierStake: cosmosmath.ZeroInt(), @@ -27,11 +29,9 @@ type morseImportWorkspace struct { // addressToIdx is a map from the Shannon bech32 address to the index of the // corresponding MorseAccount in the accounts slice. addressToIdx map[string]uint64 - // accounts is a slice of MorseAccount objects that, when populated, will be - // used to construct the final MorseAccountState. - accounts []*migrationtypes.MorseAccount - // accountState is the final MorseAccountState that will be imported into Shannon. + // It includes a slice of MorseAccount objects which are populated, by transforming + // the input MorseStateExport into the output MorseAccountState. accountState *migrationtypes.MorseAccountState // lastAccAccountIdx is the index at which the most recent accumulation/totaling @@ -57,7 +57,7 @@ type morseImportWorkspace struct { // nextIdx returns the next index to be used when appending a new account to the accounts slice. func (miw *morseImportWorkspace) nextIdx() uint64 { - return uint64(len(miw.accounts)) + return uint64(len(miw.accountState.Accounts)) } // hasAccount returns true if the given address is present in the accounts slice. @@ -101,7 +101,7 @@ func (miw *morseImportWorkspace) infoLogComplete() error { Str("total_supplier_stake", miw.totalSupplierStake().String()). Str("grand_total", miw.grandTotal().String()). Str("morse_account_state_hash", fmt.Sprintf("%x", accountStateHash)). - Msg("processing accounts...") + Msg("processing accounts complete") return nil } @@ -132,7 +132,7 @@ func (miw *morseImportWorkspace) grandTotal() cosmosmath.Int { // TODO_IN_THIS_COMMIT: godoc... func (miw *morseImportWorkspace) accumulateTotals() { - for idx, account := range miw.accounts[miw.lastAccAccountIdx:] { + for idx, account := range miw.accountState.Accounts[miw.lastAccAccountIdx:] { miw.lastAccTotalBalance = miw.lastAccTotalBalance.Add(account.Coins[0].Amount) miw.lastAccTotalAppStake = miw.lastAccTotalAppStake.Add(account.Coins[0].Amount) miw.lastAccTotalSupplierStake = miw.lastAccTotalSupplierStake.Add(account.Coins[0].Amount) @@ -153,7 +153,7 @@ func (miw *morseImportWorkspace) ensureAccount( if accountIdx, ok = miw.addressToIdx[addr]; ok { logger.Warn().Str("address", addr).Msg("unexpected workspace state: account already exists") - importAccount := miw.accounts[accountIdx] + importAccount := miw.accountState.Accounts[accountIdx] // Each account should have EXACTLY one token denomination. if len(importAccount.Coins) != 1 { err := ErrMorseStateTransform.Wrapf("account %q has multiple token denominations: %s", addr, importAccount.Coins) @@ -167,7 +167,7 @@ func (miw *morseImportWorkspace) ensureAccount( PubKey: exportAccount.Value.PubKey, Coins: cosmostypes.Coins{balance}, } - miw.accounts = append(miw.accounts, importAccount) + miw.accountState.Accounts = append(miw.accountState.Accounts, importAccount) miw.addressToIdx[addr] = accountIdx } @@ -181,7 +181,7 @@ func (miw *morseImportWorkspace) addUpokt(addr string, amount cosmosmath.Int) er return ErrMorseStateTransform.Wrapf("account %q not found", addr) } - account := miw.accounts[importAccountIdx] + account := miw.accountState.Accounts[importAccountIdx] if len(account.Coins) != 1 { return ErrMorseStateTransform.Wrapf( "account %q has %d token denominations, expected upokt only: %s", diff --git a/e2e/tests/update_params_test.go b/e2e/tests/update_params_test.go index 7c08a182b..27c0be4d0 100644 --- a/e2e/tests/update_params_test.go +++ b/e2e/tests/update_params_test.go @@ -15,14 +15,14 @@ import ( "github.com/regen-network/gocuke" "github.com/stretchr/testify/require" - /// "github.com/pokt-network/poktroll/api/poktroll/application" - /// "github.com/pokt-network/poktroll/api/poktroll/gateway" - /// "github.com/pokt-network/poktroll/api/poktroll/proof" - /// "github.com/pokt-network/poktroll/api/poktroll/service" - /// "github.com/pokt-network/poktroll/api/poktroll/session" - /// "github.com/pokt-network/poktroll/api/poktroll/shared" - /// "github.com/pokt-network/poktroll/api/poktroll/supplier" - /// "github.com/pokt-network/poktroll/api/poktroll/tokenomics" + "github.com/pokt-network/poktroll/api/poktroll/application" + "github.com/pokt-network/poktroll/api/poktroll/gateway" + "github.com/pokt-network/poktroll/api/poktroll/proof" + "github.com/pokt-network/poktroll/api/poktroll/service" + "github.com/pokt-network/poktroll/api/poktroll/session" + "github.com/pokt-network/poktroll/api/poktroll/shared" + "github.com/pokt-network/poktroll/api/poktroll/supplier" + "github.com/pokt-network/poktroll/api/poktroll/tokenomics" apptypes "github.com/pokt-network/poktroll/x/application/types" gatewaytypes "github.com/pokt-network/poktroll/x/gateway/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" diff --git a/proto/poktroll/migration/legacy.proto b/proto/poktroll/migration/legacy.proto index 23dafcbea..5b66e3df9 100644 --- a/proto/poktroll/migration/legacy.proto +++ b/proto/poktroll/migration/legacy.proto @@ -3,11 +3,11 @@ syntax = "proto3"; // Types in this file are ONLY present to facilitate the verifiability of the // migration state from Morse to Shannon. // -// These types are used by the migration subcommand to transform +// These types are used by the migration subcommand to transform // the Morse state export into the Shannon state import. // Ref: `poktrolld migrate collect-morse-accounts ...` // -// They ARE NOT persisted on-chain at any point.package poktroll.migration; +// They ARE NOT persisted on-chain at any point. package poktroll.migration; import "gogoproto/gogo.proto"; @@ -44,15 +44,15 @@ message MorseAuth { repeated MorseAuthAccount accounts = 1 [(gogoproto.jsontag) = "accounts"]; } -// A wrapper around Morse account information, necessary in order to to confirm to the Morse genesis +// A wrapper around Morse account information, necessary in order to to conform to the Morse genesis // structure. Morse originally serialized accounts as pb.Any types in order to support multiple // account types. For the purposes of the Morse -> Shannon migration, we're only concerned with // externally owned accounts (as opposed to module accounts). As a result, we're simplifying its -// representation in Shannon by avoiding usage of pb.Any. It is necessary in order too conform to +// representation in Shannon by avoiding usage of pb.Any. It is necessary in order to conform to // the Morse genesis structure. message MorseAuthAccount { - string Type = 1 [(gogoproto.jsontag) = "type"]; - MorseAccount Value = 2 [(gogoproto.jsontag) = "value"]; + string type = 1 [(gogoproto.jsontag) = "type"]; + MorseAccount value = 2 [(gogoproto.jsontag) = "value"]; } // A wrapper around the list of Morse suppliers (aka "validators", "nodes", of "servicers"). @@ -68,13 +68,14 @@ message MorseApplication { option (gogoproto.equal) = true; option (gogoproto.goproto_getters) = false; - // Address is a hex-encoded string representation of the address corresponding + // Address is a binary representation of the address corresponding // to a Morse application's ed25519 public key. bytes address = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.jsontag) = "address", (gogoproto.moretags) = "yaml:\"address\""]; // PublicKey is the binary representation of a Morse application's ed25519 public key. bytes public_key = 2 [(gogoproto.jsontag) = "public_key", (gogoproto.moretags) = "yaml:\"public_key\""]; bool jailed = 3[(gogoproto.jsontag) = "jailed", (gogoproto.moretags) = "yaml:\"jailed\""]; int32 status = 4 [(gogoproto.jsontag) = "status", (gogoproto.moretags) = "yaml:\"status\""]; + // The string representation of the BigInt amount of upokt. string staked_tokens = 6 [(gogoproto.jsontag) = "tokens"]; } @@ -86,9 +87,12 @@ message MorseValidator { option (gogoproto.goproto_stringer) = true; option (gogoproto.goproto_getters) = false; - bytes Address = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; - bytes PublicKey = 2 [(gogoproto.moretags) = "yaml:\"public_key\"", (gogoproto.jsontag) = "public_key"]; + // A binary representation of the address corresponding to a Morse application's ed25519 public key. + bytes address = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; + // The binary representation of a Morse application's ed25519 public key. + bytes public_key = 2 [(gogoproto.moretags) = "yaml:\"public_key\"", (gogoproto.jsontag) = "public_key"]; bool jailed = 3 [(gogoproto.jsontag) = "jailed"]; int32 status = 4 [(gogoproto.jsontag) = "status"]; - string StakedTokens = 7 [(gogoproto.jsontag) = "tokens"]; + // The string representation of the BigInt amount of upokt. + string staked_tokens = 7 [(gogoproto.jsontag) = "tokens"]; } diff --git a/proto/poktroll/migration/types.proto b/proto/poktroll/migration/types.proto index c978151e5..0b003e269 100644 --- a/proto/poktroll/migration/types.proto +++ b/proto/poktroll/migration/types.proto @@ -25,7 +25,7 @@ message MorseAccount { bytes address = 1 [(gogoproto.jsontag) = "address", (gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address"]; MorsePublicKey pub_key = 2 [(gogoproto.jsontag) = "public_key", (gogoproto.moretags) = "yaml:\"public_key\""]; - repeated cosmos.base.v1beta1.Coin coins = 3 [(gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin coins = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "coins"]; } // MorsePublicKey is required to conform to the encoding of the Morse state export. diff --git a/x/migration/types/legacy.pb.go b/x/migration/types/legacy.pb.go index 302a8614a..b998ee9ce 100644 --- a/x/migration/types/legacy.pb.go +++ b/x/migration/types/legacy.pb.go @@ -4,11 +4,11 @@ // Types in this file are ONLY present to facilitate the verifiability of the // migration state from Morse to Shannon. // -// These types are used by the migration subcommand to transform +// These types are used by the migration subcommand to transform // the Morse state export into the Shannon state import. // Ref: `poktrolld migrate collect-morse-accounts ...` // -// They ARE NOT persisted on-chain at any point.package poktroll.migration; +// They ARE NOT persisted on-chain at any point. package types @@ -227,15 +227,15 @@ func (m *MorseAuth) GetAccounts() []*MorseAuthAccount { return nil } -// A wrapper around Morse account information, necessary in order to to confirm to the Morse genesis +// A wrapper around Morse account information, necessary in order to to conform to the Morse genesis // structure. Morse originally serialized accounts as pb.Any types in order to support multiple // account types. For the purposes of the Morse -> Shannon migration, we're only concerned with // externally owned accounts (as opposed to module accounts). As a result, we're simplifying its -// representation in Shannon by avoiding usage of pb.Any. It is necessary in order too conform to +// representation in Shannon by avoiding usage of pb.Any. It is necessary in order to conform to // the Morse genesis structure. type MorseAuthAccount struct { - Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"type"` - Value *MorseAccount `protobuf:"bytes,2,opt,name=Value,proto3" json:"value"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type"` + Value *MorseAccount `protobuf:"bytes,2,opt,name=value,proto3" json:"value"` } func (m *MorseAuthAccount) Reset() { *m = MorseAuthAccount{} } @@ -327,13 +327,14 @@ func (m *MorsePos) GetValidators() []*MorseValidator { // It encapsulates the minimum information required to import Morse applications. // See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 type MorseApplication struct { - // Address is a hex-encoded string representation of the address corresponding + // Address is a binary representation of the address corresponding // to a Morse application's ed25519 public key. Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` // PublicKey is the binary representation of a Morse application's ed25519 public key. - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"` - Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status" yaml:"status"` + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status" yaml:"status"` + // The string representation of the BigInt amount of upokt. StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"tokens"` } @@ -370,11 +371,14 @@ var xxx_messageInfo_MorseApplication proto.InternalMessageInfo // It encapsulates the minimum information required to import Morse suppliers (aka "servicers" or "validators"). // See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 type MorseValidator struct { - Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` - PublicKey []byte `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"public_key" yaml:"public_key"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed"` - Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status"` - StakedTokens string `protobuf:"bytes,7,opt,name=StakedTokens,proto3" json:"tokens"` + // A binary representation of the address corresponding to a Morse application's ed25519 public key. + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` + // The binary representation of a Morse application's ed25519 public key. + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status"` + // The string representation of the BigInt amount of upokt. + StakedTokens string `protobuf:"bytes,7,opt,name=staked_tokens,json=stakedTokens,proto3" json:"tokens"` } func (m *MorseValidator) Reset() { *m = MorseValidator{} } @@ -420,53 +424,52 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/legacy.proto", fileDescriptor_3ba469df9d72c7fc) } var fileDescriptor_3ba469df9d72c7fc = []byte{ - // 733 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xbd, 0x6b, 0x1b, 0x49, - 0x14, 0xd7, 0xfa, 0x4b, 0xd2, 0x48, 0xf2, 0xd9, 0xc3, 0x15, 0xc2, 0xe7, 0xdb, 0xd1, 0xcd, 0xdd, - 0x11, 0x41, 0x88, 0x04, 0x72, 0x11, 0x70, 0x2a, 0x2d, 0x04, 0x02, 0x89, 0x83, 0x19, 0x1b, 0x13, - 0x1c, 0x88, 0x19, 0x49, 0x6b, 0x49, 0xd1, 0x4a, 0x33, 0xec, 0xcc, 0x3a, 0xd6, 0x7f, 0x10, 0x52, - 0xa5, 0x4c, 0xe9, 0x7f, 0x25, 0x5d, 0x4a, 0x97, 0xae, 0x36, 0x41, 0x6a, 0xc2, 0x96, 0x2e, 0x53, - 0x85, 0x99, 0xfd, 0xd0, 0xca, 0x8e, 0x82, 0x53, 0xa4, 0x59, 0xe6, 0xbd, 0xf7, 0xfb, 0xbd, 0x8f, - 0xdf, 0xbc, 0x65, 0x00, 0xe2, 0x6c, 0x20, 0x5d, 0xe6, 0x38, 0xf5, 0x61, 0xbf, 0xeb, 0x52, 0xd9, - 0x67, 0xa3, 0xba, 0x63, 0x77, 0x69, 0x7b, 0x5c, 0xe3, 0x2e, 0x93, 0x0c, 0xc2, 0x18, 0x50, 0x4b, - 0x00, 0x5b, 0x7f, 0x76, 0x59, 0x97, 0xe9, 0x70, 0x5d, 0x9d, 0x42, 0xe4, 0x96, 0xf9, 0x83, 0x54, - 0x72, 0xcc, 0x6d, 0x11, 0xc6, 0xf1, 0x3b, 0x03, 0x6c, 0xec, 0x31, 0x57, 0xd8, 0x07, 0x92, 0x4a, - 0xfb, 0xf1, 0x39, 0x67, 0xae, 0x84, 0xf7, 0x40, 0x8e, 0x72, 0x7e, 0xd2, 0xa3, 0xa2, 0x57, 0x36, - 0x2a, 0x46, 0x35, 0x6f, 0x15, 0x03, 0x1f, 0x25, 0x3e, 0x92, 0xa5, 0x9c, 0x3f, 0xa1, 0xa2, 0x07, - 0xf7, 0x40, 0x5e, 0x39, 0x85, 0xe2, 0x96, 0x97, 0x2a, 0x46, 0xb5, 0xd0, 0xf8, 0xa7, 0x76, 0xbb, - 0xb7, 0x9a, 0xae, 0xd0, 0xe4, 0x5c, 0x17, 0xb1, 0x4a, 0x81, 0x8f, 0x66, 0x3c, 0xa2, 0xf2, 0xea, - 0x00, 0xfe, 0x6c, 0x80, 0xd2, 0x1c, 0x14, 0xbe, 0x00, 0x05, 0xca, 0xb9, 0xd3, 0x6f, 0xeb, 0x3c, - 0xba, 0x99, 0x42, 0xe3, 0xff, 0x9f, 0x95, 0x88, 0xb1, 0xc2, 0xfa, 0x23, 0xf0, 0x51, 0x9a, 0x4d, - 0xd2, 0x06, 0x7c, 0x04, 0x56, 0xa8, 0x27, 0x7b, 0x51, 0xd7, 0x7f, 0x2f, 0x4e, 0xe9, 0xc9, 0x9e, - 0x95, 0x0b, 0x7c, 0xa4, 0xe1, 0x44, 0x7f, 0xe1, 0x43, 0xb0, 0xcc, 0x99, 0x28, 0x2f, 0x6b, 0xee, - 0xf6, 0x42, 0xee, 0x3e, 0x13, 0x56, 0x36, 0xf0, 0x91, 0x02, 0x13, 0xf5, 0xc1, 0x0c, 0x6c, 0xde, - 0x6a, 0x14, 0x1e, 0x83, 0x62, 0xaa, 0x33, 0x51, 0x36, 0x2a, 0xcb, 0xd5, 0x42, 0xe3, 0xbf, 0xbb, - 0x4c, 0x69, 0x6d, 0x04, 0x3e, 0x9a, 0x63, 0x93, 0x39, 0x0b, 0xbf, 0x04, 0xf9, 0x64, 0x0c, 0xf8, - 0x1c, 0xe4, 0x68, 0xbb, 0xcd, 0xbc, 0x91, 0xbc, 0x43, 0x11, 0x4f, 0xf6, 0x9a, 0x21, 0x38, 0xba, - 0xfd, 0x88, 0x49, 0x92, 0x13, 0x16, 0xd1, 0xee, 0xa4, 0xb0, 0x70, 0x1b, 0xac, 0x1c, 0x8e, 0xb9, - 0x1d, 0xed, 0x8d, 0x16, 0x4e, 0xed, 0x1b, 0xd1, 0x5e, 0xd8, 0x04, 0xab, 0x47, 0xd4, 0xf1, 0xe2, - 0x65, 0xa9, 0x2c, 0x2e, 0x1f, 0x95, 0xce, 0x07, 0x3e, 0x5a, 0x3d, 0x53, 0x14, 0x12, 0x32, 0xf1, - 0x2b, 0x90, 0x8b, 0xc5, 0x85, 0x04, 0x80, 0x33, 0xea, 0xf4, 0x3b, 0x54, 0x32, 0x37, 0x1e, 0x09, - 0x2f, 0xcc, 0x79, 0x14, 0x43, 0xad, 0xf5, 0xc0, 0x47, 0x29, 0x26, 0x49, 0x9d, 0xf1, 0x74, 0x29, - 0x9e, 0x2a, 0xb5, 0x2d, 0xa7, 0x20, 0x4b, 0x3b, 0x1d, 0xd7, 0x16, 0x42, 0x0f, 0x56, 0xb4, 0x9e, - 0x05, 0x3e, 0x8a, 0x5d, 0xd7, 0x3e, 0x5a, 0x1f, 0xd3, 0xa1, 0xb3, 0x8b, 0x23, 0x07, 0xfe, 0xe6, - 0xa3, 0xfb, 0xdd, 0xbe, 0xec, 0x79, 0xad, 0x5a, 0x9b, 0x0d, 0xeb, 0x6d, 0x36, 0xb4, 0x65, 0xeb, - 0x54, 0xa6, 0x0e, 0xee, 0x98, 0x4b, 0x56, 0x6b, 0x86, 0x78, 0x12, 0x67, 0x82, 0x16, 0x00, 0xdc, - 0x6b, 0x39, 0xfd, 0xf6, 0xc9, 0xc0, 0x1e, 0x6b, 0x91, 0x8a, 0xd6, 0xbf, 0xaa, 0xd9, 0x99, 0xf7, - 0xda, 0x47, 0x9b, 0x61, 0xb5, 0x99, 0x0f, 0x93, 0x7c, 0x68, 0x3c, 0xb5, 0xc7, 0x70, 0x07, 0xac, - 0xbd, 0xa6, 0x7d, 0xc7, 0xee, 0xe8, 0xfd, 0xcc, 0x59, 0x7f, 0x05, 0x3e, 0x8a, 0x3c, 0xd7, 0x3e, - 0x2a, 0x85, 0xdc, 0xd0, 0xc6, 0x24, 0x0a, 0x28, 0x92, 0xfa, 0x1b, 0x3d, 0x51, 0x5e, 0xa9, 0x18, - 0xd5, 0xd5, 0x90, 0x14, 0x7a, 0x66, 0xa4, 0xd0, 0xc6, 0x24, 0x0a, 0xc0, 0x3a, 0x28, 0x09, 0x49, - 0x07, 0x76, 0xe7, 0x44, 0xb2, 0x81, 0x3d, 0x12, 0xe5, 0x35, 0x7d, 0xe9, 0x40, 0x71, 0x43, 0x0f, - 0x29, 0x86, 0x80, 0x43, 0x6d, 0xed, 0xe6, 0xde, 0x5e, 0xa0, 0xcc, 0xd7, 0x0b, 0x64, 0xe0, 0x8f, - 0x4b, 0x60, 0x7d, 0xfe, 0x52, 0x94, 0xc6, 0xcd, 0xdf, 0xa9, 0x71, 0x74, 0x80, 0x4d, 0x90, 0xdf, - 0x8f, 0xc5, 0xfa, 0x25, 0x89, 0x13, 0x16, 0xc4, 0x37, 0x24, 0x06, 0x33, 0x89, 0x13, 0x45, 0xf1, - 0x0d, 0x45, 0xc1, 0x4c, 0xd1, 0x44, 0xc0, 0x1a, 0x28, 0x1e, 0xa4, 0xf4, 0x29, 0x67, 0x6f, 0xeb, - 0x97, 0x8e, 0xef, 0x16, 0x95, 0x7e, 0x1f, 0x2e, 0x90, 0xa1, 0x34, 0xb4, 0xf6, 0x3f, 0x4d, 0x4c, - 0xe3, 0x72, 0x62, 0x1a, 0x57, 0x13, 0xd3, 0xf8, 0x32, 0x31, 0x8d, 0xf7, 0x53, 0x33, 0x73, 0x39, - 0x35, 0x33, 0x57, 0x53, 0x33, 0x73, 0xdc, 0x48, 0x89, 0xa3, 0xfe, 0x88, 0x07, 0x23, 0x5b, 0xbe, - 0x61, 0xee, 0xa0, 0x9e, 0xbc, 0x08, 0xe7, 0x37, 0xdf, 0x84, 0xd6, 0x9a, 0x7e, 0x14, 0x76, 0xbe, - 0x07, 0x00, 0x00, 0xff, 0xff, 0x70, 0x19, 0x49, 0x20, 0x81, 0x06, 0x00, 0x00, + // 705 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xcf, 0x6f, 0x13, 0x39, + 0x14, 0xce, 0xf4, 0x57, 0x12, 0x27, 0xe9, 0xb6, 0xd6, 0x1e, 0xa2, 0x6e, 0x77, 0x9c, 0xf5, 0xee, + 0x6a, 0x23, 0xad, 0x48, 0xa4, 0xf4, 0x80, 0x54, 0x4e, 0x19, 0x09, 0x09, 0x09, 0x8a, 0x2a, 0x83, + 0x10, 0x2a, 0x12, 0x95, 0x93, 0x4c, 0x93, 0x90, 0x49, 0x6c, 0x8d, 0x3d, 0xa5, 0xf9, 0x0f, 0x10, + 0x27, 0x8e, 0x1c, 0xfb, 0xbf, 0x70, 0xe1, 0xd8, 0x63, 0x4f, 0x03, 0x4a, 0x2e, 0x68, 0x8e, 0x3d, + 0x72, 0x42, 0xb6, 0x67, 0x92, 0x49, 0x4b, 0xa0, 0x57, 0x2e, 0x1e, 0xbf, 0xe7, 0xef, 0x7b, 0x3f, + 0x3e, 0xbf, 0x91, 0x01, 0xe2, 0x6c, 0x20, 0x7d, 0xe6, 0x79, 0xf5, 0x61, 0xbf, 0xeb, 0x53, 0xd9, + 0x67, 0xa3, 0xba, 0xe7, 0x76, 0x69, 0x7b, 0x5c, 0xe3, 0x3e, 0x93, 0x0c, 0xc2, 0x04, 0x50, 0x9b, + 0x01, 0x76, 0x7e, 0xef, 0xb2, 0x2e, 0xd3, 0xc7, 0x75, 0xb5, 0x33, 0xc8, 0x1d, 0xfb, 0x3b, 0xa1, + 0xe4, 0x98, 0xbb, 0xc2, 0x9c, 0xe3, 0xb7, 0x16, 0xd8, 0x3a, 0x60, 0xbe, 0x70, 0x9f, 0x48, 0x2a, + 0xdd, 0xfb, 0x67, 0x9c, 0xf9, 0x12, 0xfe, 0x07, 0x72, 0x94, 0xf3, 0xe3, 0x1e, 0x15, 0xbd, 0xb2, + 0x55, 0xb1, 0xaa, 0x79, 0xa7, 0x18, 0x85, 0x68, 0xe6, 0x23, 0x59, 0xca, 0xf9, 0x03, 0x2a, 0x7a, + 0xf0, 0x00, 0xe4, 0x95, 0x53, 0x28, 0x6e, 0x79, 0xa5, 0x62, 0x55, 0x0b, 0x8d, 0xbf, 0x6a, 0x37, + 0x6b, 0xab, 0xe9, 0x0c, 0x4d, 0xce, 0x75, 0x12, 0xa7, 0x14, 0x85, 0x68, 0xce, 0x23, 0x2a, 0xae, + 0x3e, 0xc0, 0x9f, 0x2c, 0x50, 0x5a, 0x80, 0xc2, 0xe7, 0xa0, 0x40, 0x39, 0xf7, 0xfa, 0x6d, 0x1d, + 0x47, 0x17, 0x53, 0x68, 0xfc, 0xfb, 0xa3, 0x14, 0x09, 0x56, 0x38, 0xbf, 0x45, 0x21, 0x4a, 0xb3, + 0x49, 0xda, 0x80, 0xf7, 0xc0, 0x1a, 0x0d, 0x64, 0x2f, 0xae, 0xfa, 0xcf, 0xe5, 0x21, 0x03, 0xd9, + 0x73, 0x72, 0x51, 0x88, 0x34, 0x9c, 0xe8, 0x15, 0xde, 0x05, 0xab, 0x9c, 0x89, 0xf2, 0xaa, 0xe6, + 0xee, 0x2e, 0xe5, 0x1e, 0x32, 0xe1, 0x64, 0xa3, 0x10, 0x29, 0x30, 0x51, 0x0b, 0x66, 0x60, 0xfb, + 0x46, 0xa1, 0xf0, 0x08, 0x14, 0x53, 0x95, 0x89, 0xb2, 0x55, 0x59, 0xad, 0x16, 0x1a, 0xff, 0xdc, + 0xa6, 0x4b, 0x67, 0x2b, 0x0a, 0xd1, 0x02, 0x9b, 0x2c, 0x58, 0xf8, 0x05, 0xc8, 0xcf, 0xda, 0x80, + 0x8f, 0x41, 0x8e, 0xb6, 0xdb, 0x2c, 0x18, 0xc9, 0x5b, 0x24, 0x09, 0x64, 0xaf, 0x69, 0xc0, 0xf1, + 0xed, 0xc7, 0x4c, 0x32, 0xdb, 0x61, 0x11, 0xcf, 0x4e, 0x0a, 0x0b, 0x77, 0xc1, 0x9a, 0x9a, 0xaf, + 0x78, 0x6e, 0xb4, 0x70, 0xca, 0x26, 0x7a, 0x85, 0x4d, 0xb0, 0x7e, 0x4a, 0xbd, 0x20, 0x19, 0x96, + 0xca, 0xf2, 0xf4, 0x71, 0xea, 0x7c, 0x14, 0x22, 0x43, 0x21, 0xe6, 0x83, 0x5f, 0x82, 0x5c, 0x22, + 0x2e, 0x24, 0x00, 0x9c, 0x52, 0xaf, 0xdf, 0xa1, 0x92, 0xf9, 0x49, 0x4b, 0x78, 0x69, 0xcc, 0x67, + 0x09, 0xd4, 0xd9, 0x8c, 0x42, 0x94, 0x62, 0x92, 0xd4, 0x1e, 0x4f, 0x57, 0x92, 0xae, 0x52, 0xd3, + 0x72, 0x02, 0xb2, 0xb4, 0xd3, 0xf1, 0x5d, 0x21, 0x74, 0x63, 0x45, 0xe7, 0x51, 0x14, 0xa2, 0xc4, + 0x75, 0x15, 0xa2, 0xcd, 0x31, 0x1d, 0x7a, 0xfb, 0x38, 0x76, 0xe0, 0xaf, 0x21, 0xfa, 0xbf, 0xdb, + 0x97, 0xbd, 0xa0, 0x55, 0x6b, 0xb3, 0x61, 0xbd, 0xcd, 0x86, 0xae, 0x6c, 0x9d, 0xc8, 0xd4, 0xc6, + 0x1f, 0x73, 0xc9, 0x6a, 0x4d, 0x83, 0x27, 0x49, 0x24, 0xe8, 0x00, 0xc0, 0x83, 0x96, 0xd7, 0x6f, + 0x1f, 0x0f, 0xdc, 0xb1, 0x16, 0xa9, 0xe8, 0xfc, 0xad, 0x8a, 0x9d, 0x7b, 0xaf, 0x42, 0xb4, 0x6d, + 0xb2, 0xcd, 0x7d, 0x98, 0xe4, 0x8d, 0xf1, 0xd0, 0x1d, 0xc3, 0x3d, 0xb0, 0xf1, 0x8a, 0xf6, 0x3d, + 0xb7, 0xa3, 0xe7, 0x33, 0xe7, 0xfc, 0x11, 0x85, 0x28, 0xf6, 0x5c, 0x85, 0xa8, 0x64, 0xb8, 0xc6, + 0xc6, 0x24, 0x3e, 0x50, 0x24, 0xf5, 0x37, 0x06, 0xa2, 0xbc, 0x56, 0xb1, 0xaa, 0xeb, 0x86, 0x64, + 0x3c, 0x73, 0x92, 0xb1, 0x31, 0x89, 0x0f, 0x60, 0x1d, 0x94, 0x84, 0xa4, 0x03, 0xb7, 0x73, 0x2c, + 0xd9, 0xc0, 0x1d, 0x89, 0xf2, 0x86, 0xbe, 0x74, 0xa0, 0xb8, 0xc6, 0x43, 0x8a, 0x06, 0xf0, 0x54, + 0x5b, 0xfb, 0xb9, 0x37, 0xe7, 0x28, 0xf3, 0xe5, 0x1c, 0x59, 0xf8, 0xc3, 0x0a, 0xd8, 0x5c, 0xbc, + 0x94, 0x5f, 0x4a, 0x63, 0x7c, 0x4d, 0x63, 0x30, 0xd7, 0x78, 0x26, 0x29, 0xbe, 0x26, 0x29, 0x98, + 0x4b, 0xba, 0x5c, 0xc1, 0xec, 0x4f, 0x14, 0x2c, 0x2a, 0x05, 0xdf, 0x9f, 0x23, 0x4b, 0xa9, 0xe8, + 0x1c, 0x7e, 0x9c, 0xd8, 0xd6, 0xc5, 0xc4, 0xb6, 0x2e, 0x27, 0xb6, 0xf5, 0x79, 0x62, 0x5b, 0xef, + 0xa6, 0x76, 0xe6, 0x62, 0x6a, 0x67, 0x2e, 0xa7, 0x76, 0xe6, 0xa8, 0x91, 0x92, 0x47, 0xfd, 0x13, + 0x77, 0x46, 0xae, 0x7c, 0xcd, 0xfc, 0x41, 0x7d, 0xf6, 0x26, 0x9c, 0x5d, 0x7f, 0x15, 0x5a, 0x1b, + 0xfa, 0x59, 0xd8, 0xfb, 0x16, 0x00, 0x00, 0xff, 0xff, 0x02, 0x82, 0xc9, 0x0f, 0x83, 0x06, 0x00, + 0x00, } func (this *MorseApplication) Equal(that interface{}) bool { diff --git a/x/migration/types/types.pb.go b/x/migration/types/types.pb.go index 91a2f7d54..c63ed04c8 100644 --- a/x/migration/types/types.pb.go +++ b/x/migration/types/types.pb.go @@ -161,35 +161,36 @@ func init() { func init() { proto.RegisterFile("poktroll/migration/types.proto", fileDescriptor_7ed31f79aa0bc330) } var fileDescriptor_7ed31f79aa0bc330 = []byte{ - // 444 bytes of a gzipped FileDescriptorProto + // 449 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x7d, 0x2d, 0x6d, 0xd0, 0x35, 0x42, 0xaa, 0x85, 0x44, 0x5a, 0xa1, 0xbb, 0xc8, 0x2c, - 0x91, 0x50, 0xef, 0x14, 0xa3, 0x0c, 0x64, 0xab, 0x61, 0xa2, 0x42, 0xaa, 0x0c, 0x13, 0x4b, 0xb0, - 0x9d, 0x23, 0x58, 0xb1, 0xfd, 0x2c, 0xdf, 0xb9, 0xe0, 0x6f, 0xd0, 0x91, 0x09, 0x31, 0x56, 0x7c, - 0x06, 0x3e, 0x44, 0xc5, 0xd4, 0xb1, 0x93, 0x85, 0x92, 0x2d, 0x23, 0x63, 0x26, 0x64, 0x5f, 0x62, - 0x0c, 0x88, 0xed, 0xfd, 0xdf, 0xfb, 0xff, 0x4f, 0xef, 0x7e, 0x7a, 0x98, 0xa4, 0x30, 0x57, 0x19, - 0x44, 0x11, 0x8f, 0xc3, 0x59, 0xe6, 0xa9, 0x10, 0x12, 0xae, 0x8a, 0x54, 0x48, 0x96, 0x66, 0xa0, - 0xc0, 0x34, 0xb7, 0x73, 0xd6, 0xcc, 0x8f, 0x8f, 0x02, 0x90, 0x31, 0xc8, 0x49, 0xed, 0xe0, 0x5a, - 0x68, 0xfb, 0x31, 0xd1, 0x8a, 0xfb, 0x9e, 0x14, 0xfc, 0x62, 0xe8, 0x0b, 0xe5, 0x0d, 0x79, 0x00, - 0x61, 0xb2, 0x99, 0xdf, 0x9f, 0xc1, 0x0c, 0x74, 0xae, 0xaa, 0x74, 0xd7, 0x9a, 0xe0, 0xc3, 0x97, - 0x90, 0x49, 0x71, 0x1a, 0x04, 0x90, 0x27, 0xea, 0x95, 0xf2, 0x94, 0x30, 0x5f, 0xe0, 0xbb, 0x9e, - 0xd6, 0xb2, 0x87, 0xfa, 0xbb, 0x83, 0x03, 0xbb, 0xcf, 0xfe, 0x5d, 0x86, 0xb5, 0x83, 0x4e, 0x77, - 0x55, 0xd2, 0x26, 0xe5, 0x36, 0x95, 0xf5, 0x79, 0x07, 0x77, 0xdb, 0x46, 0xf3, 0x35, 0xee, 0x78, - 0xd3, 0x69, 0x26, 0x64, 0xf5, 0x36, 0x1a, 0x74, 0x9d, 0xf1, 0xaa, 0xa4, 0xdb, 0xd6, 0xba, 0xa4, - 0x8f, 0x67, 0xa1, 0x7a, 0x9f, 0xfb, 0x2c, 0x80, 0x98, 0x07, 0x10, 0x0b, 0xe5, 0xbf, 0x53, 0xad, - 0x22, 0x2b, 0x52, 0x05, 0xec, 0x54, 0xdb, 0xdd, 0x6d, 0xce, 0x7c, 0x8b, 0x3b, 0x69, 0xee, 0x4f, - 0xe6, 0xa2, 0xe8, 0xed, 0xf4, 0xd1, 0xe0, 0xc0, 0xb6, 0xfe, 0xbb, 0xf1, 0x79, 0xee, 0x47, 0x61, - 0x70, 0x26, 0x0a, 0xe7, 0xd1, 0xaa, 0xa4, 0x38, 0xad, 0x65, 0x95, 0xfc, 0x59, 0xd2, 0xc3, 0xc2, - 0x8b, 0xa3, 0xb1, 0xf5, 0xbb, 0x67, 0xb9, 0xfb, 0x69, 0xee, 0x9f, 0x89, 0xc2, 0x1c, 0xe1, 0xbd, - 0x8a, 0xa6, 0xec, 0xed, 0xd6, 0x44, 0x8e, 0xd8, 0x86, 0x7e, 0xc5, 0x9b, 0x6d, 0x78, 0xb3, 0x67, - 0x10, 0x26, 0xce, 0x9d, 0xeb, 0x92, 0x1a, 0xae, 0x76, 0x8f, 0x1f, 0x5c, 0x5e, 0x51, 0xe3, 0xcb, - 0x15, 0x45, 0x97, 0x5f, 0x29, 0xfa, 0xfe, 0xed, 0xa4, 0xb3, 0xe1, 0x60, 0x3d, 0xc7, 0xf7, 0xfe, - 0x5c, 0xc7, 0xb4, 0xf1, 0xde, 0x85, 0x17, 0xe5, 0xa2, 0xfe, 0x41, 0xd7, 0x79, 0xb8, 0x2e, 0x69, - 0x4f, 0xff, 0x97, 0x8b, 0xa9, 0x3d, 0x1a, 0x0d, 0x9f, 0xb2, 0xc6, 0xec, 0x6a, 0xab, 0x73, 0x7e, - 0xbd, 0x20, 0xe8, 0x66, 0x41, 0xd0, 0xed, 0x82, 0xa0, 0x1f, 0x0b, 0x82, 0x3e, 0x2d, 0x89, 0x71, - 0xb3, 0x24, 0xc6, 0xed, 0x92, 0x18, 0x6f, 0xec, 0x16, 0xcb, 0x0a, 0xc7, 0x49, 0x22, 0xd4, 0x07, - 0xc8, 0xe6, 0xbc, 0x39, 0xbd, 0x8f, 0x7f, 0x1f, 0x9f, 0xbf, 0x5f, 0x1f, 0xc6, 0x93, 0x5f, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xd9, 0x80, 0x8f, 0x0e, 0x9f, 0x02, 0x00, 0x00, + 0x14, 0xc7, 0x7d, 0xad, 0xda, 0xa0, 0x6b, 0x40, 0xaa, 0x85, 0x44, 0x5a, 0xa1, 0xbb, 0xc8, 0x2c, + 0x91, 0x50, 0xef, 0x14, 0xa3, 0x0e, 0x64, 0x40, 0xaa, 0x61, 0xa2, 0x42, 0xaa, 0x0c, 0x13, 0x4b, + 0xb0, 0x9d, 0x23, 0x58, 0xb1, 0xfd, 0x2c, 0xfb, 0x5c, 0xf0, 0x37, 0xe8, 0xc8, 0xc8, 0x46, 0xc5, + 0x67, 0xe0, 0x43, 0x54, 0x4c, 0x1d, 0x3b, 0x9d, 0x50, 0xb2, 0x65, 0x64, 0xcc, 0x84, 0xec, 0x4b, + 0x8c, 0x01, 0x75, 0xf2, 0xfb, 0xbf, 0xf7, 0xff, 0x5b, 0xef, 0x7e, 0x7a, 0x98, 0xa4, 0x30, 0x93, + 0x19, 0x44, 0x11, 0x8f, 0xc3, 0x69, 0xe6, 0xc9, 0x10, 0x12, 0x2e, 0xcb, 0x54, 0xe4, 0x2c, 0xcd, + 0x40, 0x82, 0x69, 0x6e, 0xe6, 0xac, 0x99, 0x1f, 0x1e, 0x04, 0x90, 0xc7, 0x90, 0x8f, 0x6b, 0x07, + 0xd7, 0x42, 0xdb, 0x0f, 0x89, 0x56, 0xdc, 0xf7, 0x72, 0xc1, 0xcf, 0x87, 0xbe, 0x90, 0xde, 0x90, + 0x07, 0x10, 0x26, 0xeb, 0xf9, 0xfd, 0x29, 0x4c, 0x41, 0xe7, 0xaa, 0x4a, 0x77, 0xad, 0x31, 0xde, + 0x7f, 0x05, 0x59, 0x2e, 0x4e, 0x82, 0x00, 0x8a, 0x44, 0xbe, 0x96, 0x9e, 0x14, 0xe6, 0x4b, 0x7c, + 0xc7, 0xd3, 0x3a, 0xef, 0xa1, 0xfe, 0xf6, 0x60, 0xcf, 0xee, 0xb3, 0xff, 0x97, 0x61, 0xed, 0xa0, + 0xd3, 0x5d, 0x2a, 0xda, 0xa4, 0xdc, 0xa6, 0xb2, 0xbe, 0x6e, 0xe1, 0x6e, 0xdb, 0x68, 0xbe, 0xc1, + 0x1d, 0x6f, 0x32, 0xc9, 0x44, 0x5e, 0xfd, 0x1b, 0x0d, 0xba, 0xce, 0x68, 0xa9, 0xe8, 0xa6, 0xb5, + 0x52, 0xf4, 0xf1, 0x34, 0x94, 0x1f, 0x0a, 0x9f, 0x05, 0x10, 0xf3, 0x00, 0x62, 0x21, 0xfd, 0xf7, + 0xb2, 0x55, 0x64, 0x65, 0x2a, 0x81, 0x9d, 0x68, 0xbb, 0xbb, 0xc9, 0x99, 0xef, 0x70, 0x27, 0x2d, + 0xfc, 0xf1, 0x4c, 0x94, 0xbd, 0xad, 0x3e, 0x1a, 0xec, 0xd9, 0xd6, 0xad, 0x1b, 0x9f, 0x15, 0x7e, + 0x14, 0x06, 0xa7, 0xa2, 0x74, 0x1e, 0x2d, 0x15, 0xc5, 0x69, 0x2d, 0xab, 0xe4, 0x2f, 0x45, 0xf7, + 0x4b, 0x2f, 0x8e, 0x46, 0xd6, 0x9f, 0x9e, 0xe5, 0xee, 0xa6, 0x85, 0x7f, 0x2a, 0x4a, 0xf3, 0x19, + 0xde, 0xa9, 0x68, 0xe6, 0xbd, 0xed, 0x9a, 0xc8, 0x01, 0x5b, 0xd3, 0xaf, 0x78, 0xb3, 0x35, 0x6f, + 0xf6, 0x1c, 0xc2, 0xc4, 0xb9, 0x7b, 0xa5, 0xa8, 0xb1, 0x54, 0x54, 0xfb, 0x5d, 0xfd, 0x19, 0x3d, + 0xb8, 0xb8, 0xa4, 0xc6, 0x97, 0x4b, 0x8a, 0x2e, 0xbe, 0x51, 0xf4, 0xe3, 0xfb, 0x51, 0x67, 0x0d, + 0xc4, 0x7a, 0x81, 0xef, 0xfd, 0xbd, 0x97, 0x69, 0xe3, 0x9d, 0x73, 0x2f, 0x2a, 0x44, 0xfd, 0x94, + 0xae, 0xf3, 0x70, 0xa5, 0x68, 0x4f, 0x3f, 0x9c, 0x8b, 0x89, 0x7d, 0x7c, 0x3c, 0x7c, 0xca, 0x1a, + 0xb3, 0xab, 0xad, 0xce, 0xd9, 0xd5, 0x9c, 0xa0, 0xeb, 0x39, 0x41, 0x37, 0x73, 0x82, 0x7e, 0xce, + 0x09, 0xfa, 0xbc, 0x20, 0xc6, 0xf5, 0x82, 0x18, 0x37, 0x0b, 0x62, 0xbc, 0xb5, 0x5b, 0x50, 0x2b, + 0x2e, 0x47, 0x89, 0x90, 0x1f, 0x21, 0x9b, 0xf1, 0xe6, 0x06, 0x3f, 0xfd, 0x7b, 0x85, 0xfe, 0x6e, + 0x7d, 0x21, 0x4f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x7d, 0x7c, 0x0e, 0x0e, 0xa8, 0x02, 0x00, + 0x00, } func (m *MorseAccountState) Marshal() (dAtA []byte, err error) { From 6f4e99210930dbcbd088321c3ec600ec21cf0e56 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Feb 2025 12:35:55 +0100 Subject: [PATCH 18/19] chore: review improvements --- cmd/poktrolld/cmd/migrate/migrate.go | 4 ++ cmd/poktrolld/cmd/migrate/types.go | 65 ++++++++-------------------- 2 files changed, 21 insertions(+), 48 deletions(-) diff --git a/cmd/poktrolld/cmd/migrate/migrate.go b/cmd/poktrolld/cmd/migrate/migrate.go index 8c7eaff05..dcde694f8 100644 --- a/cmd/poktrolld/cmd/migrate/migrate.go +++ b/cmd/poktrolld/cmd/migrate/migrate.go @@ -244,6 +244,8 @@ func collectInputApplicationStakes(inputState *migrationtypes.MorseStateExport, appAddr, err, ) } + + morseWorkspace.lastAccTotalAppStake = morseWorkspace.lastAccTotalAppStake.Add(appStakeAmtUpokt) } return nil } @@ -270,6 +272,8 @@ func collectInputSupplierStakes(inputState *migrationtypes.MorseStateExport, mor supplierAddr, err, ) } + + morseWorkspace.lastAccTotalSupplierStake = morseWorkspace.lastAccTotalSupplierStake.Add(supplierStakeAmtUpokt) } return nil } diff --git a/cmd/poktrolld/cmd/migrate/types.go b/cmd/poktrolld/cmd/migrate/types.go index 50d660b72..ba043773e 100644 --- a/cmd/poktrolld/cmd/migrate/types.go +++ b/cmd/poktrolld/cmd/migrate/types.go @@ -66,26 +66,22 @@ func (miw *morseImportWorkspace) hasAccount(addr string) bool { return ok } -// TODO_IN_THIS_COMMIT: godoc... +// debugLogProgress prints debug level logs indicating the progress of the import, +// according to flagDebugAccountsPerLog. func (miw *morseImportWorkspace) debugLogProgress(accountIdx int) { - totalBalance := miw.totalBalance() - totalAppStake := miw.totalAppStake() - totalSupplierStake := miw.totalSupplierStake() - grandTotal := totalBalance.Add(totalAppStake).Add(totalSupplierStake) - logger.Debug(). Int("account_idx", accountIdx). Uint64("num_accounts", miw.numAccounts). Uint64("num_applications", miw.numApplications). Uint64("num_suppliers", miw.numSuppliers). - Str("total_balance", totalBalance.String()). - Str("total_app_stake", totalAppStake.String()). - Str("total_supplier_stake", totalSupplierStake.String()). - Str("grand_total", grandTotal.String()). + Str("total_balance", miw.lastAccTotalBalance.String()). + Str("total_app_stake", miw.lastAccTotalAppStake.String()). + Str("total_supplier_stake", miw.lastAccTotalSupplierStake.String()). + Str("grand_total", miw.lastAccGrandTotal().String()). Msg("processing accounts...") } -// TODO_IN_THIS_COMMIT: godoc... +// infoLogComplete prints info level logs indicating the completion of the import. func (miw *morseImportWorkspace) infoLogComplete() error { accountStateHash, err := miw.accountState.GetHash() if err != nil { @@ -96,48 +92,21 @@ func (miw *morseImportWorkspace) infoLogComplete() error { Uint64("num_accounts", miw.numAccounts). Uint64("num_applications", miw.numApplications). Uint64("num_suppliers", miw.numSuppliers). - Str("total_balance", miw.totalBalance().String()). - Str("total_app_stake", miw.totalAppStake().String()). - Str("total_supplier_stake", miw.totalSupplierStake().String()). - Str("grand_total", miw.grandTotal().String()). + Str("total_balance", miw.lastAccTotalBalance.String()). + Str("total_app_stake", miw.lastAccTotalAppStake.String()). + Str("total_supplier_stake", miw.lastAccTotalSupplierStake.String()). + Str("grand_total", miw.lastAccGrandTotal().String()). Str("morse_account_state_hash", fmt.Sprintf("%x", accountStateHash)). Msg("processing accounts complete") return nil } -// TODO_IN_THIS_COMMIT: godoc... -func (miw *morseImportWorkspace) totalBalance() cosmosmath.Int { - miw.accumulateTotals() - return miw.lastAccTotalBalance -} - -// TODO_IN_THIS_COMMIT: godoc... -func (miw *morseImportWorkspace) totalAppStake() cosmosmath.Int { - miw.accumulateTotals() - return miw.lastAccTotalAppStake -} - -// TODO_IN_THIS_COMMIT: godoc... -func (miw *morseImportWorkspace) totalSupplierStake() cosmosmath.Int { - miw.accumulateTotals() - return miw.lastAccTotalSupplierStake -} - -// TODO_IN_THIS_COMMIT: godoc... -func (miw *morseImportWorkspace) grandTotal() cosmosmath.Int { - return miw.totalBalance(). - Add(miw.totalAppStake()). - Add(miw.totalSupplierStake()) -} - -// TODO_IN_THIS_COMMIT: godoc... -func (miw *morseImportWorkspace) accumulateTotals() { - for idx, account := range miw.accountState.Accounts[miw.lastAccAccountIdx:] { - miw.lastAccTotalBalance = miw.lastAccTotalBalance.Add(account.Coins[0].Amount) - miw.lastAccTotalAppStake = miw.lastAccTotalAppStake.Add(account.Coins[0].Amount) - miw.lastAccTotalSupplierStake = miw.lastAccTotalSupplierStake.Add(account.Coins[0].Amount) - miw.lastAccAccountIdx = uint64(idx) - } +// lastAccGrandTotal returns the sum of the lastAccTotalBalance, lastAccTotalAppStake, +// and lastAccTotalSupplierStake. +func (miw *morseImportWorkspace) lastAccGrandTotal() cosmosmath.Int { + return miw.lastAccTotalBalance. + Add(miw.lastAccTotalAppStake). + Add(miw.lastAccTotalSupplierStake) } // ensureAccount ensures that the given address is present in the accounts slice From 63c0790fb57a056b7d179f05fce3f59d7420a654 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 6 Feb 2025 12:48:03 +0100 Subject: [PATCH 19/19] fix: linter error --- cmd/poktrolld/cmd/migrate/types.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmd/poktrolld/cmd/migrate/types.go b/cmd/poktrolld/cmd/migrate/types.go index ba043773e..17cbca3b7 100644 --- a/cmd/poktrolld/cmd/migrate/types.go +++ b/cmd/poktrolld/cmd/migrate/types.go @@ -34,10 +34,6 @@ type morseImportWorkspace struct { // the input MorseStateExport into the output MorseAccountState. accountState *migrationtypes.MorseAccountState - // lastAccAccountIdx is the index at which the most recent accumulation/totaling - // (of actor counts, balances, and stakes) was performed such that the next - // accumulation/totaling operation may reuse previous accumulations values. - lastAccAccountIdx uint64 // lastAccTotalBalance is the most recently accumulated balances of all Morse // accounts which have been processed. lastAccTotalBalance cosmosmath.Int