From 85992e2ea5da5323144f042146992bd19f2904b0 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 23 Jan 2025 14:00:43 +0100 Subject: [PATCH 1/8] 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 2/8] 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 3/8] 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 4/8] 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 46c87be9eb36bc2e8911a74370849ac915c3412e Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 30 Jan 2025 14:32:21 +0100 Subject: [PATCH 5/8] 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 6/8] 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 7/8] 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 8/8] 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"]; }