diff --git a/api/poktroll/migration/morse_offchain.pulsar.go b/api/poktroll/migration/morse_offchain.pulsar.go new file mode 100644 index 000000000..3b44382f4 --- /dev/null +++ b/api/poktroll/migration/morse_offchain.pulsar.go @@ -0,0 +1,5129 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package migration + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_MorseStateExport protoreflect.MessageDescriptor + fd_MorseStateExport_app_hash protoreflect.FieldDescriptor + fd_MorseStateExport_app_state protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_morse_offchain_proto_init() + md_MorseStateExport = File_poktroll_migration_morse_offchain_proto.Messages().ByName("MorseStateExport") + fd_MorseStateExport_app_hash = md_MorseStateExport.Fields().ByName("app_hash") + fd_MorseStateExport_app_state = md_MorseStateExport.Fields().ByName("app_state") +} + +var _ protoreflect.Message = (*fastReflection_MorseStateExport)(nil) + +type fastReflection_MorseStateExport MorseStateExport + +func (x *MorseStateExport) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseStateExport)(x) +} + +func (x *MorseStateExport) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MorseStateExport_messageType fastReflection_MorseStateExport_messageType +var _ protoreflect.MessageType = fastReflection_MorseStateExport_messageType{} + +type fastReflection_MorseStateExport_messageType struct{} + +func (x fastReflection_MorseStateExport_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseStateExport)(nil) +} +func (x fastReflection_MorseStateExport_messageType) New() protoreflect.Message { + return new(fastReflection_MorseStateExport) +} +func (x fastReflection_MorseStateExport_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseStateExport +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseStateExport) Descriptor() protoreflect.MessageDescriptor { + return md_MorseStateExport +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MorseStateExport) Type() protoreflect.MessageType { + return _fastReflection_MorseStateExport_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseStateExport) New() protoreflect.Message { + return new(fastReflection_MorseStateExport) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseStateExport) Interface() protoreflect.ProtoMessage { + return (*MorseStateExport)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MorseStateExport) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AppHash != "" { + value := protoreflect.ValueOfString(x.AppHash) + if !f(fd_MorseStateExport_app_hash, value) { + return + } + } + if x.AppState != nil { + value := protoreflect.ValueOfMessage(x.AppState.ProtoReflect()) + if !f(fd_MorseStateExport_app_state, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MorseStateExport) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + return x.AppHash != "" + case "poktroll.migration.MorseStateExport.app_state": + return x.AppState != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseStateExport) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + x.AppHash = "" + case "poktroll.migration.MorseStateExport.app_state": + x.AppState = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MorseStateExport) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + value := x.AppHash + return protoreflect.ValueOfString(value) + case "poktroll.migration.MorseStateExport.app_state": + value := x.AppState + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseStateExport) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + x.AppHash = value.Interface().(string) + case "poktroll.migration.MorseStateExport.app_state": + x.AppState = value.Message().Interface().(*MorseTendermintAppState) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseStateExport) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_state": + if x.AppState == nil { + x.AppState = new(MorseTendermintAppState) + } + return protoreflect.ValueOfMessage(x.AppState.ProtoReflect()) + case "poktroll.migration.MorseStateExport.app_hash": + panic(fmt.Errorf("field app_hash of message poktroll.migration.MorseStateExport is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MorseStateExport) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseStateExport.app_hash": + return protoreflect.ValueOfString("") + case "poktroll.migration.MorseStateExport.app_state": + m := new(MorseTendermintAppState) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseStateExport")) + } + panic(fmt.Errorf("message poktroll.migration.MorseStateExport does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MorseStateExport) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseStateExport", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MorseStateExport) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseStateExport) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MorseStateExport) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MorseStateExport) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseStateExport) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.AppHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.AppState != nil { + l = options.Size(x.AppState) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MorseStateExport) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.AppState != nil { + encoded, err := options.Marshal(x.AppState) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.AppHash) > 0 { + i -= len(x.AppHash) + copy(dAtA[i:], x.AppHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AppHash))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseStateExport) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseStateExport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseStateExport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AppHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AppState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.AppState == nil { + x.AppState = &MorseTendermintAppState{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AppState); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MorseTendermintAppState protoreflect.MessageDescriptor + fd_MorseTendermintAppState_application protoreflect.FieldDescriptor + fd_MorseTendermintAppState_auth protoreflect.FieldDescriptor + fd_MorseTendermintAppState_pos protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_morse_offchain_proto_init() + md_MorseTendermintAppState = File_poktroll_migration_morse_offchain_proto.Messages().ByName("MorseTendermintAppState") + fd_MorseTendermintAppState_application = md_MorseTendermintAppState.Fields().ByName("application") + fd_MorseTendermintAppState_auth = md_MorseTendermintAppState.Fields().ByName("auth") + fd_MorseTendermintAppState_pos = md_MorseTendermintAppState.Fields().ByName("pos") +} + +var _ protoreflect.Message = (*fastReflection_MorseTendermintAppState)(nil) + +type fastReflection_MorseTendermintAppState MorseTendermintAppState + +func (x *MorseTendermintAppState) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseTendermintAppState)(x) +} + +func (x *MorseTendermintAppState) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_morse_offchain_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_MorseTendermintAppState_messageType fastReflection_MorseTendermintAppState_messageType +var _ protoreflect.MessageType = fastReflection_MorseTendermintAppState_messageType{} + +type fastReflection_MorseTendermintAppState_messageType struct{} + +func (x fastReflection_MorseTendermintAppState_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseTendermintAppState)(nil) +} +func (x fastReflection_MorseTendermintAppState_messageType) New() protoreflect.Message { + return new(fastReflection_MorseTendermintAppState) +} +func (x fastReflection_MorseTendermintAppState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseTendermintAppState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseTendermintAppState) Descriptor() protoreflect.MessageDescriptor { + return md_MorseTendermintAppState +} + +// 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_MorseTendermintAppState) Type() protoreflect.MessageType { + return _fastReflection_MorseTendermintAppState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseTendermintAppState) New() protoreflect.Message { + return new(fastReflection_MorseTendermintAppState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseTendermintAppState) Interface() protoreflect.ProtoMessage { + return (*MorseTendermintAppState)(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_MorseTendermintAppState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Application != nil { + value := protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + if !f(fd_MorseTendermintAppState_application, value) { + return + } + } + if x.Auth != nil { + value := protoreflect.ValueOfMessage(x.Auth.ProtoReflect()) + if !f(fd_MorseTendermintAppState_auth, value) { + return + } + } + if x.Pos != nil { + value := protoreflect.ValueOfMessage(x.Pos.ProtoReflect()) + if !f(fd_MorseTendermintAppState_pos, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MorseTendermintAppState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseTendermintAppState.application": + return x.Application != nil + case "poktroll.migration.MorseTendermintAppState.auth": + return x.Auth != nil + case "poktroll.migration.MorseTendermintAppState.pos": + return x.Pos != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseTendermintAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseTendermintAppState 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_MorseTendermintAppState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseTendermintAppState.application": + x.Application = nil + case "poktroll.migration.MorseTendermintAppState.auth": + x.Auth = nil + case "poktroll.migration.MorseTendermintAppState.pos": + x.Pos = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseTendermintAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseTendermintAppState 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_MorseTendermintAppState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseTendermintAppState.application": + value := x.Application + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MorseTendermintAppState.auth": + value := x.Auth + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "poktroll.migration.MorseTendermintAppState.pos": + value := x.Pos + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseTendermintAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseTendermintAppState 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_MorseTendermintAppState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseTendermintAppState.application": + x.Application = value.Message().Interface().(*MorseApplications) + case "poktroll.migration.MorseTendermintAppState.auth": + x.Auth = value.Message().Interface().(*MorseAuth) + case "poktroll.migration.MorseTendermintAppState.pos": + x.Pos = value.Message().Interface().(*MorsePos) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseTendermintAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseTendermintAppState 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_MorseTendermintAppState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseTendermintAppState.application": + if x.Application == nil { + x.Application = new(MorseApplications) + } + return protoreflect.ValueOfMessage(x.Application.ProtoReflect()) + case "poktroll.migration.MorseTendermintAppState.auth": + if x.Auth == nil { + x.Auth = new(MorseAuth) + } + return protoreflect.ValueOfMessage(x.Auth.ProtoReflect()) + case "poktroll.migration.MorseTendermintAppState.pos": + if x.Pos == nil { + x.Pos = new(MorsePos) + } + return protoreflect.ValueOfMessage(x.Pos.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseTendermintAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseTendermintAppState 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_MorseTendermintAppState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseTendermintAppState.application": + m := new(MorseApplications) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MorseTendermintAppState.auth": + m := new(MorseAuth) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.migration.MorseTendermintAppState.pos": + m := new(MorsePos) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseTendermintAppState")) + } + panic(fmt.Errorf("message poktroll.migration.MorseTendermintAppState 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_MorseTendermintAppState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseTendermintAppState", 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_MorseTendermintAppState) 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_MorseTendermintAppState) 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_MorseTendermintAppState) 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_MorseTendermintAppState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseTendermintAppState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Application != nil { + l = options.Size(x.Application) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Auth != nil { + l = options.Size(x.Auth) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Pos != nil { + l = options.Size(x.Pos) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MorseTendermintAppState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pos != nil { + encoded, err := options.Marshal(x.Pos) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.Auth != nil { + encoded, err := options.Marshal(x.Auth) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.Application != nil { + encoded, err := options.Marshal(x.Application) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseTendermintAppState) + 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: MorseTendermintAppState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseTendermintAppState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Application == nil { + x.Application = &MorseApplications{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Application); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Auth == nil { + x.Auth = &MorseAuth{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Auth); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pos == nil { + x.Pos = &MorsePos{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pos); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_MorseApplications_1_list)(nil) + +type _MorseApplications_1_list struct { + list *[]*MorseApplication +} + +func (x *_MorseApplications_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorseApplications_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorseApplications_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseApplication) + (*x.list)[i] = concreteValue +} + +func (x *_MorseApplications_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseApplication) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorseApplications_1_list) AppendMutable() protoreflect.Value { + v := new(MorseApplication) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseApplications_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorseApplications_1_list) NewElement() protoreflect.Value { + v := new(MorseApplication) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseApplications_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MorseApplications protoreflect.MessageDescriptor + fd_MorseApplications_applications protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_morse_offchain_proto_init() + md_MorseApplications = File_poktroll_migration_morse_offchain_proto.Messages().ByName("MorseApplications") + fd_MorseApplications_applications = md_MorseApplications.Fields().ByName("applications") +} + +var _ protoreflect.Message = (*fastReflection_MorseApplications)(nil) + +type fastReflection_MorseApplications MorseApplications + +func (x *MorseApplications) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseApplications)(x) +} + +func (x *MorseApplications) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MorseApplications_messageType fastReflection_MorseApplications_messageType +var _ protoreflect.MessageType = fastReflection_MorseApplications_messageType{} + +type fastReflection_MorseApplications_messageType struct{} + +func (x fastReflection_MorseApplications_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseApplications)(nil) +} +func (x fastReflection_MorseApplications_messageType) New() protoreflect.Message { + return new(fastReflection_MorseApplications) +} +func (x fastReflection_MorseApplications_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplications +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseApplications) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplications +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MorseApplications) Type() protoreflect.MessageType { + return _fastReflection_MorseApplications_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseApplications) New() protoreflect.Message { + return new(fastReflection_MorseApplications) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseApplications) Interface() protoreflect.ProtoMessage { + return (*MorseApplications)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MorseApplications) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Applications) != 0 { + value := protoreflect.ValueOfList(&_MorseApplications_1_list{list: &x.Applications}) + if !f(fd_MorseApplications_applications, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MorseApplications) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + return len(x.Applications) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseApplications) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + x.Applications = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MorseApplications) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseApplications.applications": + if len(x.Applications) == 0 { + return protoreflect.ValueOfList(&_MorseApplications_1_list{}) + } + listValue := &_MorseApplications_1_list{list: &x.Applications} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseApplications) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + lv := value.List() + clv := lv.(*_MorseApplications_1_list) + x.Applications = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseApplications) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + if x.Applications == nil { + x.Applications = []*MorseApplication{} + } + value := &_MorseApplications_1_list{list: &x.Applications} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MorseApplications) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplications.applications": + list := []*MorseApplication{} + return protoreflect.ValueOfList(&_MorseApplications_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplications")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplications does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MorseApplications) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseApplications", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MorseApplications) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseApplications) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MorseApplications) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MorseApplications) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseApplications) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Applications) > 0 { + for _, e := range x.Applications { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MorseApplications) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Applications) > 0 { + for iNdEx := len(x.Applications) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Applications[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseApplications) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseApplications: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseApplications: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Applications", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Applications = append(x.Applications, &MorseApplication{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Applications[len(x.Applications)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_MorseAuth_1_list)(nil) + +type _MorseAuth_1_list struct { + list *[]*MorseAuthAccount +} + +func (x *_MorseAuth_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorseAuth_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorseAuth_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAuthAccount) + (*x.list)[i] = concreteValue +} + +func (x *_MorseAuth_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAuthAccount) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorseAuth_1_list) AppendMutable() protoreflect.Value { + v := new(MorseAuthAccount) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAuth_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorseAuth_1_list) NewElement() protoreflect.Value { + v := new(MorseAuthAccount) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAuth_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MorseAuth protoreflect.MessageDescriptor + fd_MorseAuth_accounts protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_morse_offchain_proto_init() + md_MorseAuth = File_poktroll_migration_morse_offchain_proto.Messages().ByName("MorseAuth") + fd_MorseAuth_accounts = md_MorseAuth.Fields().ByName("accounts") +} + +var _ protoreflect.Message = (*fastReflection_MorseAuth)(nil) + +type fastReflection_MorseAuth MorseAuth + +func (x *MorseAuth) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseAuth)(x) +} + +func (x *MorseAuth) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_morse_offchain_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_MorseAuth_messageType fastReflection_MorseAuth_messageType +var _ protoreflect.MessageType = fastReflection_MorseAuth_messageType{} + +type fastReflection_MorseAuth_messageType struct{} + +func (x fastReflection_MorseAuth_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseAuth)(nil) +} +func (x fastReflection_MorseAuth_messageType) New() protoreflect.Message { + return new(fastReflection_MorseAuth) +} +func (x fastReflection_MorseAuth_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuth +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseAuth) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuth +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MorseAuth) Type() protoreflect.MessageType { + return _fastReflection_MorseAuth_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseAuth) New() protoreflect.Message { + return new(fastReflection_MorseAuth) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseAuth) Interface() protoreflect.ProtoMessage { + return (*MorseAuth)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MorseAuth) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Accounts) != 0 { + value := protoreflect.ValueOfList(&_MorseAuth_1_list{list: &x.Accounts}) + if !f(fd_MorseAuth_accounts, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MorseAuth) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + return len(x.Accounts) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseAuth) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + x.Accounts = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MorseAuth) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseAuth.accounts": + if len(x.Accounts) == 0 { + return protoreflect.ValueOfList(&_MorseAuth_1_list{}) + } + listValue := &_MorseAuth_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseAuth) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + lv := value.List() + clv := lv.(*_MorseAuth_1_list) + x.Accounts = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseAuth) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + if x.Accounts == nil { + x.Accounts = []*MorseAuthAccount{} + } + value := &_MorseAuth_1_list{list: &x.Accounts} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MorseAuth) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAuth.accounts": + list := []*MorseAuthAccount{} + return protoreflect.ValueOfList(&_MorseAuth_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuth")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuth does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MorseAuth) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAuth", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MorseAuth) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseAuth) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MorseAuth) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MorseAuth) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseAuth) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Accounts) > 0 { + for _, e := range x.Accounts { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MorseAuth) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Accounts) > 0 { + for iNdEx := len(x.Accounts) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Accounts[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseAuth) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Accounts = append(x.Accounts, &MorseAuthAccount{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Accounts[len(x.Accounts)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MorseAuthAccount protoreflect.MessageDescriptor + fd_MorseAuthAccount_type protoreflect.FieldDescriptor + fd_MorseAuthAccount_value protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_morse_offchain_proto_init() + md_MorseAuthAccount = File_poktroll_migration_morse_offchain_proto.Messages().ByName("MorseAuthAccount") + fd_MorseAuthAccount_type = md_MorseAuthAccount.Fields().ByName("type") + fd_MorseAuthAccount_value = md_MorseAuthAccount.Fields().ByName("value") +} + +var _ protoreflect.Message = (*fastReflection_MorseAuthAccount)(nil) + +type fastReflection_MorseAuthAccount MorseAuthAccount + +func (x *MorseAuthAccount) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorseAuthAccount)(x) +} + +func (x *MorseAuthAccount) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_morse_offchain_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_MorseAuthAccount_messageType fastReflection_MorseAuthAccount_messageType +var _ protoreflect.MessageType = fastReflection_MorseAuthAccount_messageType{} + +type fastReflection_MorseAuthAccount_messageType struct{} + +func (x fastReflection_MorseAuthAccount_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseAuthAccount)(nil) +} +func (x fastReflection_MorseAuthAccount_messageType) New() protoreflect.Message { + return new(fastReflection_MorseAuthAccount) +} +func (x fastReflection_MorseAuthAccount_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuthAccount +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseAuthAccount) Descriptor() protoreflect.MessageDescriptor { + return md_MorseAuthAccount +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MorseAuthAccount) Type() protoreflect.MessageType { + return _fastReflection_MorseAuthAccount_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseAuthAccount) New() protoreflect.Message { + return new(fastReflection_MorseAuthAccount) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseAuthAccount) Interface() protoreflect.ProtoMessage { + return (*MorseAuthAccount)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MorseAuthAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Type_ != "" { + value := protoreflect.ValueOfString(x.Type_) + if !f(fd_MorseAuthAccount_type, value) { + return + } + } + if x.Value != nil { + value := protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + if !f(fd_MorseAuthAccount_value, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MorseAuthAccount) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.type": + return x.Type_ != "" + case "poktroll.migration.MorseAuthAccount.value": + return x.Value != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseAuthAccount) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.type": + x.Type_ = "" + case "poktroll.migration.MorseAuthAccount.value": + x.Value = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MorseAuthAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseAuthAccount.type": + value := x.Type_ + return protoreflect.ValueOfString(value) + case "poktroll.migration.MorseAuthAccount.value": + value := x.Value + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseAuthAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.type": + x.Type_ = value.Interface().(string) + case "poktroll.migration.MorseAuthAccount.value": + x.Value = value.Message().Interface().(*MorseAccount) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseAuthAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.value": + if x.Value == nil { + x.Value = new(MorseAccount) + } + return protoreflect.ValueOfMessage(x.Value.ProtoReflect()) + case "poktroll.migration.MorseAuthAccount.type": + panic(fmt.Errorf("field type of message poktroll.migration.MorseAuthAccount is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MorseAuthAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseAuthAccount.type": + return protoreflect.ValueOfString("") + case "poktroll.migration.MorseAuthAccount.value": + m := new(MorseAccount) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseAuthAccount")) + } + panic(fmt.Errorf("message poktroll.migration.MorseAuthAccount does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MorseAuthAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseAuthAccount", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MorseAuthAccount) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseAuthAccount) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MorseAuthAccount) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MorseAuthAccount) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseAuthAccount) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Type_) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Value != nil { + l = options.Size(x.Value) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MorseAuthAccount) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Value != nil { + encoded, err := options.Marshal(x.Value) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Type_) > 0 { + i -= len(x.Type_) + copy(dAtA[i:], x.Type_) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Type_))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseAuthAccount) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuthAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseAuthAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Type_", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Type_ = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Value == nil { + x.Value = &MorseAccount{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Value); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_MorsePos_1_list)(nil) + +type _MorsePos_1_list struct { + list *[]*MorseValidator +} + +func (x *_MorsePos_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorsePos_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorsePos_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseValidator) + (*x.list)[i] = concreteValue +} + +func (x *_MorsePos_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseValidator) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorsePos_1_list) AppendMutable() protoreflect.Value { + v := new(MorseValidator) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorsePos_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorsePos_1_list) NewElement() protoreflect.Value { + v := new(MorseValidator) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorsePos_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MorsePos protoreflect.MessageDescriptor + fd_MorsePos_validators protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_morse_offchain_proto_init() + md_MorsePos = File_poktroll_migration_morse_offchain_proto.Messages().ByName("MorsePos") + fd_MorsePos_validators = md_MorsePos.Fields().ByName("validators") +} + +var _ protoreflect.Message = (*fastReflection_MorsePos)(nil) + +type fastReflection_MorsePos MorsePos + +func (x *MorsePos) ProtoReflect() protoreflect.Message { + return (*fastReflection_MorsePos)(x) +} + +func (x *MorsePos) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MorsePos_messageType fastReflection_MorsePos_messageType +var _ protoreflect.MessageType = fastReflection_MorsePos_messageType{} + +type fastReflection_MorsePos_messageType struct{} + +func (x fastReflection_MorsePos_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorsePos)(nil) +} +func (x fastReflection_MorsePos_messageType) New() protoreflect.Message { + return new(fastReflection_MorsePos) +} +func (x fastReflection_MorsePos_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorsePos +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorsePos) Descriptor() protoreflect.MessageDescriptor { + return md_MorsePos +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MorsePos) Type() protoreflect.MessageType { + return _fastReflection_MorsePos_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorsePos) New() protoreflect.Message { + return new(fastReflection_MorsePos) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorsePos) Interface() protoreflect.ProtoMessage { + return (*MorsePos)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MorsePos) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Validators) != 0 { + value := protoreflect.ValueOfList(&_MorsePos_1_list{list: &x.Validators}) + if !f(fd_MorsePos_validators, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MorsePos) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + return len(x.Validators) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorsePos) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + x.Validators = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MorsePos) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorsePos.validators": + if len(x.Validators) == 0 { + return protoreflect.ValueOfList(&_MorsePos_1_list{}) + } + listValue := &_MorsePos_1_list{list: &x.Validators} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorsePos) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + lv := value.List() + clv := lv.(*_MorsePos_1_list) + x.Validators = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorsePos) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + if x.Validators == nil { + x.Validators = []*MorseValidator{} + } + value := &_MorsePos_1_list{list: &x.Validators} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MorsePos) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorsePos.validators": + list := []*MorseValidator{} + return protoreflect.ValueOfList(&_MorsePos_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorsePos")) + } + panic(fmt.Errorf("message poktroll.migration.MorsePos does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MorsePos) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorsePos", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MorsePos) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorsePos) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MorsePos) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MorsePos) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorsePos) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Validators) > 0 { + for _, e := range x.Validators { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MorsePos) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Validators) > 0 { + for iNdEx := len(x.Validators) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Validators[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorsePos) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorsePos: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorsePos: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Validators = append(x.Validators, &MorseValidator{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Validators[len(x.Validators)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +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_morse_offchain_proto_init() + md_MorseApplication = File_poktroll_migration_morse_offchain_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_morse_offchain_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MorseApplication_messageType fastReflection_MorseApplication_messageType +var _ protoreflect.MessageType = fastReflection_MorseApplication_messageType{} + +type fastReflection_MorseApplication_messageType struct{} + +func (x fastReflection_MorseApplication_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseApplication)(nil) +} +func (x fastReflection_MorseApplication_messageType) New() protoreflect.Message { + return new(fastReflection_MorseApplication) +} +func (x fastReflection_MorseApplication_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplication +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseApplication) Descriptor() protoreflect.MessageDescriptor { + return md_MorseApplication +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MorseApplication) Type() protoreflect.MessageType { + return _fastReflection_MorseApplication_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseApplication) New() protoreflect.Message { + return new(fastReflection_MorseApplication) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseApplication) Interface() protoreflect.ProtoMessage { + return (*MorseApplication)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MorseApplication) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Address) != 0 { + value := protoreflect.ValueOfBytes(x.Address) + if !f(fd_MorseApplication_address, value) { + return + } + } + if len(x.PublicKey) != 0 { + value := protoreflect.ValueOfBytes(x.PublicKey) + if !f(fd_MorseApplication_public_key, value) { + return + } + } + if x.Jailed != false { + value := protoreflect.ValueOfBool(x.Jailed) + if !f(fd_MorseApplication_jailed, value) { + return + } + } + if x.Status != int32(0) { + value := protoreflect.ValueOfInt32(x.Status) + if !f(fd_MorseApplication_status, value) { + return + } + } + if x.StakedTokens != "" { + value := protoreflect.ValueOfString(x.StakedTokens) + if !f(fd_MorseApplication_staked_tokens, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MorseApplication) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + return len(x.Address) != 0 + case "poktroll.migration.MorseApplication.public_key": + return len(x.PublicKey) != 0 + case "poktroll.migration.MorseApplication.jailed": + return x.Jailed != false + case "poktroll.migration.MorseApplication.status": + return x.Status != int32(0) + case "poktroll.migration.MorseApplication.staked_tokens": + return x.StakedTokens != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseApplication) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + x.Address = nil + case "poktroll.migration.MorseApplication.public_key": + x.PublicKey = nil + case "poktroll.migration.MorseApplication.jailed": + x.Jailed = false + case "poktroll.migration.MorseApplication.status": + x.Status = int32(0) + case "poktroll.migration.MorseApplication.staked_tokens": + x.StakedTokens = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MorseApplication) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.migration.MorseApplication.address": + value := x.Address + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseApplication.public_key": + value := x.PublicKey + return protoreflect.ValueOfBytes(value) + case "poktroll.migration.MorseApplication.jailed": + value := x.Jailed + return protoreflect.ValueOfBool(value) + case "poktroll.migration.MorseApplication.status": + value := x.Status + return protoreflect.ValueOfInt32(value) + case "poktroll.migration.MorseApplication.staked_tokens": + value := x.StakedTokens + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseApplication) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + x.Address = value.Bytes() + case "poktroll.migration.MorseApplication.public_key": + x.PublicKey = value.Bytes() + case "poktroll.migration.MorseApplication.jailed": + x.Jailed = value.Bool() + case "poktroll.migration.MorseApplication.status": + x.Status = int32(value.Int()) + case "poktroll.migration.MorseApplication.staked_tokens": + x.StakedTokens = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseApplication) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + panic(fmt.Errorf("field address of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.public_key": + panic(fmt.Errorf("field public_key of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.jailed": + panic(fmt.Errorf("field jailed of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.status": + panic(fmt.Errorf("field status of message poktroll.migration.MorseApplication is not mutable")) + case "poktroll.migration.MorseApplication.staked_tokens": + panic(fmt.Errorf("field staked_tokens of message poktroll.migration.MorseApplication is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MorseApplication) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.migration.MorseApplication.address": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseApplication.public_key": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseApplication.jailed": + return protoreflect.ValueOfBool(false) + case "poktroll.migration.MorseApplication.status": + return protoreflect.ValueOfInt32(int32(0)) + case "poktroll.migration.MorseApplication.staked_tokens": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseApplication")) + } + panic(fmt.Errorf("message poktroll.migration.MorseApplication does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MorseApplication) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.migration.MorseApplication", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MorseApplication) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MorseApplication) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MorseApplication) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MorseApplication) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MorseApplication) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PublicKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Jailed { + n += 2 + } + if x.Status != 0 { + n += 1 + runtime.Sov(uint64(x.Status)) + } + l = len(x.StakedTokens) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MorseApplication) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.StakedTokens) > 0 { + i -= len(x.StakedTokens) + copy(dAtA[i:], x.StakedTokens) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.StakedTokens))) + i-- + dAtA[i] = 0x32 + } + if x.Status != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Status)) + i-- + dAtA[i] = 0x20 + } + if x.Jailed { + i-- + if x.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(x.PublicKey) > 0 { + i -= len(x.PublicKey) + copy(dAtA[i:], x.PublicKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MorseApplication) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseApplication: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MorseApplication: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Address = append(x.Address[:0], dAtA[iNdEx:postIndex]...) + if x.Address == nil { + x.Address = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.PublicKey = append(x.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if x.PublicKey == nil { + x.PublicKey = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Jailed = bool(v != 0) + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + x.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Status |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StakedTokens", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MorseValidator protoreflect.MessageDescriptor + fd_MorseValidator_address protoreflect.FieldDescriptor + fd_MorseValidator_public_key protoreflect.FieldDescriptor + fd_MorseValidator_jailed protoreflect.FieldDescriptor + fd_MorseValidator_status protoreflect.FieldDescriptor + fd_MorseValidator_staked_tokens protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_morse_offchain_proto_init() + md_MorseValidator = File_poktroll_migration_morse_offchain_proto.Messages().ByName("MorseValidator") + fd_MorseValidator_address = md_MorseValidator.Fields().ByName("address") + fd_MorseValidator_public_key = md_MorseValidator.Fields().ByName("public_key") + fd_MorseValidator_jailed = md_MorseValidator.Fields().ByName("jailed") + fd_MorseValidator_status = md_MorseValidator.Fields().ByName("status") + fd_MorseValidator_staked_tokens = md_MorseValidator.Fields().ByName("staked_tokens") +} + +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_morse_offchain_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MorseValidator_messageType fastReflection_MorseValidator_messageType +var _ protoreflect.MessageType = fastReflection_MorseValidator_messageType{} + +type fastReflection_MorseValidator_messageType struct{} + +func (x fastReflection_MorseValidator_messageType) Zero() protoreflect.Message { + return (*fastReflection_MorseValidator)(nil) +} +func (x fastReflection_MorseValidator_messageType) New() protoreflect.Message { + return new(fastReflection_MorseValidator) +} +func (x fastReflection_MorseValidator_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MorseValidator +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MorseValidator) Descriptor() protoreflect.MessageDescriptor { + return md_MorseValidator +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MorseValidator) Type() protoreflect.MessageType { + return _fastReflection_MorseValidator_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MorseValidator) New() protoreflect.Message { + return new(fastReflection_MorseValidator) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MorseValidator) Interface() protoreflect.ProtoMessage { + return (*MorseValidator)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MorseValidator) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Address) != 0 { + value := protoreflect.ValueOfBytes(x.Address) + if !f(fd_MorseValidator_address, value) { + return + } + } + if len(x.PublicKey) != 0 { + value := protoreflect.ValueOfBytes(x.PublicKey) + if !f(fd_MorseValidator_public_key, 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_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_MorseValidator) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.migration.MorseValidator.address": + return len(x.Address) != 0 + case "poktroll.migration.MorseValidator.public_key": + return len(x.PublicKey) != 0 + case "poktroll.migration.MorseValidator.jailed": + return x.Jailed != false + case "poktroll.migration.MorseValidator.status": + return x.Status != int32(0) + case "poktroll.migration.MorseValidator.staked_tokens": + 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.public_key": + x.PublicKey = nil + case "poktroll.migration.MorseValidator.jailed": + x.Jailed = false + case "poktroll.migration.MorseValidator.status": + x.Status = int32(0) + case "poktroll.migration.MorseValidator.staked_tokens": + 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.public_key": + 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.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.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.public_key": + x.PublicKey = value.Bytes() + case "poktroll.migration.MorseValidator.jailed": + x.Jailed = value.Bool() + case "poktroll.migration.MorseValidator.status": + x.Status = int32(value.Int()) + case "poktroll.migration.MorseValidator.staked_tokens": + 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.public_key": + panic(fmt.Errorf("field public_key of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.jailed": + panic(fmt.Errorf("field jailed of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.status": + panic(fmt.Errorf("field status of message poktroll.migration.MorseValidator is not mutable")) + case "poktroll.migration.MorseValidator.staked_tokens": + panic(fmt.Errorf("field staked_tokens of message poktroll.migration.MorseValidator is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.migration.MorseValidator")) + } + 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.public_key": + return protoreflect.ValueOfBytes(nil) + case "poktroll.migration.MorseValidator.jailed": + return protoreflect.ValueOfBool(false) + case "poktroll.migration.MorseValidator.status": + return protoreflect.ValueOfInt32(int32(0)) + case "poktroll.migration.MorseValidator.staked_tokens": + 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/morse_offchain.proto + +// Types in this file are ONLY present to facilitate the verifiability of the +// migration state from Morse to Shannon. +// +// These types reproduce a 1:1 de/serialization for the corresponding Morse data structures +// but are not completely identical to their Morse counterparts, not all of which are defined +// as protobuf types in the Morse codebase. +// +// Morse also leverages pb.Any types, as well as the gogoproto.casttype option in several places. +// All usages of pb.Any have been replaced with equivalent protobuf types +// (i.e. an interstitial type with `type` and/or `value` field(s)). +// All usages of gogoproto.casttype which previously referenced Morse data structures have been removed. +// A few specific fields have retained this option where the type is changed to the underlying +// external lib type that the Morse type was wrapping (e.g. address and public key fields). +// +// These types are used by the migration subcommand to transform +// the Morse state export into the Shannon state import. +// Ref: `poktrolld migrate collect-morse-accounts ...` +// +// They ARE NOT persisted on-chain (Shannon) at any point. + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MorseStateExport is the data structure that is serialized and output when running +// `pocket utils export-genesis-for-reset`. +// +// See: https://editor.swagger.io/?url=https://raw.githubusercontent.com/pokt-network/pocket-core/staging/doc/specs/rpc-spec.yaml#operations-query-post_query_state +type MorseStateExport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // app_hash is the Morse tendermint state hash. + AppHash string `protobuf:"bytes,1,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + // app_state is the entire Morse tendermint application state. + AppState *MorseTendermintAppState `protobuf:"bytes,2,opt,name=app_state,json=appState,proto3" json:"app_state,omitempty"` +} + +func (x *MorseStateExport) Reset() { + *x = MorseStateExport{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseStateExport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseStateExport) ProtoMessage() {} + +// Deprecated: Use MorseStateExport.ProtoReflect.Descriptor instead. +func (*MorseStateExport) Descriptor() ([]byte, []int) { + return file_poktroll_migration_morse_offchain_proto_rawDescGZIP(), []int{0} +} + +func (x *MorseStateExport) GetAppHash() string { + if x != nil { + return x.AppHash + } + return "" +} + +func (x *MorseStateExport) GetAppState() *MorseTendermintAppState { + if x != nil { + return x.AppState + } + return nil +} + +// MorseTendermintAppState is the tendermint application state for the Morse tendermint +// application; not to be confused with the pokt protocol actor. +// It is constructed in Morse via `PocketCoreApp#ExportAppState()`. +// +// See: https://github.com/pokt-network/pocket-core/blob/5fa61920aa9d45ca6bf9e01e863134e242c95fa7/app/pocket.go#L142 +type MorseTendermintAppState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Application *MorseApplications `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"` + Auth *MorseAuth `protobuf:"bytes,2,opt,name=auth,proto3" json:"auth,omitempty"` + Pos *MorsePos `protobuf:"bytes,3,opt,name=pos,proto3" json:"pos,omitempty"` +} + +func (x *MorseTendermintAppState) Reset() { + *x = MorseTendermintAppState{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseTendermintAppState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseTendermintAppState) ProtoMessage() {} + +// Deprecated: Use MorseTendermintAppState.ProtoReflect.Descriptor instead. +func (*MorseTendermintAppState) Descriptor() ([]byte, []int) { + return file_poktroll_migration_morse_offchain_proto_rawDescGZIP(), []int{1} +} + +func (x *MorseTendermintAppState) GetApplication() *MorseApplications { + if x != nil { + return x.Application + } + return nil +} + +func (x *MorseTendermintAppState) GetAuth() *MorseAuth { + if x != nil { + return x.Auth + } + return nil +} + +func (x *MorseTendermintAppState) GetPos() *MorsePos { + if x != nil { + return x.Pos + } + return nil +} + +// A wrapper around the list of MorseApplications, necessary in order to conform to the Morse genesis structure. +// It encapsulates the minimum information required to import Morse applications. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/x/apps/types/genesis.go#L4 +type MorseApplications struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Applications []*MorseApplication `protobuf:"bytes,1,rep,name=applications,proto3" json:"applications,omitempty"` +} + +func (x *MorseApplications) Reset() { + *x = MorseApplications{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseApplications) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseApplications) ProtoMessage() {} + +// Deprecated: Use MorseApplications.ProtoReflect.Descriptor instead. +func (*MorseApplications) Descriptor() ([]byte, []int) { + return file_poktroll_migration_morse_offchain_proto_rawDescGZIP(), []int{2} +} + +func (x *MorseApplications) GetApplications() []*MorseApplication { + if x != nil { + return x.Applications + } + return nil +} + +// A wrapper around a list of Morse accounts. +// It encapsulates the minimum information required to import Morse accounts. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/x/auth/types/genesis.go#L9 +type MorseAuth struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Accounts []*MorseAuthAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (x *MorseAuth) Reset() { + *x = MorseAuth{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseAuth) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseAuth) ProtoMessage() {} + +// Deprecated: Use MorseAuth.ProtoReflect.Descriptor instead. +func (*MorseAuth) Descriptor() ([]byte, []int) { + return file_poktroll_migration_morse_offchain_proto_rawDescGZIP(), []int{3} +} + +func (x *MorseAuth) GetAccounts() []*MorseAuthAccount { + if x != nil { + return x.Accounts + } + return nil +} + +// MorseAccount: +// * Wraps Morse account information to conform to Morse genesis structure +// * Represents only externally owned accounts (not module accounts) +// * Avoids pb.Any serialization since only external accounts needed for migration +type MorseAuthAccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type_ string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Value *MorseAccount `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *MorseAuthAccount) Reset() { + *x = MorseAuthAccount{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseAuthAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseAuthAccount) ProtoMessage() {} + +// Deprecated: Use MorseAuthAccount.ProtoReflect.Descriptor instead. +func (*MorseAuthAccount) Descriptor() ([]byte, []int) { + return file_poktroll_migration_morse_offchain_proto_rawDescGZIP(), []int{4} +} + +func (x *MorseAuthAccount) GetType_() string { + if x != nil { + return x.Type_ + } + return "" +} + +func (x *MorseAuthAccount) GetValue() *MorseAccount { + if x != nil { + return x.Value + } + return nil +} + +// A wrapper around the list of Morse suppliers (aka "validators", "nodes", of "servicers"). +// It is necessary to conform to the Morse genesis structure. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/x/nodes/types/genesis.go#L8 +type MorsePos struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Validators []*MorseValidator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` +} + +func (x *MorsePos) Reset() { + *x = MorsePos{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorsePos) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorsePos) ProtoMessage() {} + +// Deprecated: Use MorsePos.ProtoReflect.Descriptor instead. +func (*MorsePos) Descriptor() ([]byte, []int) { + return file_poktroll_migration_morse_offchain_proto_rawDescGZIP(), []int{5} +} + +func (x *MorsePos) GetValidators() []*MorseValidator { + if x != nil { + return x.Validators + } + 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 is a binary representation of the address corresponding + // to a Morse application's ed25519 public key. + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // PublicKey is the binary representation of a Morse application's ed25519 public key. + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + // The string representation of the BigInt amount of upokt. + StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` +} + +func (x *MorseApplication) Reset() { + *x = MorseApplication{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseApplication) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseApplication) ProtoMessage() {} + +// Deprecated: Use MorseApplication.ProtoReflect.Descriptor instead. +func (*MorseApplication) Descriptor() ([]byte, []int) { + return file_poktroll_migration_morse_offchain_proto_rawDescGZIP(), []int{6} +} + +func (x *MorseApplication) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *MorseApplication) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *MorseApplication) GetJailed() bool { + if x != nil { + return x.Jailed + } + return false +} + +func (x *MorseApplication) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MorseApplication) GetStakedTokens() string { + if x != nil { + return x.StakedTokens + } + return "" +} + +// MorseValidator is a subset of the Morse ProtoValidator type. +// It encapsulates the minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 +type MorseValidator struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A binary representation of the address corresponding to a Morse application's ed25519 public key. + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // The binary representation of a Morse application's ed25519 public key. + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` + // The string representation of the BigInt amount of upokt. + StakedTokens string `protobuf:"bytes,7,opt,name=staked_tokens,json=stakedTokens,proto3" json:"staked_tokens,omitempty"` +} + +func (x *MorseValidator) Reset() { + *x = MorseValidator{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_morse_offchain_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MorseValidator) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MorseValidator) ProtoMessage() {} + +// Deprecated: Use MorseValidator.ProtoReflect.Descriptor instead. +func (*MorseValidator) Descriptor() ([]byte, []int) { + return file_poktroll_migration_morse_offchain_proto_rawDescGZIP(), []int{7} +} + +func (x *MorseValidator) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *MorseValidator) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *MorseValidator) GetJailed() bool { + if x != nil { + return x.Jailed + } + return false +} + +func (x *MorseValidator) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MorseValidator) GetStakedTokens() string { + if x != nil { + return x.StakedTokens + } + return "" +} + +var File_poktroll_migration_morse_offchain_proto protoreflect.FileDescriptor + +var file_poktroll_migration_morse_offchain_proto_rawDesc = []byte{ + 0x0a, 0x27, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x14, 0x67, + 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x6f, 0x6e, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x94, 0x01, 0x0a, 0x10, + 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x12, 0x27, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x57, 0x0a, 0x09, 0x61, 0x70, 0x70, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 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, 0x54, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, + 0x74, 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x61, + 0x70, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x08, 0x61, 0x70, 0x70, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x22, 0xe9, 0x01, 0x0a, 0x17, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x54, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x58, + 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x41, 0x75, 0x74, 0x68, 0x42, 0x08, 0xea, 0xde, 0x1f, 0x04, 0x61, 0x75, 0x74, 0x68, 0x52, + 0x04, 0x61, 0x75, 0x74, 0x68, 0x12, 0x37, 0x0a, 0x03, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x73, + 0x42, 0x07, 0xea, 0xde, 0x1f, 0x03, 0x70, 0x6f, 0x73, 0x52, 0x03, 0x70, 0x6f, 0x73, 0x22, 0x6f, + 0x0a, 0x11, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x5a, 0x0a, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, + 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x10, 0xea, 0xde, 0x1f, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x0c, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0x5b, 0x0a, 0x09, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x12, 0x4e, 0x0a, 0x08, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x73, 0x0a, 0x10, + 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x1c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, + 0xea, 0xde, 0x1f, 0x04, 0x74, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x41, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, + 0x09, 0xea, 0xde, 0x1f, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x5e, 0x0a, 0x08, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x6f, 0x73, 0x12, 0x52, 0x0a, + 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x6d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x22, 0xe3, 0x02, 0x0a, 0x10, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x66, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 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, 0x2f, 0x0a, 0x0d, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, + 0x0c, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x08, 0x88, + 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xc3, 0x02, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x66, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x4c, 0xea, 0xde, 0x1f, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0xf2, 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, + 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x62, 0x66, 0x74, 0x2f, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x23, 0xea, 0xde, 0x1f, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x22, 0x52, 0x09, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x6a, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x52, 0x06, 0x6a, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, + 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xea, 0xde, 0x1f, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, + 0x0c, 0x88, 0xa0, 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0xbe, 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, 0x12, 0x4d, 0x6f, + 0x72, 0x73, 0x65, 0x4f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 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_morse_offchain_proto_rawDescOnce sync.Once + file_poktroll_migration_morse_offchain_proto_rawDescData = file_poktroll_migration_morse_offchain_proto_rawDesc +) + +func file_poktroll_migration_morse_offchain_proto_rawDescGZIP() []byte { + file_poktroll_migration_morse_offchain_proto_rawDescOnce.Do(func() { + file_poktroll_migration_morse_offchain_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_morse_offchain_proto_rawDescData) + }) + return file_poktroll_migration_morse_offchain_proto_rawDescData +} + +var file_poktroll_migration_morse_offchain_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_poktroll_migration_morse_offchain_proto_goTypes = []interface{}{ + (*MorseStateExport)(nil), // 0: poktroll.migration.MorseStateExport + (*MorseTendermintAppState)(nil), // 1: poktroll.migration.MorseTendermintAppState + (*MorseApplications)(nil), // 2: poktroll.migration.MorseApplications + (*MorseAuth)(nil), // 3: poktroll.migration.MorseAuth + (*MorseAuthAccount)(nil), // 4: poktroll.migration.MorseAuthAccount + (*MorsePos)(nil), // 5: poktroll.migration.MorsePos + (*MorseApplication)(nil), // 6: poktroll.migration.MorseApplication + (*MorseValidator)(nil), // 7: poktroll.migration.MorseValidator + (*MorseAccount)(nil), // 8: poktroll.migration.MorseAccount +} +var file_poktroll_migration_morse_offchain_proto_depIdxs = []int32{ + 1, // 0: poktroll.migration.MorseStateExport.app_state:type_name -> poktroll.migration.MorseTendermintAppState + 2, // 1: poktroll.migration.MorseTendermintAppState.application:type_name -> poktroll.migration.MorseApplications + 3, // 2: poktroll.migration.MorseTendermintAppState.auth:type_name -> poktroll.migration.MorseAuth + 5, // 3: poktroll.migration.MorseTendermintAppState.pos:type_name -> poktroll.migration.MorsePos + 6, // 4: poktroll.migration.MorseApplications.applications:type_name -> poktroll.migration.MorseApplication + 4, // 5: poktroll.migration.MorseAuth.accounts:type_name -> poktroll.migration.MorseAuthAccount + 8, // 6: poktroll.migration.MorseAuthAccount.value:type_name -> poktroll.migration.MorseAccount + 7, // 7: poktroll.migration.MorsePos.validators:type_name -> poktroll.migration.MorseValidator + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_poktroll_migration_morse_offchain_proto_init() } +func file_poktroll_migration_morse_offchain_proto_init() { + if File_poktroll_migration_morse_offchain_proto != nil { + return + } + file_poktroll_migration_morse_onchain_proto_init() + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_morse_offchain_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseStateExport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_morse_offchain_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseTendermintAppState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_morse_offchain_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseApplications); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_morse_offchain_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseAuth); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_morse_offchain_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseAuthAccount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_morse_offchain_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorsePos); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_morse_offchain_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseApplication); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_migration_morse_offchain_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MorseValidator); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_poktroll_migration_morse_offchain_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_migration_morse_offchain_proto_goTypes, + DependencyIndexes: file_poktroll_migration_morse_offchain_proto_depIdxs, + MessageInfos: file_poktroll_migration_morse_offchain_proto_msgTypes, + }.Build() + File_poktroll_migration_morse_offchain_proto = out.File + file_poktroll_migration_morse_offchain_proto_rawDesc = nil + file_poktroll_migration_morse_offchain_proto_goTypes = nil + file_poktroll_migration_morse_offchain_proto_depIdxs = nil +} diff --git a/api/poktroll/migration/morse_onchain.pulsar.go b/api/poktroll/migration/morse_onchain.pulsar.go new file mode 100644 index 000000000..25980c925 --- /dev/null +++ b/api/poktroll/migration/morse_onchain.pulsar.go @@ -0,0 +1,2178 @@ +// 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" + sort "sort" + sync "sync" +) + +var _ protoreflect.Map = (*_MorseAccountState_1_map)(nil) + +type _MorseAccountState_1_map struct { + m *map[string]uint64 +} + +func (x *_MorseAccountState_1_map) Len() int { + if x.m == nil { + return 0 + } + return len(*x.m) +} + +func (x *_MorseAccountState_1_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { + if x.m == nil { + return + } + for k, v := range *x.m { + mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k)) + mapValue := protoreflect.ValueOfUint64(v) + if !f(mapKey, mapValue) { + break + } + } +} + +func (x *_MorseAccountState_1_map) Has(key protoreflect.MapKey) bool { + if x.m == nil { + return false + } + keyUnwrapped := key.String() + concreteValue := keyUnwrapped + _, ok := (*x.m)[concreteValue] + return ok +} + +func (x *_MorseAccountState_1_map) Clear(key protoreflect.MapKey) { + if x.m == nil { + return + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + delete(*x.m, concreteKey) +} + +func (x *_MorseAccountState_1_map) Get(key protoreflect.MapKey) protoreflect.Value { + if x.m == nil { + return protoreflect.Value{} + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + v, ok := (*x.m)[concreteKey] + if !ok { + return protoreflect.Value{} + } + return protoreflect.ValueOfUint64(v) +} + +func (x *_MorseAccountState_1_map) Set(key protoreflect.MapKey, value protoreflect.Value) { + if !key.IsValid() || !value.IsValid() { + panic("invalid key or value provided") + } + keyUnwrapped := key.String() + concreteKey := keyUnwrapped + valueUnwrapped := value.Uint() + concreteValue := valueUnwrapped + (*x.m)[concreteKey] = concreteValue +} + +func (x *_MorseAccountState_1_map) Mutable(key protoreflect.MapKey) protoreflect.Value { + panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message") +} + +func (x *_MorseAccountState_1_map) NewValue() protoreflect.Value { + v := uint64(0) + return protoreflect.ValueOfUint64(v) +} + +func (x *_MorseAccountState_1_map) IsValid() bool { + return x.m != nil +} + +var _ protoreflect.List = (*_MorseAccountState_2_list)(nil) + +type _MorseAccountState_2_list struct { + list *[]*MorseAccount +} + +func (x *_MorseAccountState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MorseAccountState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MorseAccountState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAccount) + (*x.list)[i] = concreteValue +} + +func (x *_MorseAccountState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*MorseAccount) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MorseAccountState_2_list) AppendMutable() protoreflect.Value { + v := new(MorseAccount) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAccountState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MorseAccountState_2_list) NewElement() protoreflect.Value { + v := new(MorseAccount) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MorseAccountState_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MorseAccountState protoreflect.MessageDescriptor + fd_MorseAccountState_accounts_idx_by_address protoreflect.FieldDescriptor + fd_MorseAccountState_accounts protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_migration_morse_onchain_proto_init() + md_MorseAccountState = File_poktroll_migration_morse_onchain_proto.Messages().ByName("MorseAccountState") + fd_MorseAccountState_accounts_idx_by_address = md_MorseAccountState.Fields().ByName("accounts_idx_by_address") + 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_morse_onchain_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.AccountsIdxByAddress) != 0 { + value := protoreflect.ValueOfMap(&_MorseAccountState_1_map{m: &x.AccountsIdxByAddress}) + if !f(fd_MorseAccountState_accounts_idx_by_address, value) { + return + } + } + if len(x.Accounts) != 0 { + value := protoreflect.ValueOfList(&_MorseAccountState_2_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_idx_by_address": + return len(x.AccountsIdxByAddress) != 0 + 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_idx_by_address": + x.AccountsIdxByAddress = nil + 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_idx_by_address": + if len(x.AccountsIdxByAddress) == 0 { + return protoreflect.ValueOfMap(&_MorseAccountState_1_map{}) + } + mapValue := &_MorseAccountState_1_map{m: &x.AccountsIdxByAddress} + return protoreflect.ValueOfMap(mapValue) + case "poktroll.migration.MorseAccountState.accounts": + if len(x.Accounts) == 0 { + return protoreflect.ValueOfList(&_MorseAccountState_2_list{}) + } + listValue := &_MorseAccountState_2_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_idx_by_address": + mv := value.Map() + cmv := mv.(*_MorseAccountState_1_map) + x.AccountsIdxByAddress = *cmv.m + case "poktroll.migration.MorseAccountState.accounts": + lv := value.List() + clv := lv.(*_MorseAccountState_2_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_idx_by_address": + if x.AccountsIdxByAddress == nil { + x.AccountsIdxByAddress = make(map[string]uint64) + } + value := &_MorseAccountState_1_map{m: &x.AccountsIdxByAddress} + return protoreflect.ValueOfMap(value) + case "poktroll.migration.MorseAccountState.accounts": + if x.Accounts == nil { + x.Accounts = []*MorseAccount{} + } + value := &_MorseAccountState_2_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_idx_by_address": + m := make(map[string]uint64) + return protoreflect.ValueOfMap(&_MorseAccountState_1_map{m: &m}) + case "poktroll.migration.MorseAccountState.accounts": + list := []*MorseAccount{} + return protoreflect.ValueOfList(&_MorseAccountState_2_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.AccountsIdxByAddress) > 0 { + SiZeMaP := func(k string, v uint64) { + mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + runtime.Sov(uint64(v)) + n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize)) + } + if options.Deterministic { + sortme := make([]string, 0, len(x.AccountsIdxByAddress)) + for k := range x.AccountsIdxByAddress { + sortme = append(sortme, k) + } + sort.Strings(sortme) + for _, k := range sortme { + v := x.AccountsIdxByAddress[k] + SiZeMaP(k, v) + } + } else { + for k, v := range x.AccountsIdxByAddress { + SiZeMaP(k, v) + } + } + } + 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] = 0x12 + } + } + if len(x.AccountsIdxByAddress) > 0 { + MaRsHaLmAp := func(k string, v uint64) (protoiface.MarshalOutput, error) { + baseI := i + i = runtime.EncodeVarint(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = runtime.EncodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + return protoiface.MarshalOutput{}, nil + } + if options.Deterministic { + keysForAccountsIdxByAddress := make([]string, 0, len(x.AccountsIdxByAddress)) + for k := range x.AccountsIdxByAddress { + keysForAccountsIdxByAddress = append(keysForAccountsIdxByAddress, string(k)) + } + sort.Slice(keysForAccountsIdxByAddress, func(i, j int) bool { + return keysForAccountsIdxByAddress[i] < keysForAccountsIdxByAddress[j] + }) + for iNdEx := len(keysForAccountsIdxByAddress) - 1; iNdEx >= 0; iNdEx-- { + v := x.AccountsIdxByAddress[string(keysForAccountsIdxByAddress[iNdEx])] + out, err := MaRsHaLmAp(keysForAccountsIdxByAddress[iNdEx], v) + if err != nil { + return out, err + } + } + } else { + for k := range x.AccountsIdxByAddress { + v := x.AccountsIdxByAddress[k] + out, err := MaRsHaLmAp(k, v) + if err != nil { + return out, err + } + } + } + } + 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 AccountsIdxByAddress", 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.AccountsIdxByAddress == nil { + x.AccountsIdxByAddress = make(map[string]uint64) + } + var mapkey string + var mapvalue uint64 + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey 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++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postStringIndexmapkey > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + 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++ + mapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + 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) > postIndex { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + x.AccountsIdxByAddress[mapkey] = mapvalue + iNdEx = postIndex + case 2: + 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_morse_onchain_proto_init() + md_MorseAccount = File_poktroll_migration_morse_onchain_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_morse_onchain_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_morse_onchain_proto_init() + md_MorsePublicKey = File_poktroll_migration_morse_onchain_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_morse_onchain_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, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/migration/morse_onchain.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 + + AccountsIdxByAddress map[string]uint64 `protobuf:"bytes,1,rep,name=accounts_idx_by_address,json=accountsIdxByAddress,proto3" json:"accounts_idx_by_address,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Accounts []*MorseAccount `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (x *MorseAccountState) Reset() { + *x = MorseAccountState{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_migration_morse_onchain_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_morse_onchain_proto_rawDescGZIP(), []int{0} +} + +func (x *MorseAccountState) GetAccountsIdxByAddress() map[string]uint64 { + if x != nil { + return x.AccountsIdxByAddress + } + return nil +} + +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 + + // A binary representation of the address corresponding to a Morse application's ed25519 public key. + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + 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_morse_onchain_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_morse_onchain_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_morse_onchain_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_morse_onchain_proto_rawDescGZIP(), []int{2} +} + +func (x *MorsePublicKey) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +var File_poktroll_migration_morse_onchain_proto protoreflect.FileDescriptor + +var file_poktroll_migration_morse_onchain_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6d, 0x6f, 0x72, 0x73, 0x65, 0x5f, 0x6f, 0x6e, 0x63, 0x68, 0x61, + 0x69, 0x6e, 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, 0xf3, 0x02, + 0x0a, 0x11, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0xb5, 0x01, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x5f, 0x69, 0x64, 0x78, 0x5f, 0x62, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 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, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x49, 0x64, 0x78, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x3d, 0xea, 0xde, 0x1f, 0x17, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x69, 0x64, 0x78, 0x5f, 0x62, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0xf2, 0xde, 0x1f, 0x1e, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x69, 0x64, 0x78, 0x5f, 0x62, 0x79, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x14, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x49, + 0x64, 0x78, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x5d, 0x0a, 0x08, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 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, + 0x1f, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0xf2, 0xde, 0x1f, + 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, + 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x47, 0x0a, 0x19, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x49, 0x64, 0x78, 0x42, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x9f, 0x02, 0x0a, 0x0c, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x54, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x3a, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0xfa, 0xde, 0x1f, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 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, 0x3e, 0x0a, 0x05, + 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x05, + 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x3a, 0x17, 0x88, 0xa0, + 0x1f, 0x00, 0x98, 0xa0, 0x1f, 0x01, 0x88, 0xa2, 0x1f, 0x01, 0xca, 0xb4, 0x2d, 0x07, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x44, 0x0a, 0x0e, 0x4d, 0x6f, 0x72, 0x73, 0x65, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x1c, 0xfa, 0xde, 0x1f, 0x18, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x6f, 0x2f, 0x65, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x4b, 0x65, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0xbd, 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, 0x11, 0x4d, 0x6f, 0x72, 0x73, + 0x65, 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 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_morse_onchain_proto_rawDescOnce sync.Once + file_poktroll_migration_morse_onchain_proto_rawDescData = file_poktroll_migration_morse_onchain_proto_rawDesc +) + +func file_poktroll_migration_morse_onchain_proto_rawDescGZIP() []byte { + file_poktroll_migration_morse_onchain_proto_rawDescOnce.Do(func() { + file_poktroll_migration_morse_onchain_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_migration_morse_onchain_proto_rawDescData) + }) + return file_poktroll_migration_morse_onchain_proto_rawDescData +} + +var file_poktroll_migration_morse_onchain_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_poktroll_migration_morse_onchain_proto_goTypes = []interface{}{ + (*MorseAccountState)(nil), // 0: poktroll.migration.MorseAccountState + (*MorseAccount)(nil), // 1: poktroll.migration.MorseAccount + (*MorsePublicKey)(nil), // 2: poktroll.migration.MorsePublicKey + nil, // 3: poktroll.migration.MorseAccountState.AccountsIdxByAddressEntry + (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin +} +var file_poktroll_migration_morse_onchain_proto_depIdxs = []int32{ + 3, // 0: poktroll.migration.MorseAccountState.accounts_idx_by_address:type_name -> poktroll.migration.MorseAccountState.AccountsIdxByAddressEntry + 1, // 1: poktroll.migration.MorseAccountState.accounts:type_name -> poktroll.migration.MorseAccount + 2, // 2: poktroll.migration.MorseAccount.pub_key:type_name -> poktroll.migration.MorsePublicKey + 4, // 3: poktroll.migration.MorseAccount.coins:type_name -> cosmos.base.v1beta1.Coin + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_poktroll_migration_morse_onchain_proto_init() } +func file_poktroll_migration_morse_onchain_proto_init() { + if File_poktroll_migration_morse_onchain_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_migration_morse_onchain_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_morse_onchain_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_morse_onchain_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 + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_poktroll_migration_morse_onchain_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_migration_morse_onchain_proto_goTypes, + DependencyIndexes: file_poktroll_migration_morse_onchain_proto_depIdxs, + MessageInfos: file_poktroll_migration_morse_onchain_proto_msgTypes, + }.Build() + File_poktroll_migration_morse_onchain_proto = out.File + file_poktroll_migration_morse_onchain_proto_rawDesc = nil + file_poktroll_migration_morse_onchain_proto_goTypes = nil + file_poktroll_migration_morse_onchain_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/errors.go b/cmd/poktrolld/cmd/migrate/errors.go new file mode 100644 index 000000000..2fb7691f0 --- /dev/null +++ b/cmd/poktrolld/cmd/migrate/errors.go @@ -0,0 +1,16 @@ +package migrate + +import sdkerrors "cosmossdk.io/errors" + +const codespace = "poktrolld/migrate" + +var ( + // ErrInvalidUsage usage is returned when the CLI arguments are invalid. + ErrInvalidUsage = sdkerrors.Register(codespace, 1100, "invalid CLI usage") + + // ErrMorseExportState is returned with the JSON generated from `pocket util export-genesis-for-reset` is invalid. + ErrMorseExportState = sdkerrors.Register(codespace, 1101, "morse export state failed") + + // ErrMorseStateTransform is returned upon general failure when transforming the MorseExportState into the MorseAccountState. + ErrMorseStateTransform = sdkerrors.Register(codespace, 1102, "morse export to state transformation invalid") +) diff --git a/cmd/poktrolld/cmd/migrate/migrate.go b/cmd/poktrolld/cmd/migrate/migrate.go new file mode 100644 index 000000000..09b9e40b5 --- /dev/null +++ b/cmd/poktrolld/cmd/migrate/migrate.go @@ -0,0 +1,327 @@ +package migrate + +import ( + "fmt" + "io" + "os" + + cosmosmath "cosmossdk.io/math" + cmtjson "github.com/cometbft/cometbft/libs/json" + "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/pkg/polylog" + "github.com/pokt-network/poktroll/pkg/polylog/polyzero" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" +) + +const defaultLogOutput = "-" + +var ( + flagDebugAccountsPerLog int + flagLogLevel string + flagLogOutput string + logger polylog.Logger + + // DEV_NOTE: AutoCLI does not apply here because there is no gRPC service, message, or query. + // + // The purpose of this command is to facilitate the deterministic (i.e. reproducible) transformation + // from Morse's export data structure (MorseStateExport) into Shannon's import data structure (MorseAccountState). + // + // It does not interact with the network directly. + collectMorseAccountsCmd = &cobra.Command{ + Use: "collect-morse-accounts [morse-state-export-path] [morse-account-state-path]", + Args: cobra.ExactArgs(2), + Short: "Collect account balances and stakes from [morse-state-export-path] JSON file and output to [morse-account-state-path] as JSON", + Long: `Processes Morse state for Shannon migration: + * Reads MorseStateExport JSON from [morse-state-export-path] + * Contains account balances and associated stakes + * Outputs MorseAccountState JSON to [morse-account-state-path] + * Integrates with Shannon's MsgUploadMorseState + + Generate required input via Morse CLI: + pocket util export-genesis-for-reset [height] [new-chain-id] > morse-state-export.json`, + PreRunE: func(cmd *cobra.Command, args []string) error { + var ( + logOutput io.Writer + err error + ) + + logLevel := polyzero.ParseLevel(flagLogLevel) + if flagLogOutput == defaultLogOutput { + logOutput = os.Stdout + } else { + logOutput, err = os.Open(flagLogOutput) + if err != nil { + return err + } + } + + logger = polyzero.NewLogger( + polyzero.WithLevel(logLevel), + polyzero.WithOutput(logOutput), + ).With("cmd", "migrate") + + return nil + }, + RunE: runCollectMorseAccounts, + } +) + +func MigrateCmd() *cobra.Command { + migrateCmd := &cobra.Command{ + Use: "migrate", + Short: "Migration commands", + } + migrateCmd.AddCommand(collectMorseAccountsCmd) + migrateCmd.PersistentFlags().StringVar(&flagLogLevel, "log-level", "info", "The logging level (debug|info|warn|error)") + migrateCmd.PersistentFlags().StringVar(&flagLogOutput, "log-output", defaultLogOutput, "The logging output (file path); defaults to stdout") + + collectMorseAccountsCmd.Flags().IntVar(&flagDebugAccountsPerLog, "debug-accounts-per-log", 0, "The number of accounts to log per debug message") + + return migrateCmd +} + +// runCollectedMorseAccounts is run via the following command: +// $ poktrolld migrate collect-morse-accounts +func runCollectMorseAccounts(_ *cobra.Command, args []string) error { + // DEV_NOTE: No need to check args length due to cobra.ExactArgs(2). + morseStateExportPath := args[0] + morseAccountStatePath := args[1] + + logger.Info(). + Str("morse_state_export_path", morseStateExportPath). + Str("morse_account_state_path", morseAccountStatePath). + Msg("collecting Morse accounts...") + + morseWorkspace, err := collectMorseAccounts(morseStateExportPath, morseAccountStatePath) + if err != nil { + return err + } + + return morseWorkspace.infoLogComplete() +} + +// collectMorseAccounts: +// - Reads a MorseStateExport JSON file from morseStateExportPath +// - Transforms it into a MorseAccountState +// - Writes the resulting JSON to morseAccountStatePath +func collectMorseAccounts(morseStateExportPath, morseAccountStatePath string) (*morseImportWorkspace, error) { + if err := validatePathIsFile(morseStateExportPath); err != nil { + return nil, err + } + + inputStateJSON, err := os.ReadFile(morseStateExportPath) + if err != nil { + return nil, err + } + + inputState := new(migrationtypes.MorseStateExport) + if err = cmtjson.Unmarshal(inputStateJSON, inputState); err != nil { + return nil, err + } + + morseWorkspace := newMorseImportWorkspace() + if err = transformMorseState(inputState, morseWorkspace); err != nil { + return nil, err + } + + outputStateJSONBz, err := cmtjson.Marshal(morseWorkspace.accountState) + if err != nil { + return nil, err + } + + if err = os.WriteFile(morseAccountStatePath, outputStateJSONBz, 0644); err != nil { + return nil, err + } + + return morseWorkspace, 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 ErrInvalidUsage.Wrapf("[morse-JSON-input-path] cannot be a directory: %s", path) + } + return nil +} + +// transformMorseState consolidates the Morse account balance, application stake, +// and supplier stake for each account as an entry in the resulting MorseAccountState. +// NOTE: In Shannon terms, a "supplier" is equivalent to all of the following in Morse terms: +// - "validator" +// - "node" +// - "servicer" +func transformMorseState( + inputState *migrationtypes.MorseStateExport, + morseWorkspace *morseImportWorkspace, +) error { + // Iterate over accounts and copy the balances. + logger.Info().Msg("collecting account balances...") + if err := collectInputAccountBalances(inputState, morseWorkspace); err != nil { + return err + } + + // Iterate over applications and add the stakes to the corresponding account balances. + logger.Info().Msg("collecting application stakes...") + if err := collectInputApplicationStakes(inputState, morseWorkspace); err != nil { + return err + } + + // Iterate over suppliers and add the stakes to the corresponding account balances. + logger.Info().Msg("collecting supplier stakes...") + return collectInputSupplierStakes(inputState, morseWorkspace) +} + +// 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 exportAccountIdx, exportAccount := range inputState.AppState.Auth.Accounts { + // DEV_NOTE: Ignore module accounts. + // TODO_IN_THIS_PR: Create a GitHub issue based on this thread: https://github.com/pokt-network/poktroll/pull/1039/files#r1934711993 + if exportAccount.Type != "posmint/Account" { + logger.Warn(). + Str("type", exportAccount.Type). + Str("address", exportAccount.Value.Address.String()). + Str("coins", fmt.Sprintf("%s", exportAccount.Value.Coins)). + Msg("ignoring non-EOA account") + continue + } + + accountAddr := exportAccount.Value.Address.String() + if _, _, err := morseWorkspace.addAccount(accountAddr, exportAccount); err != nil { + return err + } + + coins := exportAccount.Value.Coins + + // If, for whatever reason, the account has no coins, skip it. + // DEV_NOTE: This is NEVER expected to happen, but is technically possible. + if len(coins) == 0 { + logger.Warn().Str("address", accountAddr).Msg("account has no coins; skipping") + return nil + } + + // DEV_NOTE: SHOULD ONLY be one denom (upokt). + if len(coins) > 1 { + return ErrMorseExportState.Wrapf( + "account %q has %d token denominations, expected upokt only: %s", + accountAddr, len(coins), coins, + ) + } + + coin := coins[0] + if coin.Denom != volatile.DenomuPOKT { + return ErrMorseExportState.Wrapf("unsupported denom %q", coin.Denom) + } + + if err := morseWorkspace.addUpokt(accountAddr, coin.Amount); err != nil { + return fmt.Errorf( + "adding morse account balance (%s) to account balance of address %q: %w", + coin, accountAddr, err, + ) + } + + morseWorkspace.accumulatedTotalBalance = morseWorkspace.accumulatedTotalBalance.Add(coin.Amount) + + if shouldDebugLogProgress(exportAccountIdx) { + logger.Debug(). + Int("account_idx", exportAccountIdx). + Uint64("num_accounts", morseWorkspace.getNumAccounts()). + Str("total_balance", morseWorkspace.accumulatedTotalBalance.String()). + Str("grand_total", morseWorkspace.accumulatedTotalsSum().String()). + Msg("processing account balances...") + } + } + return nil +} + +// shouldDebugLogProgress returns true if the given exportAccountIdx should be logged +// via debugLogProgress. +func shouldDebugLogProgress(exportAccountIdx int) bool { + return flagDebugAccountsPerLog > 0 && + exportAccountIdx%flagDebugAccountsPerLog == 0 +} + +// 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 exportApplicationIdx, exportApplication := range inputState.AppState.Application.Applications { + appAddr := exportApplication.Address.String() + + // DEV_NOTE: An account SHOULD exist for each actor. + if !morseWorkspace.hasAccount(appAddr) { + return ErrMorseExportState.Wrapf("account not found corresponding to application with address %q", appAddr) + } + + appStakeAmtUpokt, ok := cosmosmath.NewIntFromString(exportApplication.StakedTokens) + if !ok { + return ErrMorseExportState.Wrapf("failed to parse application stake amount %q", exportApplication.StakedTokens) + } + + if err := morseWorkspace.addUpokt(appAddr, appStakeAmtUpokt); err != nil { + return fmt.Errorf( + "adding application stake amount to account balance of address %q: %w", + appAddr, err, + ) + } + + morseWorkspace.accumulatedTotalAppStake = morseWorkspace.accumulatedTotalAppStake.Add(appStakeAmtUpokt) + morseWorkspace.numApplications++ + + if shouldDebugLogProgress(exportApplicationIdx) { + logger.Debug(). + Int("application_idx", exportApplicationIdx). + Uint64("num_accounts", morseWorkspace.getNumAccounts()). + Uint64("num_applications", morseWorkspace.numApplications). + Str("total_app_stake", morseWorkspace.accumulatedTotalAppStake.String()). + Str("grand_total", morseWorkspace.accumulatedTotalsSum().String()). + Msg("processing application stakes...") + } + } + 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 exportSupplierIdx, exportSupplier := range inputState.AppState.Pos.Validators { + supplierAddr := exportSupplier.Address.String() + + // DEV_NOTE: An account SHOULD exist for each actor. + if !morseWorkspace.hasAccount(supplierAddr) { + return ErrMorseExportState.Wrapf("account not found corresponding to supplier with address %q", supplierAddr) + } + + supplierStakeAmtUpokt, ok := cosmosmath.NewIntFromString(exportSupplier.StakedTokens) + if !ok { + return ErrMorseExportState.Wrapf("failed to parse supplier stake amount %q", exportSupplier.StakedTokens) + } + + if err := morseWorkspace.addUpokt(supplierAddr, supplierStakeAmtUpokt); err != nil { + return fmt.Errorf( + "adding supplier stake amount to account balance of address %q: %w", + supplierAddr, err, + ) + } + + morseWorkspace.accumulatedTotalSupplierStake = morseWorkspace.accumulatedTotalSupplierStake.Add(supplierStakeAmtUpokt) + morseWorkspace.numSuppliers++ + + if shouldDebugLogProgress(exportSupplierIdx) { + logger.Debug(). + Int("supplier_idx", exportSupplierIdx). + Uint64("num_accounts", morseWorkspace.getNumAccounts()). + Uint64("num_suppliers", morseWorkspace.numSuppliers). + Str("total_supplier_stake", morseWorkspace.accumulatedTotalSupplierStake.String()). + Str("grand_total", morseWorkspace.accumulatedTotalsSum().String()). + Msg("processing accounts...") + } + } + 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..01b1e8778 --- /dev/null +++ b/cmd/poktrolld/cmd/migrate/migrate_test.go @@ -0,0 +1,215 @@ +package migrate + +import ( + "encoding/binary" + "fmt" + "math" + "math/rand" + "os" + "path/filepath" + "testing" + + cometcrypto "github.com/cometbft/cometbft/crypto/ed25519" + cmtjson "github.com/cometbft/cometbft/libs/json" + cosmostypes "github.com/cosmos/cosmos-sdk/types" + "github.com/regen-network/gocuke" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/pkg/polylog/polyzero" + migrationtypes "github.com/pokt-network/poktroll/x/migration/types" +) + +// TODO_IN_THIS_PR: Add a TODO to an E2E assuming this approach is sufficient +// for what we need to do: https://github.com/pokt-network/poktroll/pull/1039#discussion_r1947036729 + +func init() { + logger = polyzero.NewLogger(polyzero.WithLevel(polyzero.DebugLevel)) + flagDebugAccountsPerLog = 1 +} + +func TestCollectMorseAccounts(t *testing.T) { + tmpDir := t.TempDir() + outputPath := filepath.Join(tmpDir, "morse-state-output.json") + inputFile, err := os.CreateTemp(tmpDir, "morse-state-input.json") + require.NoError(t, err) + + // Generate and write the MorseStateExport input JSON file. + morseStateExportBz, morseAccountStateBz := newMorseStateExportAndAccountState(t, 10) + _, err = inputFile.Write(morseStateExportBz) + 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) + + var ( + expectedMorseAccountState, + actualMorseAccountState *migrationtypes.MorseAccountState + ) + + err = cmtjson.Unmarshal(morseAccountStateBz, &expectedMorseAccountState) + require.NoError(t, err) + + err = cmtjson.Unmarshal(outputJSON, &actualMorseAccountState) + require.NoError(t, err) + + require.NoError(t, err) + require.Equal(t, expectedMorseAccountState, actualMorseAccountState) +} + +func TestNewTestMorseStateExport(t *testing.T) { + // DEV_NOTE: Beyond i=3, the naive method for calculating the expected Shannon accumulated actor stakes fails. + for i := 1; i < 4; i++ { + t.Run(fmt.Sprintf("num_accounts=%d", i), func(t *testing.T) { + morseStateExport := new(migrationtypes.MorseStateExport) + stateExportBz, _ := newMorseStateExportAndAccountState(t, i) + err := cmtjson.Unmarshal(stateExportBz, morseStateExport) + require.NoError(t, err) + + exportAccounts := morseStateExport.AppState.Auth.Accounts + require.Equal(t, i, len(exportAccounts)) + + numTotalAccounts := 1 + for k := i; k > 1; k-- { + numTotalAccounts += k + } + + expectedShannonAccountBalance := fmt.Sprintf("%d%d%d0%d%d%d", i, i, i, i, i, i) + expectedShannonTotalAppStake := fmt.Sprintf("%d000%d0", numTotalAccounts, numTotalAccounts) + expectedShannonTotalSupplierStake := fmt.Sprintf("%d0%d00", numTotalAccounts, numTotalAccounts) + + morseWorkspace := newMorseImportWorkspace() + err = transformMorseState(morseStateExport, morseWorkspace) + require.NoError(t, err) + + require.Equal(t, uint64(i), morseWorkspace.getNumAccounts()) + require.Equal(t, uint64(i), morseWorkspace.numApplications) + require.Equal(t, uint64(i), morseWorkspace.numSuppliers) + + morseAccounts := morseWorkspace.accountState.Accounts[i-1] + require.Equal(t, expectedShannonAccountBalance, morseAccounts.Coins[0].Amount.String()) + require.Equal(t, expectedShannonTotalAppStake, morseWorkspace.accumulatedTotalAppStake.String()) + require.Equal(t, expectedShannonTotalSupplierStake, morseWorkspace.accumulatedTotalSupplierStake.String()) + }) + } +} + +func BenchmarkTransformMorseState(b *testing.B) { + for i := 0; i < 5; i++ { + numAccounts := int(math.Pow10(i + 1)) + morseStateExport := new(migrationtypes.MorseStateExport) + morseStateExportBz, _ := newMorseStateExportAndAccountState(b, numAccounts) + err := cmtjson.Unmarshal(morseStateExportBz, morseStateExport) + require.NoError(b, err) + + b.Run(fmt.Sprintf("num_accounts=%d", numAccounts), func(b *testing.B) { + morseWorkspace := newMorseImportWorkspace() + + // Call the function under test. + b.ResetTimer() + for i := 0; i < b.N; i++ { + err = transformMorseState(morseStateExport, morseWorkspace) + require.NoError(b, err) + } + }) + } +} + +// TODO_CONSIDERATION: Test/benchmark execution speed can be optimized by refactoring this to a pre-generate fixture. +func newMorseStateExportAndAccountState( + t gocuke.TestingT, + numAccounts int, +) (morseStateExportBz []byte, morseAccountStateBz []byte) { + morseStateExport := &migrationtypes.MorseStateExport{ + AppHash: "", + AppState: &migrationtypes.MorseTendermintAppState{ + Application: &migrationtypes.MorseApplications{}, + Auth: &migrationtypes.MorseAuth{}, + Pos: &migrationtypes.MorsePos{}, + }, + } + + morseAccountState := &migrationtypes.MorseAccountState{ + AccountsIdxByAddress: make(map[string]uint64), + Accounts: make([]*migrationtypes.MorseAccount, numAccounts), + } + + for i := 1; i < numAccounts+1; i++ { + seedUint := rand.Uint64() + seedBz := make([]byte, 8) + binary.LittleEndian.PutUint64(seedBz, seedUint) + privKey := cometcrypto.GenPrivKeyFromSecret(seedBz) + pubKey := privKey.PubKey() + balanceAmount := int64(1e6*i + i) // i_000_00i + appStakeAmount := int64(1e5*i + (i * 10)) // i00_0i0 + supplierStakeAmount := int64(1e4*i + (i * 100)) // i0_i00 + sumAmount := balanceAmount + appStakeAmount + supplierStakeAmount // i_ii0_iii + + // Add an account. + morseStateExport.AppState.Auth.Accounts = append( + morseStateExport.AppState.Auth.Accounts, + &migrationtypes.MorseAuthAccount{ + Type: "posmint/Account", + Value: &migrationtypes.MorseAccount{ + Address: pubKey.Address(), + Coins: cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, balanceAmount)), + PubKey: &migrationtypes.MorsePublicKey{ + Value: pubKey.Bytes(), + }, + }, + }, + ) + + // Add an application. + morseStateExport.AppState.Application.Applications = append( + morseStateExport.AppState.Application.Applications, + &migrationtypes.MorseApplication{ + Address: pubKey.Address(), + PublicKey: pubKey.Bytes(), + Jailed: false, + Status: 2, + StakedTokens: fmt.Sprintf("%d", appStakeAmount), + }, + ) + + // Add a supplier. + morseStateExport.AppState.Pos.Validators = append( + morseStateExport.AppState.Pos.Validators, + &migrationtypes.MorseValidator{ + Address: pubKey.Address(), + PublicKey: pubKey.Bytes(), + Jailed: false, + Status: 2, + StakedTokens: fmt.Sprintf("%d", supplierStakeAmount), + }, + ) + + // Add the account to the morseAccountState. + morseAccountState.Accounts[i-1] = &migrationtypes.MorseAccount{ + Address: pubKey.Address(), + Coins: cosmostypes.NewCoins(cosmostypes.NewInt64Coin(volatile.DenomuPOKT, sumAmount)), + PubKey: &migrationtypes.MorsePublicKey{ + Value: pubKey.Bytes(), + }, + } + + // Add the account index to the morseAccountState. + morseAccountState.AccountsIdxByAddress[pubKey.Address().String()] = uint64(i - 1) + } + + var err error + morseStateExportBz, err = cmtjson.Marshal(morseStateExport) + require.NoError(t, err) + + morseAccountStateBz, err = cmtjson.Marshal(morseAccountState) + require.NoError(t, err) + + return morseStateExportBz, morseAccountStateBz +} diff --git a/cmd/poktrolld/cmd/migrate/types.go b/cmd/poktrolld/cmd/migrate/types.go new file mode 100644 index 000000000..ad563ce3d --- /dev/null +++ b/cmd/poktrolld/cmd/migrate/types.go @@ -0,0 +1,158 @@ +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" +) + +// newMorseImportWorkspace returns a new morseImportWorkspace with fields initialized to their zero values. +func newMorseImportWorkspace() *morseImportWorkspace { + return &morseImportWorkspace{ + accountState: &migrationtypes.MorseAccountState{ + AccountsIdxByAddress: make(map[string]uint64), + Accounts: make([]*migrationtypes.MorseAccount, 0), + }, + accumulatedTotalBalance: cosmosmath.ZeroInt(), + accumulatedTotalAppStake: cosmosmath.ZeroInt(), + accumulatedTotalSupplierStake: cosmosmath.ZeroInt(), + } +} + +// morseImportWorkspace is a helper struct that is used to consolidate the Morse account balance, +// application stake, and supplier stake for each account as an entry in the resulting MorseAccountState. +type morseImportWorkspace struct { + // accountState is the final MorseAccountState that will be imported into Shannon. + // It includes a slice of MorseAccount objects which are populated, by transforming + // the input MorseStateExport into the output MorseAccountState. + accountState *migrationtypes.MorseAccountState + + // accumulatedTotalBalance is the most recently accumulated balances of all Morse + // accounts which have been processed. + accumulatedTotalBalance cosmosmath.Int + // accumulatedTotalAppStake is the most recently accumulated application stakes of + // all Morse accounts which have been processed. + accumulatedTotalAppStake cosmosmath.Int + // accumulatedTotalSupplierStake is the most recently accumulated supplier stakes of + // all Morse accounts which have been processed. + accumulatedTotalSupplierStake cosmosmath.Int + // numApplications is the number of applications that have been processed. + numApplications uint64 + // numSuppliers is the number of suppliers that have been processed. + numSuppliers uint64 +} + +// nextIdx returns the next index to be used when appending a new account to the accounts slice. +func (miw *morseImportWorkspace) nextIdx() int64 { + return int64(len(miw.accountState.GetAccounts())) +} + +// getAccount returns the MorseAccount for the given address and its index, +// if present, in the accountState accounts slice. +// If the given address is not present, it returns nil, -1. +func (miw *morseImportWorkspace) getAccount(addr string) (*migrationtypes.MorseAccount, int64) { + accountIdx, ok := miw.accountState.AccountsIdxByAddress[addr] + if !ok { + return nil, -1 + } + + account := miw.accountState.GetAccounts()[accountIdx] + return account, int64(accountIdx) +} + +// hasAccount returns true if the given address is present in the accounts slice. +func (miw *morseImportWorkspace) hasAccount(addr string) bool { + _, accountIdx := miw.getAccount(addr) + return accountIdx != -1 +} + +// getNumAccounts returns the number of accounts in the accountState accounts map. +func (miw *morseImportWorkspace) getNumAccounts() uint64 { + return uint64(len(miw.accountState.GetAccounts())) +} + +// infoLogComplete prints info level logs indicating the completion of the import. +func (miw *morseImportWorkspace) infoLogComplete() error { + accountStateHash, err := miw.accountState.GetHash() + if err != nil { + return err + } + + logger.Info(). + Uint64("num_accounts", miw.getNumAccounts()). + Uint64("num_applications", miw.numApplications). + Uint64("num_suppliers", miw.numSuppliers). + Str("total_balance", miw.accumulatedTotalBalance.String()). + Str("total_app_stake", miw.accumulatedTotalAppStake.String()). + Str("total_supplier_stake", miw.accumulatedTotalSupplierStake.String()). + Str("grand_total", miw.accumulatedTotalsSum().String()). + Str("morse_account_state_hash", fmt.Sprintf("%x", accountStateHash)). + Msg("processing accounts complete") + return nil +} + +// accumulatedTotalsSum returns the sum of the accumulatedTotalBalance, +// accumulatedTotalAppStake, and accumulatedTotalSupplierStake. +func (miw *morseImportWorkspace) accumulatedTotalsSum() cosmosmath.Int { + return miw.accumulatedTotalBalance. + Add(miw.accumulatedTotalAppStake). + Add(miw.accumulatedTotalSupplierStake) +} + +// addAccount adds the account with the given address to the accounts slice and +// its corresponding address is in the addressToIdx map. +// If the address is already present, an error is returned. +func (miw *morseImportWorkspace) addAccount( + addr string, + exportAccount *migrationtypes.MorseAuthAccount, +) (accountIdx int64, balance cosmostypes.Coin, err error) { + // Initialize balance to zero + balance = cosmostypes.NewCoin(volatile.DenomuPOKT, cosmosmath.ZeroInt()) + + if _, accountIdx = miw.getAccount(addr); accountIdx != -1 { + return 0, cosmostypes.Coin{}, ErrMorseStateTransform.Wrapf( + "unexpected workspace state: account already exists (%s)", addr, + ) + } + + accountIdx = miw.nextIdx() + importAccount := &migrationtypes.MorseAccount{ + Address: exportAccount.Value.Address, + PubKey: exportAccount.Value.PubKey, + Coins: cosmostypes.Coins{balance}, + } + miw.accountState.Accounts = append(miw.accountState.Accounts, importAccount) + miw.accountState.AccountsIdxByAddress[addr] = uint64(accountIdx) + + return accountIdx, balance, nil +} + +// addUpokt adds the given amount to the corresponding account balances in the morseWorkspace. +func (miw *morseImportWorkspace) addUpokt(addr string, amount cosmosmath.Int) error { + account, accountIdx := miw.getAccount(addr) + if accountIdx == -1 { + return ErrMorseStateTransform.Wrapf("account %q not found", addr) + } + + if len(account.Coins) != 1 { + return ErrMorseStateTransform.Wrapf( + "account %q has %d token denominations, expected upokt only: %s", + addr, len(account.Coins), account.Coins, + ) + } + + upoktCoins := account.Coins[0] + if upoktCoins.Denom != volatile.DenomuPOKT { + return fmt.Errorf( + "account %q has %s token denomination, expected upokt only: %s", + addr, upoktCoins.Denom, account.Coins, + ) + } + + account.Coins[0].Amount = account.Coins[0].Amount.Add(amount) + return nil +} diff --git a/docusaurus/docs/operate/morse_migration/_category_.json b/docusaurus/docs/operate/morse_migration/_category_.json new file mode 100644 index 000000000..d4757bcde --- /dev/null +++ b/docusaurus/docs/operate/morse_migration/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Morse -> Shannon Migration", + "position": 4, + "link": { + "type": "generated-index", + "description": "Morse to Shannon network migration documentation" + } +} diff --git a/docusaurus/docs/operate/morse_migration/morse-migration.md b/docusaurus/docs/operate/morse_migration/morse-migration.md new file mode 100644 index 000000000..17debb0a8 --- /dev/null +++ b/docusaurus/docs/operate/morse_migration/morse-migration.md @@ -0,0 +1,257 @@ +--- +title: Diagrams +sidebar_position: 1 +--- + +:::warning TODO_UPNEXT(@bryanchriswhite,#1034) +Expand migration docs and re-organize this page. + + All migration documents can be found on notion [here](https://www.notion.so/buildwithgrove/Morse-to-Shannon-Migration-173a36edfff6809cb1cbe10827c040de?pvs=4). + +::: + +## Table of Contents + +- [Complete E2E User Sequence](#complete-e2e-user-sequence) +- [Onchain Actors \& Messages](#onchain-actors--messages) +- [Shannon Data Structures to Represent Morse State](#shannon-data-structures-to-represent-morse-state) + +## Complete E2E User Sequence + +```mermaid +sequenceDiagram + autonumber + + actor A as Authority (Foundation) + actor MA as Morse Account Holders + participant MN as Morse Network + participant SN as Shannon Network + + loop (Re-)Generate morse_account_state.json + + A ->>+ MN: $ pocket util export-geneis-for-reset + MN ->>- A: return morse_state_export.json + + A ->> A: $ poktrolld migrate collect-morse-accounts + note over A: morse_account_state.json generated + + A ->>+ MA: distribute for verification
morse_account_state.json + + opt Morse Stakeholders optionally do local verification + MA ->>+ MN: $ pocket util export-geneis-for-reset + MN ->>- MA: return for local verification
morse_state_export.json + + MA ->> MA: $ poktrolld migrate collect-morse-accounts + note over MA: morse_account_state.json generated + MA ->> MA: manual comparison of
morse_account_state.json hashes + + MA ->>- A: ** (off-chain feedback) ** + end + + end + + A ->>+ SN: upload morse state
(MsgCreateMorseAccountState) + SN ->> SN: verify morse_account_state_hash field + SN -->- A: valid / invalid + + MA ->> SN: $ poktrolld migration claim-morse-pokt
claim morse POKT
(MsgClaimMorsePOKT) +``` + +## Onchain Actors & Messages + +```mermaid +flowchart + m1[MsgCreateMorseAccountClaim]:::account + m2[MsgCreateMorseSupplierClaim]:::supplier + m3[MsgCreateMorseApplicationClaim]:::application + m4[MsgCreateMorseGatewayClaim]:::gateway + + subgraph MigrationKeeper + h1([CreateMorseAccountClaim]):::account + h2([CreateMorseSupplierClaim]):::supplier + h3([CreateMorseApplicationClaim]):::application + h4([CreateMorseGatewayClaim]):::gateway + %% ms[[MorseAccountState]] + ac[[MorseAccountClaims]]:::general + end + + h1 --"Morse Account Claim Creation
(ensure not previously claimed)"--> ac + h2 --"Morse Account Claim Creation
(ensure not previously claimed)"--> ac + h3 --"Morse Account Claim Creation
(ensure not previously claimed)"--> ac + h4 --"Morse Account Claim Creation
(ensure not previously claimed)"--> ac + + %% h1 --"ensure claim is valid"--> ms + %% h2 --"ensure claim is valid"--> ms + %% h3 --"ensure claim is valid"--> ms + %% h4 --"ensure claim is valid"--> ms + + m1 --> h1 + m2 --> h2 + m3 --> h3 + m4 --> h4 + + subgraph BankKeeper + bk1[[Balances]]:::general + end + + subgraph SupplierKeeper + sk1[["Suppliers"]]:::supplier + end + + subgraph ApplicationKeeper + ak1[["Applications"]]:::application + end + + subgraph GatewayKeeper + gk1[["Gateways"]]:::gateway + end + + h1 --"Mint Balance"----> bk1 + h2 --"Mint Supplier Stake &
Non-staked Balance"--> bk1 + h2 --"Stake Supplier"---> sk1 + h3 --"Mint Application Stake &
Non-staked Balance"--> bk1 + h3 --"Stake Application"---> ak1 + h4 --"Mint Gateway Stake &
Non-staked Balance"--> bk1 + h4 --"Stake Gateway"---> gk1 + + classDef account fill:#90EE90,color:#000 + classDef supplier fill:#FFA500,color:#000 + classDef application fill:#FFB6C6,color:#000 + classDef gateway fill:#FF0000,color:#000 + classDef general fill:#87CEEB,color:#000 +``` + +## Shannon Data Structures to Represent Morse State + +```mermaid +--- +title: MorseStateExport --> MorseAccountState Transform +--- + +flowchart + +subgraph OffC[Off-Chain] + MorseStateExport --> MorseAppState + MorseAppState --> MorseApplications + MorseAppState --> MorseAuth + MorseAppState --> MorsePos + MorseApplications --> MorseApplication + MorseAuth --> MorseAuthAccount + MorseAuthAccount --> MAOff[MorseAccount] + MorsePos --> MorseValidator +end + + +subgraph OnC[On-Chain] + MorseAccountState + MorseAccountState --> MAOn + MAOn[MorseAccount] +end + +MAOff -.add exported account balance..-> MAOn +MorseValidator -.add exported stake to account balance.-> MAOn +MorseApplication -.add exported stake to account balance.-> MAOn +``` + +```mermaid +--- +title: MorseStateExport Structure(s) +--- + +classDiagram + +class MorseStateExport { + app_hash: string + app_state: MorseAppState +} +MorseStateExport --* MorseAppState + +class MorseAppState { + application: MorseApplications + auth: MorseAuth + pos: MorsePos +} +MorseAppState --* MorseApplications +MorseAppState --* MorseAuth +MorseAppState --* MorsePos + +class MorseApplications { + applications: []MorseApplication +} + +class MorseAuth { + accounts: []MorseAuthAccount +} +MorseAuth --* MorseAuthAccount + +class MorseAuthAccount { + type: string + value: MorseAccount +} +MorseAuthAccount --* MorseAccount + +class MorsePos { + validators: []MorseValidator +} +MorsePos --* MorseValidator + +class MorseValidator { + address: bytes + public_key: bytes + jailed: bool + status: int32 + staked_tokens: string +} + +class MorseApplication { + address: bytes + public_key: bytes + jailed: bool + status: int32 + staked_tokens: string +} +MorseApplications --* MorseApplication + +class MorseAccount { + address: string + pub_key: MorsePublicKey + coins: []cosmostypes.Coin +} +MorseAccount --* MorsePublicKey + +class MorsePublicKey { + value crypto/ed25519.PublicKey +} +``` + +```mermaid +--- +title: MsgCreateMorseAccountState Structure(s) +--- + +classDiagram + +class MsgCreateMorseAccountState { + authority: string + morse_account_state: MorseAccountState + morse_account_state_hash: bytes +} +MsgCreateMorseAccountState --* MorseAccountState + +class MorseAccountState { + accounts: []MorseAccount + GetHash(): []bytes +} +MorseAccountState --* MorseAccount + +class MorseAccount { + address: string + pub_key: MorsePublicKey + coins: []cosmostypes.Coin +} +MorseAccount --* MorsePublicKey + +class MorsePublicKey { + value crypto/ed25519.PublicKey +} +``` diff --git a/docusaurus/docs/operate/networks/_category_.json b/docusaurus/docs/operate/networks/_category_.json index 978afd7cc..a04271fc1 100644 --- a/docusaurus/docs/operate/networks/_category_.json +++ b/docusaurus/docs/operate/networks/_category_.json @@ -1,6 +1,6 @@ { "label": "Networks", - "position": 4, + "position": 5, "link": { "type": "generated-index", "description": "Documentation on Poktroll Networks." diff --git a/docusaurus/docs/operate/upgrades/contigency_plans.md b/docusaurus/docs/operate/upgrades/contigency_plans.md index 0a262bd5c..71dc469ff 100644 --- a/docusaurus/docs/operate/upgrades/contigency_plans.md +++ b/docusaurus/docs/operate/upgrades/contigency_plans.md @@ -60,7 +60,7 @@ they will automatically skip the failed upgrade. ### Option 2: The migration is stuck (i.e. incomplete/partial migration) -If the migration is stuck, there's always a chance the upgrade handler was executed on-chain as scheduled, but the migration didn't complete. +If the migration is stuck, there's always a chance the upgrade handler was executed onchain as scheduled, but the migration didn't complete. In such a case, we need: diff --git a/docusaurus/docs/operate/upgrades/recovery_from_chain_halt.md b/docusaurus/docs/operate/upgrades/recovery_from_chain_halt.md index e0e0b3f0a..d502ca77e 100644 --- a/docusaurus/docs/operate/upgrades/recovery_from_chain_halt.md +++ b/docusaurus/docs/operate/upgrades/recovery_from_chain_halt.md @@ -97,7 +97,7 @@ sequenceDiagram These instructions are only relevant to Pocket Network's Shannon release. -We do not currently use `x/gov` or on-chain voting for upgrades. +We do not currently use `x/gov` or onchain voting for upgrades. Instead, all participants in our DAO vote on upgrades off-chain, and the Foundation executes transactions on their behalf. diff --git a/proto/poktroll/application/types.proto b/proto/poktroll/application/types.proto index 81e7e893e..4979807e1 100644 --- a/proto/poktroll/application/types.proto +++ b/proto/poktroll/application/types.proto @@ -14,7 +14,7 @@ import "cosmos_proto/cosmos.proto"; import "poktroll/shared/service.proto"; -// Application represents the on-chain definition and state of an application +// Application represents the onchain definition and state of an application message Application { // Bech32 address of the application string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/proto/poktroll/migration/morse_offchain.proto b/proto/poktroll/migration/morse_offchain.proto new file mode 100644 index 000000000..2db801988 --- /dev/null +++ b/proto/poktroll/migration/morse_offchain.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; + +// Types in this file are ONLY present to facilitate the verifiability of the +// migration state from Morse to Shannon. +// +// These types reproduce a 1:1 de/serialization for the corresponding Morse data structures +// but are not completely identical to their Morse counterparts, not all of which are defined +// as protobuf types in the Morse codebase. +// +// Morse leverages pb.Any types, as well as the gogoproto.casttype option in several places. +// All usages of pb.Any have been replaced with equivalent protobuf types +// (i.e. an interstitial type with `type` and/or `value` field(s)). +// All usages of gogoproto.casttype which previously referenced Morse data structures have been removed. +// A few specific fields have retained this option where the type is changed to the underlying +// external lib type that the Morse type was wrapping (e.g. address and public key fields). +// +// These types are used by the migration subcommand to transform +// the Morse state export into the Shannon state import like so: +// $ poktrolld migrate collect-morse-accounts ... +// +// CRITICAL: These types are offchain and ARE NOT persisted onchain (Shannon) at any point. +package poktroll.migration; + +import "gogoproto/gogo.proto"; +import "poktroll/migration/morse_onchain.proto"; + +option go_package = "github.com/pokt-network/poktroll/x/migration/types"; +option (gogoproto.stable_marshaler_all) = true; + +// MorseStateExport is the data structure that is serialized and output when running: +// $ pocket utils export-genesis-for-reset ... +// +// Ref: https://editor.swagger.io/?url=https://raw.githubusercontent.com/pokt-network/pocket-core/staging/doc/specs/rpc-spec.yaml#operations-query-post_query_state +message MorseStateExport { + // app_hash is the Morse tendermint state hash. + string app_hash = 1 [(gogoproto.jsontag) = "app_hash"]; + + // app_state is the entire Morse tendermint application state. + MorseTendermintAppState app_state = 2 [(gogoproto.jsontag) = "app_state"]; +} + +// MorseTendermintAppState is the tendermint application state for the Morse tendermint +// application; not to be confused with the pokt protocol actor. +// It is constructed in Morse via `PocketCoreApp#ExportAppState()`. +// +// See: https://github.com/pokt-network/pocket-core/blob/5fa61920aa9d45ca6bf9e01e863134e242c95fa7/app/pocket.go#L142 +message MorseTendermintAppState { + MorseApplications application = 1 [(gogoproto.jsontag) = "application"]; + MorseAuth auth = 2 [(gogoproto.jsontag) = "auth"]; + MorsePos pos = 3 [(gogoproto.jsontag) = "pos"]; +} + +// A wrapper around the list of MorseApplications, necessary in order to conform to the Morse genesis structure. +// It encapsulates the minimum information required to import Morse applications. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/x/apps/types/genesis.go#L4 +message MorseApplications { + repeated MorseApplication applications = 1 [(gogoproto.jsontag) = "applications"]; +} + +// A wrapper around a list of MorseAuthAccount. +// It encapsulates the minimum information required to import Morse accounts. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/x/auth/types/genesis.go#L9 +message MorseAuth { + repeated MorseAuthAccount accounts = 1 [(gogoproto.jsontag) = "accounts"]; +} + +// MorseAccount: +// * Wraps MorseAuthAccount information to conform to Morse genesis structure +// * Represents only externally owned accounts (not module accounts) +// * Avoids pb.Any serialization since only external accounts needed for migration +message MorseAuthAccount { + string type = 1 [(gogoproto.jsontag) = "type"]; + MorseAccount value = 2 [(gogoproto.jsontag) = "value"]; +} + +// A wrapper around the list of Morse suppliers (aka "validators", "nodes", of "servicers"). +// It is necessary to conform to the Morse genesis structure. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/x/nodes/types/genesis.go#L8 +message MorsePos { + repeated MorseValidator validators = 1 [(gogoproto.jsontag) = "validators"]; +} + +// MorseApplication is a subset of the Morse ProtoApplication type. +// It encapsulates the minimum information required to import Morse applications. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/apps/apps.proto#L16 +message MorseApplication { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + // Address is a binary representation of the address corresponding + // to a Morse application's ed25519 public key. + bytes address = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.jsontag) = "address", (gogoproto.moretags) = "yaml:\"address\""]; + // PublicKey is the binary representation of a Morse application's ed25519 public key. + bytes public_key = 2 [(gogoproto.jsontag) = "public_key", (gogoproto.moretags) = "yaml:\"public_key\""]; + // TODO_MAINNET(@Olshansk): Should status and/or jailed be considered during the migration, and if so, how? + bool jailed = 3[(gogoproto.jsontag) = "jailed", (gogoproto.moretags) = "yaml:\"jailed\""]; + int32 status = 4 [(gogoproto.jsontag) = "status", (gogoproto.moretags) = "yaml:\"status\""]; + // The string representation of the BigInt amount of upokt. + string staked_tokens = 6 [(gogoproto.jsontag) = "tokens"]; +} + +// 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; + + // A binary representation of the address corresponding to a Morse application's ed25519 public key. + bytes address = 1 [(gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address", (gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; + // The binary representation of a Morse application's ed25519 public key. + bytes public_key = 2 [(gogoproto.moretags) = "yaml:\"public_key\"", (gogoproto.jsontag) = "public_key"]; + // TODO_MAINNET(@Olshansk): Should status and/or jailed be considered during the migration, and if so, how? + bool jailed = 3 [(gogoproto.jsontag) = "jailed"]; + int32 status = 4 [(gogoproto.jsontag) = "status"]; + // The string representation of the BigInt amount of upokt. + string staked_tokens = 7 [(gogoproto.jsontag) = "tokens"]; +} diff --git a/proto/poktroll/migration/morse_onchain.proto b/proto/poktroll/migration/morse_onchain.proto new file mode 100644 index 000000000..263d36d12 --- /dev/null +++ b/proto/poktroll/migration/morse_onchain.proto @@ -0,0 +1,45 @@ +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 onchain representation of the imported account state from Morse. +message MorseAccountState { + // TODO_IN_THIS_PR: #PUC to the rationale of needing to index this. + map accounts_idx_by_address = 1 [(gogoproto.jsontag) = "accounts_idx_by_address", (gogoproto.moretags) = "yaml:\"accounts_idx_by_address\""]; + repeated MorseAccount accounts = 2 [(gogoproto.jsontag) = "accounts", (gogoproto.moretags) = "yaml:\"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"; + + // A binary representation of the address corresponding to a Morse application's ed25519 public key. + // TODO_IN_THIS_PR: #PUC if this is hex or not? + bytes address = 1 [(gogoproto.jsontag) = "address", (gogoproto.casttype) = "github.com/cometbft/cometbft/crypto.Address"]; + + // The ed25519 public key of the account. + MorsePublicKey pub_key = 2 [(gogoproto.jsontag) = "public_key", (gogoproto.moretags) = "yaml:\"public_key\""]; + + // The amount of uPOKT held by the account. + // TODO_IN_THIS_PR: #PUC how we distinguish staked tokens from regular tokens? + repeated cosmos.base.v1beta1.Coin coins = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "coins"]; +} + +// MorsePublicKey is required to conform to the encoding of the Morse state export. +// NB: All Morse account public keys will be ed25519 keys by definition. +message MorsePublicKey { + bytes value = 2 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; +} diff --git a/x/migration/types/morse_account_state.go b/x/migration/types/morse_account_state.go new file mode 100644 index 000000000..1ca2a9770 --- /dev/null +++ b/x/migration/types/morse_account_state.go @@ -0,0 +1,19 @@ +package types + +import ( + "crypto/sha256" + + "github.com/cosmos/gogoproto/proto" +) + +// GetHash calculates the sha256 hash of the MorseAccountState proto structure. +// It is intended to be used to verify the integrity of the MorseAccountState by network actors offchain. +func (m MorseAccountState) GetHash() ([]byte, error) { + morseAccountStateBz, err := proto.Marshal(&m) + if err != nil { + return nil, err + } + + hash := sha256.Sum256(morseAccountStateBz) + return hash[:], nil +} diff --git a/x/migration/types/morse_offchain.pb.go b/x/migration/types/morse_offchain.pb.go new file mode 100644 index 000000000..10b11344e --- /dev/null +++ b/x/migration/types/morse_offchain.pb.go @@ -0,0 +1,2223 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/migration/morse_offchain.proto + +// Types in this file are ONLY present to facilitate the verifiability of the +// migration state from Morse to Shannon. +// +// These types reproduce a 1:1 de/serialization for the corresponding Morse data structures +// but are not completely identical to their Morse counterparts, not all of which are defined +// as protobuf types in the Morse codebase. +// +// Morse also leverages pb.Any types, as well as the gogoproto.casttype option in several places. +// All usages of pb.Any have been replaced with equivalent protobuf types +// (i.e. an interstitial type with `type` and/or `value` field(s)). +// All usages of gogoproto.casttype which previously referenced Morse data structures have been removed. +// A few specific fields have retained this option where the type is changed to the underlying +// external lib type that the Morse type was wrapping (e.g. address and public key fields). +// +// These types are used by the migration subcommand to transform +// the Morse state export into the Shannon state import. +// Ref: `poktrolld migrate collect-morse-accounts ...` +// +// They ARE NOT persisted on-chain (Shannon) at any point. + +package types + +import ( + bytes "bytes" + fmt "fmt" + github_com_cometbft_cometbft_crypto "github.com/cometbft/cometbft/crypto" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + 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 + +// MorseStateExport is the data structure that is serialized and output when running +// `pocket utils export-genesis-for-reset`. +// +// See: https://editor.swagger.io/?url=https://raw.githubusercontent.com/pokt-network/pocket-core/staging/doc/specs/rpc-spec.yaml#operations-query-post_query_state +type MorseStateExport struct { + // app_hash is the Morse tendermint state hash. + AppHash string `protobuf:"bytes,1,opt,name=app_hash,json=appHash,proto3" json:"app_hash"` + // app_state is the entire Morse tendermint application state. + AppState *MorseTendermintAppState `protobuf:"bytes,2,opt,name=app_state,json=appState,proto3" json:"app_state"` +} + +func (m *MorseStateExport) Reset() { *m = MorseStateExport{} } +func (m *MorseStateExport) String() string { return proto.CompactTextString(m) } +func (*MorseStateExport) ProtoMessage() {} +func (*MorseStateExport) Descriptor() ([]byte, []int) { + return fileDescriptor_a3da515ab792a974, []int{0} +} +func (m *MorseStateExport) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseStateExport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseStateExport) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseStateExport.Merge(m, src) +} +func (m *MorseStateExport) XXX_Size() int { + return m.Size() +} +func (m *MorseStateExport) XXX_DiscardUnknown() { + xxx_messageInfo_MorseStateExport.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseStateExport proto.InternalMessageInfo + +func (m *MorseStateExport) GetAppHash() string { + if m != nil { + return m.AppHash + } + return "" +} + +func (m *MorseStateExport) GetAppState() *MorseTendermintAppState { + if m != nil { + return m.AppState + } + return nil +} + +// MorseTendermintAppState is the tendermint application state for the Morse tendermint +// application; not to be confused with the pokt protocol actor. +// It is constructed in Morse via `PocketCoreApp#ExportAppState()`. +// +// See: https://github.com/pokt-network/pocket-core/blob/5fa61920aa9d45ca6bf9e01e863134e242c95fa7/app/pocket.go#L142 +type MorseTendermintAppState struct { + Application *MorseApplications `protobuf:"bytes,1,opt,name=application,proto3" json:"application"` + Auth *MorseAuth `protobuf:"bytes,2,opt,name=auth,proto3" json:"auth"` + Pos *MorsePos `protobuf:"bytes,3,opt,name=pos,proto3" json:"pos"` +} + +func (m *MorseTendermintAppState) Reset() { *m = MorseTendermintAppState{} } +func (m *MorseTendermintAppState) String() string { return proto.CompactTextString(m) } +func (*MorseTendermintAppState) ProtoMessage() {} +func (*MorseTendermintAppState) Descriptor() ([]byte, []int) { + return fileDescriptor_a3da515ab792a974, []int{1} +} +func (m *MorseTendermintAppState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseTendermintAppState) 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 *MorseTendermintAppState) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseTendermintAppState.Merge(m, src) +} +func (m *MorseTendermintAppState) XXX_Size() int { + return m.Size() +} +func (m *MorseTendermintAppState) XXX_DiscardUnknown() { + xxx_messageInfo_MorseTendermintAppState.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseTendermintAppState proto.InternalMessageInfo + +func (m *MorseTendermintAppState) GetApplication() *MorseApplications { + if m != nil { + return m.Application + } + return nil +} + +func (m *MorseTendermintAppState) GetAuth() *MorseAuth { + if m != nil { + return m.Auth + } + return nil +} + +func (m *MorseTendermintAppState) GetPos() *MorsePos { + if m != nil { + return m.Pos + } + return nil +} + +// A wrapper around the list of MorseApplications, necessary in order to conform to the Morse genesis structure. +// It encapsulates the minimum information required to import Morse applications. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/x/apps/types/genesis.go#L4 +type MorseApplications struct { + Applications []*MorseApplication `protobuf:"bytes,1,rep,name=applications,proto3" json:"applications"` +} + +func (m *MorseApplications) Reset() { *m = MorseApplications{} } +func (m *MorseApplications) String() string { return proto.CompactTextString(m) } +func (*MorseApplications) ProtoMessage() {} +func (*MorseApplications) Descriptor() ([]byte, []int) { + return fileDescriptor_a3da515ab792a974, []int{2} +} +func (m *MorseApplications) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseApplications) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseApplications) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseApplications.Merge(m, src) +} +func (m *MorseApplications) XXX_Size() int { + return m.Size() +} +func (m *MorseApplications) XXX_DiscardUnknown() { + xxx_messageInfo_MorseApplications.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseApplications proto.InternalMessageInfo + +func (m *MorseApplications) GetApplications() []*MorseApplication { + if m != nil { + return m.Applications + } + return nil +} + +// A wrapper around a list of Morse accounts. +// It encapsulates the minimum information required to import Morse accounts. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/x/auth/types/genesis.go#L9 +type MorseAuth struct { + Accounts []*MorseAuthAccount `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts"` +} + +func (m *MorseAuth) Reset() { *m = MorseAuth{} } +func (m *MorseAuth) String() string { return proto.CompactTextString(m) } +func (*MorseAuth) ProtoMessage() {} +func (*MorseAuth) Descriptor() ([]byte, []int) { + return fileDescriptor_a3da515ab792a974, []int{3} +} +func (m *MorseAuth) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseAuth) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseAuth.Merge(m, src) +} +func (m *MorseAuth) XXX_Size() int { + return m.Size() +} +func (m *MorseAuth) XXX_DiscardUnknown() { + xxx_messageInfo_MorseAuth.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseAuth proto.InternalMessageInfo + +func (m *MorseAuth) GetAccounts() []*MorseAuthAccount { + if m != nil { + return m.Accounts + } + return nil +} + +// MorseAccount: +// * Wraps Morse account information to conform to Morse genesis structure +// * Represents only externally owned accounts (not module accounts) +// * Avoids pb.Any serialization since only external accounts needed for migration +type MorseAuthAccount struct { + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type"` + Value *MorseAccount `protobuf:"bytes,2,opt,name=value,proto3" json:"value"` +} + +func (m *MorseAuthAccount) Reset() { *m = MorseAuthAccount{} } +func (m *MorseAuthAccount) String() string { return proto.CompactTextString(m) } +func (*MorseAuthAccount) ProtoMessage() {} +func (*MorseAuthAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_a3da515ab792a974, []int{4} +} +func (m *MorseAuthAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseAuthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseAuthAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseAuthAccount.Merge(m, src) +} +func (m *MorseAuthAccount) XXX_Size() int { + return m.Size() +} +func (m *MorseAuthAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MorseAuthAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseAuthAccount proto.InternalMessageInfo + +func (m *MorseAuthAccount) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *MorseAuthAccount) GetValue() *MorseAccount { + if m != nil { + return m.Value + } + return nil +} + +// A wrapper around the list of Morse suppliers (aka "validators", "nodes", of "servicers"). +// It is necessary to conform to the Morse genesis structure. +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/x/nodes/types/genesis.go#L8 +type MorsePos struct { + Validators []*MorseValidator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` +} + +func (m *MorsePos) Reset() { *m = MorsePos{} } +func (m *MorsePos) String() string { return proto.CompactTextString(m) } +func (*MorsePos) ProtoMessage() {} +func (*MorsePos) Descriptor() ([]byte, []int) { + return fileDescriptor_a3da515ab792a974, []int{5} +} +func (m *MorsePos) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorsePos) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorsePos) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorsePos.Merge(m, src) +} +func (m *MorsePos) XXX_Size() int { + return m.Size() +} +func (m *MorsePos) XXX_DiscardUnknown() { + xxx_messageInfo_MorsePos.DiscardUnknown(m) +} + +var xxx_messageInfo_MorsePos proto.InternalMessageInfo + +func (m *MorsePos) GetValidators() []*MorseValidator { + if m != nil { + return m.Validators + } + return nil +} + +// 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 is a binary representation of the address corresponding + // to a Morse application's ed25519 public key. + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` + // PublicKey is the binary representation of a Morse application's ed25519 public key. + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed" yaml:"jailed"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status" yaml:"status"` + // The string representation of the BigInt amount of upokt. + StakedTokens string `protobuf:"bytes,6,opt,name=staked_tokens,json=stakedTokens,proto3" json:"tokens"` +} + +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_a3da515ab792a974, []int{6} +} +func (m *MorseApplication) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseApplication) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseApplication.Merge(m, src) +} +func (m *MorseApplication) XXX_Size() int { + return m.Size() +} +func (m *MorseApplication) XXX_DiscardUnknown() { + xxx_messageInfo_MorseApplication.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseApplication proto.InternalMessageInfo + +// MorseValidator is a subset of the Morse ProtoValidator type. +// It encapsulates the minimum information required to import Morse suppliers (aka "servicers" or "validators"). +// +// See: https://github.com/pokt-network/pocket-core/blob/staging/proto/x/pos/types.proto#L16 +type MorseValidator struct { + // A binary representation of the address corresponding to a Morse application's ed25519 public key. + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address" yaml:"address"` + // The binary representation of a Morse application's ed25519 public key. + PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key" yaml:"public_key"` + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status"` + // The string representation of the BigInt amount of upokt. + StakedTokens string `protobuf:"bytes,7,opt,name=staked_tokens,json=stakedTokens,proto3" json:"tokens"` +} + +func (m *MorseValidator) Reset() { *m = MorseValidator{} } +func (m *MorseValidator) String() string { return proto.CompactTextString(m) } +func (*MorseValidator) ProtoMessage() {} +func (*MorseValidator) Descriptor() ([]byte, []int) { + return fileDescriptor_a3da515ab792a974, []int{7} +} +func (m *MorseValidator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MorseValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *MorseValidator) XXX_Merge(src proto.Message) { + xxx_messageInfo_MorseValidator.Merge(m, src) +} +func (m *MorseValidator) XXX_Size() int { + return m.Size() +} +func (m *MorseValidator) XXX_DiscardUnknown() { + xxx_messageInfo_MorseValidator.DiscardUnknown(m) +} + +var xxx_messageInfo_MorseValidator proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MorseStateExport)(nil), "poktroll.migration.MorseStateExport") + proto.RegisterType((*MorseTendermintAppState)(nil), "poktroll.migration.MorseTendermintAppState") + proto.RegisterType((*MorseApplications)(nil), "poktroll.migration.MorseApplications") + proto.RegisterType((*MorseAuth)(nil), "poktroll.migration.MorseAuth") + proto.RegisterType((*MorseAuthAccount)(nil), "poktroll.migration.MorseAuthAccount") + proto.RegisterType((*MorsePos)(nil), "poktroll.migration.MorsePos") + proto.RegisterType((*MorseApplication)(nil), "poktroll.migration.MorseApplication") + proto.RegisterType((*MorseValidator)(nil), "poktroll.migration.MorseValidator") +} + +func init() { + proto.RegisterFile("poktroll/migration/morse_offchain.proto", fileDescriptor_a3da515ab792a974) +} + +var fileDescriptor_a3da515ab792a974 = []byte{ + // 721 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0x4b, 0x6b, 0xdb, 0x4a, + 0x14, 0xb6, 0xf2, 0xb2, 0x3d, 0x76, 0x72, 0x13, 0x71, 0xe1, 0x9a, 0xdc, 0x5c, 0x8f, 0x99, 0xdb, + 0x36, 0x86, 0x50, 0x1b, 0x9c, 0x45, 0x21, 0x5d, 0x59, 0x50, 0x28, 0xf4, 0x41, 0x98, 0x86, 0xb6, + 0xa4, 0x50, 0x33, 0xb6, 0x65, 0x4b, 0xb5, 0xac, 0x19, 0x34, 0xa3, 0x34, 0xfe, 0x07, 0x5d, 0x76, + 0xd1, 0x45, 0x97, 0xf9, 0x2f, 0xdd, 0x74, 0x99, 0x65, 0x56, 0xa2, 0xd8, 0x9b, 0x56, 0xcb, 0x2c, + 0xbb, 0x2a, 0x33, 0x92, 0x6c, 0x25, 0x41, 0x34, 0xdb, 0x6e, 0x46, 0x73, 0xce, 0x7c, 0xdf, 0x79, + 0x7c, 0x3a, 0xc3, 0x80, 0x5d, 0x46, 0x47, 0xc2, 0xa3, 0x8e, 0xd3, 0x1c, 0xdb, 0x43, 0x8f, 0x08, + 0x9b, 0xba, 0xcd, 0x31, 0xf5, 0xb8, 0xd9, 0xa1, 0x83, 0x41, 0xcf, 0x22, 0xb6, 0xdb, 0x60, 0x1e, + 0x15, 0x54, 0xd7, 0x13, 0x60, 0x63, 0x0e, 0xdc, 0xfe, 0x7b, 0x48, 0x87, 0x54, 0x1d, 0x37, 0xe5, + 0x2e, 0x42, 0x6e, 0xdf, 0xcb, 0x0e, 0xe9, 0xa6, 0x22, 0xa2, 0x4f, 0x1a, 0xd8, 0x7c, 0x26, 0xfd, + 0x2f, 0x04, 0x11, 0xe6, 0xa3, 0x53, 0x46, 0x3d, 0xa1, 0xef, 0x82, 0x02, 0x61, 0xac, 0x63, 0x11, + 0x6e, 0x55, 0xb4, 0x9a, 0x56, 0x2f, 0x1a, 0xe5, 0x30, 0x80, 0x73, 0x1f, 0xce, 0x13, 0xc6, 0x1e, + 0x13, 0x6e, 0xe9, 0xaf, 0x40, 0x51, 0x3a, 0xb9, 0xe4, 0x56, 0x96, 0x6a, 0x5a, 0xbd, 0xd4, 0xda, + 0x6b, 0xdc, 0xac, 0xb1, 0xa1, 0x32, 0x1c, 0x99, 0x6e, 0xdf, 0xf4, 0xc6, 0xb6, 0x2b, 0xda, 0x8c, + 0xa9, 0x74, 0xc6, 0x7a, 0x18, 0xc0, 0x45, 0x04, 0x2c, 0x33, 0xa8, 0x03, 0xf4, 0x43, 0x03, 0xff, + 0x64, 0x90, 0xf4, 0xd7, 0xa0, 0x44, 0x18, 0x73, 0xec, 0x9e, 0x8a, 0xad, 0x0a, 0x2c, 0xb5, 0xee, + 0x66, 0xa6, 0x6d, 0x2f, 0xb0, 0xdc, 0xf8, 0x2b, 0x0c, 0x60, 0x9a, 0x8d, 0xd3, 0x86, 0xfe, 0x10, + 0xac, 0x10, 0x5f, 0x58, 0x71, 0x27, 0xff, 0x65, 0x87, 0xf4, 0x85, 0x65, 0x14, 0xc2, 0x00, 0x2a, + 0x38, 0x56, 0xab, 0xfe, 0x00, 0x2c, 0x33, 0xca, 0x2b, 0xcb, 0x8a, 0xbb, 0x93, 0xc9, 0x3d, 0xa4, + 0xdc, 0xc8, 0x87, 0x01, 0x94, 0x60, 0x2c, 0x17, 0x44, 0xc1, 0xd6, 0x8d, 0x42, 0xf5, 0x63, 0x50, + 0x4e, 0x55, 0xc6, 0x2b, 0x5a, 0x6d, 0xb9, 0x5e, 0x6a, 0xdd, 0xb9, 0x4d, 0x97, 0xc6, 0x66, 0x18, + 0xc0, 0x2b, 0x6c, 0x7c, 0xc5, 0x42, 0x6f, 0x40, 0x71, 0xde, 0x86, 0xfe, 0x1c, 0x14, 0x48, 0xaf, + 0x47, 0x7d, 0x57, 0xdc, 0x22, 0x89, 0x2f, 0xac, 0x76, 0x04, 0x8e, 0x27, 0x22, 0x66, 0xe2, 0xf9, + 0x0e, 0xf1, 0x78, 0x9e, 0x52, 0x58, 0x7d, 0x07, 0xac, 0x88, 0x09, 0x33, 0xe3, 0x59, 0x52, 0xc2, + 0x49, 0x1b, 0xab, 0x55, 0x6f, 0x83, 0xd5, 0x13, 0xe2, 0xf8, 0xc9, 0x00, 0xd5, 0xb2, 0xd3, 0xc7, + 0xa9, 0x8b, 0x61, 0x00, 0x23, 0x0a, 0x8e, 0x3e, 0xe8, 0x2d, 0x28, 0x24, 0xe2, 0xea, 0x18, 0x80, + 0x13, 0xe2, 0xd8, 0x7d, 0x22, 0xa8, 0x97, 0xb4, 0x84, 0x32, 0x63, 0xbe, 0x4c, 0xa0, 0xc6, 0x46, + 0x18, 0xc0, 0x14, 0x13, 0xa7, 0xf6, 0x68, 0xb6, 0x94, 0x74, 0x95, 0x9a, 0x96, 0x01, 0xc8, 0x93, + 0x7e, 0xdf, 0x33, 0x39, 0x57, 0x8d, 0x95, 0x8d, 0xa7, 0x61, 0x00, 0x13, 0xd7, 0x65, 0x00, 0x37, + 0x26, 0x64, 0xec, 0x1c, 0xa0, 0xd8, 0x81, 0x7e, 0x06, 0x70, 0x6f, 0x68, 0x0b, 0xcb, 0xef, 0x36, + 0x7a, 0x74, 0xdc, 0xec, 0xd1, 0xb1, 0x29, 0xba, 0x03, 0x91, 0xda, 0x78, 0x13, 0x26, 0x68, 0xa3, + 0x1d, 0xe1, 0x71, 0x12, 0x49, 0x37, 0x00, 0x60, 0x7e, 0xd7, 0xb1, 0x7b, 0x9d, 0x91, 0x39, 0x51, + 0x22, 0x95, 0x8d, 0xff, 0x65, 0xb1, 0x0b, 0xef, 0x65, 0x00, 0xb7, 0xa2, 0x6c, 0x0b, 0x1f, 0xc2, + 0xc5, 0xc8, 0x78, 0x62, 0x4e, 0xf4, 0x7d, 0xb0, 0xf6, 0x8e, 0xd8, 0x8e, 0xd9, 0x57, 0xf3, 0x59, + 0x30, 0xfe, 0x0d, 0x03, 0x18, 0x7b, 0x2e, 0x03, 0xb8, 0x1e, 0x71, 0x23, 0x1b, 0xe1, 0xf8, 0x40, + 0x92, 0xe4, 0xbd, 0xf4, 0x79, 0x65, 0xa5, 0xa6, 0xd5, 0x57, 0x23, 0x52, 0xe4, 0x59, 0x90, 0x22, + 0x1b, 0xe1, 0xf8, 0x40, 0x6f, 0x82, 0x75, 0x2e, 0xc8, 0xc8, 0xec, 0x77, 0x04, 0x1d, 0x99, 0x2e, + 0xaf, 0xac, 0xa9, 0x9f, 0x0e, 0x24, 0x37, 0xf2, 0xe0, 0x72, 0x04, 0x38, 0x52, 0xd6, 0x41, 0xe1, + 0xc3, 0x19, 0xcc, 0x7d, 0x3f, 0x83, 0x1a, 0xfa, 0xb2, 0x04, 0x36, 0xae, 0xfe, 0x94, 0x3f, 0x4a, + 0x63, 0x74, 0x4d, 0x63, 0xb0, 0xd0, 0x78, 0x2e, 0x29, 0xba, 0x26, 0x29, 0x58, 0x48, 0x9a, 0xad, + 0x60, 0xfe, 0x37, 0x0a, 0x96, 0xa5, 0x82, 0x9f, 0xcf, 0xa0, 0x26, 0x55, 0x34, 0x0e, 0xbf, 0x4e, + 0xab, 0xda, 0xf9, 0xb4, 0xaa, 0x5d, 0x4c, 0xab, 0xda, 0xb7, 0x69, 0x55, 0xfb, 0x38, 0xab, 0xe6, + 0xce, 0x67, 0xd5, 0xdc, 0xc5, 0xac, 0x9a, 0x3b, 0x6e, 0xa5, 0xe4, 0x91, 0x77, 0xe2, 0xbe, 0x6b, + 0x8a, 0xf7, 0xd4, 0x1b, 0x35, 0xe7, 0xef, 0xc5, 0x69, 0xea, 0xc5, 0x90, 0xf7, 0x93, 0x77, 0xd7, + 0xd4, 0x53, 0xb1, 0xff, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x66, 0x0b, 0xd9, 0xa7, 0x06, 0x00, + 0x00, +} + +func (this *MorseApplication) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MorseApplication) + if !ok { + that2, ok := that.(MorseApplication) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Address, that1.Address) { + return false + } + if !bytes.Equal(this.PublicKey, that1.PublicKey) { + return false + } + if this.Jailed != that1.Jailed { + return false + } + if this.Status != that1.Status { + return false + } + if this.StakedTokens != that1.StakedTokens { + return false + } + return true +} +func (this *MorseValidator) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MorseValidator) + if !ok { + that2, ok := that.(MorseValidator) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Address, that1.Address) { + return false + } + if !bytes.Equal(this.PublicKey, that1.PublicKey) { + return false + } + if this.Jailed != that1.Jailed { + return false + } + if this.Status != that1.Status { + return false + } + if this.StakedTokens != that1.StakedTokens { + return false + } + return true +} +func (m *MorseStateExport) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MorseStateExport) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseStateExport) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AppState != nil { + { + size, err := m.AppState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMorseOffchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintMorseOffchain(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MorseTendermintAppState) 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 *MorseTendermintAppState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseTendermintAppState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pos != nil { + { + size, err := m.Pos.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMorseOffchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMorseOffchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Application != nil { + { + size, err := m.Application.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMorseOffchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MorseApplications) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MorseApplications) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseApplications) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Applications) > 0 { + for iNdEx := len(m.Applications) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Applications[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMorseOffchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MorseAuth) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MorseAuth) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseAuth) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMorseOffchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MorseAuthAccount) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MorseAuthAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorseAuthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMorseOffchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintMorseOffchain(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MorsePos) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MorsePos) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MorsePos) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMorseOffchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + 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 = encodeVarintMorseOffchain(dAtA, i, uint64(len(m.StakedTokens))) + i-- + dAtA[i] = 0x32 + } + if m.Status != 0 { + i = encodeVarintMorseOffchain(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 = encodeVarintMorseOffchain(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 = encodeVarintMorseOffchain(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 = encodeVarintMorseOffchain(dAtA, i, uint64(len(m.StakedTokens))) + i-- + dAtA[i] = 0x3a + } + if m.Status != 0 { + i = encodeVarintMorseOffchain(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 = encodeVarintMorseOffchain(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 = encodeVarintMorseOffchain(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMorseOffchain(dAtA []byte, offset int, v uint64) int { + offset -= sovMorseOffchain(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MorseStateExport) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovMorseOffchain(uint64(l)) + } + if m.AppState != nil { + l = m.AppState.Size() + n += 1 + l + sovMorseOffchain(uint64(l)) + } + return n +} + +func (m *MorseTendermintAppState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Application != nil { + l = m.Application.Size() + n += 1 + l + sovMorseOffchain(uint64(l)) + } + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovMorseOffchain(uint64(l)) + } + if m.Pos != nil { + l = m.Pos.Size() + n += 1 + l + sovMorseOffchain(uint64(l)) + } + return n +} + +func (m *MorseApplications) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Applications) > 0 { + for _, e := range m.Applications { + l = e.Size() + n += 1 + l + sovMorseOffchain(uint64(l)) + } + } + return n +} + +func (m *MorseAuth) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Accounts) > 0 { + for _, e := range m.Accounts { + l = e.Size() + n += 1 + l + sovMorseOffchain(uint64(l)) + } + } + return n +} + +func (m *MorseAuthAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sovMorseOffchain(uint64(l)) + } + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovMorseOffchain(uint64(l)) + } + return n +} + +func (m *MorsePos) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovMorseOffchain(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 + sovMorseOffchain(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovMorseOffchain(uint64(l)) + } + if m.Jailed { + n += 2 + } + if m.Status != 0 { + n += 1 + sovMorseOffchain(uint64(m.Status)) + } + l = len(m.StakedTokens) + if l > 0 { + n += 1 + l + sovMorseOffchain(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 + sovMorseOffchain(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovMorseOffchain(uint64(l)) + } + if m.Jailed { + n += 2 + } + if m.Status != 0 { + n += 1 + sovMorseOffchain(uint64(m.Status)) + } + l = len(m.StakedTokens) + if l > 0 { + n += 1 + l + sovMorseOffchain(uint64(l)) + } + return n +} + +func sovMorseOffchain(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMorseOffchain(x uint64) (n int) { + return sovMorseOffchain(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MorseStateExport) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MorseStateExport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseStateExport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + 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 ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AppState == nil { + m.AppState = &MorseTendermintAppState{} + } + if err := m.AppState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMorseOffchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOffchain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseTendermintAppState) 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 ErrIntOverflowMorseOffchain + } + 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: MorseTendermintAppState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseTendermintAppState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Application", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Application == nil { + m.Application = &MorseApplications{} + } + if err := m.Application.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auth == nil { + m.Auth = &MorseAuth{} + } + if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pos == nil { + m.Pos = &MorsePos{} + } + if err := m.Pos.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMorseOffchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOffchain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseApplications) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MorseApplications: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseApplications: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Applications", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Applications = append(m.Applications, &MorseApplication{}) + if err := m.Applications[len(m.Applications)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMorseOffchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOffchain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseAuth) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MorseAuth: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseAuth: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accounts = append(m.Accounts, &MorseAuthAccount{}) + if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMorseOffchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOffchain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorseAuthAccount) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MorseAuthAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorseAuthAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + 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 ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &MorseAccount{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMorseOffchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOffchain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MorsePos) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MorsePos: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MorsePos: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validators = append(m.Validators, &MorseValidator{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMorseOffchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + 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 ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMorseOffchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + 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 ErrIntOverflowMorseOffchain + } + 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 ErrInvalidLengthMorseOffchain + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMorseOffchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StakedTokens = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMorseOffchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOffchain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMorseOffchain(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, ErrIntOverflowMorseOffchain + } + 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, ErrIntOverflowMorseOffchain + } + 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, ErrIntOverflowMorseOffchain + } + 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, ErrInvalidLengthMorseOffchain + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMorseOffchain + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMorseOffchain + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMorseOffchain = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMorseOffchain = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMorseOffchain = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/migration/types/morse_onchain.pb.go b/x/migration/types/morse_onchain.pb.go new file mode 100644 index 000000000..0ce2c7f08 --- /dev/null +++ b/x/migration/types/morse_onchain.pb.go @@ -0,0 +1,955 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/migration/morse_onchain.proto + +package types + +import ( + 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" + github_com_cosmos_gogoproto_sortkeys "github.com/cosmos/gogoproto/sortkeys" + 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 { + AccountsIdxByAddress map[string]uint64 `protobuf:"bytes,1,rep,name=accounts_idx_by_address,json=accountsIdxByAddress,proto3" json:"accounts_idx_by_address" yaml:"accounts_idx_by_address" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Accounts []*MorseAccount `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts" yaml:"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_e74ea76a959fdb61, []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) GetAccountsIdxByAddress() map[string]uint64 { + if m != nil { + return m.AccountsIdxByAddress + } + return nil +} + +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 { + // A binary representation of the address corresponding to a Morse application's ed25519 public key. + Address github_com_cometbft_cometbft_crypto.Address `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cometbft/cometbft/crypto.Address" json:"address"` + 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_e74ea76a959fdb61, []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_e74ea76a959fdb61, []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 +} + +func init() { + proto.RegisterType((*MorseAccountState)(nil), "poktroll.migration.MorseAccountState") + proto.RegisterMapType((map[string]uint64)(nil), "poktroll.migration.MorseAccountState.AccountsIdxByAddressEntry") + proto.RegisterType((*MorseAccount)(nil), "poktroll.migration.MorseAccount") + proto.RegisterType((*MorsePublicKey)(nil), "poktroll.migration.MorsePublicKey") +} + +func init() { + proto.RegisterFile("poktroll/migration/morse_onchain.proto", fileDescriptor_e74ea76a959fdb61) +} + +var fileDescriptor_e74ea76a959fdb61 = []byte{ + // 555 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xcf, 0x8b, 0xd3, 0x40, + 0x14, 0xee, 0xb4, 0xee, 0x56, 0x67, 0xeb, 0x8f, 0x0d, 0x85, 0x4d, 0x8b, 0x64, 0x4a, 0x04, 0x29, + 0xc8, 0x4e, 0x68, 0x65, 0x41, 0x0b, 0x2a, 0x1b, 0x15, 0x91, 0x45, 0x58, 0xa2, 0x27, 0x41, 0x62, + 0x92, 0x8e, 0xdd, 0xd0, 0x26, 0x13, 0x32, 0x93, 0xb5, 0xf9, 0x0f, 0xf6, 0xe8, 0xd1, 0x9b, 0x8b, + 0x7f, 0x83, 0xfe, 0x0f, 0x8b, 0xa7, 0x3d, 0xee, 0x69, 0x90, 0xf6, 0xd6, 0x63, 0xbd, 0xed, 0x49, + 0xd2, 0x49, 0xbb, 0x5d, 0xd6, 0xe2, 0x29, 0xef, 0x7d, 0xf9, 0xde, 0x7b, 0xdf, 0x7c, 0xbc, 0x07, + 0xef, 0x47, 0xb4, 0xcf, 0x63, 0x3a, 0x18, 0x18, 0x81, 0xdf, 0x8b, 0x1d, 0xee, 0xd3, 0xd0, 0x08, + 0x68, 0xcc, 0x88, 0x4d, 0x43, 0xef, 0xc0, 0xf1, 0x43, 0x1c, 0xc5, 0x94, 0x53, 0x45, 0x99, 0xf3, + 0xf0, 0x82, 0x57, 0xaf, 0x79, 0x94, 0x05, 0x94, 0xd9, 0x33, 0x86, 0x21, 0x13, 0x49, 0xaf, 0x6b, + 0x32, 0x33, 0x5c, 0x87, 0x11, 0xe3, 0xb0, 0xe5, 0x12, 0xee, 0xb4, 0x0c, 0x8f, 0xce, 0xdb, 0xd5, + 0xab, 0x3d, 0xda, 0xa3, 0xb2, 0x2e, 0x8b, 0x24, 0xaa, 0xff, 0x29, 0xc2, 0xcd, 0x37, 0xd9, 0xf0, + 0x5d, 0xcf, 0xa3, 0x49, 0xc8, 0xdf, 0x72, 0x87, 0x13, 0xe5, 0x27, 0x80, 0x5b, 0x8e, 0x04, 0x98, + 0xed, 0x77, 0x87, 0xb6, 0x9b, 0xda, 0x4e, 0xb7, 0x1b, 0x13, 0xc6, 0x54, 0xd0, 0x28, 0x35, 0x37, + 0xda, 0xcf, 0xf0, 0x55, 0x75, 0xf8, 0x4a, 0x23, 0x9c, 0x27, 0xec, 0x75, 0x77, 0x68, 0xa6, 0xbb, + 0xb2, 0xc3, 0xcb, 0x90, 0xc7, 0xa9, 0xf9, 0x64, 0x22, 0xd0, 0xaa, 0x19, 0x53, 0x81, 0xb4, 0xd4, + 0x09, 0x06, 0x1d, 0x7d, 0x05, 0x41, 0xb7, 0xaa, 0xce, 0x3f, 0x3a, 0x2b, 0x1f, 0xe0, 0xf5, 0x39, + 0xae, 0x16, 0x67, 0x3a, 0x1b, 0xff, 0xd3, 0x69, 0xa2, 0x89, 0x40, 0x8b, 0xaa, 0xa9, 0x40, 0xb7, + 0x2f, 0x4f, 0xd6, 0xad, 0xc5, 0xcf, 0xfa, 0x2b, 0x58, 0x5b, 0xf9, 0x20, 0xe5, 0x0e, 0x2c, 0xf5, + 0x49, 0xaa, 0x82, 0x06, 0x68, 0xde, 0xb0, 0xb2, 0x50, 0xa9, 0xc2, 0xb5, 0x43, 0x67, 0x90, 0x10, + 0xb5, 0xd8, 0x00, 0xcd, 0x6b, 0x96, 0x4c, 0x3a, 0xc5, 0x47, 0x40, 0xff, 0x56, 0x84, 0x95, 0x65, + 0x11, 0xca, 0x3b, 0x58, 0xbe, 0xf0, 0x17, 0x34, 0x2b, 0x66, 0x67, 0x22, 0xd0, 0x1c, 0x3a, 0x17, + 0xe8, 0x41, 0xcf, 0xe7, 0x07, 0x89, 0x8b, 0x3d, 0x1a, 0x18, 0x1e, 0x0d, 0x08, 0x77, 0x3f, 0xf1, + 0xa5, 0x20, 0x4e, 0x23, 0x4e, 0x71, 0x2e, 0xc7, 0x9a, 0xd7, 0x29, 0x1f, 0x61, 0x39, 0x4a, 0x5c, + 0x3b, 0x93, 0x95, 0x49, 0xd8, 0x68, 0xeb, 0x2b, 0xdd, 0xd8, 0x4f, 0xdc, 0x81, 0xef, 0xed, 0x91, + 0xd4, 0xbc, 0x37, 0x11, 0x08, 0x46, 0xb3, 0x34, 0xab, 0x9c, 0x0a, 0xb4, 0x29, 0x1d, 0xb9, 0xc0, + 0x74, 0x6b, 0x3d, 0x4a, 0xdc, 0x3d, 0x92, 0x2a, 0x4f, 0xe1, 0x5a, 0xb6, 0x62, 0x4c, 0x2d, 0xcd, + 0xdc, 0xae, 0xe1, 0x7c, 0x25, 0xb3, 0x25, 0xc4, 0xf9, 0x12, 0xe2, 0xe7, 0xd4, 0x0f, 0xcd, 0x9b, + 0x27, 0x02, 0x15, 0x26, 0x02, 0x49, 0xbe, 0x25, 0x3f, 0x9d, 0xad, 0xa3, 0x63, 0x54, 0xf8, 0x7a, + 0x8c, 0xc0, 0xd1, 0x77, 0x04, 0x7e, 0xfd, 0xd8, 0x2e, 0xe7, 0x86, 0xe8, 0x2f, 0xe0, 0xad, 0xcb, + 0xba, 0x94, 0xf6, 0xb2, 0x9b, 0x15, 0xf3, 0xee, 0xb9, 0x40, 0xaa, 0x7c, 0xb8, 0x41, 0xba, 0xed, + 0x9d, 0x9d, 0xd6, 0x63, 0xbc, 0x20, 0xe7, 0x5e, 0x9b, 0xfb, 0x27, 0x23, 0x0d, 0x9c, 0x8e, 0x34, + 0x70, 0x36, 0xd2, 0xc0, 0xef, 0x91, 0x06, 0xbe, 0x8c, 0xb5, 0xc2, 0xe9, 0x58, 0x2b, 0x9c, 0x8d, + 0xb5, 0xc2, 0xfb, 0xf6, 0x92, 0xa9, 0x99, 0x2f, 0xdb, 0x21, 0xe1, 0x9f, 0x69, 0xdc, 0x37, 0x16, + 0x07, 0x3a, 0x5c, 0x3a, 0x51, 0x9e, 0x46, 0x84, 0xb9, 0xeb, 0xb3, 0xb3, 0x79, 0xf8, 0x37, 0x00, + 0x00, 0xff, 0xff, 0x74, 0x88, 0x66, 0xee, 0xc5, 0x03, 0x00, 0x00, +} + +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 = encodeVarintMorseOnchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.AccountsIdxByAddress) > 0 { + keysForAccountsIdxByAddress := make([]string, 0, len(m.AccountsIdxByAddress)) + for k := range m.AccountsIdxByAddress { + keysForAccountsIdxByAddress = append(keysForAccountsIdxByAddress, string(k)) + } + github_com_cosmos_gogoproto_sortkeys.Strings(keysForAccountsIdxByAddress) + for iNdEx := len(keysForAccountsIdxByAddress) - 1; iNdEx >= 0; iNdEx-- { + v := m.AccountsIdxByAddress[string(keysForAccountsIdxByAddress[iNdEx])] + baseI := i + i = encodeVarintMorseOnchain(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(keysForAccountsIdxByAddress[iNdEx]) + copy(dAtA[i:], keysForAccountsIdxByAddress[iNdEx]) + i = encodeVarintMorseOnchain(dAtA, i, uint64(len(keysForAccountsIdxByAddress[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintMorseOnchain(dAtA, i, uint64(baseI-i)) + 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 = encodeVarintMorseOnchain(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 = encodeVarintMorseOnchain(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintMorseOnchain(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 = encodeVarintMorseOnchain(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func encodeVarintMorseOnchain(dAtA []byte, offset int, v uint64) int { + offset -= sovMorseOnchain(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.AccountsIdxByAddress) > 0 { + for k, v := range m.AccountsIdxByAddress { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovMorseOnchain(uint64(len(k))) + 1 + sovMorseOnchain(uint64(v)) + n += mapEntrySize + 1 + sovMorseOnchain(uint64(mapEntrySize)) + } + } + if len(m.Accounts) > 0 { + for _, e := range m.Accounts { + l = e.Size() + n += 1 + l + sovMorseOnchain(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 + sovMorseOnchain(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovMorseOnchain(uint64(l)) + } + if len(m.Coins) > 0 { + for _, e := range m.Coins { + l = e.Size() + n += 1 + l + sovMorseOnchain(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 + sovMorseOnchain(uint64(l)) + } + return n +} + +func sovMorseOnchain(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMorseOnchain(x uint64) (n int) { + return sovMorseOnchain(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 ErrIntOverflowMorseOnchain + } + 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 AccountsIdxByAddress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOnchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOnchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOnchain + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AccountsIdxByAddress == nil { + m.AccountsIdxByAddress = make(map[string]uint64) + } + var mapkey string + var mapvalue uint64 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOnchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOnchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthMorseOnchain + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthMorseOnchain + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMorseOnchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := skipMorseOnchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOnchain + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AccountsIdxByAddress[mapkey] = mapvalue + iNdEx = postIndex + case 2: + 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 ErrIntOverflowMorseOnchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOnchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOnchain + } + 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 := skipMorseOnchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOnchain + } + 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 ErrIntOverflowMorseOnchain + } + 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 ErrIntOverflowMorseOnchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMorseOnchain + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMorseOnchain + } + 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 ErrIntOverflowMorseOnchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOnchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOnchain + } + 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 ErrIntOverflowMorseOnchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMorseOnchain + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMorseOnchain + } + 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 := skipMorseOnchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOnchain + } + 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 ErrIntOverflowMorseOnchain + } + 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 ErrIntOverflowMorseOnchain + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMorseOnchain + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMorseOnchain + } + 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 := skipMorseOnchain(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMorseOnchain + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMorseOnchain(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, ErrIntOverflowMorseOnchain + } + 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, ErrIntOverflowMorseOnchain + } + 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, ErrIntOverflowMorseOnchain + } + 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, ErrInvalidLengthMorseOnchain + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMorseOnchain + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMorseOnchain + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMorseOnchain = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMorseOnchain = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMorseOnchain = fmt.Errorf("proto: unexpected end of group") +)