From 3515058ad76d5c144aba5be92f787505bef6072b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Thu, 23 Jan 2025 14:00:43 +0100 Subject: [PATCH] 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 | 251 ++ 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, 5515 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..c764160d9 --- /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 accounts and balances from the JSON file at [morse-state-path] and output them as JSON to [morse-accounts-path]", + Long: `Collects the accounts, and balances thereof, from the 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..e1e3833ed --- /dev/null +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -0,0 +1,251 @@ +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 ( + mockMorseStateJSONTmpl = template.Must(template.New("morse_state_export").Parse(` +{ + "consensus_params": { + "validator": { + "pub_key_types": [ + "ed25519" + ] + } + }, + "app_hash": "", + "app_state": { + "application": { + "params": { + "unstaking_time": "1814400000000000", + "max_applications": "9223372036854775807", + "app_stake_minimum": "1000000", + "base_relays_per_pokt": "100", + "stability_adjustment": "0", + "participation_rate_on": false, + "maximum_chains": "15" + }, + "applications": [ + { + "address": "{{.Address1Hex}}", + "public_key": "{{.PublicKey1Hex}}", + "jailed": false, + "chains": [ + "0001" + ], + "max_relays": "10000000000000", + "status": 2, + "staked_tokens": "{{.App1StakeAmount}}", + "unstaking_time": "0001-01-01T00:00:00Z" + }, + { + "address": "{{.Address2Hex}}", + "public_key": "{{.PublicKey2Hex}}", + "jailed": false, + "chains": [ + "0001" + ], + "max_relays": "10000000000000", + "status": 2, + "staked_tokens": "{{.App2StakeAmount}}", + "unstaking_time": "0001-01-01T00:00:00Z" + } + ], + "exported": false + }, + "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}}" + } + } + } + ], + "supply": [] + }, + "pos": { + "validators": [ + { + "address": "{{.Address1Hex}}", + "public_key": "{{.PublicKey1Hex}}", + "jailed": false, + "status": 2, + "chains": [ + "0001" + ], + "service_url": "http://127.0.0.1:8081", + "tokens": "{{.Supplier1StakeAmount}}", + "unstaking_time": "0001-01-01T00:00:00Z", + "output_address": "", + "reward_delegators": null + }, + { + "address": "{{.Address2Hex}}", + "public_key": "{{.PublicKey2Hex}}", + "jailed": false, + "status": 2, + "chains": [ + "0001" + ], + "service_url": "http://127.0.0.1:8081", + "tokens": "{{.Supplier2StakeAmount}}", + "unstaking_time": "0001-01-01T00:00:00Z", + "output_address": "", + "reward_delegators": null + } + ] + } + } +} +`)) + expectedJSONTmpl = template.Must(template.New("expected").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 = mockMorseStateJSONTmpl.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 = expectedJSONTmpl.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") +)