From 4fd342f01c7d9e80af37266f892b3cafff6405bb Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 14 Oct 2024 15:11:00 +0700 Subject: [PATCH 01/24] add und entry proto --- .../accounts/defaults/lockup/lockup.pulsar.go | 772 +++++++++++++++++- runtime/module_account.go | 15 + x/accounts/defaults/lockup/types/lockup.pb.go | 341 +++++++- .../accounts/defaults/lockup/lockup.proto | 18 + 4 files changed, 1104 insertions(+), 42 deletions(-) create mode 100644 runtime/module_account.go diff --git a/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go b/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go index 78b5cfce1568..5004dc943b40 100644 --- a/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go @@ -5,12 +5,14 @@ import ( _ "cosmossdk.io/api/amino" 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" durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -589,6 +591,643 @@ func (x *fastReflection_Period) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_UnbondingEntry_2_list)(nil) + +type _UnbondingEntry_2_list struct { + list *[]*v1beta1.Coin +} + +func (x *_UnbondingEntry_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_UnbondingEntry_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_UnbondingEntry_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_UnbondingEntry_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_UnbondingEntry_2_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UnbondingEntry_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_UnbondingEntry_2_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UnbondingEntry_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_UnbondingEntry protoreflect.MessageDescriptor + fd_UnbondingEntry_end_time protoreflect.FieldDescriptor + fd_UnbondingEntry_amount protoreflect.FieldDescriptor + fd_UnbondingEntry_validator_address protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_defaults_lockup_lockup_proto_init() + md_UnbondingEntry = File_cosmos_accounts_defaults_lockup_lockup_proto.Messages().ByName("UnbondingEntry") + fd_UnbondingEntry_end_time = md_UnbondingEntry.Fields().ByName("end_time") + fd_UnbondingEntry_amount = md_UnbondingEntry.Fields().ByName("amount") + fd_UnbondingEntry_validator_address = md_UnbondingEntry.Fields().ByName("validator_address") +} + +var _ protoreflect.Message = (*fastReflection_UnbondingEntry)(nil) + +type fastReflection_UnbondingEntry UnbondingEntry + +func (x *UnbondingEntry) ProtoReflect() protoreflect.Message { + return (*fastReflection_UnbondingEntry)(x) +} + +func (x *UnbondingEntry) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_defaults_lockup_lockup_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_UnbondingEntry_messageType fastReflection_UnbondingEntry_messageType +var _ protoreflect.MessageType = fastReflection_UnbondingEntry_messageType{} + +type fastReflection_UnbondingEntry_messageType struct{} + +func (x fastReflection_UnbondingEntry_messageType) Zero() protoreflect.Message { + return (*fastReflection_UnbondingEntry)(nil) +} +func (x fastReflection_UnbondingEntry_messageType) New() protoreflect.Message { + return new(fastReflection_UnbondingEntry) +} +func (x fastReflection_UnbondingEntry_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_UnbondingEntry +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_UnbondingEntry) Descriptor() protoreflect.MessageDescriptor { + return md_UnbondingEntry +} + +// 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_UnbondingEntry) Type() protoreflect.MessageType { + return _fastReflection_UnbondingEntry_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_UnbondingEntry) New() protoreflect.Message { + return new(fastReflection_UnbondingEntry) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_UnbondingEntry) Interface() protoreflect.ProtoMessage { + return (*UnbondingEntry)(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_UnbondingEntry) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.EndTime != nil { + value := protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) + if !f(fd_UnbondingEntry_end_time, value) { + return + } + } + if len(x.Amount) != 0 { + value := protoreflect.ValueOfList(&_UnbondingEntry_2_list{list: &x.Amount}) + if !f(fd_UnbondingEntry_amount, value) { + return + } + } + if x.ValidatorAddress != "" { + value := protoreflect.ValueOfString(x.ValidatorAddress) + if !f(fd_UnbondingEntry_validator_address, 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_UnbondingEntry) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": + return x.EndTime != nil + case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": + return len(x.Amount) != 0 + case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": + return x.ValidatorAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.UnbondingEntry")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.UnbondingEntry 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_UnbondingEntry) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": + x.EndTime = nil + case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": + x.Amount = nil + case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": + x.ValidatorAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.UnbondingEntry")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.UnbondingEntry 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_UnbondingEntry) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": + value := x.EndTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": + if len(x.Amount) == 0 { + return protoreflect.ValueOfList(&_UnbondingEntry_2_list{}) + } + listValue := &_UnbondingEntry_2_list{list: &x.Amount} + return protoreflect.ValueOfList(listValue) + case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": + value := x.ValidatorAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.UnbondingEntry")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.UnbondingEntry 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_UnbondingEntry) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": + x.EndTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": + lv := value.List() + clv := lv.(*_UnbondingEntry_2_list) + x.Amount = *clv.list + case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": + x.ValidatorAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.UnbondingEntry")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.UnbondingEntry 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_UnbondingEntry) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": + if x.EndTime == nil { + x.EndTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) + case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": + if x.Amount == nil { + x.Amount = []*v1beta1.Coin{} + } + value := &_UnbondingEntry_2_list{list: &x.Amount} + return protoreflect.ValueOfList(value) + case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": + panic(fmt.Errorf("field validator_address of message cosmos.accounts.defaults.lockup.UnbondingEntry is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.UnbondingEntry")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.UnbondingEntry 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_UnbondingEntry) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_UnbondingEntry_2_list{list: &list}) + case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.UnbondingEntry")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.UnbondingEntry 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_UnbondingEntry) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.UnbondingEntry", 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_UnbondingEntry) 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_UnbondingEntry) 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_UnbondingEntry) 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_UnbondingEntry) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*UnbondingEntry) + 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.EndTime != nil { + l = options.Size(x.EndTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Amount) > 0 { + for _, e := range x.Amount { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.ValidatorAddress) + 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().(*UnbondingEntry) + 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.ValidatorAddress) > 0 { + i -= len(x.ValidatorAddress) + copy(dAtA[i:], x.ValidatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) + i-- + dAtA[i] = 0x1a + } + if len(x.Amount) > 0 { + for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Amount[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if x.EndTime != nil { + encoded, err := options.Marshal(x.EndTime) + 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().(*UnbondingEntry) + 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: UnbondingEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnbondingEntry: 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 EndTime", 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.EndTime == nil { + x.EndTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.EndTime); 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 Amount", 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.Amount = append(x.Amount, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); 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 ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 @@ -647,6 +1286,61 @@ func (x *Period) GetAmount() []*v1beta1.Coin { return nil } +// UnbondingEntry defines an entry tracking the lockup account unbonding operation. +type UnbondingEntry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // end time of entry + EndTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + // unbond amount + Amount []*v1beta1.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount,omitempty"` + // validator address + ValidatorAddress string `protobuf:"bytes,3,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (x *UnbondingEntry) Reset() { + *x = UnbondingEntry{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_defaults_lockup_lockup_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnbondingEntry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnbondingEntry) ProtoMessage() {} + +// Deprecated: Use UnbondingEntry.ProtoReflect.Descriptor instead. +func (*UnbondingEntry) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_defaults_lockup_lockup_proto_rawDescGZIP(), []int{1} +} + +func (x *UnbondingEntry) GetEndTime() *timestamppb.Timestamp { + if x != nil { + return x.EndTime + } + return nil +} + +func (x *UnbondingEntry) GetAmount() []*v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + +func (x *UnbondingEntry) GetValidatorAddress() string { + if x != nil { + return x.ValidatorAddress + } + return "" +} + var File_cosmos_accounts_defaults_lockup_lockup_proto protoreflect.FileDescriptor var file_cosmos_accounts_defaults_lockup_lockup_proto_rawDesc = []byte{ @@ -659,14 +1353,31 @@ var file_cosmos_accounts_defaults_lockup_lockup_proto_rawDesc = []byte{ 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, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x06, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x12, 0x40, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, - 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x6c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x06, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, + 0x40, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, + 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, + 0x68, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 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, 0x46, 0xc8, 0xde, + 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, + 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa1, 0x02, 0x0a, + 0x0e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x44, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, + 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 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, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, @@ -674,6 +1385,11 @@ var file_cosmos_accounts_defaults_lockup_lockup_proto_rawDesc = []byte{ 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, + 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x84, 0x02, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x42, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, @@ -705,20 +1421,24 @@ func file_cosmos_accounts_defaults_lockup_lockup_proto_rawDescGZIP() []byte { return file_cosmos_accounts_defaults_lockup_lockup_proto_rawDescData } -var file_cosmos_accounts_defaults_lockup_lockup_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_accounts_defaults_lockup_lockup_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_cosmos_accounts_defaults_lockup_lockup_proto_goTypes = []interface{}{ - (*Period)(nil), // 0: cosmos.accounts.defaults.lockup.Period - (*durationpb.Duration)(nil), // 1: google.protobuf.Duration - (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin + (*Period)(nil), // 0: cosmos.accounts.defaults.lockup.Period + (*UnbondingEntry)(nil), // 1: cosmos.accounts.defaults.lockup.UnbondingEntry + (*durationpb.Duration)(nil), // 2: google.protobuf.Duration + (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp } var file_cosmos_accounts_defaults_lockup_lockup_proto_depIdxs = []int32{ - 1, // 0: cosmos.accounts.defaults.lockup.Period.length:type_name -> google.protobuf.Duration - 2, // 1: cosmos.accounts.defaults.lockup.Period.amount:type_name -> cosmos.base.v1beta1.Coin - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 2, // 0: cosmos.accounts.defaults.lockup.Period.length:type_name -> google.protobuf.Duration + 3, // 1: cosmos.accounts.defaults.lockup.Period.amount:type_name -> cosmos.base.v1beta1.Coin + 4, // 2: cosmos.accounts.defaults.lockup.UnbondingEntry.end_time:type_name -> google.protobuf.Timestamp + 3, // 3: cosmos.accounts.defaults.lockup.UnbondingEntry.amount: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_cosmos_accounts_defaults_lockup_lockup_proto_init() } @@ -739,6 +1459,18 @@ func file_cosmos_accounts_defaults_lockup_lockup_proto_init() { return nil } } + file_cosmos_accounts_defaults_lockup_lockup_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnbondingEntry); 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{ @@ -746,7 +1478,7 @@ func file_cosmos_accounts_defaults_lockup_lockup_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_defaults_lockup_lockup_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/runtime/module_account.go b/runtime/module_account.go new file mode 100644 index 000000000000..790011fef6ea --- /dev/null +++ b/runtime/module_account.go @@ -0,0 +1,15 @@ +package runtime + +import ( + "cosmossdk.io/core/address" + + addresstypes "github.com/cosmos/cosmos-sdk/types/address" +) + +var _ address.ModuleAccount = (*ModuleAccountService)(nil) + +type ModuleAccountService struct{} + +func (h ModuleAccountService) GetModuleAccountAddress(name string) []byte { + return addresstypes.Module(name) +} diff --git a/x/accounts/defaults/lockup/types/lockup.pb.go b/x/accounts/defaults/lockup/types/lockup.pb.go index c88e65501d34..ed7c1c5438a4 100644 --- a/x/accounts/defaults/lockup/types/lockup.pb.go +++ b/x/accounts/defaults/lockup/types/lockup.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" @@ -12,6 +13,7 @@ import ( proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -84,8 +86,73 @@ func (m *Period) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { return nil } +// UnbondingEntry defines an entry tracking the lockup account unbonding operation. +type UnbondingEntry struct { + // end time of entry + EndTime time.Time `protobuf:"bytes,1,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` + // unbond amount + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + // validator address + ValidatorAddress string `protobuf:"bytes,3,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (m *UnbondingEntry) Reset() { *m = UnbondingEntry{} } +func (m *UnbondingEntry) String() string { return proto.CompactTextString(m) } +func (*UnbondingEntry) ProtoMessage() {} +func (*UnbondingEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_79b466256e1a079c, []int{1} +} +func (m *UnbondingEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UnbondingEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnbondingEntry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UnbondingEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnbondingEntry.Merge(m, src) +} +func (m *UnbondingEntry) XXX_Size() int { + return m.Size() +} +func (m *UnbondingEntry) XXX_DiscardUnknown() { + xxx_messageInfo_UnbondingEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_UnbondingEntry proto.InternalMessageInfo + +func (m *UnbondingEntry) GetEndTime() time.Time { + if m != nil { + return m.EndTime + } + return time.Time{} +} + +func (m *UnbondingEntry) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Amount + } + return nil +} + +func (m *UnbondingEntry) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + func init() { proto.RegisterType((*Period)(nil), "cosmos.accounts.defaults.lockup.Period") + proto.RegisterType((*UnbondingEntry)(nil), "cosmos.accounts.defaults.lockup.UnbondingEntry") } func init() { @@ -93,28 +160,36 @@ func init() { } var fileDescriptor_79b466256e1a079c = []byte{ - // 326 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x31, 0x4e, 0xc3, 0x30, - 0x14, 0x86, 0x63, 0x90, 0x32, 0x04, 0x18, 0xa8, 0x18, 0x4a, 0x07, 0xa7, 0x62, 0xaa, 0x2a, 0x6a, - 0xab, 0x70, 0x01, 0x54, 0x10, 0xac, 0x88, 0x91, 0x05, 0x39, 0x8e, 0xeb, 0x5a, 0x4d, 0xf2, 0xaa, - 0xda, 0x41, 0xf4, 0x16, 0x8c, 0x88, 0x13, 0x20, 0xa6, 0x5e, 0x02, 0xa9, 0x63, 0x47, 0x26, 0x8a, - 0x9a, 0xa1, 0xd7, 0x40, 0xb1, 0x9d, 0x91, 0xc5, 0xef, 0x59, 0xfe, 0xbf, 0xf7, 0xbf, 0x5f, 0x8e, - 0xce, 0x39, 0xe8, 0x1c, 0x34, 0x65, 0x9c, 0x43, 0x59, 0x18, 0x4d, 0x53, 0x31, 0x66, 0x65, 0x66, - 0x34, 0xcd, 0x80, 0x4f, 0xcb, 0x99, 0x2f, 0x64, 0x36, 0x07, 0x03, 0xad, 0xd8, 0xa9, 0x49, 0xa3, - 0x26, 0x8d, 0x9a, 0x38, 0x59, 0xe7, 0x98, 0xe5, 0xaa, 0x00, 0x6a, 0x4f, 0xc7, 0x74, 0xb0, 0x77, - 0x48, 0x98, 0x16, 0xf4, 0x79, 0x98, 0x08, 0xc3, 0x86, 0x94, 0x83, 0x2a, 0xfc, 0xfb, 0x89, 0x04, - 0x09, 0xb6, 0xa5, 0x75, 0xd7, 0x50, 0x12, 0x40, 0x66, 0x82, 0xda, 0x5b, 0x52, 0x8e, 0x69, 0x5a, - 0xce, 0x99, 0x51, 0xe0, 0xa9, 0xb3, 0x2f, 0x14, 0x85, 0xf7, 0x62, 0xae, 0x20, 0x6d, 0x5d, 0x45, - 0x61, 0x26, 0x0a, 0x69, 0x26, 0x6d, 0xd4, 0x45, 0xbd, 0x83, 0x8b, 0x53, 0xe2, 0x58, 0xd2, 0xb0, - 0xe4, 0xc6, 0xb3, 0xa3, 0xa3, 0xd5, 0x4f, 0x1c, 0xbc, 0x6d, 0x62, 0xf4, 0xb1, 0x5b, 0xf6, 0xd1, - 0x83, 0xe7, 0x5a, 0x8b, 0x28, 0x64, 0x79, 0x1d, 0xa8, 0xbd, 0xd7, 0xdd, 0xb7, 0x13, 0x7c, 0xce, - 0x7a, 0x67, 0xe2, 0x77, 0x26, 0xd7, 0xa0, 0x8a, 0xd1, 0x6d, 0x3d, 0xe1, 0x73, 0x13, 0xf7, 0xa4, - 0x32, 0x93, 0x32, 0x21, 0x1c, 0x72, 0xea, 0x03, 0xba, 0x32, 0xd0, 0xe9, 0x94, 0x9a, 0xc5, 0x4c, - 0x68, 0x0b, 0xe8, 0xf7, 0xdd, 0xb2, 0x7f, 0x98, 0x09, 0xc9, 0xf8, 0xe2, 0xa9, 0x4e, 0xad, 0xbd, - 0xb5, 0x33, 0x1c, 0xdd, 0xad, 0xb6, 0x18, 0xad, 0xb7, 0x18, 0xfd, 0x6e, 0x31, 0x7a, 0xad, 0x70, - 0xb0, 0xae, 0x70, 0xf0, 0x5d, 0xe1, 0xe0, 0x71, 0xe0, 0xe6, 0xe9, 0x74, 0x4a, 0x14, 0xd0, 0x97, - 0xff, 0x7f, 0xc8, 0x9a, 0x25, 0xa1, 0x4d, 0x7b, 0xf9, 0x17, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xa5, - 0x33, 0xd0, 0xd1, 0x01, 0x00, 0x00, + // 449 bytes of a gzipped FileDescriptorProto +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44, 0x25, 0xad, 0x1d, 0x6d, 0x4e, + 0xc8, 0xf4, 0x5a, 0x72, 0xef, 0xfb, 0xd7, 0xd9, 0x5d, 0x1c, 0xe4, 0x6d, 0xaf, 0x79, 0xec, 0x25, + 0xaf, 0x5c, 0xa5, 0x8d, 0x3a, 0xb8, 0xbd, 0xbc, 0xf4, 0x9e, 0x3c, 0x3f, 0x5d, 0x45, 0xe4, 0x6c, + 0x15, 0x91, 0x5f, 0xab, 0x88, 0x1c, 0xaf, 0xa3, 0xc1, 0xd9, 0x3a, 0x1a, 0xfc, 0x58, 0x47, 0x83, + 0x77, 0x33, 0x1f, 0x65, 0xc5, 0x9c, 0x6a, 0x60, 0xef, 0xff, 0xfd, 0x05, 0x74, 0xc3, 0x67, 0xc3, + 0x6e, 0x7f, 0x0f, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x40, 0x04, 0x49, 0xb2, 0x31, 0x03, 0x00, + 0x00, } func (m *Period) Marshal() (dAtA []byte, err error) { @@ -162,6 +237,58 @@ func (m *Period) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *UnbondingEntry) 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 *UnbondingEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnbondingEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintLockup(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLockup(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintLockup(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintLockup(dAtA []byte, offset int, v uint64) int { offset -= sovLockup(v) base := offset @@ -190,6 +317,27 @@ func (m *Period) Size() (n int) { return n } +func (m *UnbondingEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime) + n += 1 + l + sovLockup(uint64(l)) + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovLockup(uint64(l)) + } + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovLockup(uint64(l)) + } + return n +} + func sovLockup(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -313,6 +461,155 @@ func (m *Period) Unmarshal(dAtA []byte) error { } return nil } +func (m *UnbondingEntry) 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 ErrIntOverflowLockup + } + 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: UnbondingEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnbondingEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLockup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLockup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLockup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLockup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLockup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLockup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLockup + } + 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 ErrInvalidLengthLockup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLockup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLockup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLockup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipLockup(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto index 86d9efb8efae..00b9f44abd03 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto @@ -4,7 +4,9 @@ package cosmos.accounts.defaults.lockup; import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "cosmossdk.io/x/accounts/defaults/lockup/types"; @@ -20,3 +22,19 @@ message Period { (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; } + +// UnbondingEntry defines an entry tracking the lockup account unbonding operation. +message UnbondingEntry { + // end time of entry + google.protobuf.Timestamp end_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + // unbond amount + repeated cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // validator address + string validator_address = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; +} From 83d300d3143b3745552d4270fa489e8e01cc7f0c Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 14 Oct 2024 18:27:19 +0700 Subject: [PATCH 02/24] add track ubd entries --- .../accounts/defaults/lockup/lockup.pulsar.go | 178 ++++++------------ x/accounts/defaults/lockup/lockup.go | 132 ++++++++----- x/accounts/defaults/lockup/types/lockup.pb.go | 107 +++++------ .../accounts/defaults/lockup/lockup.proto | 7 +- 4 files changed, 195 insertions(+), 229 deletions(-) diff --git a/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go b/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go index 5004dc943b40..267996719c6f 100644 --- a/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go @@ -591,57 +591,6 @@ func (x *fastReflection_Period) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_UnbondingEntry_2_list)(nil) - -type _UnbondingEntry_2_list struct { - list *[]*v1beta1.Coin -} - -func (x *_UnbondingEntry_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_UnbondingEntry_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_UnbondingEntry_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_UnbondingEntry_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_UnbondingEntry_2_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_UnbondingEntry_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_UnbondingEntry_2_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_UnbondingEntry_2_list) IsValid() bool { - return x.list != nil -} - var ( md_UnbondingEntry protoreflect.MessageDescriptor fd_UnbondingEntry_end_time protoreflect.FieldDescriptor @@ -728,8 +677,8 @@ func (x *fastReflection_UnbondingEntry) Range(f func(protoreflect.FieldDescripto return } } - if len(x.Amount) != 0 { - value := protoreflect.ValueOfList(&_UnbondingEntry_2_list{list: &x.Amount}) + if x.Amount != nil { + value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) if !f(fd_UnbondingEntry_amount, value) { return } @@ -758,7 +707,7 @@ func (x *fastReflection_UnbondingEntry) Has(fd protoreflect.FieldDescriptor) boo case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": return x.EndTime != nil case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": - return len(x.Amount) != 0 + return x.Amount != nil case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": return x.ValidatorAddress != "" default: @@ -803,11 +752,8 @@ func (x *fastReflection_UnbondingEntry) Get(descriptor protoreflect.FieldDescrip value := x.EndTime return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": - if len(x.Amount) == 0 { - return protoreflect.ValueOfList(&_UnbondingEntry_2_list{}) - } - listValue := &_UnbondingEntry_2_list{list: &x.Amount} - return protoreflect.ValueOfList(listValue) + value := x.Amount + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": value := x.ValidatorAddress return protoreflect.ValueOfString(value) @@ -834,9 +780,7 @@ func (x *fastReflection_UnbondingEntry) Set(fd protoreflect.FieldDescriptor, val case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": x.EndTime = value.Message().Interface().(*timestamppb.Timestamp) case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": - lv := value.List() - clv := lv.(*_UnbondingEntry_2_list) - x.Amount = *clv.list + x.Amount = value.Message().Interface().(*v1beta1.Coin) case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": x.ValidatorAddress = value.Interface().(string) default: @@ -866,10 +810,9 @@ func (x *fastReflection_UnbondingEntry) Mutable(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": if x.Amount == nil { - x.Amount = []*v1beta1.Coin{} + x.Amount = new(v1beta1.Coin) } - value := &_UnbondingEntry_2_list{list: &x.Amount} - return protoreflect.ValueOfList(value) + return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": panic(fmt.Errorf("field validator_address of message cosmos.accounts.defaults.lockup.UnbondingEntry is not mutable")) default: @@ -889,8 +832,8 @@ func (x *fastReflection_UnbondingEntry) NewField(fd protoreflect.FieldDescriptor m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_UnbondingEntry_2_list{list: &list}) + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": return protoreflect.ValueOfString("") default: @@ -966,11 +909,9 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { l = options.Size(x.EndTime) n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.Amount) > 0 { - for _, e := range x.Amount { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } + if x.Amount != nil { + l = options.Size(x.Amount) + n += 1 + l + runtime.Sov(uint64(l)) } l = len(x.ValidatorAddress) if l > 0 { @@ -1012,21 +953,19 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x1a } - if len(x.Amount) > 0 { - for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Amount[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 + if x.Amount != nil { + encoded, err := options.Marshal(x.Amount) + 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.EndTime != nil { encoded, err := options.Marshal(x.EndTime) @@ -1156,8 +1095,10 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Amount = append(x.Amount, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); err != nil { + if x.Amount == nil { + x.Amount = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -1295,7 +1236,7 @@ type UnbondingEntry struct { // end time of entry EndTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // unbond amount - Amount []*v1beta1.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount,omitempty"` + Amount *v1beta1.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` // validator address ValidatorAddress string `protobuf:"bytes,3,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` } @@ -1327,7 +1268,7 @@ func (x *UnbondingEntry) GetEndTime() *timestamppb.Timestamp { return nil } -func (x *UnbondingEntry) GetAmount() []*v1beta1.Coin { +func (x *UnbondingEntry) GetAmount() *v1beta1.Coin { if x != nil { return x.Amount } @@ -1371,42 +1312,39 @@ var file_cosmos_accounts_defaults_lockup_lockup_proto_rawDesc = []byte{ 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa1, 0x02, 0x0a, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe4, 0x01, 0x0a, 0x0e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x44, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x65, 0x6e, - 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 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, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, - 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, - 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x42, 0x84, 0x02, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x42, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x44, 0x4c, - 0xaa, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, - 0x75, 0x70, 0xca, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, - 0x63, 0x6b, 0x75, 0x70, 0xe2, 0x02, 0x2b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, - 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, - 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, + 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x42, 0x84, 0x02, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x42, 0x0b, 0x4c, 0x6f, 0x63, + 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xa2, 0x02, 0x04, 0x43, + 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, + 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xca, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, + 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xe2, 0x02, 0x2b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 3ac17fea6133..663845765e8f 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -22,20 +22,23 @@ import ( distrtypes "cosmossdk.io/x/distribution/types" stakingtypes "cosmossdk.io/x/staking/types" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) var ( - OriginalLockingPrefix = collections.NewPrefix(0) - DelegatedFreePrefix = collections.NewPrefix(1) - DelegatedLockingPrefix = collections.NewPrefix(2) - EndTimePrefix = collections.NewPrefix(3) - StartTimePrefix = collections.NewPrefix(4) - LockingPeriodsPrefix = collections.NewPrefix(5) - OwnerPrefix = collections.NewPrefix(6) - WithdrawedCoinsPrefix = collections.NewPrefix(7) + OriginalLockingPrefix = collections.NewPrefix(0) + DelegatedFreePrefix = collections.NewPrefix(1) + DelegatedLockingPrefix = collections.NewPrefix(2) + EndTimePrefix = collections.NewPrefix(3) + StartTimePrefix = collections.NewPrefix(4) + LockingPeriodsPrefix = collections.NewPrefix(5) + OwnerPrefix = collections.NewPrefix(6) + WithdrawedCoinsPrefix = collections.NewPrefix(7) + UnbondEntriesPrefix = collections.NewPrefix(8) + UnbondingSequencePrefix = collections.NewPrefix(9) ) var ( @@ -50,14 +53,16 @@ type getLockedCoinsFunc = func(ctx context.Context, time time.Time, denoms ...st // newBaseLockup creates a new BaseLockup object. func newBaseLockup(d accountstd.Dependencies) *BaseLockup { BaseLockup := &BaseLockup{ - Owner: collections.NewItem(d.SchemaBuilder, OwnerPrefix, "owner", collections.BytesValue), - OriginalLocking: collections.NewMap(d.SchemaBuilder, OriginalLockingPrefix, "original_locking", collections.StringKey, sdk.IntValue), - DelegatedFree: collections.NewMap(d.SchemaBuilder, DelegatedFreePrefix, "delegated_free", collections.StringKey, sdk.IntValue), - DelegatedLocking: collections.NewMap(d.SchemaBuilder, DelegatedLockingPrefix, "delegated_locking", collections.StringKey, sdk.IntValue), - WithdrawedCoins: collections.NewMap(d.SchemaBuilder, WithdrawedCoinsPrefix, "withdrawed_coins", collections.StringKey, sdk.IntValue), - addressCodec: d.AddressCodec, - headerService: d.Environment.HeaderService, - EndTime: collections.NewItem(d.SchemaBuilder, EndTimePrefix, "end_time", collcodec.KeyToValueCodec[time.Time](sdk.TimeKey)), + Owner: collections.NewItem(d.SchemaBuilder, OwnerPrefix, "owner", collections.BytesValue), + OriginalLocking: collections.NewMap(d.SchemaBuilder, OriginalLockingPrefix, "original_locking", collections.StringKey, sdk.IntValue), + DelegatedFree: collections.NewMap(d.SchemaBuilder, DelegatedFreePrefix, "delegated_free", collections.StringKey, sdk.IntValue), + DelegatedLocking: collections.NewMap(d.SchemaBuilder, DelegatedLockingPrefix, "delegated_locking", collections.StringKey, sdk.IntValue), + WithdrawedCoins: collections.NewMap(d.SchemaBuilder, WithdrawedCoinsPrefix, "withdrawed_coins", collections.StringKey, sdk.IntValue), + UnbondEntries: collections.NewMap(d.SchemaBuilder, UnbondEntriesPrefix, "unbond_entries", collections.Uint64Key, codec.CollValue[lockuptypes.UnbondingEntry](d.LegacyStateCodec)), + UnbondingSequence: collections.NewSequence(d.SchemaBuilder, UnbondingSequencePrefix, "unbonding_sequence"), + addressCodec: d.AddressCodec, + headerService: d.Environment.HeaderService, + EndTime: collections.NewItem(d.SchemaBuilder, EndTimePrefix, "end_time", collcodec.KeyToValueCodec[time.Time](sdk.TimeKey)), } return BaseLockup @@ -65,13 +70,15 @@ func newBaseLockup(d accountstd.Dependencies) *BaseLockup { type BaseLockup struct { // Owner is the address of the account owner. - Owner collections.Item[[]byte] - OriginalLocking collections.Map[string, math.Int] - DelegatedFree collections.Map[string, math.Int] - DelegatedLocking collections.Map[string, math.Int] - WithdrawedCoins collections.Map[string, math.Int] - addressCodec address.Codec - headerService header.Service + Owner collections.Item[[]byte] + OriginalLocking collections.Map[string, math.Int] + DelegatedFree collections.Map[string, math.Int] + DelegatedLocking collections.Map[string, math.Int] + WithdrawedCoins collections.Map[string, math.Int] + UnbondingSequence collections.Sequence + UnbondEntries collections.Map[uint64, lockuptypes.UnbondingEntry] + addressCodec address.Codec + headerService header.Service // lockup end time. EndTime collections.Item[time.Time] } @@ -104,23 +111,6 @@ func (bva *BaseLockup) Init(ctx context.Context, msg *lockuptypes.MsgInitLockupA } } - bondDenom, err := getStakingDenom(ctx) - if err != nil { - return nil, err - } - - // Set initial value for all locked token - err = bva.DelegatedFree.Set(ctx, bondDenom, math.ZeroInt()) - if err != nil { - return nil, err - } - - // Set initial value for all locked token - err = bva.DelegatedLocking.Set(ctx, bondDenom, math.ZeroInt()) - if err != nil { - return nil, err - } - err = bva.EndTime.Set(ctx, msg.EndTime) if err != nil { return nil, err @@ -193,11 +183,6 @@ func (bva *BaseLockup) Undelegate( return nil, err } - err = bva.TrackUndelegation(ctx, sdk.Coins{msg.Amount}) - if err != nil { - return nil, err - } - msgUndelegate := &stakingtypes.MsgUndelegate{ DelegatorAddress: delegatorAddress, ValidatorAddress: msg.ValidatorAddress, @@ -208,9 +193,53 @@ func (bva *BaseLockup) Undelegate( return nil, err } + msgUndelegateResp, err := accountstd.UnpackAny[stakingtypes.MsgUndelegateResponse](resp[0]) + if err != nil { + return nil, err + } + + ubdSeq, err := bva.UnbondingSequence.Next(ctx) + if err != nil { + return nil, err + } + + err = bva.UnbondEntries.Set(ctx, ubdSeq, lockuptypes.UnbondingEntry{ + EndTime: msgUndelegateResp.CompletionTime, + Amount: msgUndelegateResp.Amount, + ValidatorAddress: msg.ValidatorAddress, + }) + if err != nil { + return nil, err + } + return &lockuptypes.MsgExecuteMessagesResponse{Responses: resp}, nil } +// loops through all unbonding entries and tracks all matured entries +func (bva *BaseLockup) TrackUnbondingEntries(ctx context.Context) error { + hs := bva.headerService.HeaderInfo(ctx) + err := bva.UnbondEntries.Walk(ctx, nil, func(key uint64, value lockuptypes.UnbondingEntry) (stop bool, err error) { + if value.EndTime.Before(hs.Time) { + return false, nil + } + + err = bva.TrackUndelegation(ctx, sdk.NewCoins(value.Amount)) + if err != nil { + return true, err + } + + // remove entry + err = bva.UnbondEntries.Remove(ctx, key) + if err != nil { + return true, err + } + + return false, nil + }) + + return err +} + func (bva *BaseLockup) WithdrawReward( ctx context.Context, msg *lockuptypes.MsgWithdrawReward, ) ( @@ -416,6 +445,19 @@ func getStakingDenom(ctx context.Context) (string, error) { return resp.Params.BondDenom, nil } +func getUnbonding(ctx context.Context, delAddr, valAddr string) (*stakingtypes.UnbondingDelegation, error) { + // Query account balance for the sent denom + resp, err := accountstd.QueryModule[*stakingtypes.QueryUnbondingDelegationResponse](ctx, &stakingtypes.QueryUnbondingDelegationRequest{ + DelegatorAddr: delAddr, + ValidatorAddr: valAddr, + }) + if err != nil { + return nil, err + } + + return &resp.Unbond, nil +} + // TrackDelegation tracks a delegation amount for any given lockup account type // given the amount of coins currently being locked and the current account balance // of the delegation denominations. diff --git a/x/accounts/defaults/lockup/types/lockup.pb.go b/x/accounts/defaults/lockup/types/lockup.pb.go index ed7c1c5438a4..01f9c342e159 100644 --- a/x/accounts/defaults/lockup/types/lockup.pb.go +++ b/x/accounts/defaults/lockup/types/lockup.pb.go @@ -91,7 +91,7 @@ type UnbondingEntry struct { // end time of entry EndTime time.Time `protobuf:"bytes,1,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` // unbond amount - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` // validator address ValidatorAddress string `protobuf:"bytes,3,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` } @@ -136,11 +136,11 @@ func (m *UnbondingEntry) GetEndTime() time.Time { return time.Time{} } -func (m *UnbondingEntry) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *UnbondingEntry) GetAmount() types.Coin { if m != nil { return m.Amount } - return nil + return types.Coin{} } func (m *UnbondingEntry) GetValidatorAddress() string { @@ -160,36 +160,36 @@ func init() { } var fileDescriptor_79b466256e1a079c = []byte{ - // 449 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x93, 0xbf, 0x6e, 0xd4, 0x40, - 0x10, 0xc6, 0x6f, 0x13, 0x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 0xec, 0x25, - 0xaf, 0x5c, 0xa5, 0x8d, 0x3a, 0xb8, 0xbd, 0xbc, 0xf4, 0x9e, 0x3c, 0x3f, 0x5d, 0x45, 0xe4, 0x6c, - 0x15, 0x91, 0x5f, 0xab, 0x88, 0x1c, 0xaf, 0xa3, 0xc1, 0xd9, 0x3a, 0x1a, 0xfc, 0x58, 0x47, 0x83, - 0x77, 0x33, 0x1f, 0x65, 0xc5, 0x9c, 0x6a, 0x60, 0xef, 0xff, 0xfd, 0x05, 0x74, 0xc3, 0x67, 0xc3, - 0x6e, 0x7f, 0x0f, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x40, 0x04, 0x49, 0xb2, 0x31, 0x03, 0x00, - 0x00, + // 458 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcd, 0x6e, 0x13, 0x31, + 0x14, 0x85, 0x63, 0x2a, 0x05, 0x3a, 0xfc, 0x88, 0x8e, 0x58, 0xa4, 0x91, 0x98, 0x09, 0x5d, 0x45, + 0x15, 0xb1, 0x55, 0xd8, 0xb2, 0x80, 0x50, 0x60, 0x87, 0x50, 0xf9, 0x59, 0xb0, 0x89, 0x3c, 0x63, + 0xd7, 0xb5, 0x32, 0xe3, 0x1b, 0x8d, 0x3d, 0x11, 0x79, 0x8b, 0x2e, 0x11, 0x4f, 0x80, 0x58, 0x75, + 0xc1, 0x2b, 0x20, 0x75, 0x59, 0xb1, 0x62, 0x45, 0x51, 0x82, 0xd4, 0xd7, 0x40, 0x1e, 0xdf, 0x41, + 0x50, 0x44, 0x37, 0x63, 0x8f, 0xef, 0x39, 0xe7, 0xfa, 0xbb, 0x72, 0x74, 0x37, 0x07, 0x5b, 0x82, + 0x65, 0x3c, 0xcf, 0xa1, 0x36, 0xce, 0x32, 0x21, 0xf7, 0x79, 0x5d, 0x38, 0xcb, 0x0a, 0xc8, 0xa7, + 0xf5, 0x0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0x21, 0x15, 0xcf, 0x17, 0x13, 0x3f, 0x31, 0x8b, + 0xad, 0x43, 0xc3, 0xad, 0x9f, 0x24, 0xba, 0xf1, 0xda, 0x64, 0x60, 0x84, 0x36, 0xea, 0x89, 0x71, + 0xd5, 0x22, 0xde, 0x8d, 0xae, 0x48, 0x23, 0x26, 0x9e, 0x18, 0x89, 0xfa, 0xff, 0x10, 0xbd, 0x6a, + 0xc7, 0x11, 0x90, 0x0e, 0x7f, 0x23, 0x5d, 0x96, 0x46, 0xf8, 0x62, 0xfc, 0xe0, 0x0f, 0x26, 0x72, + 0x31, 0xd3, 0xba, 0x8f, 0xf8, 0xeb, 0x5a, 0xf1, 0xf3, 0x68, 0x63, 0xce, 0x0b, 0x2d, 0xb8, 0x83, + 0x6a, 0xc2, 0x85, 0xa8, 0xa4, 0xb5, 0xbd, 0xb5, 0x01, 0x19, 0xae, 0x8f, 0xef, 0x7c, 0xfd, 0x3c, + 0xba, 0x8d, 0x59, 0x6f, 0x5a, 0xcd, 0xa3, 0x20, 0x79, 0xe9, 0x2a, 0x6d, 0xd4, 0xde, 0xcd, 0xf9, + 0xb9, 0xf3, 0xf1, 0xb3, 0xe3, 0x65, 0x42, 0x4e, 0x96, 0x09, 0xf9, 0xb1, 0x4c, 0xc8, 0xe1, 0x2a, + 0xe9, 0x9c, 0xac, 0x92, 0xce, 0xb7, 0x55, 0xd2, 0x79, 0x3b, 0x0a, 0x51, 0x56, 0x4c, 0xa9, 0x06, + 0xf6, 0xee, 0xff, 0x8f, 0xb8, 0x99, 0x69, 0xd6, 0x6d, 0x46, 0x70, 0xff, 0x57, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x67, 0x3b, 0x6e, 0x8b, 0xf4, 0x02, 0x00, 0x00, } func (m *Period) Marshal() (dAtA []byte, err error) { @@ -264,26 +264,22 @@ func (m *UnbondingEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLockup(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintLockup(dAtA, i, uint64(size)) } - n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) - if err2 != nil { - return 0, err2 + i-- + dAtA[i] = 0x12 + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) + if err3 != nil { + return 0, err3 } - i -= n2 - i = encodeVarintLockup(dAtA, i, uint64(n2)) + i -= n3 + i = encodeVarintLockup(dAtA, i, uint64(n3)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -325,12 +321,8 @@ func (m *UnbondingEntry) Size() (n int) { _ = l l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime) n += 1 + l + sovLockup(uint64(l)) - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovLockup(uint64(l)) - } - } + l = m.Amount.Size() + n += 1 + l + sovLockup(uint64(l)) l = len(m.ValidatorAddress) if l > 0 { n += 1 + l + sovLockup(uint64(l)) @@ -552,8 +544,7 @@ func (m *UnbondingEntry) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto index 00b9f44abd03..459a8e857075 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto @@ -29,12 +29,7 @@ message UnbondingEntry { google.protobuf.Timestamp end_time = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // unbond amount - repeated cosmos.base.v1beta1.Coin amount = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (amino.encoding) = "legacy_coins", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // validator address string validator_address = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } From a63f90982c0cf5bcb6ebbf78c4e51e79082bf2ef Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Tue, 15 Oct 2024 16:02:01 +0700 Subject: [PATCH 03/24] add track undelegations before check tokens sendable --- x/accounts/defaults/lockup/lockup.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 663845765e8f..5f16121b7eff 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -293,6 +293,12 @@ func (bva *BaseLockup) SendCoins( return nil, err } + // tracking all matured unbonding entries before check sendable tokens + err = bva.TrackUnbondingEntries(ctx) + if err != nil { + return nil, err + } + err = bva.checkTokensSendable(ctx, fromAddress, msg.Amount, lockedCoins) if err != nil { return nil, err @@ -341,6 +347,12 @@ func (bva *BaseLockup) WithdrawUnlockedCoins( return nil, err } + // tracking all matured unbonding entries + err = bva.TrackUnbondingEntries(ctx) + if err != nil { + return nil, err + } + amount := sdk.Coins{} for _, denom := range uniqueDenoms { balance, err := bva.getBalance(ctx, fromAddress, denom) @@ -445,19 +457,6 @@ func getStakingDenom(ctx context.Context) (string, error) { return resp.Params.BondDenom, nil } -func getUnbonding(ctx context.Context, delAddr, valAddr string) (*stakingtypes.UnbondingDelegation, error) { - // Query account balance for the sent denom - resp, err := accountstd.QueryModule[*stakingtypes.QueryUnbondingDelegationResponse](ctx, &stakingtypes.QueryUnbondingDelegationRequest{ - DelegatorAddr: delAddr, - ValidatorAddr: valAddr, - }) - if err != nil { - return nil, err - } - - return &resp.Unbond, nil -} - // TrackDelegation tracks a delegation amount for any given lockup account type // given the amount of coins currently being locked and the current account balance // of the delegation denominations. From a37205e5da9fd02ec02af852fcbb82e2d81206f7 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Tue, 15 Oct 2024 16:30:01 +0700 Subject: [PATCH 04/24] minor --- runtime/module_account.go | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 runtime/module_account.go diff --git a/runtime/module_account.go b/runtime/module_account.go deleted file mode 100644 index 790011fef6ea..000000000000 --- a/runtime/module_account.go +++ /dev/null @@ -1,15 +0,0 @@ -package runtime - -import ( - "cosmossdk.io/core/address" - - addresstypes "github.com/cosmos/cosmos-sdk/types/address" -) - -var _ address.ModuleAccount = (*ModuleAccountService)(nil) - -type ModuleAccountService struct{} - -func (h ModuleAccountService) GetModuleAccountAddress(name string) []byte { - return addresstypes.Module(name) -} From e1e0ce2a388016945fcf8dc7b0d60e18b3aec11d Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Tue, 15 Oct 2024 23:32:17 +0700 Subject: [PATCH 05/24] fix tests --- x/accounts/defaults/lockup/lockup.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 5f16121b7eff..054ece28490a 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -111,6 +111,23 @@ func (bva *BaseLockup) Init(ctx context.Context, msg *lockuptypes.MsgInitLockupA } } + bondDenom, err := getStakingDenom(ctx) + if err != nil { + return nil, err + } + + // Set initial value for all locked token + err = bva.DelegatedFree.Set(ctx, bondDenom, math.ZeroInt()) + if err != nil { + return nil, err + } + + // Set initial value for all locked token + err = bva.DelegatedLocking.Set(ctx, bondDenom, math.ZeroInt()) + if err != nil { + return nil, err + } + err = bva.EndTime.Set(ctx, msg.EndTime) if err != nil { return nil, err From b1135b6625782d702b8e6774d43d775a719b03ab Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Wed, 16 Oct 2024 03:12:34 +0700 Subject: [PATCH 06/24] fix tests --- .../lockup/continuous_locking_account_test.go | 44 +++++-------------- .../lockup/delayed_locking_account_test.go | 40 +++++------------ .../lockup/periodic_locking_account_test.go | 44 +++++-------------- .../lockup/permanent_locking_account_test.go | 17 +++++++ x/accounts/defaults/lockup/utils_test.go | 4 +- 5 files changed, 53 insertions(+), 96 deletions(-) diff --git a/x/accounts/defaults/lockup/continuous_locking_account_test.go b/x/accounts/defaults/lockup/continuous_locking_account_test.go index cbccbb224ec5..007a8c81cbba 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account_test.go +++ b/x/accounts/defaults/lockup/continuous_locking_account_test.go @@ -102,48 +102,26 @@ func TestContinousAccountUndelegate(t *testing.T) { }) require.NoError(t, err) - delLocking, err = acc.DelegatedLocking.Get(ctx, "test") + ubdSeq, err := acc.UnbondingSequence.Peek(sdkCtx) require.NoError(t, err) - require.True(t, delLocking.Equal(math.ZeroInt())) - - startTime, err := acc.StartTime.Get(sdkCtx) + // sequence should be the previous one + ubdEntry, err := acc.UnbondEntries.Get(sdkCtx, ubdSeq-1) require.NoError(t, err) + require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) + require.True(t, ubdEntry.ValidatorAddress == "val_address") - // Update context time to unlocked half of the original locking amount - sdkCtx = sdkCtx.WithHeaderInfo(header.Info{ - Time: startTime.Add(time.Minute * 1), - }) - - _, err = acc.Delegate(sdkCtx, &lockuptypes.MsgDelegate{ - Sender: "owner", - ValidatorAddress: "val_address", - Amount: sdk.NewCoin("test", math.NewInt(6)), - }) + // manually update entry end time since msgUndelegateResponse are mocks + // so no actual end time can be set + ubdEntry.EndTime = time.Now() + err = acc.UnbondEntries.Set(sdkCtx, ubdSeq-1, ubdEntry) require.NoError(t, err) - delLocking, err = acc.DelegatedLocking.Get(ctx, "test") - require.NoError(t, err) - require.True(t, delLocking.Equal(math.NewInt(5))) - - delFree, err := acc.DelegatedFree.Get(ctx, "test") - require.NoError(t, err) - require.True(t, delFree.Equal(math.NewInt(1))) - - // Undelegate - _, err = acc.Undelegate(sdkCtx, &lockuptypes.MsgUndelegate{ - Sender: "owner", - ValidatorAddress: "val_address", - Amount: sdk.NewCoin("test", math.NewInt(4)), - }) + err = acc.TrackUnbondingEntries(sdkCtx) require.NoError(t, err) delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) - require.True(t, delLocking.Equal(math.NewInt(2))) - - delFree, err = acc.DelegatedFree.Get(ctx, "test") - require.NoError(t, err) - require.True(t, delFree.Equal(math.ZeroInt())) + require.True(t, delLocking.Equal(math.ZeroInt())) } func TestContinousAccountSendCoins(t *testing.T) { diff --git a/x/accounts/defaults/lockup/delayed_locking_account_test.go b/x/accounts/defaults/lockup/delayed_locking_account_test.go index 9a5f2cc4ae2f..0750b058d388 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account_test.go +++ b/x/accounts/defaults/lockup/delayed_locking_account_test.go @@ -101,44 +101,26 @@ func TestDelayedAccountUndelegate(t *testing.T) { }) require.NoError(t, err) - delLocking, err = acc.DelegatedLocking.Get(ctx, "test") + ubdSeq, err := acc.UnbondingSequence.Peek(sdkCtx) require.NoError(t, err) - require.True(t, delLocking.Equal(math.ZeroInt())) - - endTime, err := acc.EndTime.Get(sdkCtx) + // sequence should be the previous one + ubdEntry, err := acc.UnbondEntries.Get(sdkCtx, ubdSeq-1) require.NoError(t, err) + require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) + require.True(t, ubdEntry.ValidatorAddress == "val_address") - // Update context time to unlocked all the original locking amount - sdkCtx = sdkCtx.WithHeaderInfo(header.Info{ - Time: endTime.Add(time.Second), - }) + // manually update entry end time since msgUndelegateResponse are mocks + // so no actual end time can be set + ubdEntry.EndTime = time.Now() + err = acc.UnbondEntries.Set(sdkCtx, ubdSeq-1, ubdEntry) + require.NoError(t, err) - _, err = acc.Delegate(sdkCtx, &lockuptypes.MsgDelegate{ - Sender: "owner", - ValidatorAddress: "val_address", - Amount: sdk.NewCoin("test", math.NewInt(6)), - }) + err = acc.TrackUnbondingEntries(sdkCtx) require.NoError(t, err) delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) - - delFree, err := acc.DelegatedFree.Get(ctx, "test") - require.NoError(t, err) - require.True(t, delFree.Equal(math.NewInt(6))) - - // Undelegate - _, err = acc.Undelegate(sdkCtx, &lockuptypes.MsgUndelegate{ - Sender: "owner", - ValidatorAddress: "val_address", - Amount: sdk.NewCoin("test", math.NewInt(4)), - }) - require.NoError(t, err) - - delFree, err = acc.DelegatedFree.Get(ctx, "test") - require.NoError(t, err) - require.True(t, delFree.Equal(math.NewInt(2))) } func TestDelayedAccountSendCoins(t *testing.T) { diff --git a/x/accounts/defaults/lockup/periodic_locking_account_test.go b/x/accounts/defaults/lockup/periodic_locking_account_test.go index 8ff7ee001461..7cd155fbb585 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account_test.go +++ b/x/accounts/defaults/lockup/periodic_locking_account_test.go @@ -135,48 +135,26 @@ func TestPeriodicAccountUndelegate(t *testing.T) { }) require.NoError(t, err) - delLocking, err = acc.DelegatedLocking.Get(ctx, "test") + ubdSeq, err := acc.UnbondingSequence.Peek(sdkCtx) require.NoError(t, err) - require.True(t, delLocking.Equal(math.ZeroInt())) - - startTime, err := acc.StartTime.Get(sdkCtx) + // sequence should be the previous one + ubdEntry, err := acc.UnbondEntries.Get(sdkCtx, ubdSeq-1) require.NoError(t, err) + require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) + require.True(t, ubdEntry.ValidatorAddress == "val_address") - // Update context time to unlocked first period token - sdkCtx = sdkCtx.WithHeaderInfo(header.Info{ - Time: startTime.Add(time.Minute * 1), - }) - - _, err = acc.Delegate(sdkCtx, &lockuptypes.MsgDelegate{ - Sender: "owner", - ValidatorAddress: "val_address", - Amount: sdk.NewCoin("test", math.NewInt(6)), - }) + // manually update entry end time since msgUndelegateResponse are mocks + // so no actual end time can be set + ubdEntry.EndTime = time.Now() + err = acc.UnbondEntries.Set(sdkCtx, ubdSeq-1, ubdEntry) require.NoError(t, err) - delLocking, err = acc.DelegatedLocking.Get(ctx, "test") - require.NoError(t, err) - require.True(t, delLocking.Equal(math.NewInt(5))) - - delFree, err := acc.DelegatedFree.Get(ctx, "test") - require.NoError(t, err) - require.True(t, delFree.Equal(math.NewInt(1))) - - // Undelegate - _, err = acc.Undelegate(sdkCtx, &lockuptypes.MsgUndelegate{ - Sender: "owner", - ValidatorAddress: "val_address", - Amount: sdk.NewCoin("test", math.NewInt(4)), - }) + err = acc.TrackUnbondingEntries(sdkCtx) require.NoError(t, err) delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) - require.True(t, delLocking.Equal(math.NewInt(2))) - - delFree, err = acc.DelegatedFree.Get(ctx, "test") - require.NoError(t, err) - require.True(t, delFree.Equal(math.ZeroInt())) + require.True(t, delLocking.Equal(math.ZeroInt())) } func TestPeriodicAccountSendCoins(t *testing.T) { diff --git a/x/accounts/defaults/lockup/permanent_locking_account_test.go b/x/accounts/defaults/lockup/permanent_locking_account_test.go index 057bc95689c0..b065f11d293e 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account_test.go +++ b/x/accounts/defaults/lockup/permanent_locking_account_test.go @@ -77,6 +77,23 @@ func TestPermanentAccountUndelegate(t *testing.T) { }) require.NoError(t, err) + ubdSeq, err := acc.UnbondingSequence.Peek(sdkCtx) + require.NoError(t, err) + // sequence should be the previous one + ubdEntry, err := acc.UnbondEntries.Get(sdkCtx, ubdSeq-1) + require.NoError(t, err) + require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) + require.True(t, ubdEntry.ValidatorAddress == "val_address") + + // manually update entry end time since msgUndelegateResponse are mocks + // so no actual end time can be set + ubdEntry.EndTime = time.Now() + err = acc.UnbondEntries.Set(sdkCtx, ubdSeq-1, ubdEntry) + require.NoError(t, err) + + err = acc.TrackUnbondingEntries(sdkCtx) + require.NoError(t, err) + delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) diff --git a/x/accounts/defaults/lockup/utils_test.go b/x/accounts/defaults/lockup/utils_test.go index 6d5ce14af7ed..e1e66a0eb39b 100644 --- a/x/accounts/defaults/lockup/utils_test.go +++ b/x/accounts/defaults/lockup/utils_test.go @@ -77,7 +77,9 @@ func newMockContext(t *testing.T) (context.Context, store.KVStoreService) { case "/cosmos.staking.v1beta1.MsgDelegate": return &stakingtypes.MsgDelegateResponse{}, nil case "/cosmos.staking.v1beta1.MsgUndelegate": - return &stakingtypes.MsgUndelegate{}, nil + return &stakingtypes.MsgUndelegateResponse{ + Amount: sdk.NewCoin("test", math.NewInt(1)), + }, nil case "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": return &distrtypes.MsgWithdrawDelegatorRewardResponse{}, nil case "/cosmos.bank.v1beta1.MsgSend": From 700ea01e6206f3257f2c534abfdb89082e377256 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Wed, 16 Oct 2024 23:59:30 +0700 Subject: [PATCH 07/24] manually track undelegation --- .../accounts/defaults/lockup/lockup.pulsar.go | 82 +- .../accounts/defaults/lockup/query.pulsar.go | 1058 ++++++++++++++++- .../accounts/defaults/lockup/tx.pulsar.go | 686 +++++++++-- .../lockup/continous_lockup_test_suite.go | 24 +- .../lockup/delayed_lockup_test_suite.go | 22 + .../lockup/periodic_lockup_test_suite.go | 24 +- .../lockup/permanent_lockup_test_suite.go | 29 +- tests/e2e/accounts/lockup/utils.go | 23 + .../lockup/continuous_locking_account.go | 1 + .../lockup/continuous_locking_account_test.go | 11 +- .../lockup/delayed_locking_account.go | 1 + .../lockup/delayed_locking_account_test.go | 11 +- x/accounts/defaults/lockup/lockup.go | 78 +- .../lockup/periodic_locking_account.go | 1 + .../lockup/periodic_locking_account_test.go | 11 +- .../lockup/permanent_locking_account.go | 2 + .../lockup/permanent_locking_account_test.go | 11 +- x/accounts/defaults/lockup/types/lockup.pb.go | 113 +- x/accounts/defaults/lockup/types/query.pb.go | 376 +++++- x/accounts/defaults/lockup/types/tx.pb.go | 304 ++++- .../accounts/defaults/lockup/lockup.proto | 8 +- .../accounts/defaults/lockup/query.proto | 9 + .../cosmos/accounts/defaults/lockup/tx.proto | 11 + 23 files changed, 2552 insertions(+), 344 deletions(-) diff --git a/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go b/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go index 267996719c6f..f2e7a24d1ca1 100644 --- a/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/lockup.pulsar.go @@ -593,6 +593,7 @@ func (x *fastReflection_Period) ProtoMethods() *protoiface.Methods { var ( md_UnbondingEntry protoreflect.MessageDescriptor + fd_UnbondingEntry_id protoreflect.FieldDescriptor fd_UnbondingEntry_end_time protoreflect.FieldDescriptor fd_UnbondingEntry_amount protoreflect.FieldDescriptor fd_UnbondingEntry_validator_address protoreflect.FieldDescriptor @@ -601,6 +602,7 @@ var ( func init() { file_cosmos_accounts_defaults_lockup_lockup_proto_init() md_UnbondingEntry = File_cosmos_accounts_defaults_lockup_lockup_proto.Messages().ByName("UnbondingEntry") + fd_UnbondingEntry_id = md_UnbondingEntry.Fields().ByName("id") fd_UnbondingEntry_end_time = md_UnbondingEntry.Fields().ByName("end_time") fd_UnbondingEntry_amount = md_UnbondingEntry.Fields().ByName("amount") fd_UnbondingEntry_validator_address = md_UnbondingEntry.Fields().ByName("validator_address") @@ -671,6 +673,12 @@ func (x *fastReflection_UnbondingEntry) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_UnbondingEntry) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_UnbondingEntry_id, value) { + return + } + } if x.EndTime != nil { value := protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) if !f(fd_UnbondingEntry_end_time, value) { @@ -704,6 +712,8 @@ func (x *fastReflection_UnbondingEntry) Range(f func(protoreflect.FieldDescripto // a repeated field is populated if it is non-empty. func (x *fastReflection_UnbondingEntry) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.id": + return x.Id != uint64(0) case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": return x.EndTime != nil case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": @@ -726,6 +736,8 @@ func (x *fastReflection_UnbondingEntry) Has(fd protoreflect.FieldDescriptor) boo // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_UnbondingEntry) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.id": + x.Id = uint64(0) case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": x.EndTime = nil case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": @@ -748,6 +760,9 @@ func (x *fastReflection_UnbondingEntry) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_UnbondingEntry) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.id": + value := x.Id + return protoreflect.ValueOfUint64(value) case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": value := x.EndTime return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -777,6 +792,8 @@ func (x *fastReflection_UnbondingEntry) Get(descriptor protoreflect.FieldDescrip // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_UnbondingEntry) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.id": + x.Id = value.Uint() case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": x.EndTime = value.Message().Interface().(*timestamppb.Timestamp) case "cosmos.accounts.defaults.lockup.UnbondingEntry.amount": @@ -813,6 +830,8 @@ func (x *fastReflection_UnbondingEntry) Mutable(fd protoreflect.FieldDescriptor) x.Amount = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + case "cosmos.accounts.defaults.lockup.UnbondingEntry.id": + panic(fmt.Errorf("field id of message cosmos.accounts.defaults.lockup.UnbondingEntry is not mutable")) case "cosmos.accounts.defaults.lockup.UnbondingEntry.validator_address": panic(fmt.Errorf("field validator_address of message cosmos.accounts.defaults.lockup.UnbondingEntry is not mutable")) default: @@ -828,6 +847,8 @@ func (x *fastReflection_UnbondingEntry) Mutable(fd protoreflect.FieldDescriptor) // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_UnbondingEntry) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.UnbondingEntry.id": + return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.accounts.defaults.lockup.UnbondingEntry.end_time": m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -905,6 +926,9 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) + } if x.EndTime != nil { l = options.Size(x.EndTime) n += 1 + l + runtime.Sov(uint64(l)) @@ -951,7 +975,7 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.ValidatorAddress) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if x.Amount != nil { encoded, err := options.Marshal(x.Amount) @@ -965,7 +989,7 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if x.EndTime != nil { encoded, err := options.Marshal(x.EndTime) @@ -979,7 +1003,12 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + if x.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + i-- + dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -1031,6 +1060,25 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + x.Id = 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.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) } @@ -1066,7 +1114,7 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -1102,7 +1150,7 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) } @@ -1233,12 +1281,14 @@ type UnbondingEntry struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // entry id + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // end time of entry - EndTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // unbond amount - Amount *v1beta1.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` + Amount *v1beta1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` // validator address - ValidatorAddress string `protobuf:"bytes,3,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,4,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` } func (x *UnbondingEntry) Reset() { @@ -1261,6 +1311,13 @@ func (*UnbondingEntry) Descriptor() ([]byte, []int) { return file_cosmos_accounts_defaults_lockup_lockup_proto_rawDescGZIP(), []int{1} } +func (x *UnbondingEntry) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + func (x *UnbondingEntry) GetEndTime() *timestamppb.Timestamp { if x != nil { return x.EndTime @@ -1312,18 +1369,19 @@ var file_cosmos_accounts_defaults_lockup_lockup_proto_rawDesc = []byte{ 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe4, 0x01, 0x0a, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xf4, 0x01, 0x0a, 0x0e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x44, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x44, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x03, 0x20, 0x01, 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, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, diff --git a/api/cosmos/accounts/defaults/lockup/query.pulsar.go b/api/cosmos/accounts/defaults/lockup/query.pulsar.go index 8499b9274554..f489543aba17 100644 --- a/api/cosmos/accounts/defaults/lockup/query.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/query.pulsar.go @@ -1639,6 +1639,856 @@ func (x *fastReflection_QueryLockupAccountInfoResponse) ProtoMethods() *protoifa } } +var ( + md_QueryUnbondingEntriesRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_accounts_defaults_lockup_query_proto_init() + md_QueryUnbondingEntriesRequest = File_cosmos_accounts_defaults_lockup_query_proto.Messages().ByName("QueryUnbondingEntriesRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryUnbondingEntriesRequest)(nil) + +type fastReflection_QueryUnbondingEntriesRequest QueryUnbondingEntriesRequest + +func (x *QueryUnbondingEntriesRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryUnbondingEntriesRequest)(x) +} + +func (x *QueryUnbondingEntriesRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryUnbondingEntriesRequest_messageType fastReflection_QueryUnbondingEntriesRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryUnbondingEntriesRequest_messageType{} + +type fastReflection_QueryUnbondingEntriesRequest_messageType struct{} + +func (x fastReflection_QueryUnbondingEntriesRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryUnbondingEntriesRequest)(nil) +} +func (x fastReflection_QueryUnbondingEntriesRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryUnbondingEntriesRequest) +} +func (x fastReflection_QueryUnbondingEntriesRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryUnbondingEntriesRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryUnbondingEntriesRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryUnbondingEntriesRequest +} + +// 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_QueryUnbondingEntriesRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryUnbondingEntriesRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryUnbondingEntriesRequest) New() protoreflect.Message { + return new(fastReflection_QueryUnbondingEntriesRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryUnbondingEntriesRequest) Interface() protoreflect.ProtoMessage { + return (*QueryUnbondingEntriesRequest)(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_QueryUnbondingEntriesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryUnbondingEntriesRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest 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_QueryUnbondingEntriesRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest 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_QueryUnbondingEntriesRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest 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_QueryUnbondingEntriesRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest 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_QueryUnbondingEntriesRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest 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_QueryUnbondingEntriesRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest 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_QueryUnbondingEntriesRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest", 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_QueryUnbondingEntriesRequest) 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_QueryUnbondingEntriesRequest) 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_QueryUnbondingEntriesRequest) 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_QueryUnbondingEntriesRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryUnbondingEntriesRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryUnbondingEntriesRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryUnbondingEntriesRequest) + 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: QueryUnbondingEntriesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryUnbondingEntriesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryUnbondingEntriesResponse_1_list)(nil) + +type _QueryUnbondingEntriesResponse_1_list struct { + list *[]*UnbondingEntry +} + +func (x *_QueryUnbondingEntriesResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryUnbondingEntriesResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryUnbondingEntriesResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*UnbondingEntry) + (*x.list)[i] = concreteValue +} + +func (x *_QueryUnbondingEntriesResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*UnbondingEntry) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryUnbondingEntriesResponse_1_list) AppendMutable() protoreflect.Value { + v := new(UnbondingEntry) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryUnbondingEntriesResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryUnbondingEntriesResponse_1_list) NewElement() protoreflect.Value { + v := new(UnbondingEntry) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryUnbondingEntriesResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryUnbondingEntriesResponse protoreflect.MessageDescriptor + fd_QueryUnbondingEntriesResponse_unbonding_entries protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_defaults_lockup_query_proto_init() + md_QueryUnbondingEntriesResponse = File_cosmos_accounts_defaults_lockup_query_proto.Messages().ByName("QueryUnbondingEntriesResponse") + fd_QueryUnbondingEntriesResponse_unbonding_entries = md_QueryUnbondingEntriesResponse.Fields().ByName("unbonding_entries") +} + +var _ protoreflect.Message = (*fastReflection_QueryUnbondingEntriesResponse)(nil) + +type fastReflection_QueryUnbondingEntriesResponse QueryUnbondingEntriesResponse + +func (x *QueryUnbondingEntriesResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryUnbondingEntriesResponse)(x) +} + +func (x *QueryUnbondingEntriesResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryUnbondingEntriesResponse_messageType fastReflection_QueryUnbondingEntriesResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryUnbondingEntriesResponse_messageType{} + +type fastReflection_QueryUnbondingEntriesResponse_messageType struct{} + +func (x fastReflection_QueryUnbondingEntriesResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryUnbondingEntriesResponse)(nil) +} +func (x fastReflection_QueryUnbondingEntriesResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryUnbondingEntriesResponse) +} +func (x fastReflection_QueryUnbondingEntriesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryUnbondingEntriesResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryUnbondingEntriesResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryUnbondingEntriesResponse +} + +// 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_QueryUnbondingEntriesResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryUnbondingEntriesResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryUnbondingEntriesResponse) New() protoreflect.Message { + return new(fastReflection_QueryUnbondingEntriesResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryUnbondingEntriesResponse) Interface() protoreflect.ProtoMessage { + return (*QueryUnbondingEntriesResponse)(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_QueryUnbondingEntriesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.UnbondingEntries) != 0 { + value := protoreflect.ValueOfList(&_QueryUnbondingEntriesResponse_1_list{list: &x.UnbondingEntries}) + if !f(fd_QueryUnbondingEntriesResponse_unbonding_entries, 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_QueryUnbondingEntriesResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse.unbonding_entries": + return len(x.UnbondingEntries) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse 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_QueryUnbondingEntriesResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse.unbonding_entries": + x.UnbondingEntries = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse 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_QueryUnbondingEntriesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse.unbonding_entries": + if len(x.UnbondingEntries) == 0 { + return protoreflect.ValueOfList(&_QueryUnbondingEntriesResponse_1_list{}) + } + listValue := &_QueryUnbondingEntriesResponse_1_list{list: &x.UnbondingEntries} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse 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_QueryUnbondingEntriesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse.unbonding_entries": + lv := value.List() + clv := lv.(*_QueryUnbondingEntriesResponse_1_list) + x.UnbondingEntries = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse 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_QueryUnbondingEntriesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse.unbonding_entries": + if x.UnbondingEntries == nil { + x.UnbondingEntries = []*UnbondingEntry{} + } + value := &_QueryUnbondingEntriesResponse_1_list{list: &x.UnbondingEntries} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse 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_QueryUnbondingEntriesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse.unbonding_entries": + list := []*UnbondingEntry{} + return protoreflect.ValueOfList(&_QueryUnbondingEntriesResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse 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_QueryUnbondingEntriesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse", 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_QueryUnbondingEntriesResponse) 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_QueryUnbondingEntriesResponse) 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_QueryUnbondingEntriesResponse) 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_QueryUnbondingEntriesResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryUnbondingEntriesResponse) + 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.UnbondingEntries) > 0 { + for _, e := range x.UnbondingEntries { + 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().(*QueryUnbondingEntriesResponse) + 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.UnbondingEntries) > 0 { + for iNdEx := len(x.UnbondingEntries) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.UnbondingEntries[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().(*QueryUnbondingEntriesResponse) + 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: QueryUnbondingEntriesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryUnbondingEntriesResponse: 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 UnbondingEntries", 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.UnbondingEntries = append(x.UnbondingEntries, &UnbondingEntry{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UnbondingEntries[len(x.UnbondingEntries)-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_QueryLockingPeriodsRequest protoreflect.MessageDescriptor ) @@ -1657,7 +2507,7 @@ func (x *QueryLockingPeriodsRequest) ProtoReflect() protoreflect.Message { } func (x *QueryLockingPeriodsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[2] + mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2066,7 +2916,7 @@ func (x *QueryLockingPeriodsResponse) ProtoReflect() protoreflect.Message { } func (x *QueryLockingPeriodsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[3] + mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2629,6 +3479,70 @@ func (x *QueryLockupAccountInfoResponse) GetOwner() string { return "" } +// QueryUnbondingEntriesRequest is used to query the lockup account unbonding entries. +type QueryUnbondingEntriesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryUnbondingEntriesRequest) Reset() { + *x = QueryUnbondingEntriesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryUnbondingEntriesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryUnbondingEntriesRequest) ProtoMessage() {} + +// Deprecated: Use QueryUnbondingEntriesRequest.ProtoReflect.Descriptor instead. +func (*QueryUnbondingEntriesRequest) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_defaults_lockup_query_proto_rawDescGZIP(), []int{2} +} + +// QueryUnbondingEntriesResponse returns the lockup account unbonding entries. +type QueryUnbondingEntriesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // UnbondingEntry defines the list of unbonding entries. + UnbondingEntries []*UnbondingEntry `protobuf:"bytes,1,rep,name=unbonding_entries,json=unbondingEntries,proto3" json:"unbonding_entries,omitempty"` +} + +func (x *QueryUnbondingEntriesResponse) Reset() { + *x = QueryUnbondingEntriesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryUnbondingEntriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryUnbondingEntriesResponse) ProtoMessage() {} + +// Deprecated: Use QueryUnbondingEntriesResponse.ProtoReflect.Descriptor instead. +func (*QueryUnbondingEntriesResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_defaults_lockup_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryUnbondingEntriesResponse) GetUnbondingEntries() []*UnbondingEntry { + if x != nil { + return x.UnbondingEntries + } + return nil +} + // QueryLockingPeriodsRequest is used to query the periodic lockup account locking periods. type QueryLockingPeriodsRequest struct { state protoimpl.MessageState @@ -2639,7 +3553,7 @@ type QueryLockingPeriodsRequest struct { func (x *QueryLockingPeriodsRequest) Reset() { *x = QueryLockingPeriodsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[2] + mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2653,7 +3567,7 @@ func (*QueryLockingPeriodsRequest) ProtoMessage() {} // Deprecated: Use QueryLockingPeriodsRequest.ProtoReflect.Descriptor instead. func (*QueryLockingPeriodsRequest) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_query_proto_rawDescGZIP(), []int{2} + return file_cosmos_accounts_defaults_lockup_query_proto_rawDescGZIP(), []int{4} } // QueryLockingPeriodsResponse returns the periodic lockup account locking periods. @@ -2669,7 +3583,7 @@ type QueryLockingPeriodsResponse struct { func (x *QueryLockingPeriodsResponse) Reset() { *x = QueryLockingPeriodsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[3] + mi := &file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2683,7 +3597,7 @@ func (*QueryLockingPeriodsResponse) ProtoMessage() {} // Deprecated: Use QueryLockingPeriodsResponse.ProtoReflect.Descriptor instead. func (*QueryLockingPeriodsResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_query_proto_rawDescGZIP(), []int{3} + return file_cosmos_accounts_defaults_lockup_query_proto_rawDescGZIP(), []int{5} } func (x *QueryLockingPeriodsResponse) GetLockingPeriods() []*Period { @@ -2759,33 +3673,43 @@ var file_cosmos_accounts_defaults_lockup_query_proto_rawDesc = []byte{ 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0d, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, - 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x6f, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, - 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x50, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0e, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x73, 0x42, 0x83, 0x02, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x1e, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, + 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7d, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, + 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x11, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, + 0x6b, 0x75, 0x70, 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x10, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x22, 0x1c, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, + 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x6f, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x69, + 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x42, 0x0a, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xa2, 0x02, 0x04, 0x43, - 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, - 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xca, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, - 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xe2, 0x02, 0x2b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x50, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x52, 0x0e, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x73, 0x42, 0x83, 0x02, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x42, 0x0a, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xa2, 0x02, 0x04, 0x43, 0x41, + 0x44, 0x4c, 0xaa, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, + 0x63, 0x6b, 0x75, 0x70, 0xca, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, + 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xe2, 0x02, 0x2b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -2800,30 +3724,34 @@ func file_cosmos_accounts_defaults_lockup_query_proto_rawDescGZIP() []byte { return file_cosmos_accounts_defaults_lockup_query_proto_rawDescData } -var file_cosmos_accounts_defaults_lockup_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_accounts_defaults_lockup_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_cosmos_accounts_defaults_lockup_query_proto_goTypes = []interface{}{ (*QueryLockupAccountInfoRequest)(nil), // 0: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoRequest (*QueryLockupAccountInfoResponse)(nil), // 1: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse - (*QueryLockingPeriodsRequest)(nil), // 2: cosmos.accounts.defaults.lockup.QueryLockingPeriodsRequest - (*QueryLockingPeriodsResponse)(nil), // 3: cosmos.accounts.defaults.lockup.QueryLockingPeriodsResponse - (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp - (*Period)(nil), // 6: cosmos.accounts.defaults.lockup.Period + (*QueryUnbondingEntriesRequest)(nil), // 2: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest + (*QueryUnbondingEntriesResponse)(nil), // 3: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse + (*QueryLockingPeriodsRequest)(nil), // 4: cosmos.accounts.defaults.lockup.QueryLockingPeriodsRequest + (*QueryLockingPeriodsResponse)(nil), // 5: cosmos.accounts.defaults.lockup.QueryLockingPeriodsResponse + (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp + (*UnbondingEntry)(nil), // 8: cosmos.accounts.defaults.lockup.UnbondingEntry + (*Period)(nil), // 9: cosmos.accounts.defaults.lockup.Period } var file_cosmos_accounts_defaults_lockup_query_proto_depIdxs = []int32{ - 4, // 0: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.original_locking:type_name -> cosmos.base.v1beta1.Coin - 4, // 1: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.delegated_free:type_name -> cosmos.base.v1beta1.Coin - 4, // 2: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.delegated_locking:type_name -> cosmos.base.v1beta1.Coin - 5, // 3: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.start_time:type_name -> google.protobuf.Timestamp - 5, // 4: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.end_time:type_name -> google.protobuf.Timestamp - 4, // 5: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.locked_coins:type_name -> cosmos.base.v1beta1.Coin - 4, // 6: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.unlocked_coins:type_name -> cosmos.base.v1beta1.Coin - 6, // 7: cosmos.accounts.defaults.lockup.QueryLockingPeriodsResponse.locking_periods:type_name -> cosmos.accounts.defaults.lockup.Period - 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 + 6, // 0: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.original_locking:type_name -> cosmos.base.v1beta1.Coin + 6, // 1: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.delegated_free:type_name -> cosmos.base.v1beta1.Coin + 6, // 2: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.delegated_locking:type_name -> cosmos.base.v1beta1.Coin + 7, // 3: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.start_time:type_name -> google.protobuf.Timestamp + 7, // 4: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.end_time:type_name -> google.protobuf.Timestamp + 6, // 5: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.locked_coins:type_name -> cosmos.base.v1beta1.Coin + 6, // 6: cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse.unlocked_coins:type_name -> cosmos.base.v1beta1.Coin + 8, // 7: cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse.unbonding_entries:type_name -> cosmos.accounts.defaults.lockup.UnbondingEntry + 9, // 8: cosmos.accounts.defaults.lockup.QueryLockingPeriodsResponse.locking_periods:type_name -> cosmos.accounts.defaults.lockup.Period + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_cosmos_accounts_defaults_lockup_query_proto_init() } @@ -2858,7 +3786,7 @@ func file_cosmos_accounts_defaults_lockup_query_proto_init() { } } file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryLockingPeriodsRequest); i { + switch v := v.(*QueryUnbondingEntriesRequest); i { case 0: return &v.state case 1: @@ -2870,6 +3798,30 @@ func file_cosmos_accounts_defaults_lockup_query_proto_init() { } } file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryUnbondingEntriesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryLockingPeriodsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_defaults_lockup_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryLockingPeriodsResponse); i { case 0: return &v.state @@ -2888,7 +3840,7 @@ func file_cosmos_accounts_defaults_lockup_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_defaults_lockup_query_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cosmos/accounts/defaults/lockup/tx.pulsar.go b/api/cosmos/accounts/defaults/lockup/tx.pulsar.go index 5483fe9c096b..bb08bcee9af7 100644 --- a/api/cosmos/accounts/defaults/lockup/tx.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/tx.pulsar.go @@ -4178,6 +4178,474 @@ func (x *fastReflection_MsgSend) ProtoMethods() *protoiface.Methods { } } +var ( + md_MsgTrackUndelegation protoreflect.MessageDescriptor + fd_MsgTrackUndelegation_sender protoreflect.FieldDescriptor + fd_MsgTrackUndelegation_id protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_defaults_lockup_tx_proto_init() + md_MsgTrackUndelegation = File_cosmos_accounts_defaults_lockup_tx_proto.Messages().ByName("MsgTrackUndelegation") + fd_MsgTrackUndelegation_sender = md_MsgTrackUndelegation.Fields().ByName("sender") + fd_MsgTrackUndelegation_id = md_MsgTrackUndelegation.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_MsgTrackUndelegation)(nil) + +type fastReflection_MsgTrackUndelegation MsgTrackUndelegation + +func (x *MsgTrackUndelegation) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgTrackUndelegation)(x) +} + +func (x *MsgTrackUndelegation) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[8] + 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_MsgTrackUndelegation_messageType fastReflection_MsgTrackUndelegation_messageType +var _ protoreflect.MessageType = fastReflection_MsgTrackUndelegation_messageType{} + +type fastReflection_MsgTrackUndelegation_messageType struct{} + +func (x fastReflection_MsgTrackUndelegation_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgTrackUndelegation)(nil) +} +func (x fastReflection_MsgTrackUndelegation_messageType) New() protoreflect.Message { + return new(fastReflection_MsgTrackUndelegation) +} +func (x fastReflection_MsgTrackUndelegation_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgTrackUndelegation +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgTrackUndelegation) Descriptor() protoreflect.MessageDescriptor { + return md_MsgTrackUndelegation +} + +// 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_MsgTrackUndelegation) Type() protoreflect.MessageType { + return _fastReflection_MsgTrackUndelegation_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgTrackUndelegation) New() protoreflect.Message { + return new(fastReflection_MsgTrackUndelegation) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgTrackUndelegation) Interface() protoreflect.ProtoMessage { + return (*MsgTrackUndelegation)(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_MsgTrackUndelegation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Sender != "" { + value := protoreflect.ValueOfString(x.Sender) + if !f(fd_MsgTrackUndelegation_sender, value) { + return + } + } + if x.Id != uint64(0) { + value := protoreflect.ValueOfUint64(x.Id) + if !f(fd_MsgTrackUndelegation_id, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgTrackUndelegation) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.sender": + return x.Sender != "" + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.id": + return x.Id != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.MsgTrackUndelegation")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.MsgTrackUndelegation 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_MsgTrackUndelegation) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.sender": + x.Sender = "" + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.id": + x.Id = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.MsgTrackUndelegation")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.MsgTrackUndelegation 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_MsgTrackUndelegation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.sender": + value := x.Sender + return protoreflect.ValueOfString(value) + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.id": + value := x.Id + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.MsgTrackUndelegation")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.MsgTrackUndelegation 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_MsgTrackUndelegation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.sender": + x.Sender = value.Interface().(string) + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.id": + x.Id = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.MsgTrackUndelegation")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.MsgTrackUndelegation 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_MsgTrackUndelegation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.sender": + panic(fmt.Errorf("field sender of message cosmos.accounts.defaults.lockup.MsgTrackUndelegation is not mutable")) + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.id": + panic(fmt.Errorf("field id of message cosmos.accounts.defaults.lockup.MsgTrackUndelegation is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.MsgTrackUndelegation")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.MsgTrackUndelegation 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_MsgTrackUndelegation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.sender": + return protoreflect.ValueOfString("") + case "cosmos.accounts.defaults.lockup.MsgTrackUndelegation.id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.MsgTrackUndelegation")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.MsgTrackUndelegation 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_MsgTrackUndelegation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.MsgTrackUndelegation", 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_MsgTrackUndelegation) 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_MsgTrackUndelegation) 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_MsgTrackUndelegation) 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_MsgTrackUndelegation) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgTrackUndelegation) + 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.Sender) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Id != 0 { + n += 1 + runtime.Sov(uint64(x.Id)) + } + 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().(*MsgTrackUndelegation) + 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.Id != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + i-- + dAtA[i] = 0x10 + } + if len(x.Sender) > 0 { + i -= len(x.Sender) + copy(dAtA[i:], x.Sender) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) + 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().(*MsgTrackUndelegation) + 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: MsgTrackUndelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgTrackUndelegation: 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 Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + x.Id = 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.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 = (*_MsgExecuteMessagesResponse_1_list)(nil) type _MsgExecuteMessagesResponse_1_list struct { @@ -4249,7 +4717,7 @@ func (x *MsgExecuteMessagesResponse) ProtoReflect() protoreflect.Message { } func (x *MsgExecuteMessagesResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[8] + mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4742,7 +5210,7 @@ func (x *MsgWithdraw) ProtoReflect() protoreflect.Message { } func (x *MsgWithdraw) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[9] + mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5353,7 +5821,7 @@ func (x *MsgWithdrawResponse) ProtoReflect() protoreflect.Message { } func (x *MsgWithdrawResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[10] + mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6218,6 +6686,50 @@ func (x *MsgSend) GetAmount() []*v1beta1.Coin { return nil } +// MsgTrackUndelegation defines a message that enable lockup account to update delegation tracking +type MsgTrackUndelegation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *MsgTrackUndelegation) Reset() { + *x = MsgTrackUndelegation{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgTrackUndelegation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgTrackUndelegation) ProtoMessage() {} + +// Deprecated: Use MsgTrackUndelegation.ProtoReflect.Descriptor instead. +func (*MsgTrackUndelegation) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_defaults_lockup_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgTrackUndelegation) GetSender() string { + if x != nil { + return x.Sender + } + return "" +} + +func (x *MsgTrackUndelegation) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + // MsgExecuteMessagesResponse defines the response for lockup execute operations type MsgExecuteMessagesResponse struct { state protoimpl.MessageState @@ -6230,7 +6742,7 @@ type MsgExecuteMessagesResponse struct { func (x *MsgExecuteMessagesResponse) Reset() { *x = MsgExecuteMessagesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[8] + mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6244,7 +6756,7 @@ func (*MsgExecuteMessagesResponse) ProtoMessage() {} // Deprecated: Use MsgExecuteMessagesResponse.ProtoReflect.Descriptor instead. func (*MsgExecuteMessagesResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_tx_proto_rawDescGZIP(), []int{8} + return file_cosmos_accounts_defaults_lockup_tx_proto_rawDescGZIP(), []int{9} } func (x *MsgExecuteMessagesResponse) GetResponses() []*anypb.Any { @@ -6269,7 +6781,7 @@ type MsgWithdraw struct { func (x *MsgWithdraw) Reset() { *x = MsgWithdraw{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[9] + mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6283,7 +6795,7 @@ func (*MsgWithdraw) ProtoMessage() {} // Deprecated: Use MsgWithdraw.ProtoReflect.Descriptor instead. func (*MsgWithdraw) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_tx_proto_rawDescGZIP(), []int{9} + return file_cosmos_accounts_defaults_lockup_tx_proto_rawDescGZIP(), []int{10} } func (x *MsgWithdraw) GetWithdrawer() string { @@ -6320,7 +6832,7 @@ type MsgWithdrawResponse struct { func (x *MsgWithdrawResponse) Reset() { *x = MsgWithdrawResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[10] + mi := &file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6334,7 +6846,7 @@ func (*MsgWithdrawResponse) ProtoMessage() {} // Deprecated: Use MsgWithdrawResponse.ProtoReflect.Descriptor instead. func (*MsgWithdrawResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_tx_proto_rawDescGZIP(), []int{10} + return file_cosmos_accounts_defaults_lockup_tx_proto_rawDescGZIP(), []int{11} } func (x *MsgWithdrawResponse) GetReceiver() string { @@ -6468,54 +6980,61 @@ var file_cosmos_accounts_defaults_lockup_tx_proto_rawDesc = []byte{ 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x13, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, - 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x50, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x4d, 0x73, - 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x38, 0x0a, 0x0a, 0x77, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x09, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x73, 0x3a, 0x17, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, - 0xb0, 0x2a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x22, 0xd8, 0x01, - 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x8a, 0x01, 0x0a, 0x0f, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, - 0x02, 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, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, - 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x80, 0x02, 0x0a, 0x23, 0x63, 0x6f, 0x6d, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, - 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xa2, 0x02, 0x04, - 0x43, 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, - 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xca, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xe2, 0x02, 0x2b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, - 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x54, 0x72, + 0x61, 0x63, 0x6b, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, + 0x64, 0x3a, 0x13, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x50, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, + 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x38, 0x0a, 0x0a, 0x77, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x09, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x73, 0x3a, 0x17, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, + 0x2a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x22, 0xd8, 0x01, 0x0a, + 0x13, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x8a, 0x01, 0x0a, 0x0f, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x02, + 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, + 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, + 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, + 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x80, 0x02, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x42, + 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xa2, 0x02, 0x04, 0x43, + 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, + 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xca, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, + 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xe2, 0x02, 0x2b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -6530,7 +7049,7 @@ func file_cosmos_accounts_defaults_lockup_tx_proto_rawDescGZIP() []byte { return file_cosmos_accounts_defaults_lockup_tx_proto_rawDescData } -var file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_cosmos_accounts_defaults_lockup_tx_proto_goTypes = []interface{}{ (*MsgInitLockupAccount)(nil), // 0: cosmos.accounts.defaults.lockup.MsgInitLockupAccount (*MsgInitLockupAccountResponse)(nil), // 1: cosmos.accounts.defaults.lockup.MsgInitLockupAccountResponse @@ -6540,24 +7059,25 @@ var file_cosmos_accounts_defaults_lockup_tx_proto_goTypes = []interface{}{ (*MsgUndelegate)(nil), // 5: cosmos.accounts.defaults.lockup.MsgUndelegate (*MsgWithdrawReward)(nil), // 6: cosmos.accounts.defaults.lockup.MsgWithdrawReward (*MsgSend)(nil), // 7: cosmos.accounts.defaults.lockup.MsgSend - (*MsgExecuteMessagesResponse)(nil), // 8: cosmos.accounts.defaults.lockup.MsgExecuteMessagesResponse - (*MsgWithdraw)(nil), // 9: cosmos.accounts.defaults.lockup.MsgWithdraw - (*MsgWithdrawResponse)(nil), // 10: cosmos.accounts.defaults.lockup.MsgWithdrawResponse - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp - (*Period)(nil), // 12: cosmos.accounts.defaults.lockup.Period - (*v1beta1.Coin)(nil), // 13: cosmos.base.v1beta1.Coin - (*anypb.Any)(nil), // 14: google.protobuf.Any + (*MsgTrackUndelegation)(nil), // 8: cosmos.accounts.defaults.lockup.MsgTrackUndelegation + (*MsgExecuteMessagesResponse)(nil), // 9: cosmos.accounts.defaults.lockup.MsgExecuteMessagesResponse + (*MsgWithdraw)(nil), // 10: cosmos.accounts.defaults.lockup.MsgWithdraw + (*MsgWithdrawResponse)(nil), // 11: cosmos.accounts.defaults.lockup.MsgWithdrawResponse + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp + (*Period)(nil), // 13: cosmos.accounts.defaults.lockup.Period + (*v1beta1.Coin)(nil), // 14: cosmos.base.v1beta1.Coin + (*anypb.Any)(nil), // 15: google.protobuf.Any } var file_cosmos_accounts_defaults_lockup_tx_proto_depIdxs = []int32{ - 11, // 0: cosmos.accounts.defaults.lockup.MsgInitLockupAccount.end_time:type_name -> google.protobuf.Timestamp - 11, // 1: cosmos.accounts.defaults.lockup.MsgInitLockupAccount.start_time:type_name -> google.protobuf.Timestamp - 11, // 2: cosmos.accounts.defaults.lockup.MsgInitPeriodicLockingAccount.start_time:type_name -> google.protobuf.Timestamp - 12, // 3: cosmos.accounts.defaults.lockup.MsgInitPeriodicLockingAccount.locking_periods:type_name -> cosmos.accounts.defaults.lockup.Period - 13, // 4: cosmos.accounts.defaults.lockup.MsgDelegate.amount:type_name -> cosmos.base.v1beta1.Coin - 13, // 5: cosmos.accounts.defaults.lockup.MsgUndelegate.amount:type_name -> cosmos.base.v1beta1.Coin - 13, // 6: cosmos.accounts.defaults.lockup.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin - 14, // 7: cosmos.accounts.defaults.lockup.MsgExecuteMessagesResponse.responses:type_name -> google.protobuf.Any - 13, // 8: cosmos.accounts.defaults.lockup.MsgWithdrawResponse.amount_received:type_name -> cosmos.base.v1beta1.Coin + 12, // 0: cosmos.accounts.defaults.lockup.MsgInitLockupAccount.end_time:type_name -> google.protobuf.Timestamp + 12, // 1: cosmos.accounts.defaults.lockup.MsgInitLockupAccount.start_time:type_name -> google.protobuf.Timestamp + 12, // 2: cosmos.accounts.defaults.lockup.MsgInitPeriodicLockingAccount.start_time:type_name -> google.protobuf.Timestamp + 13, // 3: cosmos.accounts.defaults.lockup.MsgInitPeriodicLockingAccount.locking_periods:type_name -> cosmos.accounts.defaults.lockup.Period + 14, // 4: cosmos.accounts.defaults.lockup.MsgDelegate.amount:type_name -> cosmos.base.v1beta1.Coin + 14, // 5: cosmos.accounts.defaults.lockup.MsgUndelegate.amount:type_name -> cosmos.base.v1beta1.Coin + 14, // 6: cosmos.accounts.defaults.lockup.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin + 15, // 7: cosmos.accounts.defaults.lockup.MsgExecuteMessagesResponse.responses:type_name -> google.protobuf.Any + 14, // 8: cosmos.accounts.defaults.lockup.MsgWithdrawResponse.amount_received:type_name -> cosmos.base.v1beta1.Coin 9, // [9:9] is the sub-list for method output_type 9, // [9:9] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name @@ -6669,7 +7189,7 @@ func file_cosmos_accounts_defaults_lockup_tx_proto_init() { } } file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgExecuteMessagesResponse); i { + switch v := v.(*MsgTrackUndelegation); i { case 0: return &v.state case 1: @@ -6681,7 +7201,7 @@ func file_cosmos_accounts_defaults_lockup_tx_proto_init() { } } file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgWithdraw); i { + switch v := v.(*MsgExecuteMessagesResponse); i { case 0: return &v.state case 1: @@ -6693,6 +7213,18 @@ func file_cosmos_accounts_defaults_lockup_tx_proto_init() { } } file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgWithdraw); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_defaults_lockup_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgWithdrawResponse); i { case 0: return &v.state @@ -6711,7 +7243,7 @@ func file_cosmos_accounts_defaults_lockup_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_defaults_lockup_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/tests/e2e/accounts/lockup/continous_lockup_test_suite.go b/tests/e2e/accounts/lockup/continous_lockup_test_suite.go index dfb7ed1c76d8..9092bf380a83 100644 --- a/tests/e2e/accounts/lockup/continous_lockup_test_suite.go +++ b/tests/e2e/accounts/lockup/continous_lockup_test_suite.go @@ -23,6 +23,7 @@ func (s *E2ETestSuite) TestContinuousLockingAccount() { ctx := sdk.NewContext(app.CommitMultiStore(), false, app.Logger()).WithHeaderInfo(header.Info{ Time: currentTime, }) + s.setupStakingParams(ctx, app) ownerAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) require.NoError(t, err) s.fundAccount(app, ctx, accOwner, sdk.Coins{sdk.NewCoin("stake", math.NewInt(1000000))}) @@ -163,10 +164,11 @@ func (s *E2ETestSuite) TestContinuousLockingAccount() { require.NoError(t, err) require.Equal(t, len(ubd.Entries), 1) - // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) - delLocking := lockupAccountInfoResponse.DelegatedLocking - require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) + // check if an entry is added + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr) + entries := unbondingEntriesResponse.UnbondingEntries + require.True(t, entries[0].Amount.Amount.Equal(math.NewInt(100))) + require.True(t, entries[0].ValidatorAddress == val.OperatorAddress) }) // Update context time to end time @@ -174,6 +176,20 @@ func (s *E2ETestSuite) TestContinuousLockingAccount() { Time: currentTime.Add(time.Minute), }) + t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { + msg := &types.MsgTrackUndelegation{ + Sender: ownerAddrStr, + Id: 0, + } + err = s.executeTx(ctx, msg, app, accountAddr, accOwner) + require.NoError(t, err) + + // check if tracking is updated accordingly + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) + delLocking := lockupAccountInfoResponse.DelegatedLocking + require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) + }) + // test if tracking delegate work perfectly t.Run("ok - execute delegate message", func(t *testing.T) { msg := &types.MsgDelegate{ diff --git a/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go b/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go index 4de723a49869..c5cbc295fee5 100644 --- a/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go +++ b/tests/e2e/accounts/lockup/delayed_lockup_test_suite.go @@ -23,6 +23,7 @@ func (s *E2ETestSuite) TestDelayedLockingAccount() { ctx := sdk.NewContext(app.CommitMultiStore(), false, app.Logger()).WithHeaderInfo(header.Info{ Time: currentTime, }) + s.setupStakingParams(ctx, app) ownerAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) require.NoError(t, err) s.fundAccount(app, ctx, accOwner, sdk.Coins{sdk.NewCoin("stake", math.NewInt(1000000))}) @@ -125,6 +126,27 @@ func (s *E2ETestSuite) TestDelayedLockingAccount() { require.NoError(t, err) require.Equal(t, len(ubd.Entries), 1) + // check if an entry is added + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr) + entries := unbondingEntriesResponse.UnbondingEntries + require.True(t, entries[0].Amount.Amount.Equal(math.NewInt(100))) + require.True(t, entries[0].ValidatorAddress == val.OperatorAddress) + }) + + // Update context time + // After unbond time elapsed + ctx = ctx.WithHeaderInfo(header.Info{ + Time: currentTime.Add(time.Second * 11), + }) + + t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { + msg := &types.MsgTrackUndelegation{ + Sender: ownerAddrStr, + Id: 0, + } + err = s.executeTx(ctx, msg, app, accountAddr, accOwner) + require.NoError(t, err) + // check if tracking is updated accordingly lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking diff --git a/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go b/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go index 948f5eb8a30b..ae3ae39dcdb3 100644 --- a/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go +++ b/tests/e2e/accounts/lockup/periodic_lockup_test_suite.go @@ -23,6 +23,7 @@ func (s *E2ETestSuite) TestPeriodicLockingAccount() { ctx := sdk.NewContext(app.CommitMultiStore(), false, app.Logger()).WithHeaderInfo(header.Info{ Time: currentTime, }) + s.setupStakingParams(ctx, app) ownerAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) require.NoError(t, err) s.fundAccount(app, ctx, accOwner, sdk.Coins{sdk.NewCoin("stake", math.NewInt(1000000))}) @@ -185,10 +186,11 @@ func (s *E2ETestSuite) TestPeriodicLockingAccount() { require.NoError(t, err) require.Equal(t, len(ubd.Entries), 1) - // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) - delLocking := lockupAccountInfoResponse.DelegatedLocking - require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) + // check if an entry is added + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr) + entries := unbondingEntriesResponse.UnbondingEntries + require.True(t, entries[0].Amount.Amount.Equal(math.NewInt(100))) + require.True(t, entries[0].ValidatorAddress == val.OperatorAddress) }) // Update context time @@ -197,6 +199,20 @@ func (s *E2ETestSuite) TestPeriodicLockingAccount() { Time: currentTime.Add(time.Minute * 3), }) + t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { + msg := &types.MsgTrackUndelegation{ + Sender: ownerAddrStr, + Id: 0, + } + err = s.executeTx(ctx, msg, app, accountAddr, accOwner) + require.NoError(t, err) + + // check if tracking is updated accordingly + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) + delLocking := lockupAccountInfoResponse.DelegatedLocking + require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) + }) + t.Run("ok - execute delegate message", func(t *testing.T) { msg := &types.MsgDelegate{ Sender: ownerAddrStr, diff --git a/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go b/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go index 225bc13caf98..3a862ec7dda2 100644 --- a/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go +++ b/tests/e2e/accounts/lockup/permanent_lockup_test_suite.go @@ -23,6 +23,7 @@ func (s *E2ETestSuite) TestPermanentLockingAccount() { ctx := sdk.NewContext(app.CommitMultiStore(), false, app.Logger()).WithHeaderInfo(header.Info{ Time: currentTime, }) + s.setupStakingParams(ctx, app) ownerAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) require.NoError(t, err) s.fundAccount(app, ctx, accOwner, sdk.Coins{sdk.NewCoin("stake", math.NewInt(1000000))}) @@ -109,10 +110,11 @@ func (s *E2ETestSuite) TestPermanentLockingAccount() { require.NoError(t, err) require.Equal(t, len(ubd.Entries), 1) - // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) - delLocking := lockupAccountInfoResponse.DelegatedLocking - require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) + // check if an entry is added + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr) + entries := unbondingEntriesResponse.UnbondingEntries + require.True(t, entries[0].Amount.Amount.Equal(math.NewInt(100))) + require.True(t, entries[0].ValidatorAddress == val.OperatorAddress) }) s.fundAccount(app, ctx, accountAddr, sdk.Coins{sdk.NewCoin("stake", math.NewInt(1000))}) @@ -129,4 +131,23 @@ func (s *E2ETestSuite) TestPermanentLockingAccount() { balance := app.BankKeeper.GetBalance(ctx, randAcc, "stake") require.True(t, balance.Amount.Equal(math.NewInt(100))) }) + + // Update context time + ctx = ctx.WithHeaderInfo(header.Info{ + Time: currentTime.Add(time.Second * 11), + }) + + t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { + msg := &types.MsgTrackUndelegation{ + Sender: ownerAddrStr, + Id: 0, + } + err = s.executeTx(ctx, msg, app, accountAddr, accOwner) + require.NoError(t, err) + + // check if tracking is updated accordingly + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) + delLocking := lockupAccountInfoResponse.DelegatedLocking + require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) + }) } diff --git a/tests/e2e/accounts/lockup/utils.go b/tests/e2e/accounts/lockup/utils.go index 69606d58d743..b757a29bffeb 100644 --- a/tests/e2e/accounts/lockup/utils.go +++ b/tests/e2e/accounts/lockup/utils.go @@ -2,6 +2,7 @@ package lockup import ( "testing" + "time" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -70,3 +71,25 @@ func (s *E2ETestSuite) queryLockupAccInfo(ctx sdk.Context, app *simapp.SimApp, a return lockupAccountInfoResponse } + +func (s *E2ETestSuite) queryUnbondingEntries(ctx sdk.Context, app *simapp.SimApp, accAddr []byte) *types.QueryUnbondingEntriesResponse { + req := &types.QueryUnbondingEntriesRequest{} + resp, err := s.queryAcc(ctx, req, app, accAddr) + require.NoError(s.T(), err) + require.NotNil(s.T(), resp) + + unbondingEntriesResponse, ok := resp.(*types.QueryUnbondingEntriesResponse) + require.True(s.T(), ok) + + return unbondingEntriesResponse +} + +func (s *E2ETestSuite) setupStakingParams(ctx sdk.Context, app *simapp.SimApp) { + params, err := app.StakingKeeper.Params.Get(ctx) + require.NoError(s.T(), err) + + // update unbonding time + params.UnbondingTime = time.Duration(time.Second * 10) + err = app.StakingKeeper.Params.Set(ctx, params) + require.NoError(s.T(), err) +} diff --git a/x/accounts/defaults/lockup/continuous_locking_account.go b/x/accounts/defaults/lockup/continuous_locking_account.go index c90b909cf6cf..c5d7619ea1c0 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account.go +++ b/x/accounts/defaults/lockup/continuous_locking_account.go @@ -200,4 +200,5 @@ func (cva ContinuousLockingAccount) RegisterExecuteHandlers(builder *accountstd. func (cva ContinuousLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, cva.QueryLockupAccountInfo) + accountstd.RegisterQueryHandler(builder, cva.QueryUnbondingEntries) } diff --git a/x/accounts/defaults/lockup/continuous_locking_account_test.go b/x/accounts/defaults/lockup/continuous_locking_account_test.go index 007a8c81cbba..550148ba9202 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account_test.go +++ b/x/accounts/defaults/lockup/continuous_locking_account_test.go @@ -110,13 +110,10 @@ func TestContinousAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - // manually update entry end time since msgUndelegateResponse are mocks - // so no actual end time can be set - ubdEntry.EndTime = time.Now() - err = acc.UnbondEntries.Set(sdkCtx, ubdSeq-1, ubdEntry) - require.NoError(t, err) - - err = acc.TrackUnbondingEntries(sdkCtx) + _, err = acc.TrackUndelegationEntry(sdkCtx, &lockuptypes.MsgTrackUndelegation{ + Sender: "owner", + Id: ubdSeq - 1, + }) require.NoError(t, err) delLocking, err = acc.DelegatedLocking.Get(ctx, "test") diff --git a/x/accounts/defaults/lockup/delayed_locking_account.go b/x/accounts/defaults/lockup/delayed_locking_account.go index 057a99001448..e3068f797ac2 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account.go +++ b/x/accounts/defaults/lockup/delayed_locking_account.go @@ -149,4 +149,5 @@ func (dva DelayedLockingAccount) RegisterExecuteHandlers(builder *accountstd.Exe func (dva DelayedLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, dva.QueryVestingAccountInfo) + accountstd.RegisterQueryHandler(builder, dva.QueryUnbondingEntries) } diff --git a/x/accounts/defaults/lockup/delayed_locking_account_test.go b/x/accounts/defaults/lockup/delayed_locking_account_test.go index 0750b058d388..73954c200be2 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account_test.go +++ b/x/accounts/defaults/lockup/delayed_locking_account_test.go @@ -109,13 +109,10 @@ func TestDelayedAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - // manually update entry end time since msgUndelegateResponse are mocks - // so no actual end time can be set - ubdEntry.EndTime = time.Now() - err = acc.UnbondEntries.Set(sdkCtx, ubdSeq-1, ubdEntry) - require.NoError(t, err) - - err = acc.TrackUnbondingEntries(sdkCtx) + _, err = acc.TrackUndelegationEntry(sdkCtx, &lockuptypes.MsgTrackUndelegation{ + Sender: "owner", + Id: ubdSeq - 1, + }) require.NoError(t, err) delLocking, err = acc.DelegatedLocking.Get(ctx, "test") diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 054ece28490a..46536edd3242 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "errors" + "fmt" "maps" "slices" "time" @@ -221,6 +222,7 @@ func (bva *BaseLockup) Undelegate( } err = bva.UnbondEntries.Set(ctx, ubdSeq, lockuptypes.UnbondingEntry{ + Id: ubdSeq, EndTime: msgUndelegateResp.CompletionTime, Amount: msgUndelegateResp.Amount, ValidatorAddress: msg.ValidatorAddress, @@ -232,29 +234,37 @@ func (bva *BaseLockup) Undelegate( return &lockuptypes.MsgExecuteMessagesResponse{Responses: resp}, nil } -// loops through all unbonding entries and tracks all matured entries -func (bva *BaseLockup) TrackUnbondingEntries(ctx context.Context) error { - hs := bva.headerService.HeaderInfo(ctx) - err := bva.UnbondEntries.Walk(ctx, nil, func(key uint64, value lockuptypes.UnbondingEntry) (stop bool, err error) { - if value.EndTime.Before(hs.Time) { - return false, nil - } +func (bva *BaseLockup) TrackUndelegationEntry( + ctx context.Context, msg *lockuptypes.MsgTrackUndelegation, +) ( + *lockuptypes.MsgExecuteMessagesResponse, error, +) { + err := bva.checkSender(ctx, msg.Sender) + if err != nil { + return nil, err + } + entry, err := bva.UnbondEntries.Get(ctx, msg.Id) + if err != nil { + return nil, err + } - err = bva.TrackUndelegation(ctx, sdk.NewCoins(value.Amount)) - if err != nil { - return true, err - } + hs := bva.headerService.HeaderInfo(ctx) + if entry.EndTime.After(hs.Time) { + return nil, fmt.Errorf("unbonding not matured yet, expecting end time at: %s", entry.EndTime.String()) + } - // remove entry - err = bva.UnbondEntries.Remove(ctx, key) - if err != nil { - return true, err - } + err = bva.TrackUndelegation(ctx, sdk.NewCoins(entry.Amount)) + if err != nil { + return nil, err + } - return false, nil - }) + // remove entry + err = bva.UnbondEntries.Remove(ctx, msg.Id) + if err != nil { + return nil, err + } - return err + return &lockuptypes.MsgExecuteMessagesResponse{}, nil } func (bva *BaseLockup) WithdrawReward( @@ -310,12 +320,6 @@ func (bva *BaseLockup) SendCoins( return nil, err } - // tracking all matured unbonding entries before check sendable tokens - err = bva.TrackUnbondingEntries(ctx) - if err != nil { - return nil, err - } - err = bva.checkTokensSendable(ctx, fromAddress, msg.Amount, lockedCoins) if err != nil { return nil, err @@ -364,12 +368,6 @@ func (bva *BaseLockup) WithdrawUnlockedCoins( return nil, err } - // tracking all matured unbonding entries - err = bva.TrackUnbondingEntries(ctx) - if err != nil { - return nil, err - } - amount := sdk.Coins{} for _, denom := range uniqueDenoms { balance, err := bva.getBalance(ctx, fromAddress, denom) @@ -730,7 +728,25 @@ func (bva BaseLockup) QueryLockupAccountBaseInfo(ctx context.Context, _ *lockupt }, nil } +func (bva BaseLockup) QueryUnbondingEntries(ctx context.Context, _ *lockuptypes.QueryUnbondingEntriesRequest) ( + *lockuptypes.QueryUnbondingEntriesResponse, error, +) { + entries := []*lockuptypes.UnbondingEntry{} + err := bva.UnbondEntries.Walk(ctx, nil, func(key uint64, value lockuptypes.UnbondingEntry) (stop bool, err error) { + entries = append(entries, &value) + return false, nil + }) + if err != nil { + return nil, err + } + + return &lockuptypes.QueryUnbondingEntriesResponse{ + UnbondingEntries: entries, + }, nil +} + func (bva BaseLockup) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { accountstd.RegisterExecuteHandler(builder, bva.Undelegate) accountstd.RegisterExecuteHandler(builder, bva.WithdrawReward) + accountstd.RegisterExecuteHandler(builder, bva.TrackUndelegationEntry) } diff --git a/x/accounts/defaults/lockup/periodic_locking_account.go b/x/accounts/defaults/lockup/periodic_locking_account.go index 71013980d9d7..18e5358a76e7 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account.go +++ b/x/accounts/defaults/lockup/periodic_locking_account.go @@ -343,4 +343,5 @@ func (pva PeriodicLockingAccount) RegisterExecuteHandlers(builder *accountstd.Ex func (pva PeriodicLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, pva.QueryLockupAccountInfo) accountstd.RegisterQueryHandler(builder, pva.QueryLockingPeriods) + accountstd.RegisterQueryHandler(builder, pva.QueryUnbondingEntries) } diff --git a/x/accounts/defaults/lockup/periodic_locking_account_test.go b/x/accounts/defaults/lockup/periodic_locking_account_test.go index 7cd155fbb585..d35cefebdb11 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account_test.go +++ b/x/accounts/defaults/lockup/periodic_locking_account_test.go @@ -143,13 +143,10 @@ func TestPeriodicAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - // manually update entry end time since msgUndelegateResponse are mocks - // so no actual end time can be set - ubdEntry.EndTime = time.Now() - err = acc.UnbondEntries.Set(sdkCtx, ubdSeq-1, ubdEntry) - require.NoError(t, err) - - err = acc.TrackUnbondingEntries(sdkCtx) + _, err = acc.TrackUndelegationEntry(sdkCtx, &lockuptypes.MsgTrackUndelegation{ + Sender: "owner", + Id: ubdSeq - 1, + }) require.NoError(t, err) delLocking, err = acc.DelegatedLocking.Get(ctx, "test") diff --git a/x/accounts/defaults/lockup/permanent_locking_account.go b/x/accounts/defaults/lockup/permanent_locking_account.go index 5e5d0dab98da..31bc4681569f 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account.go +++ b/x/accounts/defaults/lockup/permanent_locking_account.go @@ -103,8 +103,10 @@ func (plva PermanentLockingAccount) RegisterExecuteHandlers(builder *accountstd. accountstd.RegisterExecuteHandler(builder, plva.Undelegate) accountstd.RegisterExecuteHandler(builder, plva.SendCoins) accountstd.RegisterExecuteHandler(builder, plva.WithdrawReward) + accountstd.RegisterExecuteHandler(builder, plva.TrackUndelegationEntry) } func (plva PermanentLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, plva.QueryLockupAccountInfo) + accountstd.RegisterQueryHandler(builder, plva.QueryUnbondingEntries) } diff --git a/x/accounts/defaults/lockup/permanent_locking_account_test.go b/x/accounts/defaults/lockup/permanent_locking_account_test.go index b065f11d293e..11f7e13cc57f 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account_test.go +++ b/x/accounts/defaults/lockup/permanent_locking_account_test.go @@ -85,13 +85,10 @@ func TestPermanentAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - // manually update entry end time since msgUndelegateResponse are mocks - // so no actual end time can be set - ubdEntry.EndTime = time.Now() - err = acc.UnbondEntries.Set(sdkCtx, ubdSeq-1, ubdEntry) - require.NoError(t, err) - - err = acc.TrackUnbondingEntries(sdkCtx) + _, err = acc.TrackUndelegationEntry(sdkCtx, &lockuptypes.MsgTrackUndelegation{ + Sender: "owner", + Id: ubdSeq - 1, + }) require.NoError(t, err) delLocking, err = acc.DelegatedLocking.Get(ctx, "test") diff --git a/x/accounts/defaults/lockup/types/lockup.pb.go b/x/accounts/defaults/lockup/types/lockup.pb.go index 01f9c342e159..68061046166a 100644 --- a/x/accounts/defaults/lockup/types/lockup.pb.go +++ b/x/accounts/defaults/lockup/types/lockup.pb.go @@ -88,12 +88,14 @@ func (m *Period) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { // UnbondingEntry defines an entry tracking the lockup account unbonding operation. type UnbondingEntry struct { + // entry id + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // end time of entry - EndTime time.Time `protobuf:"bytes,1,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` + EndTime time.Time `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` // unbond amount - Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` // validator address - ValidatorAddress string `protobuf:"bytes,3,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,4,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` } func (m *UnbondingEntry) Reset() { *m = UnbondingEntry{} } @@ -129,6 +131,13 @@ func (m *UnbondingEntry) XXX_DiscardUnknown() { var xxx_messageInfo_UnbondingEntry proto.InternalMessageInfo +func (m *UnbondingEntry) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + func (m *UnbondingEntry) GetEndTime() time.Time { if m != nil { return m.EndTime @@ -160,36 +169,37 @@ func init() { } var fileDescriptor_79b466256e1a079c = []byte{ - // 458 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcd, 0x6e, 0x13, 0x31, - 0x14, 0x85, 0x63, 0x2a, 0x05, 0x3a, 0xfc, 0x88, 0x8e, 0x58, 0xa4, 0x91, 0x98, 0x09, 0x5d, 0x45, - 0x15, 0xb1, 0x55, 0xd8, 0xb2, 0x80, 0x50, 0x60, 0x87, 0x50, 0xf9, 0x59, 0xb0, 0x89, 0x3c, 0x63, - 0xd7, 0xb5, 0x32, 0xe3, 0x1b, 0x8d, 0x3d, 0x11, 0x79, 0x8b, 0x2e, 0x11, 0x4f, 0x80, 0x58, 0x75, - 0xc1, 0x2b, 0x20, 0x75, 0x59, 0xb1, 0x62, 0x45, 0x51, 0x82, 0xd4, 0xd7, 0x40, 0x1e, 0xdf, 0x41, - 0x50, 0x44, 0x37, 0x63, 0x8f, 0xef, 0x39, 0xe7, 0xfa, 0xbb, 0x72, 0x74, 0x37, 0x07, 0x5b, 0x82, - 0x65, 0x3c, 0xcf, 0xa1, 0x36, 0xce, 0x32, 0x21, 0xf7, 0x79, 0x5d, 0x38, 0xcb, 0x0a, 0xc8, 0xa7, - 0xf5, 0x0c, 0x17, 0x3a, 0xab, 0xc0, 0x41, 0x9c, 0x06, 0x35, 0x6d, 0xd5, 0xb4, 0x55, 0xd3, 0x20, - 0xeb, 0x6f, 0xf0, 0x52, 0x1b, 0x60, 0xcd, 0x37, 0x78, 0xfa, 0x09, 0x76, 0xc8, 0xb8, 0x95, 0x6c, - 0xbe, 0x93, 0x49, 0xc7, 0x77, 0x58, 0x0e, 0xda, 0x60, 0xfd, 0x96, 0x02, 0x05, 0xcd, 0x96, 0xf9, - 0x1d, 0x9e, 0x6e, 0x06, 0xd7, 0x24, 0x14, 0xb0, 0x2d, 0x06, 0x2a, 0x00, 0x55, 0x48, 0xd6, 0xfc, - 0x65, 0xf5, 0x3e, 0x13, 0x75, 0xc5, 0x9d, 0x86, 0x36, 0x30, 0x3d, 0x5f, 0x77, 0xba, 0x94, 0xd6, - 0xf1, 0x12, 0x29, 0xb6, 0xbe, 0x90, 0xa8, 0xfb, 0x42, 0x56, 0x1a, 0x44, 0xfc, 0x30, 0xea, 0x16, - 0xd2, 0x28, 0x77, 0xd0, 0x23, 0x03, 0x32, 0xbc, 0x7a, 0x6f, 0x93, 0x06, 0x33, 0x6d, 0xcd, 0x74, - 0x17, 0xc3, 0xc7, 0xd7, 0x8f, 0xbf, 0xa7, 0x9d, 0xf7, 0xa7, 0x29, 0xf9, 0x78, 0x76, 0xb4, 0x4d, - 0xf6, 0xd0, 0x17, 0x2f, 0xa2, 0x2e, 0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, 0x4c, 0xa9, 0x06, - 0xf6, 0xee, 0xff, 0x8f, 0xb8, 0x99, 0x69, 0xd6, 0x6d, 0x46, 0x70, 0xff, 0x57, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x67, 0x3b, 0x6e, 0x8b, 0xf4, 0x02, 0x00, 0x00, + // 473 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x3f, 0x6f, 0x13, 0x31, + 0x18, 0xc6, 0xe3, 0xb4, 0x0a, 0xf4, 0x80, 0x8a, 0x9e, 0x18, 0xd2, 0x48, 0xdc, 0x85, 0x4e, 0x51, + 0x45, 0x6c, 0x15, 0x56, 0x06, 0x08, 0x05, 0x36, 0x84, 0xc2, 0x9f, 0x81, 0x25, 0xf2, 0x9d, 0x5d, + 0xd7, 0xca, 0x9d, 0xdf, 0xe8, 0xec, 0x8b, 0xc8, 0xb7, 0xe8, 0x88, 0xf8, 0x04, 0x88, 0xa9, 0x03, + 0x5f, 0x01, 0xa9, 0x63, 0xc5, 0xc4, 0x44, 0x51, 0x32, 0xf4, 0x0b, 0xf0, 0x01, 0x90, 0xff, 0x5c, + 0x25, 0x5a, 0x75, 0x39, 0xfb, 0xfc, 0xbe, 0xcf, 0xf3, 0xfa, 0xf7, 0xc8, 0xd1, 0xc3, 0x1c, 0x74, + 0x09, 0x9a, 0xd0, 0x3c, 0x87, 0x5a, 0x19, 0x4d, 0x18, 0x3f, 0xa0, 0x75, 0x61, 0x34, 0x29, 0x20, + 0x9f, 0xd6, 0xb3, 0xb0, 0xe0, 0x59, 0x05, 0x06, 0xe2, 0xd4, 0x77, 0xe3, 0xa6, 0x1b, 0x37, 0xdd, + 0xd8, 0xb7, 0xf5, 0xb6, 0x68, 0x29, 0x15, 0x10, 0xf7, 0xf5, 0x9a, 0x5e, 0x12, 0x26, 0x64, 0x54, + 0x73, 0x32, 0xdf, 0xcb, 0xb8, 0xa1, 0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e3, 0xb6, 0x64, 0xf1, 0x7e, + 0x74, 0x93, 0x2b, 0x36, 0xb1, 0x09, 0x74, 0xdb, 0x8e, 0xb0, 0x77, 0x85, 0xf0, 0x5d, 0x13, 0x8f, + 0x47, 0x3c, 0xba, 0x40, 0xbc, 0xc1, 0x15, 0xb3, 0xc5, 0xf8, 0xc9, 0x05, 0xe3, 0x5a, 0x48, 0xe9, + 0x5a, 0xc6, 0x0d, 0x6b, 0xf1, 0xdf, 0x35, 0xe3, 0xd7, 0xd1, 0xd6, 0x9c, 0x16, 0x92, 0x51, 0x03, + 0xd5, 0x84, 0x32, 0x56, 0x71, 0xad, 0xbb, 0xeb, 0x7d, 0x34, 0xd8, 0x18, 0x3d, 0xf8, 0xf9, 0x7d, + 0x78, 0x3f, 0x78, 0x7d, 0x68, 0x7a, 0x9e, 0xf9, 0x96, 0xb7, 0xa6, 0x92, 0x4a, 0x8c, 0xef, 0xce, + 0x2f, 0x9d, 0x8f, 0x5e, 0x9d, 0x2c, 0x13, 0x74, 0xba, 0x4c, 0xd0, 0x9f, 0x65, 0x82, 0x8e, 0x56, + 0x49, 0xeb, 0x74, 0x95, 0xb4, 0x7e, 0xad, 0x92, 0xd6, 0xc7, 0xa1, 0xb7, 0xd2, 0x6c, 0x8a, 0x25, + 0x90, 0x4f, 0xd7, 0x3f, 0x6a, 0x97, 0x71, 0xd6, 0x71, 0x11, 0x3c, 0xfe, 0x17, 0x00, 0x00, 0xff, + 0xff, 0x94, 0x7c, 0x97, 0x45, 0x04, 0x03, 0x00, 0x00, } func (m *Period) Marshal() (dAtA []byte, err error) { @@ -262,7 +272,7 @@ func (m *UnbondingEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.ValidatorAddress) i = encodeVarintLockup(dAtA, i, uint64(len(m.ValidatorAddress))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } { size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) @@ -273,7 +283,7 @@ func (m *UnbondingEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintLockup(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) if err3 != nil { return 0, err3 @@ -281,7 +291,12 @@ func (m *UnbondingEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n3 i = encodeVarintLockup(dAtA, i, uint64(n3)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + if m.Id != 0 { + i = encodeVarintLockup(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -319,6 +334,9 @@ func (m *UnbondingEntry) Size() (n int) { } var l int _ = l + if m.Id != 0 { + n += 1 + sovLockup(uint64(m.Id)) + } l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime) n += 1 + l + sovLockup(uint64(l)) l = m.Amount.Size() @@ -483,6 +501,25 @@ func (m *UnbondingEntry) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLockup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) } @@ -515,7 +552,7 @@ func (m *UnbondingEntry) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -548,7 +585,7 @@ func (m *UnbondingEntry) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) } diff --git a/x/accounts/defaults/lockup/types/query.pb.go b/x/accounts/defaults/lockup/types/query.pb.go index ecd984b438f5..3bf288e7b246 100644 --- a/x/accounts/defaults/lockup/types/query.pb.go +++ b/x/accounts/defaults/lockup/types/query.pb.go @@ -175,6 +175,89 @@ func (m *QueryLockupAccountInfoResponse) GetOwner() string { return "" } +// QueryUnbondingEntriesRequest is used to query the lockup account unbonding entries. +type QueryUnbondingEntriesRequest struct { +} + +func (m *QueryUnbondingEntriesRequest) Reset() { *m = QueryUnbondingEntriesRequest{} } +func (m *QueryUnbondingEntriesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryUnbondingEntriesRequest) ProtoMessage() {} +func (*QueryUnbondingEntriesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f06fad50e16c8e9b, []int{2} +} +func (m *QueryUnbondingEntriesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUnbondingEntriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUnbondingEntriesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryUnbondingEntriesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUnbondingEntriesRequest.Merge(m, src) +} +func (m *QueryUnbondingEntriesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryUnbondingEntriesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUnbondingEntriesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUnbondingEntriesRequest proto.InternalMessageInfo + +// QueryUnbondingEntriesResponse returns the lockup account unbonding entries. +type QueryUnbondingEntriesResponse struct { + // UnbondingEntry defines the list of unbonding entries. + UnbondingEntries []*UnbondingEntry `protobuf:"bytes,1,rep,name=unbonding_entries,json=unbondingEntries,proto3" json:"unbonding_entries,omitempty"` +} + +func (m *QueryUnbondingEntriesResponse) Reset() { *m = QueryUnbondingEntriesResponse{} } +func (m *QueryUnbondingEntriesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryUnbondingEntriesResponse) ProtoMessage() {} +func (*QueryUnbondingEntriesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f06fad50e16c8e9b, []int{3} +} +func (m *QueryUnbondingEntriesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryUnbondingEntriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryUnbondingEntriesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryUnbondingEntriesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryUnbondingEntriesResponse.Merge(m, src) +} +func (m *QueryUnbondingEntriesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryUnbondingEntriesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryUnbondingEntriesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryUnbondingEntriesResponse proto.InternalMessageInfo + +func (m *QueryUnbondingEntriesResponse) GetUnbondingEntries() []*UnbondingEntry { + if m != nil { + return m.UnbondingEntries + } + return nil +} + // QueryLockingPeriodsRequest is used to query the periodic lockup account locking periods. type QueryLockingPeriodsRequest struct { } @@ -183,7 +266,7 @@ func (m *QueryLockingPeriodsRequest) Reset() { *m = QueryLockingPeriodsR func (m *QueryLockingPeriodsRequest) String() string { return proto.CompactTextString(m) } func (*QueryLockingPeriodsRequest) ProtoMessage() {} func (*QueryLockingPeriodsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f06fad50e16c8e9b, []int{2} + return fileDescriptor_f06fad50e16c8e9b, []int{4} } func (m *QueryLockingPeriodsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -222,7 +305,7 @@ func (m *QueryLockingPeriodsResponse) Reset() { *m = QueryLockingPeriods func (m *QueryLockingPeriodsResponse) String() string { return proto.CompactTextString(m) } func (*QueryLockingPeriodsResponse) ProtoMessage() {} func (*QueryLockingPeriodsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f06fad50e16c8e9b, []int{3} + return fileDescriptor_f06fad50e16c8e9b, []int{5} } func (m *QueryLockingPeriodsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -261,6 +344,8 @@ func (m *QueryLockingPeriodsResponse) GetLockingPeriods() []*Period { func init() { proto.RegisterType((*QueryLockupAccountInfoRequest)(nil), "cosmos.accounts.defaults.lockup.QueryLockupAccountInfoRequest") proto.RegisterType((*QueryLockupAccountInfoResponse)(nil), "cosmos.accounts.defaults.lockup.QueryLockupAccountInfoResponse") + proto.RegisterType((*QueryUnbondingEntriesRequest)(nil), "cosmos.accounts.defaults.lockup.QueryUnbondingEntriesRequest") + proto.RegisterType((*QueryUnbondingEntriesResponse)(nil), "cosmos.accounts.defaults.lockup.QueryUnbondingEntriesResponse") proto.RegisterType((*QueryLockingPeriodsRequest)(nil), "cosmos.accounts.defaults.lockup.QueryLockingPeriodsRequest") proto.RegisterType((*QueryLockingPeriodsResponse)(nil), "cosmos.accounts.defaults.lockup.QueryLockingPeriodsResponse") } @@ -270,39 +355,42 @@ func init() { } var fileDescriptor_f06fad50e16c8e9b = []byte{ - // 507 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x94, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xc7, 0x63, 0xda, 0xf4, 0x63, 0x03, 0x6d, 0x89, 0x7a, 0x30, 0x01, 0xec, 0x28, 0x17, 0x22, - 0x41, 0x77, 0x69, 0x39, 0x72, 0x40, 0x04, 0x09, 0x84, 0xd4, 0x43, 0xb1, 0x38, 0x71, 0x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xe2, 0xfd, 0x73, 0x91, 0x1d, - 0x41, 0xc9, 0x31, 0x95, 0xb6, 0x3d, 0x90, 0x3c, 0xfe, 0xe7, 0xa9, 0x69, 0x8d, 0x23, 0xb2, 0x6d, - 0x1e, 0x49, 0x58, 0xe8, 0x23, 0xd3, 0x19, 0xcf, 0xe8, 0x2d, 0xdf, 0x03, 0xd5, 0xa1, 0x82, 0xad, - 0xfc, 0x5a, 0xe4, 0xd1, 0x87, 0x8b, 0x99, 0xe7, 0x5c, 0xce, 0x3c, 0xe7, 0xd7, 0xcc, 0x73, 0xce, - 0xe7, 0x5e, 0xeb, 0x72, 0xee, 0xb5, 0x7e, 0xcc, 0xbd, 0xd6, 0x97, 0x3d, 0x1d, 0x51, 0xa6, 0x13, - 0xca, 0x91, 0x9d, 0xde, 0xfc, 0xaf, 0x34, 0x57, 0x10, 0xaf, 0x35, 0xa2, 0xbf, 0xfa, 0x13, 0x00, - 0x00, 0xff, 0xff, 0x8d, 0xa3, 0x8b, 0xf7, 0xd5, 0x04, 0x00, 0x00, + // 556 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0x69, 0xd3, 0x9f, 0x0d, 0xb4, 0x69, 0xd4, 0x43, 0x08, 0xc5, 0x8e, 0x72, 0x21, 0x12, + 0x74, 0x97, 0x96, 0x23, 0x07, 0x44, 0x10, 0x20, 0xa4, 0x1e, 0x8a, 0x05, 0x17, 0x84, 0x64, 0xf9, + 0x67, 0x62, 0x56, 0x71, 0x76, 0x52, 0xef, 0xba, 0x34, 0x07, 0xde, 0xa1, 0xcf, 0xc1, 0x93, 0xf4, + 0xd8, 0x23, 0x27, 0x8a, 0x92, 0xf7, 0x40, 0xc8, 0xde, 0x75, 0x50, 0x80, 0x2a, 0x1c, 0xd2, 0x93, + 0xbd, 0x9e, 0x99, 0xef, 0xf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09, 0x3a, 0x87, 0x3a, 0x76, 0xeb, 0xd9, 0x1f, 0x2c, 0x9d, 0x3d, 0xd2, 0x9a, + 0xad, 0x27, 0x17, 0xf1, 0x31, 0xa4, 0x1c, 0xa3, 0x99, 0x38, 0x24, 0xf7, 0xfe, 0x19, 0x35, 0xd2, + 0x8e, 0xc9, 0xb6, 0x99, 0x61, 0x6f, 0xa4, 0x43, 0x46, 0xd8, 0x83, 0x85, 0xc2, 0x34, 0x94, 0xbb, + 0x95, 0xcc, 0x21, 0xf7, 0x5e, 0x5f, 0x4c, 0x6c, 0xeb, 0x72, 0x62, 0x5b, 0x3f, 0x26, 0xb6, 0x75, + 0x3e, 0xb5, 0x2b, 0x97, 0x53, 0xbb, 0xf2, 0x6d, 0x6a, 0x57, 0x3e, 0xec, 0x6b, 0x44, 0x19, 0x0d, + 0x28, 0x47, 0x76, 0x76, 0xfd, 0xb5, 0x57, 0x38, 0x14, 0xac, 0x15, 0x33, 0xf9, 0xe4, 0x57, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xc7, 0x0f, 0x26, 0xbc, 0x74, 0x05, 0x00, 0x00, } func (m *QueryLockupAccountInfoRequest) Marshal() (dAtA []byte, err error) { @@ -448,6 +536,66 @@ func (m *QueryLockupAccountInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QueryUnbondingEntriesRequest) 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 *QueryUnbondingEntriesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUnbondingEntriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryUnbondingEntriesResponse) 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 *QueryUnbondingEntriesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryUnbondingEntriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UnbondingEntries) > 0 { + for iNdEx := len(m.UnbondingEntries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.UnbondingEntries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QueryLockingPeriodsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -579,6 +727,30 @@ func (m *QueryLockupAccountInfoResponse) Size() (n int) { return n } +func (m *QueryUnbondingEntriesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryUnbondingEntriesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.UnbondingEntries) > 0 { + for _, e := range m.UnbondingEntries { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *QueryLockingPeriodsRequest) Size() (n int) { if m == nil { return 0 @@ -983,6 +1155,140 @@ func (m *QueryLockupAccountInfoResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryUnbondingEntriesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryUnbondingEntriesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryUnbondingEntriesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryUnbondingEntriesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryUnbondingEntriesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryUnbondingEntriesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingEntries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UnbondingEntries = append(m.UnbondingEntries, &UnbondingEntry{}) + if err := m.UnbondingEntries[len(m.UnbondingEntries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryLockingPeriodsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/accounts/defaults/lockup/types/tx.pb.go b/x/accounts/defaults/lockup/types/tx.pb.go index 6a4383e31c77..34fc625bc03b 100644 --- a/x/accounts/defaults/lockup/types/tx.pb.go +++ b/x/accounts/defaults/lockup/types/tx.pb.go @@ -397,6 +397,45 @@ func (m *MsgSend) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSend proto.InternalMessageInfo +// MsgTrackUndelegation defines a message that enable lockup account to update delegation tracking +type MsgTrackUndelegation struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *MsgTrackUndelegation) Reset() { *m = MsgTrackUndelegation{} } +func (m *MsgTrackUndelegation) String() string { return proto.CompactTextString(m) } +func (*MsgTrackUndelegation) ProtoMessage() {} +func (*MsgTrackUndelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_e5f39108a4d67f92, []int{8} +} +func (m *MsgTrackUndelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTrackUndelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTrackUndelegation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTrackUndelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTrackUndelegation.Merge(m, src) +} +func (m *MsgTrackUndelegation) XXX_Size() int { + return m.Size() +} +func (m *MsgTrackUndelegation) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTrackUndelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTrackUndelegation proto.InternalMessageInfo + // MsgExecuteMessagesResponse defines the response for lockup execute operations type MsgExecuteMessagesResponse struct { Responses []*any.Any `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` @@ -406,7 +445,7 @@ func (m *MsgExecuteMessagesResponse) Reset() { *m = MsgExecuteMessagesRe func (m *MsgExecuteMessagesResponse) String() string { return proto.CompactTextString(m) } func (*MsgExecuteMessagesResponse) ProtoMessage() {} func (*MsgExecuteMessagesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e5f39108a4d67f92, []int{8} + return fileDescriptor_e5f39108a4d67f92, []int{9} } func (m *MsgExecuteMessagesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -454,7 +493,7 @@ func (m *MsgWithdraw) Reset() { *m = MsgWithdraw{} } func (m *MsgWithdraw) String() string { return proto.CompactTextString(m) } func (*MsgWithdraw) ProtoMessage() {} func (*MsgWithdraw) Descriptor() ([]byte, []int) { - return fileDescriptor_e5f39108a4d67f92, []int{9} + return fileDescriptor_e5f39108a4d67f92, []int{10} } func (m *MsgWithdraw) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -493,7 +532,7 @@ func (m *MsgWithdrawResponse) Reset() { *m = MsgWithdrawResponse{} } func (m *MsgWithdrawResponse) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawResponse) ProtoMessage() {} func (*MsgWithdrawResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e5f39108a4d67f92, []int{10} + return fileDescriptor_e5f39108a4d67f92, []int{11} } func (m *MsgWithdrawResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -545,6 +584,7 @@ func init() { proto.RegisterType((*MsgUndelegate)(nil), "cosmos.accounts.defaults.lockup.MsgUndelegate") proto.RegisterType((*MsgWithdrawReward)(nil), "cosmos.accounts.defaults.lockup.MsgWithdrawReward") proto.RegisterType((*MsgSend)(nil), "cosmos.accounts.defaults.lockup.MsgSend") + proto.RegisterType((*MsgTrackUndelegation)(nil), "cosmos.accounts.defaults.lockup.MsgTrackUndelegation") proto.RegisterType((*MsgExecuteMessagesResponse)(nil), "cosmos.accounts.defaults.lockup.MsgExecuteMessagesResponse") proto.RegisterType((*MsgWithdraw)(nil), "cosmos.accounts.defaults.lockup.MsgWithdraw") proto.RegisterType((*MsgWithdrawResponse)(nil), "cosmos.accounts.defaults.lockup.MsgWithdrawResponse") @@ -555,58 +595,60 @@ func init() { } var fileDescriptor_e5f39108a4d67f92 = []byte{ - // 816 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0xcf, 0x4f, 0x1b, 0x47, - 0x14, 0xf6, 0xda, 0xaa, 0xc1, 0x43, 0x81, 0xb2, 0x58, 0xc5, 0x58, 0x65, 0x97, 0x5a, 0x42, 0x58, - 0x56, 0xbd, 0x5b, 0x68, 0xa5, 0x56, 0x56, 0x2f, 0xb8, 0xf4, 0x97, 0x54, 0x57, 0xc8, 0xf4, 0x87, - 0xd4, 0x1c, 0xac, 0xf1, 0xee, 0x30, 0xac, 0xf0, 0xce, 0x58, 0x3b, 0x63, 0x1b, 0xdf, 0xa2, 0x28, - 0x87, 0x88, 0x13, 0xe7, 0x9c, 0x38, 0x45, 0x11, 0x27, 0x47, 0xe2, 0x8f, 0xe0, 0x88, 0x38, 0x71, - 0x0a, 0x91, 0x89, 0x64, 0xfe, 0x8c, 0x68, 0x77, 0x66, 0x89, 0x0d, 0x04, 0x1c, 0x1f, 0x12, 0x29, - 0x17, 0xef, 0x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d, 0x80, 0x74, 0x89, 0xe1, 0x5f, 0x76, 0x91, 0xd5, 0xe0, 0xa8, - 0x84, 0x18, 0x83, 0x18, 0xb1, 0x70, 0x3a, 0xd5, 0x55, 0x90, 0xf0, 0xe4, 0x9a, 0xa5, 0x94, 0x80, - 0x70, 0xf2, 0xc6, 0xcb, 0x69, 0x8d, 0xb4, 0xcb, 0x6f, 0x61, 0x99, 0x17, 0x62, 0xa2, 0xc3, 0x2e, - 0x50, 0x7f, 0x04, 0xa0, 0x25, 0xd7, 0x43, 0x08, 0xdc, 0x87, 0x1d, 0x5d, 0xe4, 0x2f, 0x41, 0xdc, - 0x46, 0x84, 0xba, 0xe2, 0x0d, 0x98, 0x28, 0xcb, 0x5d, 0x61, 0xae, 0x5f, 0x81, 0xbe, 0x4c, 0x99, - 0x33, 0x05, 0xcc, 0x0e, 0x74, 0xae, 0xac, 0xff, 0x7b, 0x30, 0xee, 0x21, 0x0b, 0x39, 0xcd, 0x21, - 0x98, 0x5f, 0x21, 0xd5, 0x3d, 0x05, 0x4c, 0x0b, 0xcd, 0x2b, 0xf2, 0xcc, 0x4e, 0x45, 0x3f, 0xd4, - 0x6d, 0x4f, 0x89, 0xcc, 0x65, 0x99, 0xb8, 0xf8, 0xdb, 0x71, 0x57, 0x53, 0x4e, 0xba, 0x9a, 0xf2, - 0xaa, 0xab, 0x29, 0xfb, 0x17, 0x5a, 0xe4, 0xe4, 0x42, 0x8b, 0x9c, 0x5d, 0x68, 0x91, 0xff, 0xf3, - 0x22, 0x2e, 0xb3, 0x77, 0x0c, 0x87, 0x9a, 0xbb, 0x77, 0xfc, 0x53, 0xf2, 0x93, 0x56, 0xe3, 0xc1, - 0x85, 0x7f, 0xf7, 0x26, 0x00, 0x00, 0xff, 0xff, 0x4e, 0xb6, 0xac, 0x3d, 0x59, 0x09, 0x00, 0x00, + // 845 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0xcf, 0x8f, 0x1b, 0x35, + 0x14, 0xce, 0x24, 0x90, 0x36, 0x5e, 0xba, 0x65, 0xa7, 0x11, 0x4d, 0x23, 0x3a, 0xb3, 0x44, 0xaa, + 0x1a, 0x45, 0x64, 0x86, 0x5d, 0x90, 0x40, 0x11, 0x97, 0x0d, 0xe5, 0x97, 0x44, 0x50, 0x35, 0x2d, + 0x20, 0xc1, 0x21, 0x72, 0xc6, 0xae, 0x6b, 0x25, 0x63, 0x47, 0x63, 0x27, 0xd9, 0xdc, 0x10, 0xe2, + 0x80, 0x7a, 0xea, 0x99, 0xd3, 0x9e, 0x10, 0xea, 0x29, 0x48, 0xfd, 0x23, 0x7a, 0xac, 0x7a, 0xea, + 0x89, 0xa2, 0x2c, 0x52, 0xf6, 0xcf, 0x40, 0x1e, 0x7b, 0x96, 0x64, 0x37, 0xec, 0x86, 0x1c, 0x40, + 0xea, 0x25, 0x33, 0xf6, 0xfb, 0xde, 0x7b, 0xdf, 0xfb, 0xde, 0xb3, 0x27, 0xa0, 0x1a, 0x72, 0x11, + 0x71, 0xe1, 0xc3, 0x30, 0xe4, 0x03, 0x26, 0x85, 0x8f, 0xf0, 0x3d, 0x38, 0xe8, 0x49, 0xe1, 0xf7, + 0x78, 0xd8, 0x1d, 0xf4, 0x7d, 0xb9, 0xef, 0xf5, 0x63, 0x2e, 0xb9, 0xed, 0x6a, 0xa4, 0x97, 0x22, + 0xbd, 0x14, 0xe9, 0x69, 0x64, 0x79, 0x0b, 0x46, 0x94, 0x71, 0x3f, 0xf9, 0xd5, 0x3e, 0x65, 0xc7, + 0x44, 0xef, 0x40, 0x81, 0xfd, 0xe1, 0x4e, 0x07, 0x4b, 0xb8, 0xe3, 0x87, 0x9c, 0x32, 0x63, 0x7f, + 0xfb, 0xbc, 0xec, 0xfa, 0x61, 0xd0, 0x57, 0x0d, 0x3a, 0x12, 0xc4, 0x1f, 0xee, 0xa8, 0x87, 0x31, + 0x5c, 0xd3, 0x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0x5c, 0x9d, 0x57, 0x60, 0x2e, 0x53, 0xe5, 0xb9, 0x05, 0xae, 0x2c, + 0x1c, 0x14, 0x53, 0xff, 0x7b, 0xe0, 0x62, 0x8c, 0x43, 0x4c, 0x87, 0x2b, 0x30, 0x3f, 0x46, 0xda, + 0x0f, 0x2c, 0x70, 0x59, 0xb7, 0xb8, 0x6d, 0xf6, 0x54, 0x1b, 0xfe, 0xa3, 0xe1, 0xda, 0xd4, 0x99, + 0x03, 0x93, 0xb8, 0xf9, 0xe9, 0x93, 0xa9, 0x63, 0x3d, 0x9d, 0x3a, 0xd6, 0x1f, 0x53, 0xc7, 0x7a, + 0x78, 0xe8, 0x64, 0x9e, 0x1e, 0x3a, 0x99, 0xe7, 0x87, 0x4e, 0xe6, 0xdb, 0xba, 0x8e, 0x2b, 0x50, + 0xd7, 0xa3, 0xdc, 0xdf, 0x3f, 0xe3, 0x8f, 0x99, 0x4a, 0xda, 0xc9, 0x27, 0x0d, 0x7f, 0xf7, 0xaf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xf2, 0xa8, 0x4e, 0xba, 0xc8, 0x09, 0x00, 0x00, } func (this *MsgInitLockupAccount) Equal(that interface{}) bool { @@ -965,6 +1007,41 @@ func (m *MsgSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTrackUndelegation) 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 *MsgTrackUndelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTrackUndelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *MsgExecuteMessagesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1237,6 +1314,22 @@ func (m *MsgSend) Size() (n int) { return n } +func (m *MsgTrackUndelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + return n +} + func (m *MsgExecuteMessagesResponse) Size() (n int) { if m == nil { return 0 @@ -2253,6 +2346,107 @@ func (m *MsgSend) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTrackUndelegation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTrackUndelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTrackUndelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgExecuteMessagesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto index 459a8e857075..88b3ffb7fed4 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto @@ -25,11 +25,13 @@ message Period { // UnbondingEntry defines an entry tracking the lockup account unbonding operation. message UnbondingEntry { + // entry id + uint64 id = 1; // end time of entry - google.protobuf.Timestamp end_time = 1 + google.protobuf.Timestamp end_time = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // unbond amount - cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // validator address - string validator_address = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string validator_address = 4 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/query.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/query.proto index 625163a22bca..c27fed30910e 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/query.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/query.proto @@ -43,6 +43,15 @@ message QueryLockupAccountInfoResponse { string owner = 8; } +// QueryUnbondingEntriesRequest is used to query the lockup account unbonding entries. +message QueryUnbondingEntriesRequest {} + +// QueryUnbondingEntriesResponse returns the lockup account unbonding entries. +message QueryUnbondingEntriesResponse { + // UnbondingEntry defines the list of unbonding entries. + repeated UnbondingEntry unbonding_entries = 1; +} + // QueryLockingPeriodsRequest is used to query the periodic lockup account locking periods. message QueryLockingPeriodsRequest {} diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/tx.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/tx.proto index c13cec55b16f..d25ebaf94e5d 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/tx.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/tx.proto @@ -107,6 +107,17 @@ message MsgSend { ]; } +// MsgTrackUndelegation defines a message that enable lockup account to update delegation tracking +message MsgTrackUndelegation { + option (cosmos.msg.v1.signer) = "sender"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + uint64 id = 2; +} + // MsgExecuteMessagesResponse defines the response for lockup execute operations message MsgExecuteMessagesResponse { repeated google.protobuf.Any responses = 1; From f157e177b46b6363091b1a71ebef2afc2e3f3729 Mon Sep 17 00:00:00 2001 From: son trinh Date: Wed, 23 Oct 2024 14:11:06 +0700 Subject: [PATCH 08/24] Update x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto Co-authored-by: Alexander Peters --- x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto index 88b3ffb7fed4..8fa5eb991456 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/lockup.proto @@ -25,7 +25,7 @@ message Period { // UnbondingEntry defines an entry tracking the lockup account unbonding operation. message UnbondingEntry { - // entry id + // ID of entry uint64 id = 1; // end time of entry google.protobuf.Timestamp end_time = 2 From 9f25810db02ce11ccaf3a53e827188c0ef5d54f9 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 28 Oct 2024 10:05:56 +0700 Subject: [PATCH 09/24] minor --- x/accounts/defaults/lockup/continuous_locking_account.go | 2 +- x/accounts/defaults/lockup/delayed_locking_account.go | 2 +- x/accounts/defaults/lockup/lockup.go | 4 ++++ x/accounts/defaults/lockup/periodic_locking_account.go | 2 +- x/accounts/defaults/lockup/permanent_locking_account.go | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/x/accounts/defaults/lockup/continuous_locking_account.go b/x/accounts/defaults/lockup/continuous_locking_account.go index f924190068db..2c674b88c234 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account.go +++ b/x/accounts/defaults/lockup/continuous_locking_account.go @@ -200,5 +200,5 @@ func (cva ContinuousLockingAccount) RegisterExecuteHandlers(builder *accountstd. func (cva ContinuousLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, cva.QueryLockupAccountInfo) - accountstd.RegisterQueryHandler(builder, cva.QueryUnbondingEntries) + cva.BaseLockup.RegisterQueryHandlers(builder) } diff --git a/x/accounts/defaults/lockup/delayed_locking_account.go b/x/accounts/defaults/lockup/delayed_locking_account.go index d13d49516043..aea4b7ef004e 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account.go +++ b/x/accounts/defaults/lockup/delayed_locking_account.go @@ -149,5 +149,5 @@ func (dva DelayedLockingAccount) RegisterExecuteHandlers(builder *accountstd.Exe func (dva DelayedLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, dva.QueryVestingAccountInfo) - accountstd.RegisterQueryHandler(builder, dva.QueryUnbondingEntries) + dva.BaseLockup.RegisterQueryHandlers(builder) } diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index da9807013748..5f89779e3450 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -750,3 +750,7 @@ func (bva BaseLockup) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder accountstd.RegisterExecuteHandler(builder, bva.WithdrawReward) accountstd.RegisterExecuteHandler(builder, bva.TrackUndelegationEntry) } + +func (bva BaseLockup) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { + accountstd.RegisterQueryHandler(builder, bva.QueryUnbondingEntries) +} diff --git a/x/accounts/defaults/lockup/periodic_locking_account.go b/x/accounts/defaults/lockup/periodic_locking_account.go index f3bf25eb0e7a..2487d88c7c61 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account.go +++ b/x/accounts/defaults/lockup/periodic_locking_account.go @@ -343,5 +343,5 @@ func (pva PeriodicLockingAccount) RegisterExecuteHandlers(builder *accountstd.Ex func (pva PeriodicLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, pva.QueryLockupAccountInfo) accountstd.RegisterQueryHandler(builder, pva.QueryLockingPeriods) - accountstd.RegisterQueryHandler(builder, pva.QueryUnbondingEntries) + pva.BaseLockup.RegisterQueryHandlers(builder) } diff --git a/x/accounts/defaults/lockup/permanent_locking_account.go b/x/accounts/defaults/lockup/permanent_locking_account.go index 8ba8e3b50254..8cab4806743c 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account.go +++ b/x/accounts/defaults/lockup/permanent_locking_account.go @@ -108,5 +108,5 @@ func (plva PermanentLockingAccount) RegisterExecuteHandlers(builder *accountstd. func (plva PermanentLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, plva.QueryLockupAccountInfo) - accountstd.RegisterQueryHandler(builder, plva.QueryUnbondingEntries) + plva.BaseLockup.RegisterQueryHandlers(builder) } From 22d24c1d182e98ad0f1a90d0d4ebc77a1dd9f959 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 28 Oct 2024 10:11:58 +0700 Subject: [PATCH 10/24] fix tests --- tests/integration/accounts/lockup/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/accounts/lockup/utils.go b/tests/integration/accounts/lockup/utils.go index 1fc61f5552a5..2c46c93909b8 100644 --- a/tests/integration/accounts/lockup/utils.go +++ b/tests/integration/accounts/lockup/utils.go @@ -72,7 +72,7 @@ func (s *IntegrationTestSuite) queryLockupAccInfo(ctx sdk.Context, app *simapp.S return lockupAccountInfoResponse } -func (s *E2ETestSuite) queryUnbondingEntries(ctx sdk.Context, app *simapp.SimApp, accAddr []byte) *types.QueryUnbondingEntriesResponse { +func (s *IntegrationTestSuite) queryUnbondingEntries(ctx sdk.Context, app *simapp.SimApp, accAddr []byte) *types.QueryUnbondingEntriesResponse { req := &types.QueryUnbondingEntriesRequest{} resp, err := s.queryAcc(ctx, req, app, accAddr) require.NoError(s.T(), err) @@ -84,7 +84,7 @@ func (s *E2ETestSuite) queryUnbondingEntries(ctx sdk.Context, app *simapp.SimApp return unbondingEntriesResponse } -func (s *E2ETestSuite) setupStakingParams(ctx sdk.Context, app *simapp.SimApp) { +func (s *IntegrationTestSuite) setupStakingParams(ctx sdk.Context, app *simapp.SimApp) { params, err := app.StakingKeeper.Params.Get(ctx) require.NoError(s.T(), err) From c990e46f5e734dd053225e9c2e5125539df143a7 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 28 Oct 2024 12:12:55 +0700 Subject: [PATCH 11/24] minor --- .../defaults/lockup/v1/lockup.pulsar.go | 2 +- .../accounts/defaults/lockup/v1/tx.pulsar.go | 280 +++++++++--------- .../lockup/continuous_locking_account_test.go | 2 +- .../lockup/delayed_locking_account_test.go | 2 +- x/accounts/defaults/lockup/lockup.go | 6 +- .../lockup/periodic_locking_account_test.go | 2 +- .../lockup/permanent_locking_account.go | 2 +- x/accounts/defaults/lockup/v1/lockup.pb.go | 2 +- x/accounts/defaults/lockup/v1/tx.pb.go | 154 +++++----- .../accounts/defaults/lockup/v1/tx.proto | 4 +- 10 files changed, 228 insertions(+), 228 deletions(-) diff --git a/api/cosmos/accounts/defaults/lockup/v1/lockup.pulsar.go b/api/cosmos/accounts/defaults/lockup/v1/lockup.pulsar.go index ceea1c24b757..d1c5b687e945 100644 --- a/api/cosmos/accounts/defaults/lockup/v1/lockup.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/v1/lockup.pulsar.go @@ -1281,7 +1281,7 @@ type UnbondingEntry struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // entry id + // ID of entry Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // end time of entry EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` diff --git a/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go b/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go index 106a4d8ba82c..328bc89776f0 100644 --- a/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go @@ -4179,27 +4179,27 @@ func (x *fastReflection_MsgSend) ProtoMethods() *protoiface.Methods { } var ( - md_MsgTrackUndelegation protoreflect.MessageDescriptor - fd_MsgTrackUndelegation_sender protoreflect.FieldDescriptor - fd_MsgTrackUndelegation_id protoreflect.FieldDescriptor + md_MsgUpdateUndelegationEntry protoreflect.MessageDescriptor + fd_MsgUpdateUndelegationEntry_sender protoreflect.FieldDescriptor + fd_MsgUpdateUndelegationEntry_id protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() - md_MsgTrackUndelegation = File_cosmos_accounts_defaults_lockup_v1_tx_proto.Messages().ByName("MsgTrackUndelegation") - fd_MsgTrackUndelegation_sender = md_MsgTrackUndelegation.Fields().ByName("sender") - fd_MsgTrackUndelegation_id = md_MsgTrackUndelegation.Fields().ByName("id") + md_MsgUpdateUndelegationEntry = File_cosmos_accounts_defaults_lockup_v1_tx_proto.Messages().ByName("MsgUpdateUndelegationEntry") + fd_MsgUpdateUndelegationEntry_sender = md_MsgUpdateUndelegationEntry.Fields().ByName("sender") + fd_MsgUpdateUndelegationEntry_id = md_MsgUpdateUndelegationEntry.Fields().ByName("id") } -var _ protoreflect.Message = (*fastReflection_MsgTrackUndelegation)(nil) +var _ protoreflect.Message = (*fastReflection_MsgUpdateUndelegationEntry)(nil) -type fastReflection_MsgTrackUndelegation MsgTrackUndelegation +type fastReflection_MsgUpdateUndelegationEntry MsgUpdateUndelegationEntry -func (x *MsgTrackUndelegation) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgTrackUndelegation)(x) +func (x *MsgUpdateUndelegationEntry) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgUpdateUndelegationEntry)(x) } -func (x *MsgTrackUndelegation) slowProtoReflect() protoreflect.Message { +func (x *MsgUpdateUndelegationEntry) slowProtoReflect() protoreflect.Message { mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4211,43 +4211,43 @@ func (x *MsgTrackUndelegation) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_MsgTrackUndelegation_messageType fastReflection_MsgTrackUndelegation_messageType -var _ protoreflect.MessageType = fastReflection_MsgTrackUndelegation_messageType{} +var _fastReflection_MsgUpdateUndelegationEntry_messageType fastReflection_MsgUpdateUndelegationEntry_messageType +var _ protoreflect.MessageType = fastReflection_MsgUpdateUndelegationEntry_messageType{} -type fastReflection_MsgTrackUndelegation_messageType struct{} +type fastReflection_MsgUpdateUndelegationEntry_messageType struct{} -func (x fastReflection_MsgTrackUndelegation_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgTrackUndelegation)(nil) +func (x fastReflection_MsgUpdateUndelegationEntry_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgUpdateUndelegationEntry)(nil) } -func (x fastReflection_MsgTrackUndelegation_messageType) New() protoreflect.Message { - return new(fastReflection_MsgTrackUndelegation) +func (x fastReflection_MsgUpdateUndelegationEntry_messageType) New() protoreflect.Message { + return new(fastReflection_MsgUpdateUndelegationEntry) } -func (x fastReflection_MsgTrackUndelegation_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgTrackUndelegation +func (x fastReflection_MsgUpdateUndelegationEntry_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateUndelegationEntry } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_MsgTrackUndelegation) Descriptor() protoreflect.MessageDescriptor { - return md_MsgTrackUndelegation +func (x *fastReflection_MsgUpdateUndelegationEntry) Descriptor() protoreflect.MessageDescriptor { + return md_MsgUpdateUndelegationEntry } // 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_MsgTrackUndelegation) Type() protoreflect.MessageType { - return _fastReflection_MsgTrackUndelegation_messageType +func (x *fastReflection_MsgUpdateUndelegationEntry) Type() protoreflect.MessageType { + return _fastReflection_MsgUpdateUndelegationEntry_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgTrackUndelegation) New() protoreflect.Message { - return new(fastReflection_MsgTrackUndelegation) +func (x *fastReflection_MsgUpdateUndelegationEntry) New() protoreflect.Message { + return new(fastReflection_MsgUpdateUndelegationEntry) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgTrackUndelegation) Interface() protoreflect.ProtoMessage { - return (*MsgTrackUndelegation)(x) +func (x *fastReflection_MsgUpdateUndelegationEntry) Interface() protoreflect.ProtoMessage { + return (*MsgUpdateUndelegationEntry)(x) } // Range iterates over every populated field in an undefined order, @@ -4255,16 +4255,16 @@ func (x *fastReflection_MsgTrackUndelegation) Interface() protoreflect.ProtoMess // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_MsgTrackUndelegation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_MsgUpdateUndelegationEntry) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Sender != "" { value := protoreflect.ValueOfString(x.Sender) - if !f(fd_MsgTrackUndelegation_sender, value) { + if !f(fd_MsgUpdateUndelegationEntry_sender, value) { return } } if x.Id != uint64(0) { value := protoreflect.ValueOfUint64(x.Id) - if !f(fd_MsgTrackUndelegation_id, value) { + if !f(fd_MsgUpdateUndelegationEntry_id, value) { return } } @@ -4281,17 +4281,17 @@ func (x *fastReflection_MsgTrackUndelegation) Range(f func(protoreflect.FieldDes // 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_MsgTrackUndelegation) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_MsgUpdateUndelegationEntry) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.sender": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": return x.Sender != "" - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.id": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": return x.Id != uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry does not contain field %s", fd.FullName())) } } @@ -4301,17 +4301,17 @@ func (x *fastReflection_MsgTrackUndelegation) Has(fd protoreflect.FieldDescripto // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTrackUndelegation) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_MsgUpdateUndelegationEntry) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.sender": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": x.Sender = "" - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.id": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": x.Id = uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry does not contain field %s", fd.FullName())) } } @@ -4321,19 +4321,19 @@ func (x *fastReflection_MsgTrackUndelegation) Clear(fd protoreflect.FieldDescrip // 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_MsgTrackUndelegation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateUndelegationEntry) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.sender": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": value := x.Sender return protoreflect.ValueOfString(value) - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.id": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": value := x.Id return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry does not contain field %s", descriptor.FullName())) } } @@ -4347,17 +4347,17 @@ func (x *fastReflection_MsgTrackUndelegation) Get(descriptor protoreflect.FieldD // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTrackUndelegation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_MsgUpdateUndelegationEntry) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.sender": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": x.Sender = value.Interface().(string) - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.id": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": x.Id = value.Uint() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry does not contain field %s", fd.FullName())) } } @@ -4371,44 +4371,44 @@ func (x *fastReflection_MsgTrackUndelegation) Set(fd protoreflect.FieldDescripto // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTrackUndelegation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateUndelegationEntry) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.sender": - panic(fmt.Errorf("field sender of message cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation is not mutable")) - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.id": - panic(fmt.Errorf("field id of message cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation is not mutable")) + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": + panic(fmt.Errorf("field sender of message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry is not mutable")) + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": + panic(fmt.Errorf("field id of message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry 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_MsgTrackUndelegation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_MsgUpdateUndelegationEntry) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.sender": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": return protoreflect.ValueOfString("") - case "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation.id": + case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry 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_MsgTrackUndelegation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_MsgUpdateUndelegationEntry) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry", d.FullName())) } panic("unreachable") } @@ -4416,7 +4416,7 @@ func (x *fastReflection_MsgTrackUndelegation) WhichOneof(d protoreflect.OneofDes // 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_MsgTrackUndelegation) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_MsgUpdateUndelegationEntry) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4427,7 +4427,7 @@ func (x *fastReflection_MsgTrackUndelegation) GetUnknown() protoreflect.RawField // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgTrackUndelegation) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_MsgUpdateUndelegationEntry) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4439,7 +4439,7 @@ func (x *fastReflection_MsgTrackUndelegation) SetUnknown(fields protoreflect.Raw // 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_MsgTrackUndelegation) IsValid() bool { +func (x *fastReflection_MsgUpdateUndelegationEntry) IsValid() bool { return x != nil } @@ -4449,9 +4449,9 @@ func (x *fastReflection_MsgTrackUndelegation) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_MsgTrackUndelegation) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_MsgUpdateUndelegationEntry) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgTrackUndelegation) + x := input.Message.Interface().(*MsgUpdateUndelegationEntry) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4480,7 +4480,7 @@ func (x *fastReflection_MsgTrackUndelegation) ProtoMethods() *protoiface.Methods } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgTrackUndelegation) + x := input.Message.Interface().(*MsgUpdateUndelegationEntry) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4522,7 +4522,7 @@ func (x *fastReflection_MsgTrackUndelegation) ProtoMethods() *protoiface.Methods }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgTrackUndelegation) + x := input.Message.Interface().(*MsgUpdateUndelegationEntry) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4554,10 +4554,10 @@ func (x *fastReflection_MsgTrackUndelegation) ProtoMethods() *protoiface.Methods fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgTrackUndelegation: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateUndelegationEntry: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgTrackUndelegation: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateUndelegationEntry: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6685,8 +6685,8 @@ func (x *MsgSend) GetAmount() []*v1beta1.Coin { return nil } -// MsgTrackUndelegation defines a message that enable lockup account to update delegation tracking -type MsgTrackUndelegation struct { +// MsgUpdateUndelegationEntry defines a message that enable lockup account to update delegation tracking +type MsgUpdateUndelegationEntry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -6695,8 +6695,8 @@ type MsgTrackUndelegation struct { Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` } -func (x *MsgTrackUndelegation) Reset() { - *x = MsgTrackUndelegation{} +func (x *MsgUpdateUndelegationEntry) Reset() { + *x = MsgUpdateUndelegationEntry{} if protoimpl.UnsafeEnabled { mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -6704,25 +6704,25 @@ func (x *MsgTrackUndelegation) Reset() { } } -func (x *MsgTrackUndelegation) String() string { +func (x *MsgUpdateUndelegationEntry) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgTrackUndelegation) ProtoMessage() {} +func (*MsgUpdateUndelegationEntry) ProtoMessage() {} -// Deprecated: Use MsgTrackUndelegation.ProtoReflect.Descriptor instead. -func (*MsgTrackUndelegation) Descriptor() ([]byte, []int) { +// Deprecated: Use MsgUpdateUndelegationEntry.ProtoReflect.Descriptor instead. +func (*MsgUpdateUndelegationEntry) Descriptor() ([]byte, []int) { return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{8} } -func (x *MsgTrackUndelegation) GetSender() string { +func (x *MsgUpdateUndelegationEntry) GetSender() string { if x != nil { return x.Sender } return "" } -func (x *MsgTrackUndelegation) GetId() uint64 { +func (x *MsgUpdateUndelegationEntry) GetId() uint64 { if x != nil { return x.Id } @@ -6980,62 +6980,62 @@ var file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDesc = []byte{ 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x13, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x55, - 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x3a, 0x13, 0x88, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x22, 0x50, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x12, 0x38, 0x0a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x64, 0x65, 0x72, 0x22, 0x73, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x02, 0x69, 0x64, 0x3a, 0x13, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, + 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x50, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x4d, + 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x38, 0x0a, 0x0a, 0x77, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x09, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, + 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x3a, 0x17, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, + 0xe7, 0xb0, 0x2a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x22, 0xd8, + 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x12, 0x37, - 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x74, 0x6f, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x3a, - 0x17, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x22, 0xd8, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, - 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x72, 0x65, - 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x8a, 0x01, 0x0a, 0x0f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x02, 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, 0x46, 0xc8, 0xde, 0x1f, - 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, - 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x64, 0x42, 0x9c, 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x07, - 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x6c, - 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x44, 0x4c, 0xaa, 0x02, - 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, - 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x67, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x8a, 0x01, 0x0a, + 0x0f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, + 0x18, 0x02, 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, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, + 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x9c, 0x02, 0x0a, 0x26, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, + 0x70, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, + 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, + 0x43, 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, + 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x2e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, + 0x63, 0x6b, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7060,7 +7060,7 @@ var file_cosmos_accounts_defaults_lockup_v1_tx_proto_goTypes = []interface{}{ (*MsgUndelegate)(nil), // 5: cosmos.accounts.defaults.lockup.v1.MsgUndelegate (*MsgWithdrawReward)(nil), // 6: cosmos.accounts.defaults.lockup.v1.MsgWithdrawReward (*MsgSend)(nil), // 7: cosmos.accounts.defaults.lockup.v1.MsgSend - (*MsgTrackUndelegation)(nil), // 8: cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation + (*MsgUpdateUndelegationEntry)(nil), // 8: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry (*MsgExecuteMessagesResponse)(nil), // 9: cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse (*MsgWithdraw)(nil), // 10: cosmos.accounts.defaults.lockup.v1.MsgWithdraw (*MsgWithdrawResponse)(nil), // 11: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse @@ -7190,7 +7190,7 @@ func file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() { } } file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgTrackUndelegation); i { + switch v := v.(*MsgUpdateUndelegationEntry); i { case 0: return &v.state case 1: diff --git a/x/accounts/defaults/lockup/continuous_locking_account_test.go b/x/accounts/defaults/lockup/continuous_locking_account_test.go index 667f742e7f09..3df0fed559a4 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account_test.go +++ b/x/accounts/defaults/lockup/continuous_locking_account_test.go @@ -110,7 +110,7 @@ func TestContinousAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - _, err = acc.TrackUndelegationEntry(sdkCtx, &lockuptypes.MsgTrackUndelegation{ + _, err = acc.UpdateUndelegationEntry(sdkCtx, &lockuptypes.MsgUpdateUndelegationEntry{ Sender: "owner", Id: ubdSeq - 1, }) diff --git a/x/accounts/defaults/lockup/delayed_locking_account_test.go b/x/accounts/defaults/lockup/delayed_locking_account_test.go index e930937cef14..f49a058ae741 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account_test.go +++ b/x/accounts/defaults/lockup/delayed_locking_account_test.go @@ -109,7 +109,7 @@ func TestDelayedAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - _, err = acc.TrackUndelegationEntry(sdkCtx, &lockuptypes.MsgTrackUndelegation{ + _, err = acc.UpdateUndelegationEntry(sdkCtx, &lockuptypes.MsgUpdateUndelegationEntry{ Sender: "owner", Id: ubdSeq - 1, }) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 5f89779e3450..08dd7abaab9e 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -234,8 +234,8 @@ func (bva *BaseLockup) Undelegate( return &lockuptypes.MsgExecuteMessagesResponse{Responses: resp}, nil } -func (bva *BaseLockup) TrackUndelegationEntry( - ctx context.Context, msg *lockuptypes.MsgTrackUndelegation, +func (bva *BaseLockup) UpdateUndelegationEntry( + ctx context.Context, msg *lockuptypes.MsgUpdateUndelegationEntry, ) ( *lockuptypes.MsgExecuteMessagesResponse, error, ) { @@ -748,7 +748,7 @@ func (bva BaseLockup) QueryUnbondingEntries(ctx context.Context, _ *lockuptypes. func (bva BaseLockup) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { accountstd.RegisterExecuteHandler(builder, bva.Undelegate) accountstd.RegisterExecuteHandler(builder, bva.WithdrawReward) - accountstd.RegisterExecuteHandler(builder, bva.TrackUndelegationEntry) + accountstd.RegisterExecuteHandler(builder, bva.UpdateUndelegationEntry) } func (bva BaseLockup) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { diff --git a/x/accounts/defaults/lockup/periodic_locking_account_test.go b/x/accounts/defaults/lockup/periodic_locking_account_test.go index 9caec029d91e..5f08eecb4ed3 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account_test.go +++ b/x/accounts/defaults/lockup/periodic_locking_account_test.go @@ -143,7 +143,7 @@ func TestPeriodicAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - _, err = acc.TrackUndelegationEntry(sdkCtx, &lockuptypes.MsgTrackUndelegation{ + _, err = acc.UpdateUndelegationEntry(sdkCtx, &lockuptypes.MsgUpdateUndelegationEntry{ Sender: "owner", Id: ubdSeq - 1, }) diff --git a/x/accounts/defaults/lockup/permanent_locking_account.go b/x/accounts/defaults/lockup/permanent_locking_account.go index 8cab4806743c..97bf8fd517d6 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account.go +++ b/x/accounts/defaults/lockup/permanent_locking_account.go @@ -103,7 +103,7 @@ func (plva PermanentLockingAccount) RegisterExecuteHandlers(builder *accountstd. accountstd.RegisterExecuteHandler(builder, plva.Undelegate) accountstd.RegisterExecuteHandler(builder, plva.SendCoins) accountstd.RegisterExecuteHandler(builder, plva.WithdrawReward) - accountstd.RegisterExecuteHandler(builder, plva.TrackUndelegationEntry) + accountstd.RegisterExecuteHandler(builder, plva.UpdateUndelegationEntry) } func (plva PermanentLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { diff --git a/x/accounts/defaults/lockup/v1/lockup.pb.go b/x/accounts/defaults/lockup/v1/lockup.pb.go index 3e4b9471eb79..bfaea39ca537 100644 --- a/x/accounts/defaults/lockup/v1/lockup.pb.go +++ b/x/accounts/defaults/lockup/v1/lockup.pb.go @@ -88,7 +88,7 @@ func (m *Period) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { // UnbondingEntry defines an entry tracking the lockup account unbonding operation. type UnbondingEntry struct { - // entry id + // ID of entry Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // end time of entry EndTime time.Time `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` diff --git a/x/accounts/defaults/lockup/v1/tx.pb.go b/x/accounts/defaults/lockup/v1/tx.pb.go index 5a2d02a30477..c8d7e1a554b0 100644 --- a/x/accounts/defaults/lockup/v1/tx.pb.go +++ b/x/accounts/defaults/lockup/v1/tx.pb.go @@ -396,24 +396,24 @@ func (m *MsgSend) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSend proto.InternalMessageInfo -// MsgTrackUndelegation defines a message that enable lockup account to update delegation tracking -type MsgTrackUndelegation struct { +// MsgUpdateUndelegationEntry defines a message that enable lockup account to update delegation tracking +type MsgUpdateUndelegationEntry struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` } -func (m *MsgTrackUndelegation) Reset() { *m = MsgTrackUndelegation{} } -func (m *MsgTrackUndelegation) String() string { return proto.CompactTextString(m) } -func (*MsgTrackUndelegation) ProtoMessage() {} -func (*MsgTrackUndelegation) Descriptor() ([]byte, []int) { +func (m *MsgUpdateUndelegationEntry) Reset() { *m = MsgUpdateUndelegationEntry{} } +func (m *MsgUpdateUndelegationEntry) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateUndelegationEntry) ProtoMessage() {} +func (*MsgUpdateUndelegationEntry) Descriptor() ([]byte, []int) { return fileDescriptor_84e5f410632b9d39, []int{8} } -func (m *MsgTrackUndelegation) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateUndelegationEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgTrackUndelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateUndelegationEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgTrackUndelegation.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateUndelegationEntry.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -423,17 +423,17 @@ func (m *MsgTrackUndelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *MsgTrackUndelegation) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgTrackUndelegation.Merge(m, src) +func (m *MsgUpdateUndelegationEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateUndelegationEntry.Merge(m, src) } -func (m *MsgTrackUndelegation) XXX_Size() int { +func (m *MsgUpdateUndelegationEntry) XXX_Size() int { return m.Size() } -func (m *MsgTrackUndelegation) XXX_DiscardUnknown() { - xxx_messageInfo_MsgTrackUndelegation.DiscardUnknown(m) +func (m *MsgUpdateUndelegationEntry) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateUndelegationEntry.DiscardUnknown(m) } -var xxx_messageInfo_MsgTrackUndelegation proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateUndelegationEntry proto.InternalMessageInfo // MsgExecuteMessagesResponse defines the response for lockup execute operations type MsgExecuteMessagesResponse struct { @@ -583,7 +583,7 @@ func init() { proto.RegisterType((*MsgUndelegate)(nil), "cosmos.accounts.defaults.lockup.v1.MsgUndelegate") proto.RegisterType((*MsgWithdrawReward)(nil), "cosmos.accounts.defaults.lockup.v1.MsgWithdrawReward") proto.RegisterType((*MsgSend)(nil), "cosmos.accounts.defaults.lockup.v1.MsgSend") - proto.RegisterType((*MsgTrackUndelegation)(nil), "cosmos.accounts.defaults.lockup.v1.MsgTrackUndelegation") + proto.RegisterType((*MsgUpdateUndelegationEntry)(nil), "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry") proto.RegisterType((*MsgExecuteMessagesResponse)(nil), "cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse") proto.RegisterType((*MsgWithdraw)(nil), "cosmos.accounts.defaults.lockup.v1.MsgWithdraw") proto.RegisterType((*MsgWithdrawResponse)(nil), "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse") @@ -594,60 +594,60 @@ func init() { } var fileDescriptor_84e5f410632b9d39 = []byte{ - // 844 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xda, 0xe0, 0xd6, 0x13, 0x9a, 0x92, 0xad, 0x45, 0x5d, 0x8b, 0xee, 0x06, 0x4b, 0x15, - 0x96, 0x51, 0x66, 0x71, 0x40, 0x02, 0x59, 0x5c, 0x62, 0x02, 0x02, 0x09, 0xa3, 0x6a, 0x5b, 0x40, - 0xe2, 0x80, 0x35, 0xde, 0x99, 0x4e, 0x47, 0xf6, 0xce, 0x58, 0x3b, 0x63, 0x3b, 0xbe, 0x21, 0xc4, - 0x01, 0xf5, 0xd4, 0x33, 0xa7, 0x1c, 0xa1, 0x27, 0x23, 0xf5, 0x47, 0xf4, 0x58, 0xf5, 0x94, 0x13, - 0x41, 0x0e, 0x92, 0xf3, 0x33, 0xd0, 0xee, 0xcc, 0x06, 0x3b, 0x31, 0xc1, 0xf8, 0x00, 0x12, 0x17, - 0x6b, 0x66, 0xde, 0xf7, 0xde, 0xfb, 0xde, 0x37, 0x6f, 0xde, 0x1a, 0xbc, 0x15, 0x08, 0x19, 0x0a, - 0xe9, 0xa1, 0x20, 0x10, 0x03, 0xae, 0xa4, 0x87, 0xc9, 0x03, 0x34, 0xe8, 0x29, 0xe9,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, 0xb3, 0x0c, - 0x2f, 0x4f, 0x77, 0x17, 0x94, 0x5b, 0x92, 0x7e, 0x74, 0x40, 0x82, 0x81, 0x22, 0x2d, 0x22, 0x25, - 0xa2, 0x44, 0xa6, 0xc3, 0xc0, 0xde, 0x05, 0x85, 0xc8, 0xac, 0x65, 0xc9, 0x4a, 0xf4, 0x29, 0x5e, - 0x18, 0x87, 0x7b, 0x7c, 0xec, 0xff, 0x09, 0xab, 0xfc, 0xa2, 0x07, 0x48, 0xda, 0x74, 0xf6, 0xfb, - 0x00, 0x8c, 0xcc, 0x7a, 0x05, 0xf2, 0x73, 0xd8, 0xf5, 0xef, 0xf4, 0x35, 0x90, 0xc7, 0x84, 0x8b, - 0x50, 0xcf, 0xdc, 0x82, 0x6f, 0x76, 0x8d, 0x9b, 0xf3, 0x0a, 0xcc, 0x65, 0xaa, 0x1c, 0x59, 0xe0, - 0xc6, 0xc2, 0x43, 0x31, 0xf5, 0xbf, 0x0b, 0xae, 0x46, 0x24, 0x20, 0x6c, 0xb8, 0x02, 0xf3, 0x33, - 0xa4, 0xfd, 0xc8, 0x02, 0xd7, 0xf5, 0x15, 0xb7, 0xcd, 0x59, 0x7c, 0x0d, 0xff, 0x52, 0x73, 0x6d, - 0xea, 0xcc, 0xbe, 0x49, 0xdc, 0xdc, 0x7f, 0x36, 0x75, 0xac, 0xe7, 0x53, 0xc7, 0xfa, 0x6d, 0xea, - 0x58, 0x8f, 0x4f, 0x9c, 0xcc, 0xf3, 0x13, 0x27, 0x73, 0x74, 0xe2, 0x64, 0xbe, 0xae, 0xe9, 0xb8, - 0x12, 0x77, 0x21, 0x13, 0xde, 0xc1, 0x65, 0x7f, 0x90, 0x3a, 0xf9, 0xe4, 0xb6, 0xdf, 0xf9, 0x23, - 0x00, 0x00, 0xff, 0xff, 0x5e, 0x48, 0x4c, 0x48, 0xd1, 0x09, 0x00, 0x00, + // 847 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0xcf, 0x8f, 0x1b, 0x35, + 0x14, 0xce, 0x64, 0x21, 0x6d, 0xbc, 0x74, 0xcb, 0x4e, 0x23, 0x9a, 0x46, 0x74, 0x66, 0x89, 0x54, + 0x11, 0x05, 0xad, 0x87, 0x2c, 0x48, 0xa0, 0x88, 0xcb, 0x86, 0x2d, 0x02, 0x89, 0xa0, 0x6a, 0xca, + 0x0f, 0x89, 0x03, 0x91, 0x33, 0x76, 0x5d, 0x6b, 0x33, 0x76, 0x34, 0x76, 0x92, 0xcd, 0x0d, 0x21, + 0x0e, 0xa8, 0xa7, 0x9e, 0x39, 0xed, 0x11, 0x7a, 0x0a, 0x52, 0xff, 0x88, 0x1e, 0xab, 0x9e, 0x7a, + 0xa2, 0x28, 0x8b, 0x94, 0xfe, 0x19, 0xc8, 0x63, 0xcf, 0x92, 0x6c, 0xc3, 0x12, 0x72, 0x00, 0x89, + 0x4b, 0x64, 0xfb, 0x7d, 0xef, 0xbd, 0xef, 0x7d, 0xef, 0xd9, 0x13, 0xf0, 0x56, 0x24, 0x64, 0x2c, + 0x64, 0x80, 0xa2, 0x48, 0x0c, 0xb8, 0x92, 0x01, 0x26, 0x77, 0xd0, 0xa0, 0xa7, 0x64, 0xd0, 0x13, + 0xd1, 0xe1, 0xa0, 0x1f, 0x0c, 0x1b, 0x81, 0x3a, 0x82, 0xfd, 0x44, 0x28, 0xe1, 0x56, 0x0d, 0x18, + 0x66, 0x60, 0x98, 0x81, 0xa1, 0x01, 0xc3, 0x61, 0xa3, 0xb2, 0x8d, 0x62, 0xc6, 0x45, 0x90, 0xfe, + 0x1a, 0xb7, 0x8a, 0x67, 0x73, 0x74, 0x91, 0x24, 0xc1, 0xb0, 0xd1, 0x25, 0x0a, 0x35, 0x82, 0x48, + 0x30, 0x6e, 0xed, 0xc1, 0x0a, 0x1c, 0x6c, 0x02, 0xe3, 0x70, 0xd5, 0x3a, 0xc4, 0x92, 0x6a,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, + 0x30, 0xe1, 0x22, 0x36, 0x2f, 0x6f, 0x31, 0xb4, 0xbb, 0xe6, 0xd5, 0x79, 0x05, 0xe6, 0x32, 0x55, + 0x9f, 0x3a, 0xe0, 0xca, 0xc2, 0x75, 0xb1, 0xf5, 0xbf, 0x0b, 0x2e, 0x26, 0x24, 0x22, 0x6c, 0xb8, + 0x02, 0xf3, 0x53, 0xa4, 0x7b, 0xcf, 0x01, 0x97, 0x4d, 0xa3, 0x3b, 0xf6, 0x4c, 0xb7, 0xe1, 0x5f, + 0x1a, 0xb1, 0x2d, 0x93, 0x39, 0xb4, 0x89, 0x5b, 0x07, 0x8f, 0xa6, 0x9e, 0xf3, 0x78, 0xea, 0x39, + 0xbf, 0x4d, 0x3d, 0xe7, 0xfe, 0x89, 0x97, 0x7b, 0x7c, 0xe2, 0xe5, 0x9e, 0x9e, 0x78, 0xb9, 0xaf, + 0xeb, 0x26, 0xae, 0xc4, 0x87, 0x90, 0x89, 0xe0, 0xe8, 0xbc, 0xbf, 0x49, 0xdd, 0x42, 0xda, 0xed, + 0x77, 0xfe, 0x08, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x40, 0x33, 0x37, 0xd7, 0x09, 0x00, 0x00, } func (this *MsgInitLockupAccount) Equal(that interface{}) bool { @@ -1006,7 +1006,7 @@ func (m *MsgSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgTrackUndelegation) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateUndelegationEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1016,12 +1016,12 @@ func (m *MsgTrackUndelegation) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgTrackUndelegation) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateUndelegationEntry) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgTrackUndelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateUndelegationEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1313,7 +1313,7 @@ func (m *MsgSend) Size() (n int) { return n } -func (m *MsgTrackUndelegation) Size() (n int) { +func (m *MsgUpdateUndelegationEntry) Size() (n int) { if m == nil { return 0 } @@ -2345,7 +2345,7 @@ func (m *MsgSend) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgTrackUndelegation) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateUndelegationEntry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2368,10 +2368,10 @@ func (m *MsgTrackUndelegation) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgTrackUndelegation: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateUndelegationEntry: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTrackUndelegation: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateUndelegationEntry: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto index 9b35ad417ab0..051ff536ec56 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto @@ -97,8 +97,8 @@ message MsgSend { ]; } -// MsgTrackUndelegation defines a message that enable lockup account to update delegation tracking -message MsgTrackUndelegation { +// MsgUpdateUndelegationEntry defines a message that enable lockup account to update delegation tracking +message MsgUpdateUndelegationEntry { option (cosmos.msg.v1.signer) = "sender"; option (gogoproto.equal) = false; From 8e9bde25af9d8ee5b44a69699ee7386e52f42905 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 28 Oct 2024 12:34:37 +0700 Subject: [PATCH 12/24] fix tests --- .../integration/accounts/lockup/continous_lockup_test_suite.go | 2 +- tests/integration/accounts/lockup/delayed_lockup_test_suite.go | 2 +- tests/integration/accounts/lockup/periodic_lockup_test_suite.go | 2 +- .../integration/accounts/lockup/permanent_lockup_test_suite.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/accounts/lockup/continous_lockup_test_suite.go b/tests/integration/accounts/lockup/continous_lockup_test_suite.go index d256db637525..4cf53792b834 100644 --- a/tests/integration/accounts/lockup/continous_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/continous_lockup_test_suite.go @@ -177,7 +177,7 @@ func (s *IntegrationTestSuite) TestContinuousLockingAccount() { }) t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { - msg := &types.MsgTrackUndelegation{ + msg := &types.MsgUpdateUndelegationEntry{ Sender: ownerAddrStr, Id: 0, } diff --git a/tests/integration/accounts/lockup/delayed_lockup_test_suite.go b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go index 2cd675828cad..d05b7a93d332 100644 --- a/tests/integration/accounts/lockup/delayed_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go @@ -140,7 +140,7 @@ func (s *IntegrationTestSuite) TestDelayedLockingAccount() { }) t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { - msg := &types.MsgTrackUndelegation{ + msg := &types.MsgUpdateUndelegationEntry{ Sender: ownerAddrStr, Id: 0, } diff --git a/tests/integration/accounts/lockup/periodic_lockup_test_suite.go b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go index 7f763b1ff97f..6b4101487db8 100644 --- a/tests/integration/accounts/lockup/periodic_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go @@ -200,7 +200,7 @@ func (s *IntegrationTestSuite) TestPeriodicLockingAccount() { }) t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { - msg := &types.MsgTrackUndelegation{ + msg := &types.MsgUpdateUndelegationEntry{ Sender: ownerAddrStr, Id: 0, } diff --git a/tests/integration/accounts/lockup/permanent_lockup_test_suite.go b/tests/integration/accounts/lockup/permanent_lockup_test_suite.go index 4ea6788cea64..f32bb3662c00 100644 --- a/tests/integration/accounts/lockup/permanent_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/permanent_lockup_test_suite.go @@ -138,7 +138,7 @@ func (s *IntegrationTestSuite) TestPermanentLockingAccount() { }) t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { - msg := &types.MsgTrackUndelegation{ + msg := &types.MsgUpdateUndelegationEntry{ Sender: ownerAddrStr, Id: 0, } From 70e61c53d20aea59c12edc2a495a4f11303486b0 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 28 Oct 2024 14:44:42 +0700 Subject: [PATCH 13/24] minor --- x/accounts/defaults/lockup/permanent_locking_account_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/accounts/defaults/lockup/permanent_locking_account_test.go b/x/accounts/defaults/lockup/permanent_locking_account_test.go index dd024b84d874..f56fa1062480 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account_test.go +++ b/x/accounts/defaults/lockup/permanent_locking_account_test.go @@ -85,7 +85,7 @@ func TestPermanentAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - _, err = acc.TrackUndelegationEntry(sdkCtx, &lockuptypes.MsgTrackUndelegation{ + _, err = acc.UpdateUndelegationEntry(sdkCtx, &lockuptypes.MsgUpdateUndelegationEntry{ Sender: "owner", Id: ubdSeq - 1, }) From f9dcc39e76f40e6493a95106f8636faba9452789 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Fri, 29 Nov 2024 01:32:35 +0700 Subject: [PATCH 14/24] remove ubd id --- .../defaults/lockup/v1/lockup.pulsar.go | 709 ++++++++++++++++-- .../lockup/continuous_locking_account_test.go | 6 - .../lockup/delayed_locking_account_test.go | 6 - x/accounts/defaults/lockup/lockup.go | 165 ++-- .../lockup/periodic_locking_account_test.go | 6 - .../lockup/permanent_locking_account.go | 1 - .../lockup/permanent_locking_account_test.go | 6 - x/accounts/defaults/lockup/v1/lockup.pb.go | 269 +++++-- .../accounts/defaults/lockup/v1/lockup.proto | 7 +- 9 files changed, 957 insertions(+), 218 deletions(-) diff --git a/api/cosmos/accounts/defaults/lockup/v1/lockup.pulsar.go b/api/cosmos/accounts/defaults/lockup/v1/lockup.pulsar.go index d1c5b687e945..a2549acdf88f 100644 --- a/api/cosmos/accounts/defaults/lockup/v1/lockup.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/v1/lockup.pulsar.go @@ -591,9 +591,503 @@ func (x *fastReflection_Period) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_UnbondingEntries_1_list)(nil) + +type _UnbondingEntries_1_list struct { + list *[]*UnbondingEntry +} + +func (x *_UnbondingEntries_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_UnbondingEntries_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_UnbondingEntries_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*UnbondingEntry) + (*x.list)[i] = concreteValue +} + +func (x *_UnbondingEntries_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*UnbondingEntry) + *x.list = append(*x.list, concreteValue) +} + +func (x *_UnbondingEntries_1_list) AppendMutable() protoreflect.Value { + v := new(UnbondingEntry) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UnbondingEntries_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_UnbondingEntries_1_list) NewElement() protoreflect.Value { + v := new(UnbondingEntry) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_UnbondingEntries_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_UnbondingEntries protoreflect.MessageDescriptor + fd_UnbondingEntries_entries protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_defaults_lockup_v1_lockup_proto_init() + md_UnbondingEntries = File_cosmos_accounts_defaults_lockup_v1_lockup_proto.Messages().ByName("UnbondingEntries") + fd_UnbondingEntries_entries = md_UnbondingEntries.Fields().ByName("entries") +} + +var _ protoreflect.Message = (*fastReflection_UnbondingEntries)(nil) + +type fastReflection_UnbondingEntries UnbondingEntries + +func (x *UnbondingEntries) ProtoReflect() protoreflect.Message { + return (*fastReflection_UnbondingEntries)(x) +} + +func (x *UnbondingEntries) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_defaults_lockup_v1_lockup_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_UnbondingEntries_messageType fastReflection_UnbondingEntries_messageType +var _ protoreflect.MessageType = fastReflection_UnbondingEntries_messageType{} + +type fastReflection_UnbondingEntries_messageType struct{} + +func (x fastReflection_UnbondingEntries_messageType) Zero() protoreflect.Message { + return (*fastReflection_UnbondingEntries)(nil) +} +func (x fastReflection_UnbondingEntries_messageType) New() protoreflect.Message { + return new(fastReflection_UnbondingEntries) +} +func (x fastReflection_UnbondingEntries_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_UnbondingEntries +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_UnbondingEntries) Descriptor() protoreflect.MessageDescriptor { + return md_UnbondingEntries +} + +// 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_UnbondingEntries) Type() protoreflect.MessageType { + return _fastReflection_UnbondingEntries_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_UnbondingEntries) New() protoreflect.Message { + return new(fastReflection_UnbondingEntries) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_UnbondingEntries) Interface() protoreflect.ProtoMessage { + return (*UnbondingEntries)(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_UnbondingEntries) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Entries) != 0 { + value := protoreflect.ValueOfList(&_UnbondingEntries_1_list{list: &x.Entries}) + if !f(fd_UnbondingEntries_entries, 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_UnbondingEntries) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntries.entries": + return len(x.Entries) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.UnbondingEntries")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.UnbondingEntries 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_UnbondingEntries) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntries.entries": + x.Entries = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.UnbondingEntries")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.UnbondingEntries 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_UnbondingEntries) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntries.entries": + if len(x.Entries) == 0 { + return protoreflect.ValueOfList(&_UnbondingEntries_1_list{}) + } + listValue := &_UnbondingEntries_1_list{list: &x.Entries} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.UnbondingEntries")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.UnbondingEntries 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_UnbondingEntries) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntries.entries": + lv := value.List() + clv := lv.(*_UnbondingEntries_1_list) + x.Entries = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.UnbondingEntries")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.UnbondingEntries 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_UnbondingEntries) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntries.entries": + if x.Entries == nil { + x.Entries = []*UnbondingEntry{} + } + value := &_UnbondingEntries_1_list{list: &x.Entries} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.UnbondingEntries")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.UnbondingEntries 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_UnbondingEntries) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntries.entries": + list := []*UnbondingEntry{} + return protoreflect.ValueOfList(&_UnbondingEntries_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.UnbondingEntries")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.UnbondingEntries 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_UnbondingEntries) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.v1.UnbondingEntries", 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_UnbondingEntries) 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_UnbondingEntries) 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_UnbondingEntries) 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_UnbondingEntries) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*UnbondingEntries) + 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.Entries) > 0 { + for _, e := range x.Entries { + 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().(*UnbondingEntries) + 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.Entries) > 0 { + for iNdEx := len(x.Entries) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Entries[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().(*UnbondingEntries) + 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: UnbondingEntries: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: UnbondingEntries: 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 Entries", 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.Entries = append(x.Entries, &UnbondingEntry{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Entries[len(x.Entries)-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_UnbondingEntry protoreflect.MessageDescriptor - fd_UnbondingEntry_id protoreflect.FieldDescriptor + fd_UnbondingEntry_creation_height protoreflect.FieldDescriptor fd_UnbondingEntry_end_time protoreflect.FieldDescriptor fd_UnbondingEntry_amount protoreflect.FieldDescriptor fd_UnbondingEntry_validator_address protoreflect.FieldDescriptor @@ -602,7 +1096,7 @@ var ( func init() { file_cosmos_accounts_defaults_lockup_v1_lockup_proto_init() md_UnbondingEntry = File_cosmos_accounts_defaults_lockup_v1_lockup_proto.Messages().ByName("UnbondingEntry") - fd_UnbondingEntry_id = md_UnbondingEntry.Fields().ByName("id") + fd_UnbondingEntry_creation_height = md_UnbondingEntry.Fields().ByName("creation_height") fd_UnbondingEntry_end_time = md_UnbondingEntry.Fields().ByName("end_time") fd_UnbondingEntry_amount = md_UnbondingEntry.Fields().ByName("amount") fd_UnbondingEntry_validator_address = md_UnbondingEntry.Fields().ByName("validator_address") @@ -617,7 +1111,7 @@ func (x *UnbondingEntry) ProtoReflect() protoreflect.Message { } func (x *UnbondingEntry) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_v1_lockup_proto_msgTypes[1] + mi := &file_cosmos_accounts_defaults_lockup_v1_lockup_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -673,9 +1167,9 @@ func (x *fastReflection_UnbondingEntry) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_UnbondingEntry) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != uint64(0) { - value := protoreflect.ValueOfUint64(x.Id) - if !f(fd_UnbondingEntry_id, value) { + if x.CreationHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.CreationHeight) + if !f(fd_UnbondingEntry_creation_height, value) { return } } @@ -712,8 +1206,8 @@ func (x *fastReflection_UnbondingEntry) Range(f func(protoreflect.FieldDescripto // a repeated field is populated if it is non-empty. func (x *fastReflection_UnbondingEntry) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.id": - return x.Id != uint64(0) + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.creation_height": + return x.CreationHeight != int64(0) case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.end_time": return x.EndTime != nil case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.amount": @@ -736,8 +1230,8 @@ func (x *fastReflection_UnbondingEntry) Has(fd protoreflect.FieldDescriptor) boo // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_UnbondingEntry) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.id": - x.Id = uint64(0) + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.creation_height": + x.CreationHeight = int64(0) case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.end_time": x.EndTime = nil case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.amount": @@ -760,9 +1254,9 @@ func (x *fastReflection_UnbondingEntry) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_UnbondingEntry) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.id": - value := x.Id - return protoreflect.ValueOfUint64(value) + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.creation_height": + value := x.CreationHeight + return protoreflect.ValueOfInt64(value) case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.end_time": value := x.EndTime return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -792,8 +1286,8 @@ func (x *fastReflection_UnbondingEntry) Get(descriptor protoreflect.FieldDescrip // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_UnbondingEntry) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.id": - x.Id = value.Uint() + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.creation_height": + x.CreationHeight = value.Int() case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.end_time": x.EndTime = value.Message().Interface().(*timestamppb.Timestamp) case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.amount": @@ -830,8 +1324,8 @@ func (x *fastReflection_UnbondingEntry) Mutable(fd protoreflect.FieldDescriptor) x.Amount = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) - case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.id": - panic(fmt.Errorf("field id of message cosmos.accounts.defaults.lockup.v1.UnbondingEntry is not mutable")) + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.creation_height": + panic(fmt.Errorf("field creation_height of message cosmos.accounts.defaults.lockup.v1.UnbondingEntry is not mutable")) case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.validator_address": panic(fmt.Errorf("field validator_address of message cosmos.accounts.defaults.lockup.v1.UnbondingEntry is not mutable")) default: @@ -847,8 +1341,8 @@ func (x *fastReflection_UnbondingEntry) Mutable(fd protoreflect.FieldDescriptor) // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_UnbondingEntry) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.id": - return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.creation_height": + return protoreflect.ValueOfInt64(int64(0)) case "cosmos.accounts.defaults.lockup.v1.UnbondingEntry.end_time": m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -926,8 +1420,8 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.Id != 0 { - n += 1 + runtime.Sov(uint64(x.Id)) + if x.CreationHeight != 0 { + n += 1 + runtime.Sov(uint64(x.CreationHeight)) } if x.EndTime != nil { l = options.Size(x.EndTime) @@ -1005,8 +1499,8 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if x.Id != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) + if x.CreationHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CreationHeight)) i-- dAtA[i] = 0x8 } @@ -1061,9 +1555,9 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType) } - x.Id = 0 + x.CreationHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1073,7 +1567,7 @@ func (x *fastReflection_UnbondingEntry) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.Id |= uint64(b&0x7F) << shift + x.CreationHeight |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -1275,14 +1769,48 @@ func (x *Period) GetAmount() []*v1beta1.Coin { return nil } +type UnbondingEntries struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Entries []*UnbondingEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` +} + +func (x *UnbondingEntries) Reset() { + *x = UnbondingEntries{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_defaults_lockup_v1_lockup_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnbondingEntries) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnbondingEntries) ProtoMessage() {} + +// Deprecated: Use UnbondingEntries.ProtoReflect.Descriptor instead. +func (*UnbondingEntries) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_defaults_lockup_v1_lockup_proto_rawDescGZIP(), []int{1} +} + +func (x *UnbondingEntries) GetEntries() []*UnbondingEntry { + if x != nil { + return x.Entries + } + return nil +} + // UnbondingEntry defines an entry tracking the lockup account unbonding operation. type UnbondingEntry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // ID of entry - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"` // end time of entry EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` // unbond amount @@ -1294,7 +1822,7 @@ type UnbondingEntry struct { func (x *UnbondingEntry) Reset() { *x = UnbondingEntry{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_v1_lockup_proto_msgTypes[1] + mi := &file_cosmos_accounts_defaults_lockup_v1_lockup_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1308,12 +1836,12 @@ func (*UnbondingEntry) ProtoMessage() {} // Deprecated: Use UnbondingEntry.ProtoReflect.Descriptor instead. func (*UnbondingEntry) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_v1_lockup_proto_rawDescGZIP(), []int{1} + return file_cosmos_accounts_defaults_lockup_v1_lockup_proto_rawDescGZIP(), []int{2} } -func (x *UnbondingEntry) GetId() uint64 { +func (x *UnbondingEntry) GetCreationHeight() int64 { if x != nil { - return x.Id + return x.CreationHeight } return 0 } @@ -1370,41 +1898,48 @@ var file_cosmos_accounts_defaults_lockup_v1_lockup_proto_rawDesc = []byte{ 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0xf4, 0x01, 0x0a, 0x0e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x44, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 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, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, - 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0xa0, 0x02, 0x0a, 0x26, 0x63, 0x6f, - 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, - 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, - 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, - 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, + 0x6e, 0x74, 0x22, 0x60, 0x0a, 0x10, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, + 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x62, + 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x22, 0x8d, 0x02, 0x0a, 0x0e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x44, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, + 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x65, + 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 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, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x42, 0xa0, 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x42, + 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, + 0x2f, 0x76, 0x31, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, + 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, + 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x2e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, - 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, - 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x26, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, + 0x6b, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1419,24 +1954,26 @@ func file_cosmos_accounts_defaults_lockup_v1_lockup_proto_rawDescGZIP() []byte { return file_cosmos_accounts_defaults_lockup_v1_lockup_proto_rawDescData } -var file_cosmos_accounts_defaults_lockup_v1_lockup_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_accounts_defaults_lockup_v1_lockup_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cosmos_accounts_defaults_lockup_v1_lockup_proto_goTypes = []interface{}{ (*Period)(nil), // 0: cosmos.accounts.defaults.lockup.v1.Period - (*UnbondingEntry)(nil), // 1: cosmos.accounts.defaults.lockup.v1.UnbondingEntry - (*durationpb.Duration)(nil), // 2: google.protobuf.Duration - (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*UnbondingEntries)(nil), // 1: cosmos.accounts.defaults.lockup.v1.UnbondingEntries + (*UnbondingEntry)(nil), // 2: cosmos.accounts.defaults.lockup.v1.UnbondingEntry + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration + (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp } var file_cosmos_accounts_defaults_lockup_v1_lockup_proto_depIdxs = []int32{ - 2, // 0: cosmos.accounts.defaults.lockup.v1.Period.length:type_name -> google.protobuf.Duration - 3, // 1: cosmos.accounts.defaults.lockup.v1.Period.amount:type_name -> cosmos.base.v1beta1.Coin - 4, // 2: cosmos.accounts.defaults.lockup.v1.UnbondingEntry.end_time:type_name -> google.protobuf.Timestamp - 3, // 3: cosmos.accounts.defaults.lockup.v1.UnbondingEntry.amount: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 + 3, // 0: cosmos.accounts.defaults.lockup.v1.Period.length:type_name -> google.protobuf.Duration + 4, // 1: cosmos.accounts.defaults.lockup.v1.Period.amount:type_name -> cosmos.base.v1beta1.Coin + 2, // 2: cosmos.accounts.defaults.lockup.v1.UnbondingEntries.entries:type_name -> cosmos.accounts.defaults.lockup.v1.UnbondingEntry + 5, // 3: cosmos.accounts.defaults.lockup.v1.UnbondingEntry.end_time:type_name -> google.protobuf.Timestamp + 4, // 4: cosmos.accounts.defaults.lockup.v1.UnbondingEntry.amount:type_name -> cosmos.base.v1beta1.Coin + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_cosmos_accounts_defaults_lockup_v1_lockup_proto_init() } @@ -1458,6 +1995,18 @@ func file_cosmos_accounts_defaults_lockup_v1_lockup_proto_init() { } } file_cosmos_accounts_defaults_lockup_v1_lockup_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnbondingEntries); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_defaults_lockup_v1_lockup_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnbondingEntry); i { case 0: return &v.state @@ -1476,7 +2025,7 @@ func file_cosmos_accounts_defaults_lockup_v1_lockup_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_defaults_lockup_v1_lockup_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/x/accounts/defaults/lockup/continuous_locking_account_test.go b/x/accounts/defaults/lockup/continuous_locking_account_test.go index 3df0fed559a4..1c8d381221d0 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account_test.go +++ b/x/accounts/defaults/lockup/continuous_locking_account_test.go @@ -110,12 +110,6 @@ func TestContinousAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - _, err = acc.UpdateUndelegationEntry(sdkCtx, &lockuptypes.MsgUpdateUndelegationEntry{ - Sender: "owner", - Id: ubdSeq - 1, - }) - require.NoError(t, err) - delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) diff --git a/x/accounts/defaults/lockup/delayed_locking_account_test.go b/x/accounts/defaults/lockup/delayed_locking_account_test.go index f49a058ae741..26fcf6930683 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account_test.go +++ b/x/accounts/defaults/lockup/delayed_locking_account_test.go @@ -109,12 +109,6 @@ func TestDelayedAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - _, err = acc.UpdateUndelegationEntry(sdkCtx, &lockuptypes.MsgUpdateUndelegationEntry{ - Sender: "owner", - Id: ubdSeq - 1, - }) - require.NoError(t, err) - delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 08dd7abaab9e..b0623e25503b 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "errors" - "fmt" "maps" "slices" "time" @@ -30,16 +29,15 @@ import ( ) var ( - OriginalLockingPrefix = collections.NewPrefix(0) - DelegatedFreePrefix = collections.NewPrefix(1) - DelegatedLockingPrefix = collections.NewPrefix(2) - EndTimePrefix = collections.NewPrefix(3) - StartTimePrefix = collections.NewPrefix(4) - LockingPeriodsPrefix = collections.NewPrefix(5) - OwnerPrefix = collections.NewPrefix(6) - WithdrawedCoinsPrefix = collections.NewPrefix(7) - UnbondEntriesPrefix = collections.NewPrefix(8) - UnbondingSequencePrefix = collections.NewPrefix(9) + OriginalLockingPrefix = collections.NewPrefix(0) + DelegatedFreePrefix = collections.NewPrefix(1) + DelegatedLockingPrefix = collections.NewPrefix(2) + EndTimePrefix = collections.NewPrefix(3) + StartTimePrefix = collections.NewPrefix(4) + LockingPeriodsPrefix = collections.NewPrefix(5) + OwnerPrefix = collections.NewPrefix(6) + WithdrawedCoinsPrefix = collections.NewPrefix(7) + UnbondEntriesPrefix = collections.NewPrefix(8) ) var ( @@ -54,16 +52,15 @@ type getLockedCoinsFunc = func(ctx context.Context, time time.Time, denoms ...st // newBaseLockup creates a new BaseLockup object. func newBaseLockup(d accountstd.Dependencies) *BaseLockup { BaseLockup := &BaseLockup{ - Owner: collections.NewItem(d.SchemaBuilder, OwnerPrefix, "owner", collections.BytesValue), - OriginalLocking: collections.NewMap(d.SchemaBuilder, OriginalLockingPrefix, "original_locking", collections.StringKey, sdk.IntValue), - DelegatedFree: collections.NewMap(d.SchemaBuilder, DelegatedFreePrefix, "delegated_free", collections.StringKey, sdk.IntValue), - DelegatedLocking: collections.NewMap(d.SchemaBuilder, DelegatedLockingPrefix, "delegated_locking", collections.StringKey, sdk.IntValue), - WithdrawedCoins: collections.NewMap(d.SchemaBuilder, WithdrawedCoinsPrefix, "withdrawed_coins", collections.StringKey, sdk.IntValue), - UnbondEntries: collections.NewMap(d.SchemaBuilder, UnbondEntriesPrefix, "unbond_entries", collections.Uint64Key, codec.CollValue[lockuptypes.UnbondingEntry](d.LegacyStateCodec)), - UnbondingSequence: collections.NewSequence(d.SchemaBuilder, UnbondingSequencePrefix, "unbonding_sequence"), - addressCodec: d.AddressCodec, - headerService: d.Environment.HeaderService, - EndTime: collections.NewItem(d.SchemaBuilder, EndTimePrefix, "end_time", collcodec.KeyToValueCodec[time.Time](sdk.TimeKey)), + Owner: collections.NewItem(d.SchemaBuilder, OwnerPrefix, "owner", collections.BytesValue), + OriginalLocking: collections.NewMap(d.SchemaBuilder, OriginalLockingPrefix, "original_locking", collections.StringKey, sdk.IntValue), + DelegatedFree: collections.NewMap(d.SchemaBuilder, DelegatedFreePrefix, "delegated_free", collections.StringKey, sdk.IntValue), + DelegatedLocking: collections.NewMap(d.SchemaBuilder, DelegatedLockingPrefix, "delegated_locking", collections.StringKey, sdk.IntValue), + WithdrawedCoins: collections.NewMap(d.SchemaBuilder, WithdrawedCoinsPrefix, "withdrawed_coins", collections.StringKey, sdk.IntValue), + UnbondEntries: collections.NewMap(d.SchemaBuilder, UnbondEntriesPrefix, "unbond_entries", collections.StringKey, codec.CollValue[lockuptypes.UnbondingEntries](d.LegacyStateCodec)), + addressCodec: d.AddressCodec, + headerService: d.Environment.HeaderService, + EndTime: collections.NewItem(d.SchemaBuilder, EndTimePrefix, "end_time", collcodec.KeyToValueCodec[time.Time](sdk.TimeKey)), } return BaseLockup @@ -71,15 +68,15 @@ func newBaseLockup(d accountstd.Dependencies) *BaseLockup { type BaseLockup struct { // Owner is the address of the account owner. - Owner collections.Item[[]byte] - OriginalLocking collections.Map[string, math.Int] - DelegatedFree collections.Map[string, math.Int] - DelegatedLocking collections.Map[string, math.Int] - WithdrawedCoins collections.Map[string, math.Int] - UnbondingSequence collections.Sequence - UnbondEntries collections.Map[uint64, lockuptypes.UnbondingEntry] - addressCodec address.Codec - headerService header.Service + Owner collections.Item[[]byte] + OriginalLocking collections.Map[string, math.Int] + DelegatedFree collections.Map[string, math.Int] + DelegatedLocking collections.Map[string, math.Int] + WithdrawedCoins collections.Map[string, math.Int] + // map val address to unbonding entries + UnbondEntries collections.Map[string, lockuptypes.UnbondingEntries] + addressCodec address.Codec + headerService header.Service // lockup end time. EndTime collections.Item[time.Time] } @@ -211,60 +208,37 @@ func (bva *BaseLockup) Undelegate( return nil, err } + header := bva.headerService.HeaderInfo(ctx) + msgUndelegateResp, err := accountstd.UnpackAny[stakingtypes.MsgUndelegateResponse](resp[0]) if err != nil { return nil, err } - ubdSeq, err := bva.UnbondingSequence.Next(ctx) + entries, err := bva.UnbondEntries.Get(ctx, msg.ValidatorAddress) if err != nil { - return nil, err + if !errorsmod.IsOf(err, collections.ErrNotFound) { + entries = lockuptypes.UnbondingEntries{ + Entries: []*lockuptypes.UnbondingEntry{}, + } + } else { + return nil, err + } } - err = bva.UnbondEntries.Set(ctx, ubdSeq, lockuptypes.UnbondingEntry{ - Id: ubdSeq, + entries.Entries = append(entries.Entries, &lockuptypes.UnbondingEntry{ EndTime: msgUndelegateResp.CompletionTime, Amount: msgUndelegateResp.Amount, ValidatorAddress: msg.ValidatorAddress, + CreationHeight: header.Height, }) - if err != nil { - return nil, err - } - - return &lockuptypes.MsgExecuteMessagesResponse{Responses: resp}, nil -} - -func (bva *BaseLockup) UpdateUndelegationEntry( - ctx context.Context, msg *lockuptypes.MsgUpdateUndelegationEntry, -) ( - *lockuptypes.MsgExecuteMessagesResponse, error, -) { - err := bva.checkSender(ctx, msg.Sender) - if err != nil { - return nil, err - } - entry, err := bva.UnbondEntries.Get(ctx, msg.Id) - if err != nil { - return nil, err - } - hs := bva.headerService.HeaderInfo(ctx) - if entry.EndTime.After(hs.Time) { - return nil, fmt.Errorf("unbonding not matured yet, expecting end time at: %s", entry.EndTime.String()) - } - - err = bva.TrackUndelegation(ctx, sdk.NewCoins(entry.Amount)) + err = bva.UnbondEntries.Set(ctx, msg.ValidatorAddress, entries) if err != nil { return nil, err } - // remove entry - err = bva.UnbondEntries.Remove(ctx, msg.Id) - if err != nil { - return nil, err - } - - return &lockuptypes.MsgExecuteMessagesResponse{}, nil + return &lockuptypes.MsgExecuteMessagesResponse{Responses: resp}, nil } func (bva *BaseLockup) WithdrawReward( @@ -472,6 +446,51 @@ func getStakingDenom(ctx context.Context) (string, error) { return resp.Params.BondDenom, nil } +// iterates through all the unbonding entries and check if any of the entries are matured and handled. +func (bva *BaseLockup) CheckUbdEntriesMature(ctx context.Context) error { + whoami := accountstd.Whoami(ctx) + delAddr, err := bva.addressCodec.BytesToString(whoami) + if err != nil { + return err + } + + currentTime := bva.headerService.HeaderInfo(ctx).Time + + err = bva.UnbondEntries.Walk(ctx, nil, func(key string, value lockuptypes.UnbondingEntries) (stop bool, err error) { + // if not mature then skip + if value.EndTime.After(currentTime) { + return false, nil + } + + ubdEntries := []stakingtypes.UnbondingDelegationEntry{} + entries, err := bva.getUbdEntries(ctx, delAddr, key) + if err != nil { + return true, err + } + + ubdEntries = append(ubdEntries, entries...) + + found := false + // check if the entry is still exist in the unbonding entries + for _, entry := range ubdEntries { + if entry.GetCompletionTime().Equal(value.EndTime) && entry.CreationHeight == value.CreationHeight { + found = true + break + } + } + + if !found { + err = bva.TrackUndelegation(ctx, sdk.NewCoins(value.Amount)) + if err != nil { + return true, err + } + } + + return false, nil + }) + return err +} + // TrackDelegation tracks a delegation amount for any given lockup account type // given the amount of coins currently being locked and the current account balance // of the delegation denominations. @@ -602,6 +621,17 @@ func (bva BaseLockup) getBalance(ctx context.Context, sender, denom string) (*sd return resp.Balance, nil } +func (bva BaseLockup) getUbdEntries(ctx context.Context, delAddr, valAddr string) ([]stakingtypes.UnbondingDelegationEntry, error) { + resp, err := accountstd.QueryModule[*stakingtypes.QueryUnbondingDelegationResponse]( + ctx, &stakingtypes.QueryUnbondingDelegationRequest{DelegatorAddr: delAddr, ValidatorAddr: valAddr}, + ) + if err != nil { + return nil, err + } + + return resp.Unbond.Entries, nil +} + func (bva BaseLockup) checkTokensSendable(ctx context.Context, sender string, amount, lockedCoins sdk.Coins) error { // Check if any sent tokens is exceeds lockup account balances for _, coin := range amount { @@ -748,7 +778,6 @@ func (bva BaseLockup) QueryUnbondingEntries(ctx context.Context, _ *lockuptypes. func (bva BaseLockup) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { accountstd.RegisterExecuteHandler(builder, bva.Undelegate) accountstd.RegisterExecuteHandler(builder, bva.WithdrawReward) - accountstd.RegisterExecuteHandler(builder, bva.UpdateUndelegationEntry) } func (bva BaseLockup) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { diff --git a/x/accounts/defaults/lockup/periodic_locking_account_test.go b/x/accounts/defaults/lockup/periodic_locking_account_test.go index 5f08eecb4ed3..f2f92b24bfe9 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account_test.go +++ b/x/accounts/defaults/lockup/periodic_locking_account_test.go @@ -143,12 +143,6 @@ func TestPeriodicAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - _, err = acc.UpdateUndelegationEntry(sdkCtx, &lockuptypes.MsgUpdateUndelegationEntry{ - Sender: "owner", - Id: ubdSeq - 1, - }) - require.NoError(t, err) - delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) diff --git a/x/accounts/defaults/lockup/permanent_locking_account.go b/x/accounts/defaults/lockup/permanent_locking_account.go index 97bf8fd517d6..ee0d0a447a95 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account.go +++ b/x/accounts/defaults/lockup/permanent_locking_account.go @@ -103,7 +103,6 @@ func (plva PermanentLockingAccount) RegisterExecuteHandlers(builder *accountstd. accountstd.RegisterExecuteHandler(builder, plva.Undelegate) accountstd.RegisterExecuteHandler(builder, plva.SendCoins) accountstd.RegisterExecuteHandler(builder, plva.WithdrawReward) - accountstd.RegisterExecuteHandler(builder, plva.UpdateUndelegationEntry) } func (plva PermanentLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { diff --git a/x/accounts/defaults/lockup/permanent_locking_account_test.go b/x/accounts/defaults/lockup/permanent_locking_account_test.go index f56fa1062480..83cdc4890349 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account_test.go +++ b/x/accounts/defaults/lockup/permanent_locking_account_test.go @@ -85,12 +85,6 @@ func TestPermanentAccountUndelegate(t *testing.T) { require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) require.True(t, ubdEntry.ValidatorAddress == "val_address") - _, err = acc.UpdateUndelegationEntry(sdkCtx, &lockuptypes.MsgUpdateUndelegationEntry{ - Sender: "owner", - Id: ubdSeq - 1, - }) - require.NoError(t, err) - delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) diff --git a/x/accounts/defaults/lockup/v1/lockup.pb.go b/x/accounts/defaults/lockup/v1/lockup.pb.go index bfaea39ca537..7b9e835a9e43 100644 --- a/x/accounts/defaults/lockup/v1/lockup.pb.go +++ b/x/accounts/defaults/lockup/v1/lockup.pb.go @@ -86,10 +86,53 @@ func (m *Period) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { return nil } +type UnbondingEntries struct { + Entries []*UnbondingEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` +} + +func (m *UnbondingEntries) Reset() { *m = UnbondingEntries{} } +func (m *UnbondingEntries) String() string { return proto.CompactTextString(m) } +func (*UnbondingEntries) ProtoMessage() {} +func (*UnbondingEntries) Descriptor() ([]byte, []int) { + return fileDescriptor_6b9783f5e2b76d96, []int{1} +} +func (m *UnbondingEntries) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UnbondingEntries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnbondingEntries.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UnbondingEntries) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnbondingEntries.Merge(m, src) +} +func (m *UnbondingEntries) XXX_Size() int { + return m.Size() +} +func (m *UnbondingEntries) XXX_DiscardUnknown() { + xxx_messageInfo_UnbondingEntries.DiscardUnknown(m) +} + +var xxx_messageInfo_UnbondingEntries proto.InternalMessageInfo + +func (m *UnbondingEntries) GetEntries() []*UnbondingEntry { + if m != nil { + return m.Entries + } + return nil +} + // UnbondingEntry defines an entry tracking the lockup account unbonding operation. type UnbondingEntry struct { - // ID of entry - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"` // end time of entry EndTime time.Time `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` // unbond amount @@ -102,7 +145,7 @@ func (m *UnbondingEntry) Reset() { *m = UnbondingEntry{} } func (m *UnbondingEntry) String() string { return proto.CompactTextString(m) } func (*UnbondingEntry) ProtoMessage() {} func (*UnbondingEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_6b9783f5e2b76d96, []int{1} + return fileDescriptor_6b9783f5e2b76d96, []int{2} } func (m *UnbondingEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -131,9 +174,9 @@ func (m *UnbondingEntry) XXX_DiscardUnknown() { var xxx_messageInfo_UnbondingEntry proto.InternalMessageInfo -func (m *UnbondingEntry) GetId() uint64 { +func (m *UnbondingEntry) GetCreationHeight() int64 { if m != nil { - return m.Id + return m.CreationHeight } return 0 } @@ -161,6 +204,7 @@ func (m *UnbondingEntry) GetValidatorAddress() string { func init() { proto.RegisterType((*Period)(nil), "cosmos.accounts.defaults.lockup.v1.Period") + proto.RegisterType((*UnbondingEntries)(nil), "cosmos.accounts.defaults.lockup.v1.UnbondingEntries") proto.RegisterType((*UnbondingEntry)(nil), "cosmos.accounts.defaults.lockup.v1.UnbondingEntry") } @@ -169,37 +213,40 @@ func init() { } var fileDescriptor_6b9783f5e2b76d96 = []byte{ - // 476 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x4f, 0x6f, 0xd3, 0x30, - 0x18, 0xc6, 0xeb, 0x6e, 0x2a, 0x2c, 0xc0, 0xc4, 0x22, 0x0e, 0x5d, 0x25, 0xd2, 0xd2, 0x53, 0x55, - 0x69, 0xb6, 0x0a, 0x57, 0x0e, 0x50, 0x0a, 0x47, 0x84, 0xca, 0x9f, 0x03, 0x97, 0xca, 0x89, 0x3d, - 0xcf, 0x6a, 0xe2, 0xb7, 0x8a, 0x9d, 0x88, 0x7c, 0x8b, 0x1d, 0x11, 0x9f, 0x00, 0x71, 0xda, 0x81, - 0xaf, 0x80, 0xb4, 0xe3, 0xc4, 0x89, 0x13, 0x43, 0xed, 0x61, 0x5f, 0x80, 0x0f, 0x80, 0x62, 0x3b, - 0x93, 0x18, 0x62, 0x97, 0xf6, 0x8d, 0xdf, 0xf7, 0x79, 0x5e, 0xff, 0x9e, 0x24, 0x20, 0x09, 0xe8, - 0x0c, 0x34, 0xa1, 0x49, 0x02, 0x85, 0x32, 0x9a, 0x30, 0x7e, 0x48, 0x8b, 0xd4, 0x68, 0x92, 0x42, - 0xb2, 0x2c, 0x56, 0xa4, 0x9c, 0xf8, 0x0a, 0xaf, 0x72, 0x30, 0x10, 0x0e, 0x9d, 0x00, 0x37, 0x02, - 0xdc, 0x08, 0xb0, 0x1f, 0x2b, 0x27, 0xbd, 0x3d, 0x9a, 0x49, 0x05, 0xc4, 0xfe, 0x3a, 0x59, 0x2f, - 0xf2, 0x7b, 0x62, 0xaa, 0x39, 0x29, 0x27, 0x31, 0x37, 0x74, 0x42, 0x12, 0x90, 0xca, 0xf7, 0xef, - 0x09, 0x10, 0x60, 0x4b, 0x52, 0x57, 0xfe, 0x74, 0xdf, 0xa9, 0x16, 0xae, 0xe1, 0x37, 0x7b, 0x43, - 0x01, 0x20, 0x52, 0x4e, 0xec, 0x53, 0x5c, 0x1c, 0x12, 0x56, 0xe4, 0xd4, 0x48, 0x68, 0x0c, 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0x29, 0xfd, 0x97, 0x71, 0xa7, 0xb6, 0xf8, 0xeb, 0x9a, 0xe1, 0xcb, 0x60, 0xaf, - 0xa4, 0xa9, 0x64, 0xd4, 0x40, 0xbe, 0xa0, 0x8c, 0xe5, 0x5c, 0xeb, 0xee, 0xf6, 0x00, 0x8d, 0x76, - 0xa6, 0x0f, 0xbe, 0x7f, 0x3d, 0xb8, 0xef, 0xbd, 0xde, 0x35, 0x33, 0x4f, 0xdd, 0xc8, 0x6b, 0x93, - 0x4b, 0x25, 0xe6, 0x77, 0xcb, 0x2b, 0xe7, 0xd3, 0xd9, 0xe9, 0x3a, 0x42, 0x67, 0xeb, 0x08, 0xfd, - 0x5a, 0x47, 0xe8, 0x78, 0x13, 0xb5, 0xce, 0x36, 0x51, 0xeb, 0xc7, 0x26, 0x6a, 0xbd, 0x1f, 0x3b, - 0x2b, 0xcd, 0x96, 0x58, 0x02, 0xf9, 0x70, 0xdd, 0xa7, 0x1d, 0x77, 0x2c, 0xff, 0xa3, 0x3f, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x06, 0xd9, 0xd4, 0xef, 0x07, 0x03, 0x00, 0x00, + // 517 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xcf, 0x6e, 0x13, 0x31, + 0x10, 0xc6, 0xe3, 0x06, 0xa5, 0xd4, 0x40, 0x69, 0x57, 0x1c, 0xd2, 0x48, 0x6c, 0x42, 0x2e, 0x44, + 0x91, 0x6a, 0x2b, 0xe5, 0xca, 0x01, 0x42, 0x40, 0x1c, 0x10, 0x42, 0xe1, 0xcf, 0x81, 0x4b, 0xf0, + 0xae, 0x5d, 0xc7, 0xca, 0xae, 0x1d, 0xad, 0xbd, 0x2b, 0xf2, 0x10, 0x48, 0x3d, 0x22, 0x9e, 0x00, + 0x71, 0xea, 0x81, 0x57, 0x40, 0xea, 0xb1, 0xe2, 0xc4, 0x89, 0x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 0x40, 0x6f, 0x6b, 0x78, 0xe7, 0xfb, 0xd7, 0xfd, 0xdb, 0xde, + 0xeb, 0x4d, 0x75, 0xe6, 0xa1, 0x3b, 0xf2, 0xd2, 0x64, 0x42, 0xf2, 0xf1, 0x4e, 0x71, 0x29, 0x3f, + 0x1c, 0x9d, 0x2c, 0x43, 0x70, 0xba, 0x0c, 0xc1, 0xaf, 0x65, 0x08, 0x8e, 0x56, 0x61, 0xed, 0x74, + 0x15, 0xd6, 0x7e, 0xac, 0xc2, 0xda, 0xdb, 0xbe, 0xb3, 0xd2, 0x74, 0x86, 0x84, 0xc2, 0xef, 0xff, + 0xf5, 0x57, 0x45, 0x0d, 0x3b, 0xff, 0xbd, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xd3, 0xd6, + 0xb7, 0x82, 0x03, 0x00, 0x00, } func (m *Period) Marshal() (dAtA []byte, err error) { @@ -247,6 +294,43 @@ func (m *Period) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *UnbondingEntries) 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 *UnbondingEntries) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnbondingEntries) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLockup(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *UnbondingEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -292,8 +376,8 @@ func (m *UnbondingEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintLockup(dAtA, i, uint64(n3)) i-- dAtA[i] = 0x12 - if m.Id != 0 { - i = encodeVarintLockup(dAtA, i, uint64(m.Id)) + if m.CreationHeight != 0 { + i = encodeVarintLockup(dAtA, i, uint64(m.CreationHeight)) i-- dAtA[i] = 0x8 } @@ -328,14 +412,29 @@ func (m *Period) Size() (n int) { return n } +func (m *UnbondingEntries) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovLockup(uint64(l)) + } + } + return n +} + func (m *UnbondingEntry) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Id != 0 { - n += 1 + sovLockup(uint64(m.Id)) + if m.CreationHeight != 0 { + n += 1 + sovLockup(uint64(m.CreationHeight)) } l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime) n += 1 + l + sovLockup(uint64(l)) @@ -471,6 +570,90 @@ func (m *Period) Unmarshal(dAtA []byte) error { } return nil } +func (m *UnbondingEntries) 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 ErrIntOverflowLockup + } + 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: UnbondingEntries: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnbondingEntries: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLockup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLockup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLockup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Entries = append(m.Entries, &UnbondingEntry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLockup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLockup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *UnbondingEntry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -502,9 +685,9 @@ func (m *UnbondingEntry) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType) } - m.Id = 0 + m.CreationHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowLockup @@ -514,7 +697,7 @@ func (m *UnbondingEntry) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Id |= uint64(b&0x7F) << shift + m.CreationHeight |= int64(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/lockup.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/lockup.proto index a67aa6159aff..65338a1f441e 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/lockup.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/lockup.proto @@ -23,10 +23,13 @@ message Period { ]; } +message UnbondingEntries { + repeated UnbondingEntry entries = 1; +} + // UnbondingEntry defines an entry tracking the lockup account unbonding operation. message UnbondingEntry { - // ID of entry - uint64 id = 1; + int64 creation_height = 1; // end time of entry google.protobuf.Timestamp end_time = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; From f9d1bfbd492dc96419daf3334fa8ed504a687488 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 2 Dec 2024 10:34:44 +0700 Subject: [PATCH 15/24] fixing --- .../defaults/lockup/v1/query.pulsar.go | 251 ++++++++++++------ .../lockup/continuous_locking_account_test.go | 11 +- .../lockup/delayed_locking_account_test.go | 11 +- x/accounts/defaults/lockup/lockup.go | 87 +++--- .../lockup/periodic_locking_account_test.go | 12 +- .../lockup/permanent_locking_account_test.go | 12 +- x/accounts/defaults/lockup/utils_test.go | 43 ++- x/accounts/defaults/lockup/v1/query.pb.go | 128 ++++++--- .../accounts/defaults/lockup/v1/query.proto | 5 +- 9 files changed, 372 insertions(+), 188 deletions(-) diff --git a/api/cosmos/accounts/defaults/lockup/v1/query.pulsar.go b/api/cosmos/accounts/defaults/lockup/v1/query.pulsar.go index 2dcd3ca4f35d..cd151e536adc 100644 --- a/api/cosmos/accounts/defaults/lockup/v1/query.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/v1/query.pulsar.go @@ -4,6 +4,7 @@ package lockupv1 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" @@ -1640,12 +1641,14 @@ func (x *fastReflection_QueryLockupAccountInfoResponse) ProtoMethods() *protoifa } var ( - md_QueryUnbondingEntriesRequest protoreflect.MessageDescriptor + md_QueryUnbondingEntriesRequest protoreflect.MessageDescriptor + fd_QueryUnbondingEntriesRequest_validator_address protoreflect.FieldDescriptor ) func init() { file_cosmos_accounts_defaults_lockup_v1_query_proto_init() md_QueryUnbondingEntriesRequest = File_cosmos_accounts_defaults_lockup_v1_query_proto.Messages().ByName("QueryUnbondingEntriesRequest") + fd_QueryUnbondingEntriesRequest_validator_address = md_QueryUnbondingEntriesRequest.Fields().ByName("validator_address") } var _ protoreflect.Message = (*fastReflection_QueryUnbondingEntriesRequest)(nil) @@ -1713,6 +1716,12 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) Interface() protoreflect.P // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_QueryUnbondingEntriesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ValidatorAddress != "" { + value := protoreflect.ValueOfString(x.ValidatorAddress) + if !f(fd_QueryUnbondingEntriesRequest_validator_address, value) { + return + } + } } // Has reports whether a field is populated. @@ -1728,6 +1737,8 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) Range(f func(protoreflect. // a repeated field is populated if it is non-empty. func (x *fastReflection_QueryUnbondingEntriesRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest.validator_address": + return x.ValidatorAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest")) @@ -1744,6 +1755,8 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) Has(fd protoreflect.FieldD // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryUnbondingEntriesRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest.validator_address": + x.ValidatorAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest")) @@ -1760,6 +1773,9 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) Clear(fd protoreflect.Fiel // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_QueryUnbondingEntriesRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest.validator_address": + value := x.ValidatorAddress + return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest")) @@ -1780,6 +1796,8 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) Get(descriptor protoreflec // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryUnbondingEntriesRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest.validator_address": + x.ValidatorAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest")) @@ -1800,6 +1818,8 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) Set(fd protoreflect.FieldD // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryUnbondingEntriesRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest.validator_address": + panic(fmt.Errorf("field validator_address of message cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest")) @@ -1813,6 +1833,8 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) Mutable(fd protoreflect.Fi // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_QueryUnbondingEntriesRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest.validator_address": + return protoreflect.ValueOfString("") default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesRequest")) @@ -1882,6 +1904,10 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) ProtoMethods() *protoiface var n int var l int _ = l + l = len(x.ValidatorAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1911,6 +1937,13 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) ProtoMethods() *protoiface i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.ValidatorAddress) > 0 { + i -= len(x.ValidatorAddress) + copy(dAtA[i:], x.ValidatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -1960,6 +1993,38 @@ func (x *fastReflection_QueryUnbondingEntriesRequest) ProtoMethods() *protoiface return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryUnbondingEntriesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3484,6 +3549,8 @@ type QueryUnbondingEntriesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` } func (x *QueryUnbondingEntriesRequest) Reset() { @@ -3506,6 +3573,13 @@ func (*QueryUnbondingEntriesRequest) Descriptor() ([]byte, []int) { return file_cosmos_accounts_defaults_lockup_v1_query_proto_rawDescGZIP(), []int{2} } +func (x *QueryUnbondingEntriesRequest) GetValidatorAddress() string { + if x != nil { + return x.ValidatorAddress + } + return "" +} + // QueryUnbondingEntriesResponse returns the lockup account unbonding entries. type QueryUnbondingEntriesResponse struct { state protoimpl.MessageState @@ -3623,95 +3697,102 @@ var file_cosmos_accounts_defaults_lockup_v1_query_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1f, 0x0a, 0x1d, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xfe, 0x05, - 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x76, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x6f, 0x63, - 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, - 0x6c, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x72, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x72, 0x65, 0x65, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, - 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0d, 0x64, - 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x46, 0x72, 0x65, 0x65, 0x12, 0x78, 0x0a, 0x11, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, - 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1f, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xfe, 0x05, 0x0a, 0x1e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, 0x10, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, + 0x01, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x73, 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4c, 0x6f, 0x63, 0x6b, + 0x69, 0x6e, 0x67, 0x12, 0x72, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x66, 0x72, 0x65, 0x65, 0x18, 0x02, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x64, 0x46, 0x72, 0x65, 0x65, 0x12, 0x78, 0x0a, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 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, 0x30, 0xc8, + 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, + 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, + 0x67, 0x12, 0x3f, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x6e, 0x0a, 0x0c, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, + 0x06, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x73, 0x52, 0x0b, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, + 0x72, 0x0a, 0x0e, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x69, 0x6e, + 0x73, 0x18, 0x07, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4c, - 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x3f, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x64, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x6e, 0x0a, 0x0c, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x63, - 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x06, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0b, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x43, - 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x72, 0x0a, 0x0e, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, - 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x07, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, - 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0d, 0x75, 0x6e, 0x6c, 0x6f, 0x63, - 0x6b, 0x65, 0x64, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x1e, - 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x80, - 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x5f, 0x0a, 0x11, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, - 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x10, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x22, 0x1c, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, - 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x72, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, - 0x0a, 0x0f, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x52, 0x0e, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, - 0x6f, 0x64, 0x73, 0x42, 0x9f, 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x76, - 0x31, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x44, - 0x4c, 0xaa, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x63, - 0x6b, 0x75, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0d, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x43, 0x6f, + 0x69, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x6e, 0x0a, 0x1c, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x1d, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x11, 0x75, + 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x62, 0x6f, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x75, 0x6e, 0x62, 0x6f, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x1c, 0x0a, 0x1a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x72, 0x0a, 0x1b, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0f, 0x6c, 0x6f, 0x63, + 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, + 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0e, + 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x42, 0x9f, + 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, + 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x6c, 0x6f, 0x63, + 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x22, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, + 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2e, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x26, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, - 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, - 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/x/accounts/defaults/lockup/continuous_locking_account_test.go b/x/accounts/defaults/lockup/continuous_locking_account_test.go index 1c8d381221d0..6bcbb60af11c 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account_test.go +++ b/x/accounts/defaults/lockup/continuous_locking_account_test.go @@ -102,13 +102,14 @@ func TestContinousAccountUndelegate(t *testing.T) { }) require.NoError(t, err) - ubdSeq, err := acc.UnbondingSequence.Peek(sdkCtx) + entries, err := acc.UnbondEntries.Get(sdkCtx, "val_address") require.NoError(t, err) - // sequence should be the previous one - ubdEntry, err := acc.UnbondEntries.Get(sdkCtx, ubdSeq-1) + require.Len(t, entries.Entries, 1) + require.True(t, entries.Entries[0].Amount.Amount.Equal(math.NewInt(1))) + require.True(t, entries.Entries[0].ValidatorAddress == "val_address") + + err = acc.CheckUbdEntriesMature(sdkCtx) require.NoError(t, err) - require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) - require.True(t, ubdEntry.ValidatorAddress == "val_address") delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) diff --git a/x/accounts/defaults/lockup/delayed_locking_account_test.go b/x/accounts/defaults/lockup/delayed_locking_account_test.go index 26fcf6930683..d91c1345aa4a 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account_test.go +++ b/x/accounts/defaults/lockup/delayed_locking_account_test.go @@ -101,13 +101,14 @@ func TestDelayedAccountUndelegate(t *testing.T) { }) require.NoError(t, err) - ubdSeq, err := acc.UnbondingSequence.Peek(sdkCtx) + entries, err := acc.UnbondEntries.Get(sdkCtx, "val_address") require.NoError(t, err) - // sequence should be the previous one - ubdEntry, err := acc.UnbondEntries.Get(sdkCtx, ubdSeq-1) + require.Len(t, entries.Entries, 1) + require.True(t, entries.Entries[0].Amount.Amount.Equal(math.NewInt(1))) + require.True(t, entries.Entries[0].ValidatorAddress == "val_address") + + err = acc.CheckUbdEntriesMature(sdkCtx) require.NoError(t, err) - require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) - require.True(t, ubdEntry.ValidatorAddress == "val_address") delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index b0623e25503b..1ed16e1aa97d 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -215,23 +215,41 @@ func (bva *BaseLockup) Undelegate( return nil, err } + isNewEntry := true + skipEntriesIteration := false entries, err := bva.UnbondEntries.Get(ctx, msg.ValidatorAddress) if err != nil { - if !errorsmod.IsOf(err, collections.ErrNotFound) { + if errorsmod.IsOf(err, collections.ErrNotFound) { entries = lockuptypes.UnbondingEntries{ Entries: []*lockuptypes.UnbondingEntry{}, } + skipEntriesIteration = true } else { return nil, err } } - entries.Entries = append(entries.Entries, &lockuptypes.UnbondingEntry{ - EndTime: msgUndelegateResp.CompletionTime, - Amount: msgUndelegateResp.Amount, - ValidatorAddress: msg.ValidatorAddress, - CreationHeight: header.Height, - }) + if !skipEntriesIteration { + for i, entry := range entries.Entries { + if entry.CreationHeight == header.Height && entry.EndTime.Equal(msgUndelegateResp.CompletionTime) { + entry.Amount = entry.Amount.Add(msg.Amount) + + // update the entry + entries.Entries[i] = entry + isNewEntry = false + break + } + } + } + + if isNewEntry { + entries.Entries = append(entries.Entries, &lockuptypes.UnbondingEntry{ + EndTime: msgUndelegateResp.CompletionTime, + Amount: msgUndelegateResp.Amount, + ValidatorAddress: msg.ValidatorAddress, + CreationHeight: header.Height, + }) + } err = bva.UnbondEntries.Set(ctx, msg.ValidatorAddress, entries) if err != nil { @@ -457,32 +475,35 @@ func (bva *BaseLockup) CheckUbdEntriesMature(ctx context.Context) error { currentTime := bva.headerService.HeaderInfo(ctx).Time err = bva.UnbondEntries.Walk(ctx, nil, func(key string, value lockuptypes.UnbondingEntries) (stop bool, err error) { - // if not mature then skip - if value.EndTime.After(currentTime) { - return false, nil - } + for _, entry := range value.Entries { + // if not mature then skip + if entry.EndTime.After(currentTime) { + return false, nil + } - ubdEntries := []stakingtypes.UnbondingDelegationEntry{} - entries, err := bva.getUbdEntries(ctx, delAddr, key) - if err != nil { - return true, err - } + ubdEntries := []stakingtypes.UnbondingDelegationEntry{} + entries, err := bva.getUbdEntries(ctx, delAddr, key) + if err != nil { + return true, err + } - ubdEntries = append(ubdEntries, entries...) + ubdEntries = append(ubdEntries, entries...) - found := false - // check if the entry is still exist in the unbonding entries - for _, entry := range ubdEntries { - if entry.GetCompletionTime().Equal(value.EndTime) && entry.CreationHeight == value.CreationHeight { - found = true - break + found := false + // check if the entry is still exist in the unbonding entries + for _, e := range ubdEntries { + if e.GetCompletionTime().Equal(entry.EndTime) && entry.CreationHeight == entry.CreationHeight { + found = true + break + } } - } - if !found { - err = bva.TrackUndelegation(ctx, sdk.NewCoins(value.Amount)) - if err != nil { - return true, err + // if not found then assume ubd entry is being handled + if !found { + err = bva.TrackUndelegation(ctx, sdk.NewCoins(entry.Amount)) + if err != nil { + return true, err + } } } @@ -758,20 +779,16 @@ func (bva BaseLockup) QueryLockupAccountBaseInfo(ctx context.Context, _ *lockupt }, nil } -func (bva BaseLockup) QueryUnbondingEntries(ctx context.Context, _ *lockuptypes.QueryUnbondingEntriesRequest) ( +func (bva BaseLockup) QueryUnbondingEntries(ctx context.Context, req *lockuptypes.QueryUnbondingEntriesRequest) ( *lockuptypes.QueryUnbondingEntriesResponse, error, ) { - entries := []*lockuptypes.UnbondingEntry{} - err := bva.UnbondEntries.Walk(ctx, nil, func(key uint64, value lockuptypes.UnbondingEntry) (stop bool, err error) { - entries = append(entries, &value) - return false, nil - }) + entries, err := bva.UnbondEntries.Get(ctx, req.ValidatorAddress) if err != nil { return nil, err } return &lockuptypes.QueryUnbondingEntriesResponse{ - UnbondingEntries: entries, + UnbondingEntries: entries.Entries, }, nil } diff --git a/x/accounts/defaults/lockup/periodic_locking_account_test.go b/x/accounts/defaults/lockup/periodic_locking_account_test.go index f2f92b24bfe9..17ec2eefd6c3 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account_test.go +++ b/x/accounts/defaults/lockup/periodic_locking_account_test.go @@ -135,13 +135,15 @@ func TestPeriodicAccountUndelegate(t *testing.T) { }) require.NoError(t, err) - ubdSeq, err := acc.UnbondingSequence.Peek(sdkCtx) - require.NoError(t, err) // sequence should be the previous one - ubdEntry, err := acc.UnbondEntries.Get(sdkCtx, ubdSeq-1) + entries, err := acc.UnbondEntries.Get(sdkCtx, "val_address") + require.NoError(t, err) + require.Len(t, entries.Entries, 1) + require.True(t, entries.Entries[0].Amount.Amount.Equal(math.NewInt(1))) + require.True(t, entries.Entries[0].ValidatorAddress == "val_address") + + err = acc.CheckUbdEntriesMature(sdkCtx) require.NoError(t, err) - require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) - require.True(t, ubdEntry.ValidatorAddress == "val_address") delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) diff --git a/x/accounts/defaults/lockup/permanent_locking_account_test.go b/x/accounts/defaults/lockup/permanent_locking_account_test.go index 83cdc4890349..a732db475adf 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account_test.go +++ b/x/accounts/defaults/lockup/permanent_locking_account_test.go @@ -77,13 +77,15 @@ func TestPermanentAccountUndelegate(t *testing.T) { }) require.NoError(t, err) - ubdSeq, err := acc.UnbondingSequence.Peek(sdkCtx) - require.NoError(t, err) // sequence should be the previous one - ubdEntry, err := acc.UnbondEntries.Get(sdkCtx, ubdSeq-1) + entries, err := acc.UnbondEntries.Get(sdkCtx, "val_address") + require.NoError(t, err) + require.Len(t, entries.Entries, 1) + require.True(t, entries.Entries[0].Amount.Amount.Equal(math.NewInt(1))) + require.True(t, entries.Entries[0].ValidatorAddress == "val_address") + + err = acc.CheckUbdEntriesMature(sdkCtx) require.NoError(t, err) - require.True(t, ubdEntry.Amount.Amount.Equal(math.NewInt(1))) - require.True(t, ubdEntry.ValidatorAddress == "val_address") delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) diff --git a/x/accounts/defaults/lockup/utils_test.go b/x/accounts/defaults/lockup/utils_test.go index e1e66a0eb39b..684e43b79bd3 100644 --- a/x/accounts/defaults/lockup/utils_test.go +++ b/x/accounts/defaults/lockup/utils_test.go @@ -4,9 +4,9 @@ import ( "context" "errors" "testing" + "time" gogoproto "github.com/cosmos/gogoproto/proto" - "github.com/stretchr/testify/require" "cosmossdk.io/collections" appmodulev2 "cosmossdk.io/core/appmodule/v2" @@ -88,23 +88,44 @@ func newMockContext(t *testing.T) (context.Context, store.KVStoreService) { return nil, errors.New("unrecognized request type") } }, func(ctx context.Context, req transaction.Msg) (transaction.Msg, error) { - _, ok := req.(*banktypes.QueryBalanceRequest) - if !ok { - _, ok = req.(*stakingtypes.QueryParamsRequest) - require.True(t, ok) + typeUrl := sdk.MsgTypeURL(req) + switch typeUrl { + case "/cosmos.staking.v1beta1.QueryParamsRequest": return &stakingtypes.QueryParamsResponse{ Params: stakingtypes.Params{ BondDenom: "test", }, }, nil + case "/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest": + return &stakingtypes.QueryUnbondingDelegationResponse{ + Unbond: stakingtypes.UnbondingDelegation{ + DelegatorAddress: "sender", + ValidatorAddress: "val_address", + Entries: []stakingtypes.UnbondingDelegationEntry{ + { + CreationHeight: 1, + CompletionTime: time.Now(), + Balance: math.NewInt(1), + }, + { + CreationHeight: 1, + CompletionTime: time.Now().Add(time.Hour), + Balance: math.NewInt(1), + }, + }, + }, + }, nil + case "/cosmos.bank.v1beta1.QueryBalanceRequest": + return &banktypes.QueryBalanceResponse{ + Balance: &(sdk.Coin{ + Denom: "test", + Amount: TestFunds.AmountOf("test"), + }), + }, nil + default: + return nil, errors.New("unrecognized request type") } - return &banktypes.QueryBalanceResponse{ - Balance: &(sdk.Coin{ - Denom: "test", - Amount: TestFunds.AmountOf("test"), - }), - }, nil }, ) } diff --git a/x/accounts/defaults/lockup/v1/query.pb.go b/x/accounts/defaults/lockup/v1/query.pb.go index d44956c50a0e..9121abdaa72f 100644 --- a/x/accounts/defaults/lockup/v1/query.pb.go +++ b/x/accounts/defaults/lockup/v1/query.pb.go @@ -5,6 +5,7 @@ package v1 import ( fmt "fmt" + _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" @@ -177,6 +178,7 @@ func (m *QueryLockupAccountInfoResponse) GetOwner() string { // QueryUnbondingEntriesRequest is used to query the lockup account unbonding entries. type QueryUnbondingEntriesRequest struct { + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` } func (m *QueryUnbondingEntriesRequest) Reset() { *m = QueryUnbondingEntriesRequest{} } @@ -212,6 +214,13 @@ func (m *QueryUnbondingEntriesRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryUnbondingEntriesRequest proto.InternalMessageInfo +func (m *QueryUnbondingEntriesRequest) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + // QueryUnbondingEntriesResponse returns the lockup account unbonding entries. type QueryUnbondingEntriesResponse struct { // UnbondingEntry defines the list of unbonding entries. @@ -355,42 +364,46 @@ func init() { } var fileDescriptor_f2c1403191515490 = []byte{ - // 556 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0x8d, 0xe9, 0x7b, 0x02, 0x6d, 0x1a, 0x75, 0x11, 0x42, 0x71, 0xa2, 0xac, 0xa2, 0x4a, 0xcc, - 0x90, 0xb0, 0x64, 0x81, 0x08, 0x0f, 0x09, 0xa9, 0x0b, 0x30, 0xb0, 0x61, 0x63, 0xf9, 0x71, 0x63, - 0x46, 0x71, 0x66, 0xdc, 0x99, 0x71, 0x68, 0x76, 0x7c, 0x42, 0xbf, 0x83, 0x2f, 0xe9, 0xb2, 0x4b, - 0x56, 0x14, 0x25, 0xff, 0x81, 0x90, 0x3d, 0x33, 0x41, 0xe1, 0x99, 0x45, 0x58, 0xd9, 0xe3, 0x7b, - 0xee, 0x39, 0xe7, 0xfa, 0xde, 0x3b, 0x08, 0x47, 0x5c, 0x8e, 0xb9, 0x24, 0x41, 0x14, 0xf1, 0x9c, - 0x29, 0x49, 0x62, 0x18, 0x06, 0x79, 0xaa, 0x24, 0x49, 0x79, 0x34, 0xca, 0x33, 0x32, 0xe9, 0x91, - 0xb3, 0x1c, 0xc4, 0x14, 0x67, 0x82, 0x2b, 0x5e, 0xef, 0x68, 0x3c, 0xb6, 0x78, 0x6c, 0xf1, 0x58, - 0xe3, 0xf1, 0xa4, 0xd7, 0x24, 0x2b, 0x70, 0x1a, 0x74, 0x49, 0xda, 0x74, 0x4d, 0x42, 0x18, 0x48, - 0x20, 0x93, 0x5e, 0x08, 0x2a, 0xe8, 0x91, 0x88, 0x53, 0x66, 0xe2, 0x47, 0x09, 0x4f, 0x78, 0xf9, - 0x4a, 0x8a, 0x37, 0xf3, 0xb5, 0x95, 0x70, 0x9e, 0xa4, 0x40, 0xca, 0x53, 0x98, 0x0f, 0x89, 0xa2, - 0x63, 0x90, 0x2a, 0x18, 0x1b, 0xda, 0x4e, 0x0b, 0xdd, 0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x00, 0xff, 0xff, 0xa2, 0xb2, 0x94, 0xe4, 0x81, 0x05, 0x00, 0x00, + // 613 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xcd, 0x4e, 0xdc, 0x3c, + 0x14, 0x9d, 0x7c, 0xfc, 0x9b, 0xaf, 0x30, 0x8c, 0x58, 0x0c, 0x53, 0xc8, 0xd0, 0xac, 0x46, 0x48, + 0xd8, 0x1d, 0xba, 0xec, 0xa2, 0x62, 0xfa, 0x23, 0x55, 0x42, 0x55, 0x1b, 0xda, 0x2e, 0xba, 0x89, + 0x92, 0xf8, 0x4e, 0x6a, 0x91, 0xb1, 0x07, 0xdb, 0x49, 0x61, 0xd7, 0x47, 0xe0, 0x39, 0xba, 0xee, + 0x43, 0xb0, 0x44, 0x5d, 0x75, 0x55, 0x2a, 0x78, 0x8f, 0xaa, 0x4a, 0x6c, 0x53, 0x41, 0xff, 0x58, + 0xd0, 0x55, 0x72, 0x7d, 0xcf, 0x3d, 0xe7, 0x9e, 0x5c, 0xdf, 0x20, 0x9c, 0x0a, 0x35, 0x12, 0x8a, + 0xc4, 0x69, 0x2a, 0x0a, 0xae, 0x15, 0xa1, 0x30, 0x8c, 0x8b, 0x5c, 0x2b, 0x92, 0x8b, 0x74, 0xaf, + 0x18, 0x93, 0xb2, 0x4f, 0xf6, 0x0b, 0x90, 0x87, 0x78, 0x2c, 0x85, 0x16, 0xad, 0xc0, 0xe0, 0xb1, + 0xc3, 0x63, 0x87, 0xc7, 0x06, 0x8f, 0xcb, 0x7e, 0x87, 0x5c, 0x83, 0xd3, 0xa2, 0x6b, 0xd2, 0x8e, + 0x6f, 0x0b, 0x92, 0x58, 0x01, 0x29, 0xfb, 0x09, 0xe8, 0xb8, 0x4f, 0x52, 0xc1, 0xb8, 0xcd, 0x2f, + 0x67, 0x22, 0x13, 0xf5, 0x2b, 0xa9, 0xde, 0xec, 0x69,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dd, 0xfe, 0x65, 0xd6, 0x76, 0xb7, 0x8b, 0x16, 0xed, 0x5e, 0x44, 0x63, + 0x93, 0xb2, 0xbd, 0x6d, 0x5c, 0xa7, 0x37, 0xc3, 0x16, 0x2e, 0xe4, 0x97, 0xc8, 0x07, 0x8f, 0x8e, + 0xcf, 0x7c, 0xef, 0xe4, 0xcc, 0xf7, 0xbe, 0x9e, 0xf9, 0xde, 0xd1, 0xb9, 0xdf, 0x38, 0x39, 0xf7, + 0x1b, 0x9f, 0xcf, 0xfd, 0xc6, 0x9b, 0x0d, 0x43, 0xaa, 0xe8, 0x1e, 0x66, 0x82, 0x1c, 0xfc, 0xe9, + 0x5f, 0x9b, 0x4c, 0xd7, 0xf7, 0xfc, 0xde, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x28, 0x0b, + 0x44, 0xec, 0x05, 0x00, 0x00, } func (m *QueryLockupAccountInfoRequest) Marshal() (dAtA []byte, err error) { @@ -556,6 +569,13 @@ func (m *QueryUnbondingEntriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -733,6 +753,10 @@ func (m *QueryUnbondingEntriesRequest) Size() (n int) { } var l int _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -1184,6 +1208,38 @@ func (m *QueryUnbondingEntriesRequest) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: QueryUnbondingEntriesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/query.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/query.proto index e8a83d0772e8..660b8d210ce0 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/query.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/query.proto @@ -5,6 +5,7 @@ import "cosmos/accounts/defaults/lockup/v1/lockup.proto"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "cosmossdk.io/x/accounts/defaults/lockup/v1"; @@ -44,7 +45,9 @@ message QueryLockupAccountInfoResponse { } // QueryUnbondingEntriesRequest is used to query the lockup account unbonding entries. -message QueryUnbondingEntriesRequest {} +message QueryUnbondingEntriesRequest { + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; +} // QueryUnbondingEntriesResponse returns the lockup account unbonding entries. message QueryUnbondingEntriesResponse { From 8e3be3d4589fae383c63e2c590300d94be0480c9 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 2 Dec 2024 15:14:50 +0700 Subject: [PATCH 16/24] fix tests --- .../accounts/defaults/lockup/v1/tx.pulsar.go | 686 ++---------------- .../lockup/continous_lockup_test_suite.go | 19 +- .../lockup/delayed_lockup_test_suite.go | 36 +- .../lockup/periodic_lockup_test_suite.go | 21 +- .../lockup/permanent_lockup_test_suite.go | 27 +- tests/integration/accounts/lockup/utils.go | 6 +- x/accounts/defaults/lockup/lockup.go | 23 +- x/accounts/defaults/lockup/v1/tx.pb.go | 305 ++------ .../accounts/defaults/lockup/v1/tx.proto | 11 - x/staking/keeper/grpc_query.go | 4 +- 10 files changed, 202 insertions(+), 936 deletions(-) diff --git a/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go b/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go index 328bc89776f0..6c690258c20f 100644 --- a/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go @@ -4178,474 +4178,6 @@ func (x *fastReflection_MsgSend) ProtoMethods() *protoiface.Methods { } } -var ( - md_MsgUpdateUndelegationEntry protoreflect.MessageDescriptor - fd_MsgUpdateUndelegationEntry_sender protoreflect.FieldDescriptor - fd_MsgUpdateUndelegationEntry_id protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() - md_MsgUpdateUndelegationEntry = File_cosmos_accounts_defaults_lockup_v1_tx_proto.Messages().ByName("MsgUpdateUndelegationEntry") - fd_MsgUpdateUndelegationEntry_sender = md_MsgUpdateUndelegationEntry.Fields().ByName("sender") - fd_MsgUpdateUndelegationEntry_id = md_MsgUpdateUndelegationEntry.Fields().ByName("id") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateUndelegationEntry)(nil) - -type fastReflection_MsgUpdateUndelegationEntry MsgUpdateUndelegationEntry - -func (x *MsgUpdateUndelegationEntry) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateUndelegationEntry)(x) -} - -func (x *MsgUpdateUndelegationEntry) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[8] - 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_MsgUpdateUndelegationEntry_messageType fastReflection_MsgUpdateUndelegationEntry_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateUndelegationEntry_messageType{} - -type fastReflection_MsgUpdateUndelegationEntry_messageType struct{} - -func (x fastReflection_MsgUpdateUndelegationEntry_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateUndelegationEntry)(nil) -} -func (x fastReflection_MsgUpdateUndelegationEntry_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateUndelegationEntry) -} -func (x fastReflection_MsgUpdateUndelegationEntry_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateUndelegationEntry -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateUndelegationEntry) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateUndelegationEntry -} - -// 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_MsgUpdateUndelegationEntry) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateUndelegationEntry_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateUndelegationEntry) New() protoreflect.Message { - return new(fastReflection_MsgUpdateUndelegationEntry) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateUndelegationEntry) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateUndelegationEntry)(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_MsgUpdateUndelegationEntry) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Sender != "" { - value := protoreflect.ValueOfString(x.Sender) - if !f(fd_MsgUpdateUndelegationEntry_sender, value) { - return - } - } - if x.Id != uint64(0) { - value := protoreflect.ValueOfUint64(x.Id) - if !f(fd_MsgUpdateUndelegationEntry_id, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateUndelegationEntry) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": - return x.Sender != "" - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": - return x.Id != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry 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_MsgUpdateUndelegationEntry) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": - x.Sender = "" - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": - x.Id = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry 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_MsgUpdateUndelegationEntry) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": - value := x.Sender - return protoreflect.ValueOfString(value) - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": - value := x.Id - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry 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_MsgUpdateUndelegationEntry) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": - x.Sender = value.Interface().(string) - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": - x.Id = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry 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_MsgUpdateUndelegationEntry) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": - panic(fmt.Errorf("field sender of message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry is not mutable")) - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": - panic(fmt.Errorf("field id of message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry 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_MsgUpdateUndelegationEntry) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.sender": - return protoreflect.ValueOfString("") - case "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry.id": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry 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_MsgUpdateUndelegationEntry) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry", 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_MsgUpdateUndelegationEntry) 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_MsgUpdateUndelegationEntry) 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_MsgUpdateUndelegationEntry) 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_MsgUpdateUndelegationEntry) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateUndelegationEntry) - 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.Sender) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Id != 0 { - n += 1 + runtime.Sov(uint64(x.Id)) - } - 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().(*MsgUpdateUndelegationEntry) - 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.Id != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Id)) - i-- - dAtA[i] = 0x10 - } - if len(x.Sender) > 0 { - i -= len(x.Sender) - copy(dAtA[i:], x.Sender) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) - 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().(*MsgUpdateUndelegationEntry) - 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: MsgUpdateUndelegationEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateUndelegationEntry: 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 Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - x.Id = 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.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 = (*_MsgExecuteMessagesResponse_1_list)(nil) type _MsgExecuteMessagesResponse_1_list struct { @@ -4717,7 +4249,7 @@ func (x *MsgExecuteMessagesResponse) ProtoReflect() protoreflect.Message { } func (x *MsgExecuteMessagesResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[9] + mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5210,7 +4742,7 @@ func (x *MsgWithdraw) ProtoReflect() protoreflect.Message { } func (x *MsgWithdraw) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[10] + mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5821,7 +5353,7 @@ func (x *MsgWithdrawResponse) ProtoReflect() protoreflect.Message { } func (x *MsgWithdrawResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[11] + mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6685,50 +6217,6 @@ func (x *MsgSend) GetAmount() []*v1beta1.Coin { return nil } -// MsgUpdateUndelegationEntry defines a message that enable lockup account to update delegation tracking -type MsgUpdateUndelegationEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *MsgUpdateUndelegationEntry) Reset() { - *x = MsgUpdateUndelegationEntry{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateUndelegationEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateUndelegationEntry) ProtoMessage() {} - -// Deprecated: Use MsgUpdateUndelegationEntry.ProtoReflect.Descriptor instead. -func (*MsgUpdateUndelegationEntry) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{8} -} - -func (x *MsgUpdateUndelegationEntry) GetSender() string { - if x != nil { - return x.Sender - } - return "" -} - -func (x *MsgUpdateUndelegationEntry) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - // MsgExecuteMessagesResponse defines the response for lockup execute operations type MsgExecuteMessagesResponse struct { state protoimpl.MessageState @@ -6741,7 +6229,7 @@ type MsgExecuteMessagesResponse struct { func (x *MsgExecuteMessagesResponse) Reset() { *x = MsgExecuteMessagesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[9] + mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6755,7 +6243,7 @@ func (*MsgExecuteMessagesResponse) ProtoMessage() {} // Deprecated: Use MsgExecuteMessagesResponse.ProtoReflect.Descriptor instead. func (*MsgExecuteMessagesResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{9} + return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{8} } func (x *MsgExecuteMessagesResponse) GetResponses() []*anypb.Any { @@ -6780,7 +6268,7 @@ type MsgWithdraw struct { func (x *MsgWithdraw) Reset() { *x = MsgWithdraw{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[10] + mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6794,7 +6282,7 @@ func (*MsgWithdraw) ProtoMessage() {} // Deprecated: Use MsgWithdraw.ProtoReflect.Descriptor instead. func (*MsgWithdraw) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{10} + return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{9} } func (x *MsgWithdraw) GetWithdrawer() string { @@ -6831,7 +6319,7 @@ type MsgWithdrawResponse struct { func (x *MsgWithdrawResponse) Reset() { *x = MsgWithdrawResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[11] + mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6845,7 +6333,7 @@ func (*MsgWithdrawResponse) ProtoMessage() {} // Deprecated: Use MsgWithdrawResponse.ProtoReflect.Descriptor instead. func (*MsgWithdrawResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{11} + return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{10} } func (x *MsgWithdrawResponse) GetReceiver() string { @@ -6980,62 +6468,55 @@ var file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDesc = []byte{ 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x13, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x22, 0x73, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x02, 0x69, 0x64, 0x3a, 0x13, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, - 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x50, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, - 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x4d, - 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x38, 0x0a, 0x0a, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x52, 0x09, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x3a, 0x17, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, - 0xe7, 0xb0, 0x2a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x22, 0xd8, - 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x8a, 0x01, 0x0a, - 0x0f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, - 0x18, 0x02, 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, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, - 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x9c, 0x02, 0x0a, 0x26, 0x63, 0x6f, - 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, - 0x70, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, - 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, - 0x43, 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, - 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, + 0x64, 0x65, 0x72, 0x22, 0x50, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x38, 0x0a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x12, + 0x37, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x74, + 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, + 0x3a, 0x17, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x77, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x22, 0xd8, 0x01, 0x0a, 0x13, 0x4d, 0x73, + 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x8a, 0x01, 0x0a, 0x0f, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x02, 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, 0x46, 0xc8, 0xde, + 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, + 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, + 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x64, 0x42, 0x9c, 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x42, + 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x76, 0x31, 0x3b, + 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x44, 0x4c, 0xaa, + 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x75, + 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, + 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x2e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, - 0x63, 0x6b, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x26, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7050,7 +6531,7 @@ func file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP() []byte { return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescData } -var file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_cosmos_accounts_defaults_lockup_v1_tx_proto_goTypes = []interface{}{ (*MsgInitLockupAccount)(nil), // 0: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount (*MsgInitLockupAccountResponse)(nil), // 1: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccountResponse @@ -7060,25 +6541,24 @@ var file_cosmos_accounts_defaults_lockup_v1_tx_proto_goTypes = []interface{}{ (*MsgUndelegate)(nil), // 5: cosmos.accounts.defaults.lockup.v1.MsgUndelegate (*MsgWithdrawReward)(nil), // 6: cosmos.accounts.defaults.lockup.v1.MsgWithdrawReward (*MsgSend)(nil), // 7: cosmos.accounts.defaults.lockup.v1.MsgSend - (*MsgUpdateUndelegationEntry)(nil), // 8: cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry - (*MsgExecuteMessagesResponse)(nil), // 9: cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse - (*MsgWithdraw)(nil), // 10: cosmos.accounts.defaults.lockup.v1.MsgWithdraw - (*MsgWithdrawResponse)(nil), // 11: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse - (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp - (*Period)(nil), // 13: cosmos.accounts.defaults.lockup.v1.Period - (*v1beta1.Coin)(nil), // 14: cosmos.base.v1beta1.Coin - (*anypb.Any)(nil), // 15: google.protobuf.Any + (*MsgExecuteMessagesResponse)(nil), // 8: cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse + (*MsgWithdraw)(nil), // 9: cosmos.accounts.defaults.lockup.v1.MsgWithdraw + (*MsgWithdrawResponse)(nil), // 10: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + (*Period)(nil), // 12: cosmos.accounts.defaults.lockup.v1.Period + (*v1beta1.Coin)(nil), // 13: cosmos.base.v1beta1.Coin + (*anypb.Any)(nil), // 14: google.protobuf.Any } var file_cosmos_accounts_defaults_lockup_v1_tx_proto_depIdxs = []int32{ - 12, // 0: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount.end_time:type_name -> google.protobuf.Timestamp - 12, // 1: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount.start_time:type_name -> google.protobuf.Timestamp - 12, // 2: cosmos.accounts.defaults.lockup.v1.MsgInitPeriodicLockingAccount.start_time:type_name -> google.protobuf.Timestamp - 13, // 3: cosmos.accounts.defaults.lockup.v1.MsgInitPeriodicLockingAccount.locking_periods:type_name -> cosmos.accounts.defaults.lockup.v1.Period - 14, // 4: cosmos.accounts.defaults.lockup.v1.MsgDelegate.amount:type_name -> cosmos.base.v1beta1.Coin - 14, // 5: cosmos.accounts.defaults.lockup.v1.MsgUndelegate.amount:type_name -> cosmos.base.v1beta1.Coin - 14, // 6: cosmos.accounts.defaults.lockup.v1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin - 15, // 7: cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse.responses:type_name -> google.protobuf.Any - 14, // 8: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.amount_received:type_name -> cosmos.base.v1beta1.Coin + 11, // 0: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount.end_time:type_name -> google.protobuf.Timestamp + 11, // 1: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount.start_time:type_name -> google.protobuf.Timestamp + 11, // 2: cosmos.accounts.defaults.lockup.v1.MsgInitPeriodicLockingAccount.start_time:type_name -> google.protobuf.Timestamp + 12, // 3: cosmos.accounts.defaults.lockup.v1.MsgInitPeriodicLockingAccount.locking_periods:type_name -> cosmos.accounts.defaults.lockup.v1.Period + 13, // 4: cosmos.accounts.defaults.lockup.v1.MsgDelegate.amount:type_name -> cosmos.base.v1beta1.Coin + 13, // 5: cosmos.accounts.defaults.lockup.v1.MsgUndelegate.amount:type_name -> cosmos.base.v1beta1.Coin + 13, // 6: cosmos.accounts.defaults.lockup.v1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin + 14, // 7: cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse.responses:type_name -> google.protobuf.Any + 13, // 8: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.amount_received:type_name -> cosmos.base.v1beta1.Coin 9, // [9:9] is the sub-list for method output_type 9, // [9:9] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name @@ -7190,18 +6670,6 @@ func file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() { } } file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateUndelegationEntry); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgExecuteMessagesResponse); i { case 0: return &v.state @@ -7213,7 +6681,7 @@ func file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() { return nil } } - file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgWithdraw); i { case 0: return &v.state @@ -7225,7 +6693,7 @@ func file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() { return nil } } - file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgWithdrawResponse); i { case 0: return &v.state @@ -7244,7 +6712,7 @@ func file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/tests/integration/accounts/lockup/continous_lockup_test_suite.go b/tests/integration/accounts/lockup/continous_lockup_test_suite.go index 4cf53792b834..78f19cbc764b 100644 --- a/tests/integration/accounts/lockup/continous_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/continous_lockup_test_suite.go @@ -165,7 +165,7 @@ func (s *IntegrationTestSuite) TestContinuousLockingAccount() { require.Equal(t, len(ubd.Entries), 1) // check if an entry is added - unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr) + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr, val.OperatorAddress) entries := unbondingEntriesResponse.UnbondingEntries require.True(t, entries[0].Amount.Amount.Equal(math.NewInt(100))) require.True(t, entries[0].ValidatorAddress == val.OperatorAddress) @@ -176,19 +176,9 @@ func (s *IntegrationTestSuite) TestContinuousLockingAccount() { Time: currentTime.Add(time.Minute), }) - t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { - msg := &types.MsgUpdateUndelegationEntry{ - Sender: ownerAddrStr, - Id: 0, - } - err = s.executeTx(ctx, msg, app, accountAddr, accOwner) - require.NoError(t, err) - - // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) - delLocking := lockupAccountInfoResponse.DelegatedLocking - require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) - }) + // trigger endblock for staking to handle matured unbonding delegation + _, err = app.StakingKeeper.EndBlocker(ctx) + require.NoError(t, err) // test if tracking delegate work perfectly t.Run("ok - execute delegate message", func(t *testing.T) { @@ -212,6 +202,7 @@ func (s *IntegrationTestSuite) TestContinuousLockingAccount() { // check if tracking is updated accordingly lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking + // should be update as ubd entry is matured require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) delFree := lockupAccountInfoResponse.DelegatedFree require.True(t, delFree.AmountOf("stake").Equal(math.NewInt(100))) diff --git a/tests/integration/accounts/lockup/delayed_lockup_test_suite.go b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go index d05b7a93d332..b35736cfff50 100644 --- a/tests/integration/accounts/lockup/delayed_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go @@ -127,38 +127,23 @@ func (s *IntegrationTestSuite) TestDelayedLockingAccount() { require.Equal(t, len(ubd.Entries), 1) // check if an entry is added - unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr) + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr, val.OperatorAddress) entries := unbondingEntriesResponse.UnbondingEntries require.True(t, entries[0].Amount.Amount.Equal(math.NewInt(100))) require.True(t, entries[0].ValidatorAddress == val.OperatorAddress) }) - // Update context time - // After unbond time elapsed - ctx = ctx.WithHeaderInfo(header.Info{ - Time: currentTime.Add(time.Second * 11), - }) - - t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { - msg := &types.MsgUpdateUndelegationEntry{ - Sender: ownerAddrStr, - Id: 0, - } - err = s.executeTx(ctx, msg, app, accountAddr, accOwner) - require.NoError(t, err) - - // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) - delLocking := lockupAccountInfoResponse.DelegatedLocking - require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) - }) - // Update context time // After endtime fund should be unlock + // And unbond time elapsed ctx = ctx.WithHeaderInfo(header.Info{ Time: currentTime.Add(time.Second * 61), }) + // trigger endblock for staking to handle matured unbonding delegation + _, err = app.StakingKeeper.EndBlocker(ctx) + require.NoError(t, err) + // Check if token is sendable after unlock t.Run("ok - execute send message", func(t *testing.T) { msg := &types.MsgSend{ @@ -171,6 +156,11 @@ func (s *IntegrationTestSuite) TestDelayedLockingAccount() { balance := app.BankKeeper.GetBalance(ctx, randAcc, "stake") require.True(t, balance.Amount.Equal(math.NewInt(100))) + + // check if tracking ubd entry is updated accordingly + lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) + delLocking := lockupAccountInfoResponse.DelegatedLocking + require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) }) // Test to withdraw all the remain funds to an account of choice t.Run("ok - execute withdraw message", func(t *testing.T) { @@ -187,8 +177,8 @@ func (s *IntegrationTestSuite) TestDelayedLockingAccount() { require.NoError(t, err) // withdrawable amount should be - // 1000stake - 100stake( above sent amt ) - 100stake(above delegate amt) = 800stake + // 1000stake - 100stake( above sent amt ) = 800stake balance := app.BankKeeper.GetBalance(ctx, withdrawAcc, "stake") - require.True(t, balance.Amount.Equal(math.NewInt(800))) + require.True(t, balance.Amount.Equal(math.NewInt(900))) }) } diff --git a/tests/integration/accounts/lockup/periodic_lockup_test_suite.go b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go index 6b4101487db8..0c45d10d34ed 100644 --- a/tests/integration/accounts/lockup/periodic_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go @@ -187,7 +187,7 @@ func (s *IntegrationTestSuite) TestPeriodicLockingAccount() { require.Equal(t, len(ubd.Entries), 1) // check if an entry is added - unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr) + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr, val.OperatorAddress) entries := unbondingEntriesResponse.UnbondingEntries require.True(t, entries[0].Amount.Amount.Equal(math.NewInt(100))) require.True(t, entries[0].ValidatorAddress == val.OperatorAddress) @@ -199,19 +199,9 @@ func (s *IntegrationTestSuite) TestPeriodicLockingAccount() { Time: currentTime.Add(time.Minute * 3), }) - t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { - msg := &types.MsgUpdateUndelegationEntry{ - Sender: ownerAddrStr, - Id: 0, - } - err = s.executeTx(ctx, msg, app, accountAddr, accOwner) - require.NoError(t, err) - - // check if tracking is updated accordingly - lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) - delLocking := lockupAccountInfoResponse.DelegatedLocking - require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) - }) + // trigger endblock for staking to handle matured unbonding delegation + _, err = app.StakingKeeper.EndBlocker(ctx) + require.NoError(t, err) t.Run("ok - execute delegate message", func(t *testing.T) { msg := &types.MsgDelegate{ @@ -233,6 +223,9 @@ func (s *IntegrationTestSuite) TestPeriodicLockingAccount() { // check if tracking is updated accordingly lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) + // check if matured ubd entry cleared + delLocking := lockupAccountInfoResponse.DelegatedLocking + require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) delFree := lockupAccountInfoResponse.DelegatedFree require.True(t, delFree.AmountOf("stake").Equal(math.NewInt(100))) }) diff --git a/tests/integration/accounts/lockup/permanent_lockup_test_suite.go b/tests/integration/accounts/lockup/permanent_lockup_test_suite.go index f32bb3662c00..4119652e9fab 100644 --- a/tests/integration/accounts/lockup/permanent_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/permanent_lockup_test_suite.go @@ -111,7 +111,7 @@ func (s *IntegrationTestSuite) TestPermanentLockingAccount() { require.Equal(t, len(ubd.Entries), 1) // check if an entry is added - unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr) + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr, val.OperatorAddress) entries := unbondingEntriesResponse.UnbondingEntries require.True(t, entries[0].Amount.Amount.Equal(math.NewInt(100))) require.True(t, entries[0].ValidatorAddress == val.OperatorAddress) @@ -137,17 +137,32 @@ func (s *IntegrationTestSuite) TestPermanentLockingAccount() { Time: currentTime.Add(time.Second * 11), }) - t.Run("ok - execute tracking unbonding entry", func(t *testing.T) { - msg := &types.MsgUpdateUndelegationEntry{ - Sender: ownerAddrStr, - Id: 0, + // trigger endblock for staking to handle matured unbonding delegation + _, err = app.StakingKeeper.EndBlocker(ctx) + require.NoError(t, err) + + t.Run("ok - execute delegate message", func(t *testing.T) { + msg := &types.MsgDelegate{ + Sender: ownerAddrStr, + ValidatorAddress: val.OperatorAddress, + Amount: sdk.NewCoin("stake", math.NewInt(10)), } err = s.executeTx(ctx, msg, app, accountAddr, accOwner) require.NoError(t, err) + valbz, err := app.StakingKeeper.ValidatorAddressCodec().StringToBytes(val.OperatorAddress) + require.NoError(t, err) + + del, err := app.StakingKeeper.Delegations.Get( + ctx, collections.Join(sdk.AccAddress(accountAddr), sdk.ValAddress(valbz)), + ) + require.NoError(t, err) + require.NotNil(t, del) + // check if tracking is updated accordingly lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking - require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) + // matured ubd entry should be cleared so del locking should only be 10 + require.True(t, delLocking.AmountOf("stake").Equal(math.NewInt(10))) }) } diff --git a/tests/integration/accounts/lockup/utils.go b/tests/integration/accounts/lockup/utils.go index 2c46c93909b8..d92586f1ac90 100644 --- a/tests/integration/accounts/lockup/utils.go +++ b/tests/integration/accounts/lockup/utils.go @@ -72,8 +72,10 @@ func (s *IntegrationTestSuite) queryLockupAccInfo(ctx sdk.Context, app *simapp.S return lockupAccountInfoResponse } -func (s *IntegrationTestSuite) queryUnbondingEntries(ctx sdk.Context, app *simapp.SimApp, accAddr []byte) *types.QueryUnbondingEntriesResponse { - req := &types.QueryUnbondingEntriesRequest{} +func (s *IntegrationTestSuite) queryUnbondingEntries(ctx sdk.Context, app *simapp.SimApp, accAddr []byte, valAddr string) *types.QueryUnbondingEntriesResponse { + req := &types.QueryUnbondingEntriesRequest{ + ValidatorAddress: valAddr, + } resp, err := s.queryAcc(ctx, req, app, accAddr) require.NoError(s.T(), err) require.NotNil(s.T(), resp) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 1ed16e1aa97d..d5df9665bc27 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -160,6 +160,12 @@ func (bva *BaseLockup) Delegate( return nil, err } + // refresh ubd entries to make sure delegation locking amount is up to date + err = bva.CheckUbdEntriesMature(ctx) + if err != nil { + return nil, err + } + err = bva.TrackDelegation( ctx, sdk.Coins{*balance}, @@ -481,18 +487,17 @@ func (bva *BaseLockup) CheckUbdEntriesMature(ctx context.Context) error { return false, nil } - ubdEntries := []stakingtypes.UnbondingDelegationEntry{} entries, err := bva.getUbdEntries(ctx, delAddr, key) if err != nil { - return true, err + if !errorsmod.IsOf(err, stakingtypes.ErrNoUnbondingDelegation) { + return true, err + } } - ubdEntries = append(ubdEntries, entries...) - found := false // check if the entry is still exist in the unbonding entries - for _, e := range ubdEntries { - if e.GetCompletionTime().Equal(entry.EndTime) && entry.CreationHeight == entry.CreationHeight { + for _, e := range entries { + if e.CompletionTime.Equal(entry.EndTime) && entry.CreationHeight == entry.CreationHeight { found = true break } @@ -704,6 +709,12 @@ func (bva BaseLockup) IterateCoinEntries( // GetNotBondedLockedCoin returns the coin that are not spendable that are not bonded by denom // for a lockup account. If the coin by the provided denom are not locked, an coin with zero amount is returned. func (bva BaseLockup) GetNotBondedLockedCoin(ctx context.Context, lockedCoin sdk.Coin, denom string) (sdk.Coin, error) { + // refresh the unbonding entries + err := bva.CheckUbdEntriesMature(ctx) + if err != nil { + return sdk.Coin{}, err + } + bondDenom, err := getStakingDenom(ctx) if err != nil { return sdk.Coin{}, err diff --git a/x/accounts/defaults/lockup/v1/tx.pb.go b/x/accounts/defaults/lockup/v1/tx.pb.go index c8d7e1a554b0..eb831479e0fc 100644 --- a/x/accounts/defaults/lockup/v1/tx.pb.go +++ b/x/accounts/defaults/lockup/v1/tx.pb.go @@ -396,45 +396,6 @@ func (m *MsgSend) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSend proto.InternalMessageInfo -// MsgUpdateUndelegationEntry defines a message that enable lockup account to update delegation tracking -type MsgUpdateUndelegationEntry struct { - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *MsgUpdateUndelegationEntry) Reset() { *m = MsgUpdateUndelegationEntry{} } -func (m *MsgUpdateUndelegationEntry) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateUndelegationEntry) ProtoMessage() {} -func (*MsgUpdateUndelegationEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_84e5f410632b9d39, []int{8} -} -func (m *MsgUpdateUndelegationEntry) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateUndelegationEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateUndelegationEntry.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateUndelegationEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateUndelegationEntry.Merge(m, src) -} -func (m *MsgUpdateUndelegationEntry) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateUndelegationEntry) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateUndelegationEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateUndelegationEntry proto.InternalMessageInfo - // MsgExecuteMessagesResponse defines the response for lockup execute operations type MsgExecuteMessagesResponse struct { Responses []*any.Any `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` @@ -444,7 +405,7 @@ func (m *MsgExecuteMessagesResponse) Reset() { *m = MsgExecuteMessagesRe func (m *MsgExecuteMessagesResponse) String() string { return proto.CompactTextString(m) } func (*MsgExecuteMessagesResponse) ProtoMessage() {} func (*MsgExecuteMessagesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_84e5f410632b9d39, []int{9} + return fileDescriptor_84e5f410632b9d39, []int{8} } func (m *MsgExecuteMessagesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -492,7 +453,7 @@ func (m *MsgWithdraw) Reset() { *m = MsgWithdraw{} } func (m *MsgWithdraw) String() string { return proto.CompactTextString(m) } func (*MsgWithdraw) ProtoMessage() {} func (*MsgWithdraw) Descriptor() ([]byte, []int) { - return fileDescriptor_84e5f410632b9d39, []int{10} + return fileDescriptor_84e5f410632b9d39, []int{9} } func (m *MsgWithdraw) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -531,7 +492,7 @@ func (m *MsgWithdrawResponse) Reset() { *m = MsgWithdrawResponse{} } func (m *MsgWithdrawResponse) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawResponse) ProtoMessage() {} func (*MsgWithdrawResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_84e5f410632b9d39, []int{11} + return fileDescriptor_84e5f410632b9d39, []int{10} } func (m *MsgWithdrawResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -583,7 +544,6 @@ func init() { proto.RegisterType((*MsgUndelegate)(nil), "cosmos.accounts.defaults.lockup.v1.MsgUndelegate") proto.RegisterType((*MsgWithdrawReward)(nil), "cosmos.accounts.defaults.lockup.v1.MsgWithdrawReward") proto.RegisterType((*MsgSend)(nil), "cosmos.accounts.defaults.lockup.v1.MsgSend") - proto.RegisterType((*MsgUpdateUndelegationEntry)(nil), "cosmos.accounts.defaults.lockup.v1.MsgUpdateUndelegationEntry") proto.RegisterType((*MsgExecuteMessagesResponse)(nil), "cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse") proto.RegisterType((*MsgWithdraw)(nil), "cosmos.accounts.defaults.lockup.v1.MsgWithdraw") proto.RegisterType((*MsgWithdrawResponse)(nil), "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse") @@ -594,60 +554,59 @@ func init() { } var fileDescriptor_84e5f410632b9d39 = []byte{ - // 847 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0xcf, 0x8f, 0x1b, 0x35, - 0x14, 0xce, 0x64, 0x21, 0x6d, 0xbc, 0x74, 0xcb, 0x4e, 0x23, 0x9a, 0x46, 0x74, 0x66, 0x89, 0x54, - 0x11, 0x05, 0xad, 0x87, 0x2c, 0x48, 0xa0, 0x88, 0xcb, 0x86, 0x2d, 0x02, 0x89, 0xa0, 0x6a, 0xca, - 0x0f, 0x89, 0x03, 0x91, 0x33, 0x76, 0x5d, 0x6b, 0x33, 0x76, 0x34, 0x76, 0x92, 0xcd, 0x0d, 0x21, - 0x0e, 0xa8, 0xa7, 0x9e, 0x39, 0xed, 0x11, 0x7a, 0x0a, 0x52, 0xff, 0x88, 0x1e, 0xab, 0x9e, 0x7a, - 0xa2, 0x28, 0x8b, 0x94, 0xfe, 0x19, 0xc8, 0x63, 0xcf, 0x92, 0x6c, 0xc3, 0x12, 0x72, 0x00, 0x89, - 0x4b, 0x64, 0xfb, 0x7d, 0xef, 0xbd, 0xef, 0x7d, 0xef, 0xd9, 0x13, 0xf0, 0x56, 0x24, 0x64, 0x2c, - 0x64, 0x80, 0xa2, 0x48, 0x0c, 0xb8, 0x92, 0x01, 0x26, 0x77, 0xd0, 0xa0, 0xa7, 0x64, 0xd0, 0x13, - 0xd1, 0xe1, 0xa0, 0x1f, 0x0c, 0x1b, 0x81, 0x3a, 0x82, 0xfd, 0x44, 0x28, 0xe1, 0x56, 0x0d, 0x18, - 0x66, 0x60, 0x98, 0x81, 0xa1, 0x01, 0xc3, 0x61, 0xa3, 0xb2, 0x8d, 0x62, 0xc6, 0x45, 0x90, 0xfe, - 0x1a, 0xb7, 0x8a, 0x67, 0x73, 0x74, 0x91, 0x24, 0xc1, 0xb0, 0xd1, 0x25, 0x0a, 0x35, 0x82, 0x48, - 0x30, 0x6e, 0xed, 0xc1, 0x0a, 0x1c, 0x6c, 0x02, 0xe3, 0x70, 0xd5, 0x3a, 0xc4, 0x92, 0x6a, 0x5b, - 0x2c, 0xa9, 0x35, 0x5c, 0x33, 0x86, 0x4e, 0xba, 0xb3, 0x61, 0xad, 0xa9, 0x44, 0x05, 0x15, 0xe6, - 0x5c, 0xaf, 0x32, 0x07, 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2, 0x75, 0xb1, 0xf5, 0xbf, 0x0b, 0x2e, 0x26, 0x24, 0x22, 0x6c, 0xb8, - 0x02, 0xf3, 0x53, 0xa4, 0x7b, 0xcf, 0x01, 0x97, 0x4d, 0xa3, 0x3b, 0xf6, 0x4c, 0xb7, 0xe1, 0x5f, - 0x1a, 0xb1, 0x2d, 0x93, 0x39, 0xb4, 0x89, 0x5b, 0x07, 0x8f, 0xa6, 0x9e, 0xf3, 0x78, 0xea, 0x39, - 0xbf, 0x4d, 0x3d, 0xe7, 0xfe, 0x89, 0x97, 0x7b, 0x7c, 0xe2, 0xe5, 0x9e, 0x9e, 0x78, 0xb9, 0xaf, - 0xeb, 0x26, 0xae, 0xc4, 0x87, 0x90, 0x89, 0xe0, 0xe8, 0xbc, 0xbf, 0x49, 0xdd, 0x42, 0xda, 0xed, - 0x77, 0xfe, 0x08, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x40, 0x33, 0x37, 0xd7, 0x09, 0x00, 0x00, + // 817 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0xcf, 0x4f, 0xe3, 0x46, + 0x14, 0x8e, 0x13, 0x35, 0x90, 0xa1, 0x40, 0x31, 0x51, 0x09, 0x51, 0xb1, 0x69, 0x24, 0xd4, 0x28, + 0x15, 0xe3, 0x86, 0x56, 0x6a, 0x15, 0xf5, 0x42, 0x4a, 0xab, 0x56, 0x6a, 0x2a, 0x14, 0xfa, 0x43, + 0xea, 0xa1, 0xd1, 0xc4, 0x1e, 0x06, 0x8b, 0x78, 0x26, 0xf2, 0x4c, 0x12, 0x72, 0xab, 0xaa, 0x1e, + 0x2a, 0x4e, 0x9c, 0x7b, 0xe2, 0xd8, 0x72, 0x4a, 0x25, 0xfe, 0x08, 0x8e, 0x88, 0x13, 0xa7, 0xb2, + 0x0a, 0x2b, 0x85, 0x3f, 0x63, 0x65, 0xcf, 0x98, 0x4d,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, 0x77, 0x83, 0x0b, 0x66, 0x77, + 0x6b, 0xc1, 0x17, 0x89, 0x8f, 0x71, 0x66, 0xdb, 0x20, 0x5b, 0xe1, 0xe4, 0xeb, 0x03, 0x6c, 0xb7, + 0x04, 0xae, 0x60, 0xce, 0x11, 0xc1, 0x3c, 0x9a, 0x4e, 0x7d, 0x03, 0xa4, 0x7c, 0xf5, 0xcc, 0x33, + 0x5a, 0x28, 0x38, 0x7d, 0xef, 0xfd, 0xb4, 0x49, 0xbb, 0xd5, 0xe7, 0xb4, 0xdc, 0x7f, 0x72, 0xa2, + 0xa3, 0x5b, 0xa0, 0x7f, 0x01, 0x40, 0x47, 0x3d, 0x8f, 0x61, 0xf0, 0x10, 0x77, 0x72, 0x93, 0xdf, + 0x07, 0x49, 0x07, 0x53, 0xe6, 0xc9, 0x97, 0x60, 0xaa, 0xaa, 0x56, 0xa5, 0xa5, 0x61, 0x07, 0x86, + 0x2a, 0xe5, 0x2e, 0x35, 0xb0, 0x38, 0x72, 0x73, 0x55, 0xff, 0x9f, 0x81, 0x69, 0x1f, 0xdb, 0xd8, + 0x6d, 0x8f, 0xa1, 0xfc, 0x96, 0xa9, 0x1f, 0x6a, 0x60, 0x5e, 0x7a, 0x5e, 0x53, 0x7b, 0x4e, 0x26, + 0xfe, 0xba, 0x4e, 0x7b, 0x4e, 0x56, 0xae, 0xaa, 0xc2, 0xe5, 0xad, 0xb3, 0xbe, 0xa1, 0x9d, 0xf7, + 0x0d, 0xed, 0x49, 0xdf, 0xd0, 0x8e, 0xae, 0x8d, 0xd8, 0xf9, 0xb5, 0x11, 0xbb, 0xbc, 0x36, 0x62, + 0xbf, 0x16, 0x64, 0x5e, 0xee, 0xec, 0x43, 0x97, 0x59, 0x07, 0x8f, 0xfd, 0x63, 0xa9, 0x27, 0xc3, + 0xd3, 0xfe, 0xf4, 0x59, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x35, 0x67, 0x40, 0x62, 0x09, 0x00, + 0x00, } func (this *MsgInitLockupAccount) Equal(that interface{}) bool { @@ -1006,41 +965,6 @@ func (m *MsgSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateUndelegationEntry) 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 *MsgUpdateUndelegationEntry) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateUndelegationEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x10 - } - if len(m.Sender) > 0 { - i -= len(m.Sender) - copy(dAtA[i:], m.Sender) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *MsgExecuteMessagesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1313,22 +1237,6 @@ func (m *MsgSend) Size() (n int) { return n } -func (m *MsgUpdateUndelegationEntry) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Id != 0 { - n += 1 + sovTx(uint64(m.Id)) - } - return n -} - func (m *MsgExecuteMessagesResponse) Size() (n int) { if m == nil { return 0 @@ -2345,107 +2253,6 @@ func (m *MsgSend) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateUndelegationEntry) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateUndelegationEntry: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateUndelegationEntry: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sender = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgExecuteMessagesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto index 051ff536ec56..980cc90c5307 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto @@ -97,17 +97,6 @@ message MsgSend { ]; } -// MsgUpdateUndelegationEntry defines a message that enable lockup account to update delegation tracking -message MsgUpdateUndelegationEntry { - option (cosmos.msg.v1.signer) = "sender"; - - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - uint64 id = 2; -} - // MsgExecuteMessagesResponse defines the response for lockup execute operations message MsgExecuteMessagesResponse { repeated google.protobuf.Any responses = 1; diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index aaf61daf4707..f822c4f50633 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -302,10 +302,10 @@ func (k Querier) UnbondingDelegation(ctx context.Context, req *types.QueryUnbond unbond, err := k.GetUnbondingDelegation(ctx, delAddr, valAddr) if err != nil { - return nil, status.Errorf( + return nil, errorsmod.Wrap(err, status.Errorf( codes.NotFound, "unbonding delegation with delegator %s not found for validator %s", - req.DelegatorAddr, req.ValidatorAddr) + req.DelegatorAddr, req.ValidatorAddr).Error()) } return &types.QueryUnbondingDelegationResponse{Unbond: unbond}, nil From 7fb8c294aa248f1cae267488e7f612f44beb2f98 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 2 Dec 2024 15:47:47 +0700 Subject: [PATCH 17/24] add remove matured entry --- .../lockup/continous_lockup_test_suite.go | 5 +++ .../lockup/delayed_lockup_test_suite.go | 5 +++ .../lockup/periodic_lockup_test_suite.go | 5 +++ .../lockup/permanent_lockup_test_suite.go | 5 +++ x/accounts/defaults/lockup/lockup.go | 45 +++++++++++++++---- 5 files changed, 57 insertions(+), 8 deletions(-) diff --git a/tests/integration/accounts/lockup/continous_lockup_test_suite.go b/tests/integration/accounts/lockup/continous_lockup_test_suite.go index 78f19cbc764b..42c144a28ebb 100644 --- a/tests/integration/accounts/lockup/continous_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/continous_lockup_test_suite.go @@ -206,5 +206,10 @@ func (s *IntegrationTestSuite) TestContinuousLockingAccount() { require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) delFree := lockupAccountInfoResponse.DelegatedFree require.True(t, delFree.AmountOf("stake").Equal(math.NewInt(100))) + + // check if the entry is removed + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr, val.OperatorAddress) + entries := unbondingEntriesResponse.UnbondingEntries + require.Len(t, entries, 0) }) } diff --git a/tests/integration/accounts/lockup/delayed_lockup_test_suite.go b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go index b35736cfff50..d78848809bbc 100644 --- a/tests/integration/accounts/lockup/delayed_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go @@ -161,6 +161,11 @@ func (s *IntegrationTestSuite) TestDelayedLockingAccount() { lockupAccountInfoResponse := s.queryLockupAccInfo(ctx, app, accountAddr) delLocking := lockupAccountInfoResponse.DelegatedLocking require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) + + // check if the entry is removed + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr, val.OperatorAddress) + entries := unbondingEntriesResponse.UnbondingEntries + require.Len(t, entries, 0) }) // Test to withdraw all the remain funds to an account of choice t.Run("ok - execute withdraw message", func(t *testing.T) { diff --git a/tests/integration/accounts/lockup/periodic_lockup_test_suite.go b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go index 0c45d10d34ed..53bd664967ed 100644 --- a/tests/integration/accounts/lockup/periodic_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go @@ -228,5 +228,10 @@ func (s *IntegrationTestSuite) TestPeriodicLockingAccount() { require.True(t, delLocking.AmountOf("stake").Equal(math.ZeroInt())) delFree := lockupAccountInfoResponse.DelegatedFree require.True(t, delFree.AmountOf("stake").Equal(math.NewInt(100))) + + // check if the entry is removed + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr, val.OperatorAddress) + entries := unbondingEntriesResponse.UnbondingEntries + require.Len(t, entries, 0) }) } diff --git a/tests/integration/accounts/lockup/permanent_lockup_test_suite.go b/tests/integration/accounts/lockup/permanent_lockup_test_suite.go index 4119652e9fab..d0f2348e752e 100644 --- a/tests/integration/accounts/lockup/permanent_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/permanent_lockup_test_suite.go @@ -164,5 +164,10 @@ func (s *IntegrationTestSuite) TestPermanentLockingAccount() { delLocking := lockupAccountInfoResponse.DelegatedLocking // matured ubd entry should be cleared so del locking should only be 10 require.True(t, delLocking.AmountOf("stake").Equal(math.NewInt(10))) + + // check if the entry is removed + unbondingEntriesResponse := s.queryUnbondingEntries(ctx, app, accountAddr, val.OperatorAddress) + entries := unbondingEntriesResponse.UnbondingEntries + require.Len(t, entries, 0) }) } diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index d5df9665bc27..89af1ce59d56 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -481,34 +481,57 @@ func (bva *BaseLockup) CheckUbdEntriesMature(ctx context.Context) error { currentTime := bva.headerService.HeaderInfo(ctx).Time err = bva.UnbondEntries.Walk(ctx, nil, func(key string, value lockuptypes.UnbondingEntries) (stop bool, err error) { - for _, entry := range value.Entries { + for i := 0; i < len(value.Entries); i++ { + entry := value.Entries[i] // if not mature then skip if entry.EndTime.After(currentTime) { return false, nil } + skipIteration := false entries, err := bva.getUbdEntries(ctx, delAddr, key) if err != nil { + // if ubd delegation is empty then skip the next iteration check if !errorsmod.IsOf(err, stakingtypes.ErrNoUnbondingDelegation) { return true, err } + + skipIteration = true } found := false // check if the entry is still exist in the unbonding entries - for _, e := range entries { - if e.CompletionTime.Equal(entry.EndTime) && entry.CreationHeight == entry.CreationHeight { - found = true - break + if !skipIteration { + for _, e := range entries { + if e.CompletionTime.Equal(entry.EndTime) && entry.CreationHeight == entry.CreationHeight { + found = true + break + } } } - // if not found then assume ubd entry is being handled - if !found { + // if not found or ubd delegation is empty then assume ubd entry is being handled + if !found || skipIteration { err = bva.TrackUndelegation(ctx, sdk.NewCoins(entry.Amount)) if err != nil { return true, err } + + // remove entry + value.Entries = append(value.Entries[:i], value.Entries[i+1:]...) + i-- + } + } + + if len(value.Entries) == 0 { + err = bva.UnbondEntries.Remove(ctx, key) + if err != nil { + return true, err + } + } else { + err = bva.UnbondEntries.Set(ctx, key, value) + if err != nil { + return true, err } } @@ -795,7 +818,13 @@ func (bva BaseLockup) QueryUnbondingEntries(ctx context.Context, req *lockuptype ) { entries, err := bva.UnbondEntries.Get(ctx, req.ValidatorAddress) if err != nil { - return nil, err + if !errorsmod.IsOf(err, collections.ErrNotFound) { + return nil, err + } + + entries = lockuptypes.UnbondingEntries{ + Entries: []*lockuptypes.UnbondingEntry{}, + } } return &lockuptypes.QueryUnbondingEntriesResponse{ From 1ed4b64c802bb1349bc15d08e60103775201d336 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 2 Dec 2024 15:52:43 +0700 Subject: [PATCH 18/24] revert --- math/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math/go.mod b/math/go.mod index 48f4da0c3c3b..2afb0109af6d 100644 --- a/math/go.mod +++ b/math/go.mod @@ -1,6 +1,6 @@ module cosmossdk.io/math -go 1.23 +go 1.20 require ( github.com/cockroachdb/apd/v3 v3.2.1 From a7ee20312869e862c5e27645ecfd93bcbc210495 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 2 Dec 2024 16:04:58 +0700 Subject: [PATCH 19/24] fix tests --- .../lockup/continuous_locking_account_test.go | 3 +++ .../defaults/lockup/delayed_locking_account_test.go | 3 +++ x/accounts/defaults/lockup/lockup.go | 13 +++++++++---- .../lockup/periodic_locking_account_test.go | 3 +++ .../lockup/permanent_locking_account_test.go | 3 +++ 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/x/accounts/defaults/lockup/continuous_locking_account_test.go b/x/accounts/defaults/lockup/continuous_locking_account_test.go index 6bcbb60af11c..fa8fff37afd1 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account_test.go +++ b/x/accounts/defaults/lockup/continuous_locking_account_test.go @@ -111,6 +111,9 @@ func TestContinousAccountUndelegate(t *testing.T) { err = acc.CheckUbdEntriesMature(sdkCtx) require.NoError(t, err) + _, err = acc.UnbondEntries.Get(sdkCtx, "val_address") + require.Error(t, err) + delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) diff --git a/x/accounts/defaults/lockup/delayed_locking_account_test.go b/x/accounts/defaults/lockup/delayed_locking_account_test.go index d91c1345aa4a..c9e82842ee37 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account_test.go +++ b/x/accounts/defaults/lockup/delayed_locking_account_test.go @@ -110,6 +110,9 @@ func TestDelayedAccountUndelegate(t *testing.T) { err = acc.CheckUbdEntriesMature(sdkCtx) require.NoError(t, err) + _, err = acc.UnbondEntries.Get(sdkCtx, "val_address") + require.Error(t, err) + delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 89af1ce59d56..c8e6067412a9 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -480,6 +480,7 @@ func (bva *BaseLockup) CheckUbdEntriesMature(ctx context.Context) error { currentTime := bva.headerService.HeaderInfo(ctx).Time + removeKeys := []string{} err = bva.UnbondEntries.Walk(ctx, nil, func(key string, value lockuptypes.UnbondingEntries) (stop bool, err error) { for i := 0; i < len(value.Entries); i++ { entry := value.Entries[i] @@ -524,10 +525,7 @@ func (bva *BaseLockup) CheckUbdEntriesMature(ctx context.Context) error { } if len(value.Entries) == 0 { - err = bva.UnbondEntries.Remove(ctx, key) - if err != nil { - return true, err - } + removeKeys = append(removeKeys, key) } else { err = bva.UnbondEntries.Set(ctx, key, value) if err != nil { @@ -537,6 +535,13 @@ func (bva *BaseLockup) CheckUbdEntriesMature(ctx context.Context) error { return false, nil }) + + for _, key := range removeKeys { + err = bva.UnbondEntries.Remove(ctx, key) + if err != nil { + return err + } + } return err } diff --git a/x/accounts/defaults/lockup/periodic_locking_account_test.go b/x/accounts/defaults/lockup/periodic_locking_account_test.go index 17ec2eefd6c3..38db636c5024 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account_test.go +++ b/x/accounts/defaults/lockup/periodic_locking_account_test.go @@ -145,6 +145,9 @@ func TestPeriodicAccountUndelegate(t *testing.T) { err = acc.CheckUbdEntriesMature(sdkCtx) require.NoError(t, err) + _, err = acc.UnbondEntries.Get(sdkCtx, "val_address") + require.Error(t, err) + delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) diff --git a/x/accounts/defaults/lockup/permanent_locking_account_test.go b/x/accounts/defaults/lockup/permanent_locking_account_test.go index a732db475adf..cd87d3be918f 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account_test.go +++ b/x/accounts/defaults/lockup/permanent_locking_account_test.go @@ -87,6 +87,9 @@ func TestPermanentAccountUndelegate(t *testing.T) { err = acc.CheckUbdEntriesMature(sdkCtx) require.NoError(t, err) + _, err = acc.UnbondEntries.Get(sdkCtx, "val_address") + require.Error(t, err) + delLocking, err = acc.DelegatedLocking.Get(ctx, "test") require.NoError(t, err) require.True(t, delLocking.Equal(math.ZeroInt())) From af32a94698b576e03b80beeb9e9d790b53cc9e74 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 2 Dec 2024 16:10:45 +0700 Subject: [PATCH 20/24] more fixing --- x/accounts/defaults/lockup/lockup_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/x/accounts/defaults/lockup/lockup_test.go b/x/accounts/defaults/lockup/lockup_test.go index 3a704d791796..0748a17e8caf 100644 --- a/x/accounts/defaults/lockup/lockup_test.go +++ b/x/accounts/defaults/lockup/lockup_test.go @@ -7,7 +7,9 @@ import ( "github.com/stretchr/testify/require" + "cosmossdk.io/core/header" "cosmossdk.io/core/store" + "cosmossdk.io/log" "cosmossdk.io/math" lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/v1" @@ -229,6 +231,9 @@ func TestTrackingUnDelegation(t *testing.T) { func TestGetNotBondedLockedCoin(t *testing.T) { ctx, ss := newMockContext(t) + sdkCtx := sdk.NewContext(nil, true, log.NewNopLogger()).WithContext(ctx).WithHeaderInfo(header.Info{ + Time: time.Now(), + }) testcases := []struct { name string @@ -257,10 +262,10 @@ func TestGetNotBondedLockedCoin(t *testing.T) { } for _, test := range testcases { - baseLockup := setup(t, ctx, ss) - test.malaete(ctx, baseLockup) + baseLockup := setup(t, sdkCtx, ss) + test.malaete(sdkCtx, baseLockup) - lockedCoin, err := baseLockup.GetNotBondedLockedCoin(ctx, test.lockedCoin, "test") + lockedCoin, err := baseLockup.GetNotBondedLockedCoin(sdkCtx, test.lockedCoin, "test") require.NoError(t, err) require.True(t, test.expLockCoin.Equal(lockedCoin), test.name+" locked amount must be equal") From 54c8f5c00de3546f175ac2c5b99ddfbdf6cfe4cb Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Wed, 4 Dec 2024 13:04:42 +0700 Subject: [PATCH 21/24] remove withdraw unlocked coins --- .../defaults/lockup/v1/query.pulsar.go | 1031 +++++++++++- .../accounts/defaults/lockup/v1/tx.pulsar.go | 1391 +---------------- .../lockup/continous_lockup_test_suite.go | 30 - .../lockup/delayed_lockup_test_suite.go | 33 - .../lockup/periodic_lockup_test_suite.go | 33 - .../lockup/continuous_locking_account.go | 25 +- .../lockup/continuous_locking_account_test.go | 30 - .../lockup/delayed_locking_account.go | 25 +- .../lockup/delayed_locking_account_test.go | 30 - x/accounts/defaults/lockup/lockup.go | 148 +- .../lockup/periodic_locking_account.go | 7 - .../lockup/periodic_locking_account_test.go | 34 - x/accounts/defaults/lockup/v1/query.pb.go | 384 ++++- x/accounts/defaults/lockup/v1/tx.pb.go | 590 +------ .../accounts/defaults/lockup/v1/query.proto | 9 + .../accounts/defaults/lockup/v1/tx.proto | 23 - 16 files changed, 1512 insertions(+), 2311 deletions(-) diff --git a/api/cosmos/accounts/defaults/lockup/v1/query.pulsar.go b/api/cosmos/accounts/defaults/lockup/v1/query.pulsar.go index cd151e536adc..9c89b0fecd5d 100644 --- a/api/cosmos/accounts/defaults/lockup/v1/query.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/v1/query.pulsar.go @@ -3404,6 +3404,856 @@ func (x *fastReflection_QueryLockingPeriodsResponse) ProtoMethods() *protoiface. } } +var ( + md_QuerySpendableAmountRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_accounts_defaults_lockup_v1_query_proto_init() + md_QuerySpendableAmountRequest = File_cosmos_accounts_defaults_lockup_v1_query_proto.Messages().ByName("QuerySpendableAmountRequest") +} + +var _ protoreflect.Message = (*fastReflection_QuerySpendableAmountRequest)(nil) + +type fastReflection_QuerySpendableAmountRequest QuerySpendableAmountRequest + +func (x *QuerySpendableAmountRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QuerySpendableAmountRequest)(x) +} + +func (x *QuerySpendableAmountRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_defaults_lockup_v1_query_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_QuerySpendableAmountRequest_messageType fastReflection_QuerySpendableAmountRequest_messageType +var _ protoreflect.MessageType = fastReflection_QuerySpendableAmountRequest_messageType{} + +type fastReflection_QuerySpendableAmountRequest_messageType struct{} + +func (x fastReflection_QuerySpendableAmountRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QuerySpendableAmountRequest)(nil) +} +func (x fastReflection_QuerySpendableAmountRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QuerySpendableAmountRequest) +} +func (x fastReflection_QuerySpendableAmountRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySpendableAmountRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QuerySpendableAmountRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySpendableAmountRequest +} + +// 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_QuerySpendableAmountRequest) Type() protoreflect.MessageType { + return _fastReflection_QuerySpendableAmountRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QuerySpendableAmountRequest) New() protoreflect.Message { + return new(fastReflection_QuerySpendableAmountRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QuerySpendableAmountRequest) Interface() protoreflect.ProtoMessage { + return (*QuerySpendableAmountRequest)(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_QuerySpendableAmountRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QuerySpendableAmountRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest 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_QuerySpendableAmountRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest 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_QuerySpendableAmountRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest 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_QuerySpendableAmountRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest 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_QuerySpendableAmountRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest 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_QuerySpendableAmountRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest 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_QuerySpendableAmountRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest", 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_QuerySpendableAmountRequest) 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_QuerySpendableAmountRequest) 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_QuerySpendableAmountRequest) 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_QuerySpendableAmountRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QuerySpendableAmountRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QuerySpendableAmountRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QuerySpendableAmountRequest) + 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: QuerySpendableAmountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySpendableAmountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QuerySpendableAmountResponse_1_list)(nil) + +type _QuerySpendableAmountResponse_1_list struct { + list *[]*v1beta1.Coin +} + +func (x *_QuerySpendableAmountResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QuerySpendableAmountResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QuerySpendableAmountResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_QuerySpendableAmountResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QuerySpendableAmountResponse_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QuerySpendableAmountResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QuerySpendableAmountResponse_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QuerySpendableAmountResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QuerySpendableAmountResponse protoreflect.MessageDescriptor + fd_QuerySpendableAmountResponse_spendable_tokens protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_defaults_lockup_v1_query_proto_init() + md_QuerySpendableAmountResponse = File_cosmos_accounts_defaults_lockup_v1_query_proto.Messages().ByName("QuerySpendableAmountResponse") + fd_QuerySpendableAmountResponse_spendable_tokens = md_QuerySpendableAmountResponse.Fields().ByName("spendable_tokens") +} + +var _ protoreflect.Message = (*fastReflection_QuerySpendableAmountResponse)(nil) + +type fastReflection_QuerySpendableAmountResponse QuerySpendableAmountResponse + +func (x *QuerySpendableAmountResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QuerySpendableAmountResponse)(x) +} + +func (x *QuerySpendableAmountResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_defaults_lockup_v1_query_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_QuerySpendableAmountResponse_messageType fastReflection_QuerySpendableAmountResponse_messageType +var _ protoreflect.MessageType = fastReflection_QuerySpendableAmountResponse_messageType{} + +type fastReflection_QuerySpendableAmountResponse_messageType struct{} + +func (x fastReflection_QuerySpendableAmountResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QuerySpendableAmountResponse)(nil) +} +func (x fastReflection_QuerySpendableAmountResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QuerySpendableAmountResponse) +} +func (x fastReflection_QuerySpendableAmountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySpendableAmountResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QuerySpendableAmountResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QuerySpendableAmountResponse +} + +// 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_QuerySpendableAmountResponse) Type() protoreflect.MessageType { + return _fastReflection_QuerySpendableAmountResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QuerySpendableAmountResponse) New() protoreflect.Message { + return new(fastReflection_QuerySpendableAmountResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QuerySpendableAmountResponse) Interface() protoreflect.ProtoMessage { + return (*QuerySpendableAmountResponse)(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_QuerySpendableAmountResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.SpendableTokens) != 0 { + value := protoreflect.ValueOfList(&_QuerySpendableAmountResponse_1_list{list: &x.SpendableTokens}) + if !f(fd_QuerySpendableAmountResponse_spendable_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_QuerySpendableAmountResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse.spendable_tokens": + return len(x.SpendableTokens) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse 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_QuerySpendableAmountResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse.spendable_tokens": + x.SpendableTokens = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse 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_QuerySpendableAmountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse.spendable_tokens": + if len(x.SpendableTokens) == 0 { + return protoreflect.ValueOfList(&_QuerySpendableAmountResponse_1_list{}) + } + listValue := &_QuerySpendableAmountResponse_1_list{list: &x.SpendableTokens} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse 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_QuerySpendableAmountResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse.spendable_tokens": + lv := value.List() + clv := lv.(*_QuerySpendableAmountResponse_1_list) + x.SpendableTokens = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse 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_QuerySpendableAmountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse.spendable_tokens": + if x.SpendableTokens == nil { + x.SpendableTokens = []*v1beta1.Coin{} + } + value := &_QuerySpendableAmountResponse_1_list{list: &x.SpendableTokens} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse 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_QuerySpendableAmountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse.spendable_tokens": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_QuerySpendableAmountResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse")) + } + panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse 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_QuerySpendableAmountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse", 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_QuerySpendableAmountResponse) 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_QuerySpendableAmountResponse) 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_QuerySpendableAmountResponse) 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_QuerySpendableAmountResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QuerySpendableAmountResponse) + 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.SpendableTokens) > 0 { + for _, e := range x.SpendableTokens { + 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().(*QuerySpendableAmountResponse) + 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.SpendableTokens) > 0 { + for iNdEx := len(x.SpendableTokens) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.SpendableTokens[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().(*QuerySpendableAmountResponse) + 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: QuerySpendableAmountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QuerySpendableAmountResponse: 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 SpendableTokens", 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.SpendableTokens = append(x.SpendableTokens, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.SpendableTokens[len(x.SpendableTokens)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -3681,6 +4531,69 @@ func (x *QueryLockingPeriodsResponse) GetLockingPeriods() []*Period { return nil } +// QuerySpendableAmountRequest is used to query the lockup account total spendable tokens. +type QuerySpendableAmountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QuerySpendableAmountRequest) Reset() { + *x = QuerySpendableAmountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_defaults_lockup_v1_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuerySpendableAmountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuerySpendableAmountRequest) ProtoMessage() {} + +// Deprecated: Use QuerySpendableAmountRequest.ProtoReflect.Descriptor instead. +func (*QuerySpendableAmountRequest) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_defaults_lockup_v1_query_proto_rawDescGZIP(), []int{6} +} + +// QuerySpendableAmountResponse returns lockup account total spendable tokens. +type QuerySpendableAmountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SpendableTokens []*v1beta1.Coin `protobuf:"bytes,1,rep,name=spendable_tokens,json=spendableTokens,proto3" json:"spendable_tokens,omitempty"` +} + +func (x *QuerySpendableAmountResponse) Reset() { + *x = QuerySpendableAmountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_defaults_lockup_v1_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuerySpendableAmountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuerySpendableAmountResponse) ProtoMessage() {} + +// Deprecated: Use QuerySpendableAmountResponse.ProtoReflect.Descriptor instead. +func (*QuerySpendableAmountResponse) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_defaults_lockup_v1_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QuerySpendableAmountResponse) GetSpendableTokens() []*v1beta1.Coin { + if x != nil { + return x.SpendableTokens + } + return nil +} + var File_cosmos_accounts_defaults_lockup_v1_query_proto protoreflect.FileDescriptor var file_cosmos_accounts_defaults_lockup_v1_query_proto_rawDesc = []byte{ @@ -3773,26 +4686,37 @@ var file_cosmos_accounts_defaults_lockup_v1_query_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0e, - 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x42, 0x9f, - 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, - 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x6c, 0x6f, 0x63, - 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x22, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, - 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x22, 0x1d, + 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, + 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x96, 0x01, + 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, + 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x76, + 0x0a, 0x10, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x18, 0x01, 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, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0f, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x42, 0x9f, 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, + 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x3c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, + 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, + 0x43, 0x41, 0x44, 0x4c, 0xaa, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, + 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x2e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x26, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x3a, 0x3a, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, + 0x63, 0x6b, 0x75, 0x70, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3807,7 +4731,7 @@ func file_cosmos_accounts_defaults_lockup_v1_query_proto_rawDescGZIP() []byte { return file_cosmos_accounts_defaults_lockup_v1_query_proto_rawDescData } -var file_cosmos_accounts_defaults_lockup_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cosmos_accounts_defaults_lockup_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_cosmos_accounts_defaults_lockup_v1_query_proto_goTypes = []interface{}{ (*QueryLockupAccountInfoRequest)(nil), // 0: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoRequest (*QueryLockupAccountInfoResponse)(nil), // 1: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse @@ -3815,26 +4739,29 @@ var file_cosmos_accounts_defaults_lockup_v1_query_proto_goTypes = []interface{}{ (*QueryUnbondingEntriesResponse)(nil), // 3: cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesResponse (*QueryLockingPeriodsRequest)(nil), // 4: cosmos.accounts.defaults.lockup.v1.QueryLockingPeriodsRequest (*QueryLockingPeriodsResponse)(nil), // 5: cosmos.accounts.defaults.lockup.v1.QueryLockingPeriodsResponse - (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp - (*UnbondingEntry)(nil), // 8: cosmos.accounts.defaults.lockup.v1.UnbondingEntry - (*Period)(nil), // 9: cosmos.accounts.defaults.lockup.v1.Period + (*QuerySpendableAmountRequest)(nil), // 6: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest + (*QuerySpendableAmountResponse)(nil), // 7: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse + (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp + (*UnbondingEntry)(nil), // 10: cosmos.accounts.defaults.lockup.v1.UnbondingEntry + (*Period)(nil), // 11: cosmos.accounts.defaults.lockup.v1.Period } var file_cosmos_accounts_defaults_lockup_v1_query_proto_depIdxs = []int32{ - 6, // 0: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.original_locking:type_name -> cosmos.base.v1beta1.Coin - 6, // 1: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.delegated_free:type_name -> cosmos.base.v1beta1.Coin - 6, // 2: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.delegated_locking:type_name -> cosmos.base.v1beta1.Coin - 7, // 3: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.start_time:type_name -> google.protobuf.Timestamp - 7, // 4: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.end_time:type_name -> google.protobuf.Timestamp - 6, // 5: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.locked_coins:type_name -> cosmos.base.v1beta1.Coin - 6, // 6: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.unlocked_coins:type_name -> cosmos.base.v1beta1.Coin - 8, // 7: cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesResponse.unbonding_entries:type_name -> cosmos.accounts.defaults.lockup.v1.UnbondingEntry - 9, // 8: cosmos.accounts.defaults.lockup.v1.QueryLockingPeriodsResponse.locking_periods:type_name -> cosmos.accounts.defaults.lockup.v1.Period - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 8, // 0: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.original_locking:type_name -> cosmos.base.v1beta1.Coin + 8, // 1: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.delegated_free:type_name -> cosmos.base.v1beta1.Coin + 8, // 2: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.delegated_locking:type_name -> cosmos.base.v1beta1.Coin + 9, // 3: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.start_time:type_name -> google.protobuf.Timestamp + 9, // 4: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.end_time:type_name -> google.protobuf.Timestamp + 8, // 5: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.locked_coins:type_name -> cosmos.base.v1beta1.Coin + 8, // 6: cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse.unlocked_coins:type_name -> cosmos.base.v1beta1.Coin + 10, // 7: cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesResponse.unbonding_entries:type_name -> cosmos.accounts.defaults.lockup.v1.UnbondingEntry + 11, // 8: cosmos.accounts.defaults.lockup.v1.QueryLockingPeriodsResponse.locking_periods:type_name -> cosmos.accounts.defaults.lockup.v1.Period + 8, // 9: cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse.spendable_tokens:type_name -> cosmos.base.v1beta1.Coin + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_cosmos_accounts_defaults_lockup_v1_query_proto_init() } @@ -3916,6 +4843,30 @@ func file_cosmos_accounts_defaults_lockup_v1_query_proto_init() { return nil } } + file_cosmos_accounts_defaults_lockup_v1_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySpendableAmountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_defaults_lockup_v1_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySpendableAmountResponse); 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{ @@ -3923,7 +4874,7 @@ func file_cosmos_accounts_defaults_lockup_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_defaults_lockup_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go b/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go index 6c690258c20f..985f4799aad4 100644 --- a/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go +++ b/api/cosmos/accounts/defaults/lockup/v1/tx.pulsar.go @@ -4672,1172 +4672,6 @@ func (x *fastReflection_MsgExecuteMessagesResponse) ProtoMethods() *protoiface.M } } -var _ protoreflect.List = (*_MsgWithdraw_3_list)(nil) - -type _MsgWithdraw_3_list struct { - list *[]string -} - -func (x *_MsgWithdraw_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgWithdraw_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_MsgWithdraw_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_MsgWithdraw_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgWithdraw_3_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message MsgWithdraw at list field Denoms as it is not of Message kind")) -} - -func (x *_MsgWithdraw_3_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_MsgWithdraw_3_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_MsgWithdraw_3_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgWithdraw protoreflect.MessageDescriptor - fd_MsgWithdraw_withdrawer protoreflect.FieldDescriptor - fd_MsgWithdraw_to_address protoreflect.FieldDescriptor - fd_MsgWithdraw_denoms protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() - md_MsgWithdraw = File_cosmos_accounts_defaults_lockup_v1_tx_proto.Messages().ByName("MsgWithdraw") - fd_MsgWithdraw_withdrawer = md_MsgWithdraw.Fields().ByName("withdrawer") - fd_MsgWithdraw_to_address = md_MsgWithdraw.Fields().ByName("to_address") - fd_MsgWithdraw_denoms = md_MsgWithdraw.Fields().ByName("denoms") -} - -var _ protoreflect.Message = (*fastReflection_MsgWithdraw)(nil) - -type fastReflection_MsgWithdraw MsgWithdraw - -func (x *MsgWithdraw) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgWithdraw)(x) -} - -func (x *MsgWithdraw) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[9] - 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_MsgWithdraw_messageType fastReflection_MsgWithdraw_messageType -var _ protoreflect.MessageType = fastReflection_MsgWithdraw_messageType{} - -type fastReflection_MsgWithdraw_messageType struct{} - -func (x fastReflection_MsgWithdraw_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgWithdraw)(nil) -} -func (x fastReflection_MsgWithdraw_messageType) New() protoreflect.Message { - return new(fastReflection_MsgWithdraw) -} -func (x fastReflection_MsgWithdraw_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgWithdraw -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgWithdraw) Descriptor() protoreflect.MessageDescriptor { - return md_MsgWithdraw -} - -// 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_MsgWithdraw) Type() protoreflect.MessageType { - return _fastReflection_MsgWithdraw_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgWithdraw) New() protoreflect.Message { - return new(fastReflection_MsgWithdraw) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgWithdraw) Interface() protoreflect.ProtoMessage { - return (*MsgWithdraw)(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_MsgWithdraw) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Withdrawer != "" { - value := protoreflect.ValueOfString(x.Withdrawer) - if !f(fd_MsgWithdraw_withdrawer, value) { - return - } - } - if x.ToAddress != "" { - value := protoreflect.ValueOfString(x.ToAddress) - if !f(fd_MsgWithdraw_to_address, value) { - return - } - } - if len(x.Denoms) != 0 { - value := protoreflect.ValueOfList(&_MsgWithdraw_3_list{list: &x.Denoms}) - if !f(fd_MsgWithdraw_denoms, 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_MsgWithdraw) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.withdrawer": - return x.Withdrawer != "" - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.to_address": - return x.ToAddress != "" - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.denoms": - return len(x.Denoms) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdraw 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_MsgWithdraw) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.withdrawer": - x.Withdrawer = "" - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.to_address": - x.ToAddress = "" - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.denoms": - x.Denoms = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdraw 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_MsgWithdraw) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.withdrawer": - value := x.Withdrawer - return protoreflect.ValueOfString(value) - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.to_address": - value := x.ToAddress - return protoreflect.ValueOfString(value) - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.denoms": - if len(x.Denoms) == 0 { - return protoreflect.ValueOfList(&_MsgWithdraw_3_list{}) - } - listValue := &_MsgWithdraw_3_list{list: &x.Denoms} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdraw 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_MsgWithdraw) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.withdrawer": - x.Withdrawer = value.Interface().(string) - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.to_address": - x.ToAddress = value.Interface().(string) - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.denoms": - lv := value.List() - clv := lv.(*_MsgWithdraw_3_list) - x.Denoms = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdraw 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_MsgWithdraw) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.denoms": - if x.Denoms == nil { - x.Denoms = []string{} - } - value := &_MsgWithdraw_3_list{list: &x.Denoms} - return protoreflect.ValueOfList(value) - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.withdrawer": - panic(fmt.Errorf("field withdrawer of message cosmos.accounts.defaults.lockup.v1.MsgWithdraw is not mutable")) - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.to_address": - panic(fmt.Errorf("field to_address of message cosmos.accounts.defaults.lockup.v1.MsgWithdraw is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdraw 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_MsgWithdraw) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.withdrawer": - return protoreflect.ValueOfString("") - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.to_address": - return protoreflect.ValueOfString("") - case "cosmos.accounts.defaults.lockup.v1.MsgWithdraw.denoms": - list := []string{} - return protoreflect.ValueOfList(&_MsgWithdraw_3_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdraw 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_MsgWithdraw) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.v1.MsgWithdraw", 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_MsgWithdraw) 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_MsgWithdraw) 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_MsgWithdraw) 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_MsgWithdraw) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgWithdraw) - 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.Withdrawer) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ToAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Denoms) > 0 { - for _, s := range x.Denoms { - l = len(s) - 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().(*MsgWithdraw) - 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.Denoms) > 0 { - for iNdEx := len(x.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Denoms[iNdEx]) - copy(dAtA[i:], x.Denoms[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(x.ToAddress) > 0 { - i -= len(x.ToAddress) - copy(dAtA[i:], x.ToAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ToAddress))) - i-- - dAtA[i] = 0x12 - } - if len(x.Withdrawer) > 0 { - i -= len(x.Withdrawer) - copy(dAtA[i:], x.Withdrawer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Withdrawer))) - 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().(*MsgWithdraw) - 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: MsgWithdraw: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgWithdraw: 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 Withdrawer", 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.Withdrawer = 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 ToAddress", 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.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denoms", 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.Denoms = append(x.Denoms, 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 _ protoreflect.List = (*_MsgWithdrawResponse_2_list)(nil) - -type _MsgWithdrawResponse_2_list struct { - list *[]*v1beta1.Coin -} - -func (x *_MsgWithdrawResponse_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgWithdrawResponse_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgWithdrawResponse_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_MsgWithdrawResponse_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgWithdrawResponse_2_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgWithdrawResponse_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgWithdrawResponse_2_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgWithdrawResponse_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgWithdrawResponse protoreflect.MessageDescriptor - fd_MsgWithdrawResponse_receiver protoreflect.FieldDescriptor - fd_MsgWithdrawResponse_amount_received protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() - md_MsgWithdrawResponse = File_cosmos_accounts_defaults_lockup_v1_tx_proto.Messages().ByName("MsgWithdrawResponse") - fd_MsgWithdrawResponse_receiver = md_MsgWithdrawResponse.Fields().ByName("receiver") - fd_MsgWithdrawResponse_amount_received = md_MsgWithdrawResponse.Fields().ByName("amount_received") -} - -var _ protoreflect.Message = (*fastReflection_MsgWithdrawResponse)(nil) - -type fastReflection_MsgWithdrawResponse MsgWithdrawResponse - -func (x *MsgWithdrawResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgWithdrawResponse)(x) -} - -func (x *MsgWithdrawResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[10] - 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_MsgWithdrawResponse_messageType fastReflection_MsgWithdrawResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgWithdrawResponse_messageType{} - -type fastReflection_MsgWithdrawResponse_messageType struct{} - -func (x fastReflection_MsgWithdrawResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgWithdrawResponse)(nil) -} -func (x fastReflection_MsgWithdrawResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgWithdrawResponse) -} -func (x fastReflection_MsgWithdrawResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgWithdrawResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgWithdrawResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgWithdrawResponse -} - -// 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_MsgWithdrawResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgWithdrawResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgWithdrawResponse) New() protoreflect.Message { - return new(fastReflection_MsgWithdrawResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgWithdrawResponse) Interface() protoreflect.ProtoMessage { - return (*MsgWithdrawResponse)(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_MsgWithdrawResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Receiver != "" { - value := protoreflect.ValueOfString(x.Receiver) - if !f(fd_MsgWithdrawResponse_receiver, value) { - return - } - } - if len(x.AmountReceived) != 0 { - value := protoreflect.ValueOfList(&_MsgWithdrawResponse_2_list{list: &x.AmountReceived}) - if !f(fd_MsgWithdrawResponse_amount_received, 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_MsgWithdrawResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.receiver": - return x.Receiver != "" - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.amount_received": - return len(x.AmountReceived) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse 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_MsgWithdrawResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.receiver": - x.Receiver = "" - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.amount_received": - x.AmountReceived = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse 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_MsgWithdrawResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.receiver": - value := x.Receiver - return protoreflect.ValueOfString(value) - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.amount_received": - if len(x.AmountReceived) == 0 { - return protoreflect.ValueOfList(&_MsgWithdrawResponse_2_list{}) - } - listValue := &_MsgWithdrawResponse_2_list{list: &x.AmountReceived} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse 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_MsgWithdrawResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.receiver": - x.Receiver = value.Interface().(string) - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.amount_received": - lv := value.List() - clv := lv.(*_MsgWithdrawResponse_2_list) - x.AmountReceived = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse 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_MsgWithdrawResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.amount_received": - if x.AmountReceived == nil { - x.AmountReceived = []*v1beta1.Coin{} - } - value := &_MsgWithdrawResponse_2_list{list: &x.AmountReceived} - return protoreflect.ValueOfList(value) - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.receiver": - panic(fmt.Errorf("field receiver of message cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse 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_MsgWithdrawResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.receiver": - return protoreflect.ValueOfString("") - case "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.amount_received": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_MsgWithdrawResponse_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse 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_MsgWithdrawResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse", 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_MsgWithdrawResponse) 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_MsgWithdrawResponse) 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_MsgWithdrawResponse) 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_MsgWithdrawResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgWithdrawResponse) - 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.Receiver) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.AmountReceived) > 0 { - for _, e := range x.AmountReceived { - 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().(*MsgWithdrawResponse) - 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.AmountReceived) > 0 { - for iNdEx := len(x.AmountReceived) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.AmountReceived[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.Receiver) > 0 { - i -= len(x.Receiver) - copy(dAtA[i:], x.Receiver) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Receiver))) - 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().(*MsgWithdrawResponse) - 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: MsgWithdrawResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgWithdrawResponse: 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 Receiver", 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.Receiver = 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 AmountReceived", 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.AmountReceived = append(x.AmountReceived, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AmountReceived[len(x.AmountReceived)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -6253,103 +5087,6 @@ func (x *MsgExecuteMessagesResponse) GetResponses() []*anypb.Any { return nil } -// MsgWithdraw defines a message that the owner of the lockup can perform to withdraw unlocked token to an account of -// choice -type MsgWithdraw struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Withdrawer string `protobuf:"bytes,1,opt,name=withdrawer,proto3" json:"withdrawer,omitempty"` - ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` - Denoms []string `protobuf:"bytes,3,rep,name=denoms,proto3" json:"denoms,omitempty"` -} - -func (x *MsgWithdraw) Reset() { - *x = MsgWithdraw{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgWithdraw) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgWithdraw) ProtoMessage() {} - -// Deprecated: Use MsgWithdraw.ProtoReflect.Descriptor instead. -func (*MsgWithdraw) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{9} -} - -func (x *MsgWithdraw) GetWithdrawer() string { - if x != nil { - return x.Withdrawer - } - return "" -} - -func (x *MsgWithdraw) GetToAddress() string { - if x != nil { - return x.ToAddress - } - return "" -} - -func (x *MsgWithdraw) GetDenoms() []string { - if x != nil { - return x.Denoms - } - return nil -} - -// MsgWithdrawResponse defines the response for MsgWithdraw -type MsgWithdrawResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Receiver string `protobuf:"bytes,1,opt,name=receiver,proto3" json:"receiver,omitempty"` - AmountReceived []*v1beta1.Coin `protobuf:"bytes,2,rep,name=amount_received,json=amountReceived,proto3" json:"amount_received,omitempty"` -} - -func (x *MsgWithdrawResponse) Reset() { - *x = MsgWithdrawResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgWithdrawResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgWithdrawResponse) ProtoMessage() {} - -// Deprecated: Use MsgWithdrawResponse.ProtoReflect.Descriptor instead. -func (*MsgWithdrawResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP(), []int{10} -} - -func (x *MsgWithdrawResponse) GetReceiver() string { - if x != nil { - return x.Receiver - } - return "" -} - -func (x *MsgWithdrawResponse) GetAmountReceived() []*v1beta1.Coin { - if x != nil { - return x.AmountReceived - } - return nil -} - var File_cosmos_accounts_defaults_lockup_v1_tx_proto protoreflect.FileDescriptor var file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDesc = []byte{ @@ -6473,50 +5210,25 @@ var file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDesc = []byte{ 0x65, 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x12, 0x38, 0x0a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, - 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x12, - 0x37, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x74, - 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, - 0x3a, 0x17, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x77, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x22, 0xd8, 0x01, 0x0a, 0x13, 0x4d, 0x73, - 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x72, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x8a, 0x01, 0x0a, 0x0f, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x02, 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, 0x46, 0xc8, 0xde, - 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, - 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, - 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x64, 0x42, 0x9c, 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x76, 0x31, 0x3b, - 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x44, 0x4c, 0xaa, - 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x75, - 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, - 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2e, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x26, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x44, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x42, 0x9c, 0x02, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x76, 0x31, + 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x76, 0x31, + 0x3b, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x76, 0x31, 0xa2, 0x02, 0x04, 0x43, 0x41, 0x44, 0x4c, + 0xaa, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, + 0x75, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, + 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x2e, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x44, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x26, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6531,7 +5243,7 @@ func file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescGZIP() []byte { return file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDescData } -var file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_cosmos_accounts_defaults_lockup_v1_tx_proto_goTypes = []interface{}{ (*MsgInitLockupAccount)(nil), // 0: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount (*MsgInitLockupAccountResponse)(nil), // 1: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccountResponse @@ -6542,28 +5254,25 @@ var file_cosmos_accounts_defaults_lockup_v1_tx_proto_goTypes = []interface{}{ (*MsgWithdrawReward)(nil), // 6: cosmos.accounts.defaults.lockup.v1.MsgWithdrawReward (*MsgSend)(nil), // 7: cosmos.accounts.defaults.lockup.v1.MsgSend (*MsgExecuteMessagesResponse)(nil), // 8: cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse - (*MsgWithdraw)(nil), // 9: cosmos.accounts.defaults.lockup.v1.MsgWithdraw - (*MsgWithdrawResponse)(nil), // 10: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp - (*Period)(nil), // 12: cosmos.accounts.defaults.lockup.v1.Period - (*v1beta1.Coin)(nil), // 13: cosmos.base.v1beta1.Coin - (*anypb.Any)(nil), // 14: google.protobuf.Any + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp + (*Period)(nil), // 10: cosmos.accounts.defaults.lockup.v1.Period + (*v1beta1.Coin)(nil), // 11: cosmos.base.v1beta1.Coin + (*anypb.Any)(nil), // 12: google.protobuf.Any } var file_cosmos_accounts_defaults_lockup_v1_tx_proto_depIdxs = []int32{ - 11, // 0: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount.end_time:type_name -> google.protobuf.Timestamp - 11, // 1: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount.start_time:type_name -> google.protobuf.Timestamp - 11, // 2: cosmos.accounts.defaults.lockup.v1.MsgInitPeriodicLockingAccount.start_time:type_name -> google.protobuf.Timestamp - 12, // 3: cosmos.accounts.defaults.lockup.v1.MsgInitPeriodicLockingAccount.locking_periods:type_name -> cosmos.accounts.defaults.lockup.v1.Period - 13, // 4: cosmos.accounts.defaults.lockup.v1.MsgDelegate.amount:type_name -> cosmos.base.v1beta1.Coin - 13, // 5: cosmos.accounts.defaults.lockup.v1.MsgUndelegate.amount:type_name -> cosmos.base.v1beta1.Coin - 13, // 6: cosmos.accounts.defaults.lockup.v1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin - 14, // 7: cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse.responses:type_name -> google.protobuf.Any - 13, // 8: cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse.amount_received:type_name -> cosmos.base.v1beta1.Coin - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 9, // 0: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount.end_time:type_name -> google.protobuf.Timestamp + 9, // 1: cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount.start_time:type_name -> google.protobuf.Timestamp + 9, // 2: cosmos.accounts.defaults.lockup.v1.MsgInitPeriodicLockingAccount.start_time:type_name -> google.protobuf.Timestamp + 10, // 3: cosmos.accounts.defaults.lockup.v1.MsgInitPeriodicLockingAccount.locking_periods:type_name -> cosmos.accounts.defaults.lockup.v1.Period + 11, // 4: cosmos.accounts.defaults.lockup.v1.MsgDelegate.amount:type_name -> cosmos.base.v1beta1.Coin + 11, // 5: cosmos.accounts.defaults.lockup.v1.MsgUndelegate.amount:type_name -> cosmos.base.v1beta1.Coin + 11, // 6: cosmos.accounts.defaults.lockup.v1.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin + 12, // 7: cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse.responses:type_name -> google.protobuf.Any + 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_cosmos_accounts_defaults_lockup_v1_tx_proto_init() } @@ -6681,30 +5390,6 @@ func file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() { return nil } } - file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgWithdraw); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_accounts_defaults_lockup_v1_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgWithdrawResponse); 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{ @@ -6712,7 +5397,7 @@ func file_cosmos_accounts_defaults_lockup_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_defaults_lockup_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/tests/integration/accounts/lockup/continous_lockup_test_suite.go b/tests/integration/accounts/lockup/continous_lockup_test_suite.go index 42c144a28ebb..20271b5ba2ca 100644 --- a/tests/integration/accounts/lockup/continous_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/continous_lockup_test_suite.go @@ -28,7 +28,6 @@ func (s *IntegrationTestSuite) TestContinuousLockingAccount() { require.NoError(t, err) s.fundAccount(app, ctx, accOwner, sdk.Coins{sdk.NewCoin("stake", math.NewInt(1000000))}) randAcc := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - withdrawAcc := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) _, accountAddr, err := app.AccountsKeeper.Init(ctx, lockupaccount.CONTINUOUS_LOCKING_ACCOUNT, accOwner, &types.MsgInitLockupAccount{ Owner: ownerAddrStr, @@ -63,19 +62,6 @@ func (s *IntegrationTestSuite) TestContinuousLockingAccount() { err := s.executeTx(ctx, msg, app, accountAddr, accOwner) require.NotNil(t, err) }) - t.Run("error - execute withdraw message, no withdrawable token", func(t *testing.T) { - ownerAddr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) - require.NoError(t, err) - withdrawAddr, err := app.AuthKeeper.AddressCodec().BytesToString(withdrawAcc) - require.NoError(t, err) - msg := &types.MsgWithdraw{ - Withdrawer: ownerAddr, - ToAddress: withdrawAddr, - Denoms: []string{"stake"}, - } - err = s.executeTx(ctx, msg, app, accountAddr, accOwner) - require.NotNil(t, err) - }) // Update context time // 12 sec = 1/5 of a minute so 200stake should be released @@ -96,23 +82,7 @@ func (s *IntegrationTestSuite) TestContinuousLockingAccount() { balance := app.BankKeeper.GetBalance(ctx, randAcc, "stake") require.True(t, balance.Amount.Equal(math.NewInt(100))) }) - t.Run("ok - execute withdraw message", func(t *testing.T) { - ownerAddr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) - require.NoError(t, err) - withdrawAddr, err := app.AuthKeeper.AddressCodec().BytesToString(withdrawAcc) - require.NoError(t, err) - msg := &types.MsgWithdraw{ - Withdrawer: ownerAddr, - ToAddress: withdrawAddr, - Denoms: []string{"stake"}, - } - err = s.executeTx(ctx, msg, app, accountAddr, accOwner) - require.NoError(t, err) - // withdrawable amount should be 200 - 100 = 100stake - balance := app.BankKeeper.GetBalance(ctx, withdrawAcc, "stake") - require.True(t, balance.Amount.Equal(math.NewInt(100))) - }) t.Run("ok - execute delegate message", func(t *testing.T) { msg := &types.MsgDelegate{ Sender: ownerAddrStr, diff --git a/tests/integration/accounts/lockup/delayed_lockup_test_suite.go b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go index d78848809bbc..ad947f1ce9a0 100644 --- a/tests/integration/accounts/lockup/delayed_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/delayed_lockup_test_suite.go @@ -28,7 +28,6 @@ func (s *IntegrationTestSuite) TestDelayedLockingAccount() { require.NoError(t, err) s.fundAccount(app, ctx, accOwner, sdk.Coins{sdk.NewCoin("stake", math.NewInt(1000000))}) randAcc := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - withdrawAcc := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) _, accountAddr, err := app.AccountsKeeper.Init(ctx, lockupaccount.DELAYED_LOCKING_ACCOUNT, accOwner, &types.MsgInitLockupAccount{ Owner: ownerAddrStr, @@ -62,19 +61,6 @@ func (s *IntegrationTestSuite) TestDelayedLockingAccount() { err := s.executeTx(ctx, msg, app, accountAddr, accOwner) require.NotNil(t, err) }) - t.Run("error - execute withdraw message, no withdrawable token", func(t *testing.T) { - ownerAddr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) - require.NoError(t, err) - withdrawAddr, err := app.AuthKeeper.AddressCodec().BytesToString(withdrawAcc) - require.NoError(t, err) - msg := &types.MsgWithdraw{ - Withdrawer: ownerAddr, - ToAddress: withdrawAddr, - Denoms: []string{"stake"}, - } - err = s.executeTx(ctx, msg, app, accountAddr, accOwner) - require.NotNil(t, err) - }) t.Run("ok - execute delegate message", func(t *testing.T) { msg := &types.MsgDelegate{ Sender: ownerAddrStr, @@ -167,23 +153,4 @@ func (s *IntegrationTestSuite) TestDelayedLockingAccount() { entries := unbondingEntriesResponse.UnbondingEntries require.Len(t, entries, 0) }) - // Test to withdraw all the remain funds to an account of choice - t.Run("ok - execute withdraw message", func(t *testing.T) { - ownerAddr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) - require.NoError(t, err) - withdrawAddr, err := app.AuthKeeper.AddressCodec().BytesToString(withdrawAcc) - require.NoError(t, err) - msg := &types.MsgWithdraw{ - Withdrawer: ownerAddr, - ToAddress: withdrawAddr, - Denoms: []string{"stake"}, - } - err = s.executeTx(ctx, msg, app, accountAddr, accOwner) - require.NoError(t, err) - - // withdrawable amount should be - // 1000stake - 100stake( above sent amt ) = 800stake - balance := app.BankKeeper.GetBalance(ctx, withdrawAcc, "stake") - require.True(t, balance.Amount.Equal(math.NewInt(900))) - }) } diff --git a/tests/integration/accounts/lockup/periodic_lockup_test_suite.go b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go index 53bd664967ed..ed760adb9e25 100644 --- a/tests/integration/accounts/lockup/periodic_lockup_test_suite.go +++ b/tests/integration/accounts/lockup/periodic_lockup_test_suite.go @@ -28,7 +28,6 @@ func (s *IntegrationTestSuite) TestPeriodicLockingAccount() { require.NoError(t, err) s.fundAccount(app, ctx, accOwner, sdk.Coins{sdk.NewCoin("stake", math.NewInt(1000000))}) randAcc := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - withdrawAcc := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) _, accountAddr, err := app.AccountsKeeper.Init(ctx, lockupaccount.PERIODIC_LOCKING_ACCOUNT, accOwner, &types.MsgInitPeriodicLockingAccount{ Owner: ownerAddrStr, @@ -76,19 +75,6 @@ func (s *IntegrationTestSuite) TestPeriodicLockingAccount() { err := s.executeTx(ctx, msg, app, accountAddr, accOwner) require.NotNil(t, err) }) - t.Run("error - execute withdraw message, no withdrawable token", func(t *testing.T) { - ownerAddr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) - require.NoError(t, err) - withdrawAddr, err := app.AuthKeeper.AddressCodec().BytesToString(withdrawAcc) - require.NoError(t, err) - msg := &types.MsgWithdraw{ - Withdrawer: ownerAddr, - ToAddress: withdrawAddr, - Denoms: []string{"stake"}, - } - err = s.executeTx(ctx, msg, app, accountAddr, accOwner) - require.NotNil(t, err) - }) // Update context time // After first period 500stake should be unlock @@ -116,25 +102,6 @@ func (s *IntegrationTestSuite) TestPeriodicLockingAccount() { Time: currentTime.Add(time.Minute * 2), }) - t.Run("oke - execute withdraw message", func(t *testing.T) { - ownerAddr, err := app.AuthKeeper.AddressCodec().BytesToString(accOwner) - require.NoError(t, err) - withdrawAddr, err := app.AuthKeeper.AddressCodec().BytesToString(withdrawAcc) - require.NoError(t, err) - msg := &types.MsgWithdraw{ - Withdrawer: ownerAddr, - ToAddress: withdrawAddr, - Denoms: []string{"stake"}, - } - err = s.executeTx(ctx, msg, app, accountAddr, accOwner) - require.NoError(t, err) - - // withdrawable amount should be - // 1000stake - 500stake( above sent amt ) = 500stake - balance := app.BankKeeper.GetBalance(ctx, withdrawAcc, "stake") - require.True(t, balance.Amount.Equal(math.NewInt(500))) - }) - t.Run("ok - execute delegate message", func(t *testing.T) { msg := &types.MsgDelegate{ Sender: ownerAddrStr, diff --git a/x/accounts/defaults/lockup/continuous_locking_account.go b/x/accounts/defaults/lockup/continuous_locking_account.go index 2c674b88c234..abe22f649270 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account.go +++ b/x/accounts/defaults/lockup/continuous_locking_account.go @@ -72,12 +72,6 @@ func (cva *ContinuousLockingAccount) SendCoins(ctx context.Context, msg *lockupt return cva.BaseLockup.SendCoins(ctx, msg, cva.GetLockedCoinsWithDenoms) } -func (cva *ContinuousLockingAccount) WithdrawUnlockedCoins(ctx context.Context, msg *lockuptypes.MsgWithdraw) ( - *lockuptypes.MsgWithdrawResponse, error, -) { - return cva.BaseLockup.WithdrawUnlockedCoins(ctx, msg, cva.GetLockedCoinsWithDenoms) -} - // GetLockCoinsInfo returns the total number of unlocked and locked coins. func (cva ContinuousLockingAccount) GetLockCoinsInfo(ctx context.Context, blockTime time.Time) (unlockedCoins, lockedCoins sdk.Coins, err error) { unlockedCoins = sdk.Coins{} @@ -186,6 +180,23 @@ func (cva ContinuousLockingAccount) QueryLockupAccountInfo(ctx context.Context, return resp, nil } +func (cva ContinuousLockingAccount) QuerySpendableTokens(ctx context.Context, req *lockuptypes.QuerySpendableAmountRequest) ( + *lockuptypes.QuerySpendableAmountResponse, error, +) { + hs := cva.headerService.HeaderInfo(ctx) + _, lockedCoins, err := cva.GetLockCoinsInfo(ctx, hs.Time) + if err != nil { + return nil, err + } + + resp, err := cva.BaseLockup.QuerySpendableTokens(ctx, lockedCoins) + if err != nil { + return nil, err + } + + return resp, nil +} + // Implement smart account interface func (cva ContinuousLockingAccount) RegisterInitHandler(builder *accountstd.InitBuilder) { accountstd.RegisterInitHandler(builder, cva.Init) @@ -194,11 +205,11 @@ func (cva ContinuousLockingAccount) RegisterInitHandler(builder *accountstd.Init func (cva ContinuousLockingAccount) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { accountstd.RegisterExecuteHandler(builder, cva.Delegate) accountstd.RegisterExecuteHandler(builder, cva.SendCoins) - accountstd.RegisterExecuteHandler(builder, cva.WithdrawUnlockedCoins) cva.BaseLockup.RegisterExecuteHandlers(builder) } func (cva ContinuousLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, cva.QueryLockupAccountInfo) + accountstd.RegisterQueryHandler(builder, cva.QuerySpendableTokens) cva.BaseLockup.RegisterQueryHandlers(builder) } diff --git a/x/accounts/defaults/lockup/continuous_locking_account_test.go b/x/accounts/defaults/lockup/continuous_locking_account_test.go index fa8fff37afd1..357f94e6b4dc 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account_test.go +++ b/x/accounts/defaults/lockup/continuous_locking_account_test.go @@ -149,36 +149,6 @@ func TestContinousAccountSendCoins(t *testing.T) { require.NoError(t, err) } -func TestContinousAccountWithdrawUnlockedCoins(t *testing.T) { - ctx, ss := newMockContext(t) - sdkCtx := sdk.NewContext(nil, true, log.NewNopLogger()).WithContext(ctx).WithHeaderInfo(header.Info{ - Time: time.Now(), - }) - - acc := setupContinousAccount(t, sdkCtx, ss) - _, err := acc.WithdrawUnlockedCoins(sdkCtx, &lockuptypes.MsgWithdraw{ - Withdrawer: "owner", - ToAddress: "receiver", - Denoms: []string{"test"}, - }) - require.Error(t, err) - - startTime, err := acc.StartTime.Get(sdkCtx) - require.NoError(t, err) - - // Update context time to unlocked half of the original locking amount - sdkCtx = sdkCtx.WithHeaderInfo(header.Info{ - Time: startTime.Add(time.Minute * 1), - }) - - _, err = acc.WithdrawUnlockedCoins(sdkCtx, &lockuptypes.MsgWithdraw{ - Withdrawer: "owner", - ToAddress: "receiver", - Denoms: []string{"test"}, - }) - require.NoError(t, err) -} - func TestContinousAccountGetLockCoinInfo(t *testing.T) { ctx, ss := newMockContext(t) sdkCtx := sdk.NewContext(nil, true, log.NewNopLogger()).WithContext(ctx).WithHeaderInfo(header.Info{ diff --git a/x/accounts/defaults/lockup/delayed_locking_account.go b/x/accounts/defaults/lockup/delayed_locking_account.go index aea4b7ef004e..22d00b3dc502 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account.go +++ b/x/accounts/defaults/lockup/delayed_locking_account.go @@ -49,12 +49,6 @@ func (dva *DelayedLockingAccount) SendCoins(ctx context.Context, msg *lockuptype return dva.BaseLockup.SendCoins(ctx, msg, dva.GetLockedCoinsWithDenoms) } -func (dva *DelayedLockingAccount) WithdrawUnlockedCoins(ctx context.Context, msg *lockuptypes.MsgWithdraw) ( - *lockuptypes.MsgWithdrawResponse, error, -) { - return dva.BaseLockup.WithdrawUnlockedCoins(ctx, msg, dva.GetLockedCoinsWithDenoms) -} - // GetLockCoinsInfo returns the total number of unlocked and locked coins. func (dva DelayedLockingAccount) GetLockCoinsInfo(ctx context.Context, blockTime time.Time) (sdk.Coins, sdk.Coins, error) { endTime, err := dva.EndTime.Get(ctx) @@ -135,6 +129,23 @@ func (dva DelayedLockingAccount) QueryVestingAccountInfo(ctx context.Context, re return resp, nil } +func (dva DelayedLockingAccount) QuerySpendableTokens(ctx context.Context, req *lockuptypes.QuerySpendableAmountRequest) ( + *lockuptypes.QuerySpendableAmountResponse, error, +) { + hs := dva.headerService.HeaderInfo(ctx) + _, lockedCoins, err := dva.GetLockCoinsInfo(ctx, hs.Time) + if err != nil { + return nil, err + } + + resp, err := dva.BaseLockup.QuerySpendableTokens(ctx, lockedCoins) + if err != nil { + return nil, err + } + + return resp, nil +} + // Implement smart account interface func (dva DelayedLockingAccount) RegisterInitHandler(builder *accountstd.InitBuilder) { accountstd.RegisterInitHandler(builder, dva.Init) @@ -143,11 +154,11 @@ func (dva DelayedLockingAccount) RegisterInitHandler(builder *accountstd.InitBui func (dva DelayedLockingAccount) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { accountstd.RegisterExecuteHandler(builder, dva.Delegate) accountstd.RegisterExecuteHandler(builder, dva.SendCoins) - accountstd.RegisterExecuteHandler(builder, dva.WithdrawUnlockedCoins) dva.BaseLockup.RegisterExecuteHandlers(builder) } func (dva DelayedLockingAccount) RegisterQueryHandlers(builder *accountstd.QueryBuilder) { accountstd.RegisterQueryHandler(builder, dva.QueryVestingAccountInfo) + accountstd.RegisterQueryHandler(builder, dva.QuerySpendableTokens) dva.BaseLockup.RegisterQueryHandlers(builder) } diff --git a/x/accounts/defaults/lockup/delayed_locking_account_test.go b/x/accounts/defaults/lockup/delayed_locking_account_test.go index c9e82842ee37..958886b2763e 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account_test.go +++ b/x/accounts/defaults/lockup/delayed_locking_account_test.go @@ -148,36 +148,6 @@ func TestDelayedAccountSendCoins(t *testing.T) { require.NoError(t, err) } -func TestDelayedAccountWithdrawUnlockedCoins(t *testing.T) { - ctx, ss := newMockContext(t) - sdkCtx := sdk.NewContext(nil, true, log.NewNopLogger()).WithContext(ctx).WithHeaderInfo(header.Info{ - Time: time.Now(), - }) - - acc := setupDelayedAccount(t, sdkCtx, ss) - _, err := acc.WithdrawUnlockedCoins(sdkCtx, &lockuptypes.MsgWithdraw{ - Withdrawer: "owner", - ToAddress: "receiver", - Denoms: []string{"test"}, - }) - require.Error(t, err) - - endTime, err := acc.EndTime.Get(sdkCtx) - require.NoError(t, err) - - // Update context time to unlocked all the original locking amount - sdkCtx = sdkCtx.WithHeaderInfo(header.Info{ - Time: endTime.Add(time.Second), - }) - - _, err = acc.WithdrawUnlockedCoins(sdkCtx, &lockuptypes.MsgWithdraw{ - Withdrawer: "owner", - ToAddress: "receiver", - Denoms: []string{"test"}, - }) - require.NoError(t, err) -} - func TestDelayedAccountGetLockCoinInfo(t *testing.T) { ctx, ss := newMockContext(t) sdkCtx := sdk.NewContext(nil, true, log.NewNopLogger()).WithContext(ctx).WithHeaderInfo(header.Info{ diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index c8e6067412a9..e607f9ce8905 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -4,8 +4,6 @@ import ( "bytes" "context" "errors" - "maps" - "slices" "time" "github.com/cosmos/gogoproto/proto" @@ -336,105 +334,6 @@ func (bva *BaseLockup) SendCoins( return &lockuptypes.MsgExecuteMessagesResponse{Responses: resp}, nil } -// WithdrawUnlockedCoins allow owner to withdraw the unlocked token for a specific denoms to an -// account of choice. Update the withdrawed token tracking for lockup account -func (bva *BaseLockup) WithdrawUnlockedCoins( - ctx context.Context, msg *lockuptypes.MsgWithdraw, getLockedCoinsFunc getLockedCoinsFunc, -) ( - *lockuptypes.MsgWithdrawResponse, error, -) { - err := bva.checkSender(ctx, msg.Withdrawer) - if err != nil { - return nil, err - } - whoami := accountstd.Whoami(ctx) - fromAddress, err := bva.addressCodec.BytesToString(whoami) - if err != nil { - return nil, err - } - - // deduplicate the denoms - denoms := make(map[string]struct{}) - for _, denom := range msg.Denoms { - denoms[denom] = struct{}{} - } - uniqueDenoms := slices.Collect(maps.Keys(denoms)) - - hs := bva.headerService.HeaderInfo(ctx) - lockedCoins, err := getLockedCoinsFunc(ctx, hs.Time, uniqueDenoms...) - if err != nil { - return nil, err - } - - amount := sdk.Coins{} - for _, denom := range uniqueDenoms { - balance, err := bva.getBalance(ctx, fromAddress, denom) - if err != nil { - return nil, err - } - lockedAmt := lockedCoins.AmountOf(denom) - - // get lockedCoin from that are not bonded for the sent denom - notBondedLockedCoin, err := bva.GetNotBondedLockedCoin(ctx, sdk.NewCoin(denom, lockedAmt), denom) - if err != nil { - return nil, err - } - - spendable, err := balance.SafeSub(notBondedLockedCoin) - if err != nil { - return nil, errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, - "locked amount exceeds account balance funds: %s > %s", notBondedLockedCoin, balance) - } - - withdrawedAmt, err := bva.WithdrawedCoins.Get(ctx, denom) - if err != nil { - return nil, err - } - originalLockingAmt, err := bva.OriginalLocking.Get(ctx, denom) - if err != nil { - return nil, err - } - - // withdrawable amount is equal to original locking amount subtract already withdrawed amount - withdrawableAmt, err := originalLockingAmt.SafeSub(withdrawedAmt) - if err != nil { - return nil, err - } - - withdrawAmt := math.MinInt(withdrawableAmt, spendable.Amount) - // if zero amount go to the next iteration - if withdrawAmt.IsZero() { - continue - } - amount = append(amount, sdk.NewCoin(denom, withdrawAmt)) - - // update the withdrawed amount - err = bva.WithdrawedCoins.Set(ctx, denom, withdrawedAmt.Add(withdrawAmt)) - if err != nil { - return nil, err - } - } - if len(amount) == 0 { - return nil, errors.New("no tokens available for withdrawing") - } - - msgSend := &banktypes.MsgSend{ - FromAddress: fromAddress, - ToAddress: msg.ToAddress, - Amount: amount, - } - - _, err = sendMessage(ctx, msgSend) - if err != nil { - return nil, err - } - - return &lockuptypes.MsgWithdrawResponse{ - Receiver: msg.ToAddress, - AmountReceived: amount, - }, nil -} - func (bva *BaseLockup) checkSender(ctx context.Context, sender string) error { owner, err := bva.Owner.Get(ctx) if err != nil { @@ -675,6 +574,16 @@ func (bva BaseLockup) getBalance(ctx context.Context, sender, denom string) (*sd return resp.Balance, nil } +func (bva BaseLockup) getBalances(ctx context.Context, sender string) (sdk.Coins, error) { + // Query account balance for the sent denom + resp, err := accountstd.QueryModule[*banktypes.QueryAllBalancesResponse](ctx, &banktypes.QueryAllBalancesRequest{Address: sender}) + if err != nil { + return nil, err + } + + return resp.Balances, nil +} + func (bva BaseLockup) getUbdEntries(ctx context.Context, delAddr, valAddr string) ([]stakingtypes.UnbondingDelegationEntry, error) { resp, err := accountstd.QueryModule[*stakingtypes.QueryUnbondingDelegationResponse]( ctx, &stakingtypes.QueryUnbondingDelegationRequest{DelegatorAddr: delAddr, ValidatorAddr: valAddr}, @@ -837,6 +746,43 @@ func (bva BaseLockup) QueryUnbondingEntries(ctx context.Context, req *lockuptype }, nil } +func (bva BaseLockup) QuerySpendableTokens(ctx context.Context, lockedCoins sdk.Coins) ( + *lockuptypes.QuerySpendableAmountResponse, error, +) { + whoami := accountstd.Whoami(ctx) + accAddr, err := bva.addressCodec.BytesToString(whoami) + if err != nil { + return nil, err + } + + balances, err := bva.getBalances(ctx, accAddr) + if err != nil { + return nil, err + } + + spendables := sdk.Coins{} + for _, balance := range balances { + lockedAmt := lockedCoins.AmountOf(balance.Denom) + + // get lockedCoin from that are not bonded for the sent denom + notBondedLockedCoin, err := bva.GetNotBondedLockedCoin(ctx, sdk.NewCoin(balance.Denom, lockedAmt), balance.Denom) + if err != nil { + return nil, err + } + + spendable, hasNeg := sdk.Coins{balance}.SafeSub(notBondedLockedCoin) + if hasNeg { + spendable = sdk.Coins{sdk.NewCoin(balance.Denom, math.ZeroInt())} + } + + spendables = spendables.Add(spendable...) + } + + return &lockuptypes.QuerySpendableAmountResponse{ + SpendableTokens: spendables, + }, nil +} + func (bva BaseLockup) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { accountstd.RegisterExecuteHandler(builder, bva.Undelegate) accountstd.RegisterExecuteHandler(builder, bva.WithdrawReward) diff --git a/x/accounts/defaults/lockup/periodic_locking_account.go b/x/accounts/defaults/lockup/periodic_locking_account.go index 2487d88c7c61..7e02b740b2f4 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account.go +++ b/x/accounts/defaults/lockup/periodic_locking_account.go @@ -134,12 +134,6 @@ func (pva *PeriodicLockingAccount) SendCoins(ctx context.Context, msg *lockuptyp return pva.BaseLockup.SendCoins(ctx, msg, pva.GetLockedCoinsWithDenoms) } -func (pva *PeriodicLockingAccount) WithdrawUnlockedCoins(ctx context.Context, msg *lockuptypes.MsgWithdraw) ( - *lockuptypes.MsgWithdrawResponse, error, -) { - return pva.BaseLockup.WithdrawUnlockedCoins(ctx, msg, pva.GetLockedCoinsWithDenoms) -} - // IteratePeriods iterates over all the Periods entries. func (pva PeriodicLockingAccount) IteratePeriods( ctx context.Context, @@ -336,7 +330,6 @@ func (pva PeriodicLockingAccount) RegisterInitHandler(builder *accountstd.InitBu func (pva PeriodicLockingAccount) RegisterExecuteHandlers(builder *accountstd.ExecuteBuilder) { accountstd.RegisterExecuteHandler(builder, pva.Delegate) accountstd.RegisterExecuteHandler(builder, pva.SendCoins) - accountstd.RegisterExecuteHandler(builder, pva.WithdrawUnlockedCoins) pva.BaseLockup.RegisterExecuteHandlers(builder) } diff --git a/x/accounts/defaults/lockup/periodic_locking_account_test.go b/x/accounts/defaults/lockup/periodic_locking_account_test.go index 38db636c5024..2a2e731589ea 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account_test.go +++ b/x/accounts/defaults/lockup/periodic_locking_account_test.go @@ -183,40 +183,6 @@ func TestPeriodicAccountSendCoins(t *testing.T) { require.NoError(t, err) } -func TestPeriodicAccountWithdrawUnlockedCoins(t *testing.T) { - ctx, ss := newMockContext(t) - sdkCtx := sdk.NewContext(nil, true, log.NewNopLogger()).WithContext(ctx).WithHeaderInfo(header.Info{ - Time: time.Now(), - }) - - acc := setupPeriodicAccount(t, sdkCtx, ss) - _, err := acc.WithdrawUnlockedCoins(sdkCtx, &lockuptypes.MsgWithdraw{ - Withdrawer: "owner", - ToAddress: "receiver", - Denoms: []string{"test"}, - }) - require.Error(t, err) - - startTime, err := acc.StartTime.Get(sdkCtx) - require.NoError(t, err) - - // Update context time to unlocked first period token - sdkCtx = sdkCtx.WithHeaderInfo(header.Info{ - Time: startTime.Add(time.Minute * 1), - }) - - // withdraw unlocked token - resp, err := acc.WithdrawUnlockedCoins(sdkCtx, &lockuptypes.MsgWithdraw{ - Withdrawer: "owner", - ToAddress: "receiver", - Denoms: []string{"test", "test"}, // duplicate tokens should be ignored - }) - require.NoError(t, err) - require.Equal(t, resp.AmountReceived.Len(), 1) - require.Equal(t, resp.AmountReceived, sdk.NewCoins(sdk.NewCoin("test", math.NewInt(5)))) - require.Equal(t, resp.Receiver, "receiver") -} - func TestPeriodicAccountGetLockCoinInfo(t *testing.T) { ctx, ss := newMockContext(t) sdkCtx := sdk.NewContext(nil, true, log.NewNopLogger()).WithContext(ctx).WithHeaderInfo(header.Info{ diff --git a/x/accounts/defaults/lockup/v1/query.pb.go b/x/accounts/defaults/lockup/v1/query.pb.go index 9121abdaa72f..bdea948f1fa2 100644 --- a/x/accounts/defaults/lockup/v1/query.pb.go +++ b/x/accounts/defaults/lockup/v1/query.pb.go @@ -350,6 +350,88 @@ func (m *QueryLockingPeriodsResponse) GetLockingPeriods() []*Period { return nil } +// QuerySpendableAmountRequest is used to query the lockup account total spendable tokens. +type QuerySpendableAmountRequest struct { +} + +func (m *QuerySpendableAmountRequest) Reset() { *m = QuerySpendableAmountRequest{} } +func (m *QuerySpendableAmountRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySpendableAmountRequest) ProtoMessage() {} +func (*QuerySpendableAmountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f2c1403191515490, []int{6} +} +func (m *QuerySpendableAmountRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpendableAmountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpendableAmountRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySpendableAmountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpendableAmountRequest.Merge(m, src) +} +func (m *QuerySpendableAmountRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySpendableAmountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpendableAmountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpendableAmountRequest proto.InternalMessageInfo + +// QuerySpendableAmountResponse returns lockup account total spendable tokens. +type QuerySpendableAmountResponse struct { + SpendableTokens github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=spendable_tokens,json=spendableTokens,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"spendable_tokens"` +} + +func (m *QuerySpendableAmountResponse) Reset() { *m = QuerySpendableAmountResponse{} } +func (m *QuerySpendableAmountResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySpendableAmountResponse) ProtoMessage() {} +func (*QuerySpendableAmountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f2c1403191515490, []int{7} +} +func (m *QuerySpendableAmountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpendableAmountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpendableAmountResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySpendableAmountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpendableAmountResponse.Merge(m, src) +} +func (m *QuerySpendableAmountResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySpendableAmountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpendableAmountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpendableAmountResponse proto.InternalMessageInfo + +func (m *QuerySpendableAmountResponse) GetSpendableTokens() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.SpendableTokens + } + return nil +} + func init() { proto.RegisterType((*QueryLockupAccountInfoRequest)(nil), "cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoRequest") proto.RegisterType((*QueryLockupAccountInfoResponse)(nil), "cosmos.accounts.defaults.lockup.v1.QueryLockupAccountInfoResponse") @@ -357,6 +439,8 @@ func init() { proto.RegisterType((*QueryUnbondingEntriesResponse)(nil), "cosmos.accounts.defaults.lockup.v1.QueryUnbondingEntriesResponse") proto.RegisterType((*QueryLockingPeriodsRequest)(nil), "cosmos.accounts.defaults.lockup.v1.QueryLockingPeriodsRequest") proto.RegisterType((*QueryLockingPeriodsResponse)(nil), "cosmos.accounts.defaults.lockup.v1.QueryLockingPeriodsResponse") + proto.RegisterType((*QuerySpendableAmountRequest)(nil), "cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountRequest") + proto.RegisterType((*QuerySpendableAmountResponse)(nil), "cosmos.accounts.defaults.lockup.v1.QuerySpendableAmountResponse") } func init() { @@ -364,46 +448,48 @@ func init() { } var fileDescriptor_f2c1403191515490 = []byte{ - // 613 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xcd, 0x4e, 0xdc, 0x3c, - 0x14, 0x9d, 0x7c, 0xfc, 0x9b, 0xaf, 0x30, 0x8c, 0x58, 0x0c, 0x53, 0xc8, 0xd0, 0xac, 0x46, 0x48, - 0xd8, 0x1d, 0xba, 0xec, 0xa2, 0x62, 0xfa, 0x23, 0x55, 0x42, 0x55, 0x1b, 0xda, 0x2e, 0xba, 0x89, - 0x92, 0xf8, 0x4e, 0x6a, 0x91, 0xb1, 0x07, 0xdb, 0x49, 0x61, 0xd7, 0x47, 0xe0, 0x39, 0xba, 0xee, - 0x43, 0xb0, 0x44, 0x5d, 0x75, 0x55, 0x2a, 0x78, 0x8f, 0xaa, 0x4a, 0x6c, 0x53, 0x41, 0xff, 0x58, - 0xd0, 0x55, 0x72, 0x7d, 0xcf, 0x3d, 0xe7, 0x9e, 0x5c, 0xdf, 0x20, 0x9c, 0x0a, 0x35, 0x12, 0x8a, - 0xc4, 0x69, 0x2a, 0x0a, 0xae, 0x15, 0xa1, 0x30, 0x8c, 0x8b, 0x5c, 0x2b, 0x92, 0x8b, 0x74, 0xaf, - 0x18, 0x93, 0xb2, 0x4f, 0xf6, 0x0b, 0x90, 0x87, 0x78, 0x2c, 0x85, 0x16, 0xad, 0xc0, 0xe0, 0xb1, - 0xc3, 0x63, 0x87, 0xc7, 0x06, 0x8f, 0xcb, 0x7e, 0x87, 0x5c, 0x83, 0xd3, 0xa2, 0x6b, 0xd2, 0x8e, - 0x6f, 0x0b, 0x92, 0x58, 0x01, 0x29, 0xfb, 0x09,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, 0x45, 0x28, 0x58, 0x45, 0x9d, 0x8b, 0x95, 0x67, 0x3c, 0x7b, 0x0e, 0x92, 0x09, - 0xea, 0x0c, 0x07, 0x12, 0xdd, 0xfe, 0x65, 0xd6, 0x76, 0xb7, 0x8b, 0x16, 0xed, 0x5e, 0x44, 0x63, - 0x93, 0xb2, 0xbd, 0x6d, 0x5c, 0xa7, 0x37, 0xc3, 0x16, 0x2e, 0xe4, 0x97, 0xc8, 0x07, 0x8f, 0x8e, - 0xcf, 0x7c, 0xef, 0xe4, 0xcc, 0xf7, 0xbe, 0x9e, 0xf9, 0xde, 0xd1, 0xb9, 0xdf, 0x38, 0x39, 0xf7, - 0x1b, 0x9f, 0xcf, 0xfd, 0xc6, 0x9b, 0x0d, 0x43, 0xaa, 0xe8, 0x1e, 0x66, 0x82, 0x1c, 0xfc, 0xe9, - 0x5f, 0x9b, 0x4c, 0xd7, 0xf7, 0xfc, 0xde, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x28, 0x0b, - 0x44, 0xec, 0x05, 0x00, 0x00, + // 654 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcb, 0x4e, 0xdb, 0x4c, + 0x14, 0x8e, 0x7f, 0xee, 0xc3, 0xff, 0x43, 0x88, 0x58, 0x84, 0xfc, 0xe0, 0x50, 0xaf, 0x22, 0x24, + 0x66, 0x1a, 0xba, 0xec, 0xa2, 0x22, 0xbd, 0x48, 0x95, 0x50, 0xd5, 0x1a, 0xda, 0x45, 0x37, 0x96, + 0x9d, 0x39, 0x71, 0x47, 0x71, 0x66, 0xc2, 0xcc, 0x38, 0x85, 0x5d, 0x1f, 0x81, 0x55, 0x1f, 0xa2, + 0xeb, 0x3e, 0x04, 0x4b, 0xd4, 0x55, 0x57, 0xa5, 0x82, 0xf7, 0xa8, 0x2a, 0x7b, 0x66, 0x82, 0x80, + 0x5e, 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0x33, 0x41, 0x0e, 0xfe, 0xf4, 0x1f, 0x91, 0x4c, 0x97, 0xfb, 0xf9, 0xe0, + 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x35, 0xa7, 0xeb, 0x0d, 0xa4, 0x06, 0x00, 0x00, } func (m *QueryLockupAccountInfoRequest) Marshal() (dAtA []byte, err error) { @@ -676,6 +762,66 @@ func (m *QueryLockingPeriodsResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *QuerySpendableAmountRequest) 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 *QuerySpendableAmountRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpendableAmountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QuerySpendableAmountResponse) 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 *QuerySpendableAmountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpendableAmountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SpendableTokens) > 0 { + for iNdEx := len(m.SpendableTokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SpendableTokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -799,6 +945,30 @@ func (m *QueryLockingPeriodsResponse) Size() (n int) { return n } +func (m *QuerySpendableAmountRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QuerySpendableAmountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SpendableTokens) > 0 { + for _, e := range m.SpendableTokens { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1479,6 +1649,140 @@ func (m *QueryLockingPeriodsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QuerySpendableAmountRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySpendableAmountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpendableAmountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySpendableAmountResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySpendableAmountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpendableAmountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpendableTokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpendableTokens = append(m.SpendableTokens, types.Coin{}) + if err := m.SpendableTokens[len(m.SpendableTokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/accounts/defaults/lockup/v1/tx.pb.go b/x/accounts/defaults/lockup/v1/tx.pb.go index eb831479e0fc..858e49e2758b 100644 --- a/x/accounts/defaults/lockup/v1/tx.pb.go +++ b/x/accounts/defaults/lockup/v1/tx.pb.go @@ -441,100 +441,6 @@ func (m *MsgExecuteMessagesResponse) GetResponses() []*any.Any { return nil } -// MsgWithdraw defines a message that the owner of the lockup can perform to withdraw unlocked token to an account of -// choice -type MsgWithdraw struct { - Withdrawer string `protobuf:"bytes,1,opt,name=withdrawer,proto3" json:"withdrawer,omitempty"` - ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` - Denoms []string `protobuf:"bytes,3,rep,name=denoms,proto3" json:"denoms,omitempty"` -} - -func (m *MsgWithdraw) Reset() { *m = MsgWithdraw{} } -func (m *MsgWithdraw) String() string { return proto.CompactTextString(m) } -func (*MsgWithdraw) ProtoMessage() {} -func (*MsgWithdraw) Descriptor() ([]byte, []int) { - return fileDescriptor_84e5f410632b9d39, []int{9} -} -func (m *MsgWithdraw) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdraw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdraw.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgWithdraw) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdraw.Merge(m, src) -} -func (m *MsgWithdraw) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdraw) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdraw.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdraw proto.InternalMessageInfo - -// MsgWithdrawResponse defines the response for MsgWithdraw -type MsgWithdrawResponse struct { - Receiver string `protobuf:"bytes,1,opt,name=receiver,proto3" json:"receiver,omitempty"` - AmountReceived github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount_received,json=amountReceived,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount_received"` -} - -func (m *MsgWithdrawResponse) Reset() { *m = MsgWithdrawResponse{} } -func (m *MsgWithdrawResponse) String() string { return proto.CompactTextString(m) } -func (*MsgWithdrawResponse) ProtoMessage() {} -func (*MsgWithdrawResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_84e5f410632b9d39, []int{10} -} -func (m *MsgWithdrawResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdrawResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdrawResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgWithdrawResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdrawResponse.Merge(m, src) -} -func (m *MsgWithdrawResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdrawResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdrawResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdrawResponse proto.InternalMessageInfo - -func (m *MsgWithdrawResponse) GetReceiver() string { - if m != nil { - return m.Receiver - } - return "" -} - -func (m *MsgWithdrawResponse) GetAmountReceived() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.AmountReceived - } - return nil -} - func init() { proto.RegisterType((*MsgInitLockupAccount)(nil), "cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccount") proto.RegisterType((*MsgInitLockupAccountResponse)(nil), "cosmos.accounts.defaults.lockup.v1.MsgInitLockupAccountResponse") @@ -545,8 +451,6 @@ func init() { proto.RegisterType((*MsgWithdrawReward)(nil), "cosmos.accounts.defaults.lockup.v1.MsgWithdrawReward") proto.RegisterType((*MsgSend)(nil), "cosmos.accounts.defaults.lockup.v1.MsgSend") proto.RegisterType((*MsgExecuteMessagesResponse)(nil), "cosmos.accounts.defaults.lockup.v1.MsgExecuteMessagesResponse") - proto.RegisterType((*MsgWithdraw)(nil), "cosmos.accounts.defaults.lockup.v1.MsgWithdraw") - proto.RegisterType((*MsgWithdrawResponse)(nil), "cosmos.accounts.defaults.lockup.v1.MsgWithdrawResponse") } func init() { @@ -554,59 +458,53 @@ func init() { } var fileDescriptor_84e5f410632b9d39 = []byte{ - // 817 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0xcf, 0x4f, 0xe3, 0x46, - 0x14, 0x8e, 0x13, 0x35, 0x90, 0xa1, 0x40, 0x31, 0x51, 0x09, 0x51, 0xb1, 0x69, 0x24, 0xd4, 0x28, - 0x15, 0xe3, 0x86, 0x56, 0x6a, 0x15, 0xf5, 0x42, 0x4a, 0xab, 0x56, 0x6a, 0x2a, 0x14, 0xfa, 0x43, - 0xea, 0xa1, 0xd1, 0xc4, 0x1e, 0x06, 0x8b, 0x78, 0x26, 0xf2, 0x4c, 0x12, 0x72, 0xab, 0xaa, 0x1e, - 0x2a, 0x4e, 0x9c, 0x7b, 0xe2, 0xd8, 0x72, 0x4a, 0x25, 0xfe, 0x08, 0x8e, 0x88, 0x13, 0xa7, 0xb2, - 0x0a, 0x2b, 0x85, 0x3f, 0x63, 0x65, 0xcf, 0x98, 0x4d, 0x80, 0x65, 0xb3, 0x39, 0xec, 0x4a, 0x7b, - 0x89, 0x3c, 0xf3, 0x7d, 0xef, 0xbd, 0xef, 0x7d, 0x33, 0xcf, 0x0e, 0xf8, 0xd8, 0x66, 0xdc, 0x63, - 0xdc, 0x42, 0xb6, 0xcd, 0x5a, 0x54, 0x70, 0xcb, 0xc1, 0xbb, 0xa8, 0xd5, 0x10, 0xdc, 0x6a, 0x30, - 0x7b, 0xbf, 0xd5, 0xb4, 0xda, 0x45, 0x4b, 0x1c, 0xc0, 0xa6, 0xcf, 0x04, 0xd3, 0x73, 0x92, 0x0c, - 0x23, 0x32, 0x8c, 0xc8, 0x50, 0x92, 0x61, 0xbb, 0x98, 0x5d, 0x40, 0x9e, 0x4b, 0x99, 0x15, 0xfe, - 0xca, 0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, 0xe6, 0xc9, 0x97, 0x60, 0xaa, 0xaa, 0x56, 0xa5, 0xa5, 0x61, 0x07, 0x86, - 0x2a, 0xe5, 0x2e, 0x35, 0xb0, 0x38, 0x72, 0x73, 0x55, 0xff, 0x9f, 0x81, 0x69, 0x1f, 0xdb, 0xd8, - 0x6d, 0x8f, 0xa1, 0xfc, 0x96, 0xa9, 0x1f, 0x6a, 0x60, 0x5e, 0x7a, 0x5e, 0x53, 0x7b, 0x4e, 0x26, - 0xfe, 0xba, 0x4e, 0x7b, 0x4e, 0x56, 0xae, 0xaa, 0xc2, 0xe5, 0xad, 0xb3, 0xbe, 0xa1, 0x9d, 0xf7, - 0x0d, 0xed, 0x49, 0xdf, 0xd0, 0x8e, 0xae, 0x8d, 0xd8, 0xf9, 0xb5, 0x11, 0xbb, 0xbc, 0x36, 0x62, - 0xbf, 0x16, 0x64, 0x5e, 0xee, 0xec, 0x43, 0x97, 0x59, 0x07, 0x8f, 0xfd, 0x63, 0xa9, 0x27, 0xc3, - 0xd3, 0xfe, 0xf4, 0x59, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x35, 0x67, 0x40, 0x62, 0x09, 0x00, - 0x00, + // 735 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x55, 0xbf, 0x4f, 0x1b, 0x49, + 0x18, 0xf5, 0xda, 0x3a, 0x38, 0x0f, 0xc7, 0xdd, 0xb1, 0x67, 0xe9, 0x8c, 0x75, 0xec, 0x72, 0x96, + 0xd0, 0x59, 0x3e, 0x31, 0x7b, 0xe6, 0x8a, 0x48, 0x28, 0x0d, 0x0e, 0x89, 0x12, 0x29, 0x8e, 0x90, + 0xc9, 0x0f, 0x29, 0x45, 0xac, 0xf1, 0xee, 0x30, 0xac, 0xf0, 0xce, 0x58, 0xfb, 0x8d, 0x0d, 0xee, + 0xa2, 0x28, 0x45, 0x94, 0x8a, 0x3a, 0x15, 0x65, 0x42, 0xe5, 0x82, 0x3f, 0x82, 0x12, 0x51, 0xa5, + 0x0a, 0x91, 0x89, 0x64, 0xfe, 0x8c, 0x68, 0x77, 0x66, 0x13, 0x7e, 0x85, 0x10, 0x9a, 0x48, 0x69, + 0xac, 0xdd, 0x79, 0xef, 0x7b, 0xdf, 0xfb, 0x9e, 0x67, 0x76, 0xd0, 0xbf, 0xae, 0x80, 0x40, 0x80, + 0x43, 0x5c, 0x57, 0x74, 0xb8, 0x04, 0xc7, 0xa3, 0x2b, 0xa4, 0xd3, 0x92, 0xe0, 0xb4, 0x84, 0xbb, + 0xd6, 0x69, 0x3b, 0xdd, 0x8a, 0x23, 0x37, 0x70, 0x3b, 0x14, 0x52, 0x98, 0x45, 0x45, 0xc6, 0x09, + 0x19, 0x27, 0x64, 0xac, 0xc8, 0xb8, 0x5b, 0x29, 0x4c, 0x90, 0xc0, 0xe7, 0xc2, 0x89, 0x7f, 0x55, + 0x59, 0xc1, 0xd2, 0x3d, 0x9a, 0x04, 0xa8, 0xd3, 0xad, 0x34, 0xa9, 0x24, 0x15, 0xc7, 0x15, 0x3e, + 0xd7, 0xb8, 0x73, 0x09, 0x0f, 0xba, 0x81, 0x2a, 0xf8, 0x53, 0x17, 0x04, 0xc0, 0x22, 0x2c, 0x00, + 0xa6, 0x81, 0x49, 0x05, 0x34, 0xe2, 0x37, 0x2d, 0xab, 0xa1, 0x1c, 0x13, 0x4c, 0xa8, 0xf5, 0xe8, + 0x29, 0x29, 0x60, 0x42, 0xb0, 0x16, 0x75, 0xe2, 0xb7, 0x66, 0x67, 0xc5, 0x21, 0xbc, 0xa7, 0x21, + 0xfb, 0x34, 0x24, 0xfd, 0x80, 0x82, 0x24, 0x81, 0x76, 0x51, 0x7c, 0x9a, 0x46, 0xb9, 0x1a, 0xb0, + 0x3b, 0xdc, 0x97, 0x77, 0x63, 0x77, 0x0b, 0xca, 0xbf, 0x89, 0xd1, 0x4f, 0x62, 0x9d, 0xd3, 0x30, +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x97, 0xcb, 0xb1, 0x43, 0x28, 0x7b, + 0x6d, 0x0a, 0x71, 0x01, 0xbc, 0x1a, 0xf6, 0xcb, 0xbf, 0x44, 0x1b, 0xcc, 0xed, 0x35, 0xa2, 0x1b, + 0x09, 0x2e, 0xf1, 0x9f, 0x2d, 0xa1, 0x42, 0x0d, 0xd8, 0xcd, 0x0d, 0xea, 0x76, 0x24, 0xad, 0x51, + 0x00, 0xc2, 0x28, 0x24, 0xa7, 0xd3, 0x9c, 0x43, 0xd9, 0x50, 0x3f, 0x43, 0xde, 0x88, 0x0d, 0xe7, + 0xce, 0x7c, 0x9f, 0x16, 0x78, 0xaf, 0xfe, 0x99, 0x56, 0x5d, 0xdc, 0x1d, 0x58, 0xc6, 0xde, 0xc0, + 0x32, 0xde, 0x0f, 0x2c, 0x63, 0xf3, 0xd0, 0x4a, 0xed, 0x1d, 0x5a, 0xa9, 0xb7, 0x87, 0x56, 0xea, + 0x71, 0x59, 0xd9, 0x06, 0x6f, 0x0d, 0xfb, 0xc2, 0xd9, 0xb8, 0xe8, 0x8a, 0x6c, 0x8e, 0xc4, 0xf2, + 0xff, 0x7f, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x08, 0x33, 0x56, 0xd8, 0xd3, 0x07, 0x00, 0x00, } func (this *MsgInitLockupAccount) Equal(that interface{}) bool { @@ -1002,96 +900,6 @@ func (m *MsgExecuteMessagesResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *MsgWithdraw) 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 *MsgWithdraw) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.Withdrawer) > 0 { - i -= len(m.Withdrawer) - copy(dAtA[i:], m.Withdrawer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Withdrawer))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgWithdrawResponse) 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 *MsgWithdrawResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdrawResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AmountReceived) > 0 { - for iNdEx := len(m.AmountReceived) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.AmountReceived[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Receiver) > 0 { - i -= len(m.Receiver) - copy(dAtA[i:], m.Receiver) - i = encodeVarintTx(dAtA, i, uint64(len(m.Receiver))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1252,48 +1060,6 @@ func (m *MsgExecuteMessagesResponse) Size() (n int) { return n } -func (m *MsgWithdraw) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Withdrawer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgWithdrawResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Receiver) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.AmountReceived) > 0 { - for _, e := range m.AmountReceived { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2337,268 +2103,6 @@ func (m *MsgExecuteMessagesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgWithdraw) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgWithdraw: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdraw: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Withdrawer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Withdrawer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgWithdrawResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgWithdrawResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Receiver = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountReceived", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AmountReceived = append(m.AmountReceived, types.Coin{}) - if err := m.AmountReceived[len(m.AmountReceived)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/query.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/query.proto index 660b8d210ce0..a5589ce3d9b4 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/query.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/query.proto @@ -63,3 +63,12 @@ message QueryLockingPeriodsResponse { // lockup_periods defines the value of the periodic lockup account locking periods. repeated Period locking_periods = 1; } + +// QuerySpendableAmountRequest is used to query the lockup account total spendable tokens. +message QuerySpendableAmountRequest {} + +// QuerySpendableAmountResponse returns lockup account total spendable tokens. +message QuerySpendableAmountResponse { + repeated cosmos.base.v1beta1.Coin spendable_tokens = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} diff --git a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto index 980cc90c5307..11fb09726186 100644 --- a/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto +++ b/x/accounts/proto/cosmos/accounts/defaults/lockup/v1/tx.proto @@ -101,26 +101,3 @@ message MsgSend { message MsgExecuteMessagesResponse { repeated google.protobuf.Any responses = 1; } - -// MsgWithdraw defines a message that the owner of the lockup can perform to withdraw unlocked token to an account of -// choice -message MsgWithdraw { - option (cosmos.msg.v1.signer) = "withdrawer"; - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string withdrawer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated string denoms = 3; -} - -// MsgWithdrawResponse defines the response for MsgWithdraw -message MsgWithdrawResponse { - string receiver = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - repeated cosmos.base.v1beta1.Coin amount_received = 2 [ - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true, - (amino.encoding) = "legacy_coins", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} From a4c8c3e764c0e67ca594b7227cc2b639ec19d9ed Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Wed, 4 Dec 2024 13:39:46 +0700 Subject: [PATCH 22/24] clean up --- x/accounts/defaults/lockup/lockup.go | 11 +---------- .../defaults/lockup/periodic_locking_account.go | 6 ------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index e607f9ce8905..6a9ee1d755c2 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -34,8 +34,7 @@ var ( StartTimePrefix = collections.NewPrefix(4) LockingPeriodsPrefix = collections.NewPrefix(5) OwnerPrefix = collections.NewPrefix(6) - WithdrawedCoinsPrefix = collections.NewPrefix(7) - UnbondEntriesPrefix = collections.NewPrefix(8) + UnbondEntriesPrefix = collections.NewPrefix(7) ) var ( @@ -54,7 +53,6 @@ func newBaseLockup(d accountstd.Dependencies) *BaseLockup { OriginalLocking: collections.NewMap(d.SchemaBuilder, OriginalLockingPrefix, "original_locking", collections.StringKey, sdk.IntValue), DelegatedFree: collections.NewMap(d.SchemaBuilder, DelegatedFreePrefix, "delegated_free", collections.StringKey, sdk.IntValue), DelegatedLocking: collections.NewMap(d.SchemaBuilder, DelegatedLockingPrefix, "delegated_locking", collections.StringKey, sdk.IntValue), - WithdrawedCoins: collections.NewMap(d.SchemaBuilder, WithdrawedCoinsPrefix, "withdrawed_coins", collections.StringKey, sdk.IntValue), UnbondEntries: collections.NewMap(d.SchemaBuilder, UnbondEntriesPrefix, "unbond_entries", collections.StringKey, codec.CollValue[lockuptypes.UnbondingEntries](d.LegacyStateCodec)), addressCodec: d.AddressCodec, headerService: d.Environment.HeaderService, @@ -70,7 +68,6 @@ type BaseLockup struct { OriginalLocking collections.Map[string, math.Int] DelegatedFree collections.Map[string, math.Int] DelegatedLocking collections.Map[string, math.Int] - WithdrawedCoins collections.Map[string, math.Int] // map val address to unbonding entries UnbondEntries collections.Map[string, lockuptypes.UnbondingEntries] addressCodec address.Codec @@ -99,12 +96,6 @@ func (bva *BaseLockup) Init(ctx context.Context, msg *lockuptypes.MsgInitLockupA if err != nil { return nil, err } - - // Set initial value for all locked token - err = bva.WithdrawedCoins.Set(ctx, coin.Denom, math.ZeroInt()) - if err != nil { - return nil, err - } } bondDenom, err := getStakingDenom(ctx) diff --git a/x/accounts/defaults/lockup/periodic_locking_account.go b/x/accounts/defaults/lockup/periodic_locking_account.go index 7e02b740b2f4..6e2caba7e6cf 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account.go +++ b/x/accounts/defaults/lockup/periodic_locking_account.go @@ -81,12 +81,6 @@ func (pva PeriodicLockingAccount) Init(ctx context.Context, msg *lockuptypes.Msg if err != nil { return nil, err } - - // Set initial value for all withdrawed token - err = pva.WithdrawedCoins.Set(ctx, coin.Denom, math.ZeroInt()) - if err != nil { - return nil, err - } } bondDenom, err := getStakingDenom(ctx) From 292cf01077d47f8dfdfde0864a6ece57e14dc1e7 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 9 Dec 2024 16:22:15 +0700 Subject: [PATCH 23/24] address comments --- .../lockup/continuous_locking_account_test.go | 2 +- .../lockup/delayed_locking_account_test.go | 2 +- x/accounts/defaults/lockup/lockup.go | 68 +++++++------------ .../lockup/permanent_locking_account_test.go | 2 +- 4 files changed, 28 insertions(+), 46 deletions(-) diff --git a/x/accounts/defaults/lockup/continuous_locking_account_test.go b/x/accounts/defaults/lockup/continuous_locking_account_test.go index 357f94e6b4dc..46b8627c2a31 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account_test.go +++ b/x/accounts/defaults/lockup/continuous_locking_account_test.go @@ -108,7 +108,7 @@ func TestContinousAccountUndelegate(t *testing.T) { require.True(t, entries.Entries[0].Amount.Amount.Equal(math.NewInt(1))) require.True(t, entries.Entries[0].ValidatorAddress == "val_address") - err = acc.CheckUbdEntriesMature(sdkCtx) + err = acc.checkUnbondingEntriesMature(sdkCtx) require.NoError(t, err) _, err = acc.UnbondEntries.Get(sdkCtx, "val_address") diff --git a/x/accounts/defaults/lockup/delayed_locking_account_test.go b/x/accounts/defaults/lockup/delayed_locking_account_test.go index 958886b2763e..dc3235c7a6ba 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account_test.go +++ b/x/accounts/defaults/lockup/delayed_locking_account_test.go @@ -107,7 +107,7 @@ func TestDelayedAccountUndelegate(t *testing.T) { require.True(t, entries.Entries[0].Amount.Amount.Equal(math.NewInt(1))) require.True(t, entries.Entries[0].ValidatorAddress == "val_address") - err = acc.CheckUbdEntriesMature(sdkCtx) + err = acc.checkUnbondingEntriesMature(sdkCtx) require.NoError(t, err) _, err = acc.UnbondEntries.Get(sdkCtx, "val_address") diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index 6a9ee1d755c2..a1582bf5c625 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -150,7 +150,7 @@ func (bva *BaseLockup) Delegate( } // refresh ubd entries to make sure delegation locking amount is up to date - err = bva.CheckUbdEntriesMature(ctx) + err = bva.checkUnbondingEntriesMature(ctx) if err != nil { return nil, err } @@ -211,29 +211,25 @@ func (bva *BaseLockup) Undelegate( } isNewEntry := true - skipEntriesIteration := false entries, err := bva.UnbondEntries.Get(ctx, msg.ValidatorAddress) if err != nil { if errorsmod.IsOf(err, collections.ErrNotFound) { entries = lockuptypes.UnbondingEntries{ Entries: []*lockuptypes.UnbondingEntry{}, } - skipEntriesIteration = true } else { return nil, err } } - if !skipEntriesIteration { - for i, entry := range entries.Entries { - if entry.CreationHeight == header.Height && entry.EndTime.Equal(msgUndelegateResp.CompletionTime) { - entry.Amount = entry.Amount.Add(msg.Amount) + for i, entry := range entries.Entries { + if entry.CreationHeight == header.Height && entry.EndTime.Equal(msgUndelegateResp.CompletionTime) { + entry.Amount = entry.Amount.Add(msg.Amount) - // update the entry - entries.Entries[i] = entry - isNewEntry = false - break - } + // update the entry + entries.Entries[i] = entry + isNewEntry = false + break } } @@ -360,8 +356,8 @@ func getStakingDenom(ctx context.Context) (string, error) { return resp.Params.BondDenom, nil } -// iterates through all the unbonding entries and check if any of the entries are matured and handled. -func (bva *BaseLockup) CheckUbdEntriesMature(ctx context.Context) error { +// checkUnbondingEntriesMature iterates through all the unbonding entries and check if any of the entries are matured and handled. +func (bva *BaseLockup) checkUnbondingEntriesMature(ctx context.Context) error { whoami := accountstd.Whoami(ctx) delAddr, err := bva.addressCodec.BytesToString(whoami) if err != nil { @@ -379,30 +375,26 @@ func (bva *BaseLockup) CheckUbdEntriesMature(ctx context.Context) error { return false, nil } - skipIteration := false - entries, err := bva.getUbdEntries(ctx, delAddr, key) + stakingUnbonding, err := bva.getUnbondingEntries(ctx, delAddr, key) if err != nil { // if ubd delegation is empty then skip the next iteration check if !errorsmod.IsOf(err, stakingtypes.ErrNoUnbondingDelegation) { return true, err } - skipIteration = true } found := false // check if the entry is still exist in the unbonding entries - if !skipIteration { - for _, e := range entries { - if e.CompletionTime.Equal(entry.EndTime) && entry.CreationHeight == entry.CreationHeight { - found = true - break - } + for _, e := range stakingUnbonding { + if e.CompletionTime.Equal(entry.EndTime) && entry.CreationHeight == entry.CreationHeight { + found = true + break } } // if not found or ubd delegation is empty then assume ubd entry is being handled - if !found || skipIteration { + if !found { err = bva.TrackUndelegation(ctx, sdk.NewCoins(entry.Amount)) if err != nil { return true, err @@ -565,17 +557,7 @@ func (bva BaseLockup) getBalance(ctx context.Context, sender, denom string) (*sd return resp.Balance, nil } -func (bva BaseLockup) getBalances(ctx context.Context, sender string) (sdk.Coins, error) { - // Query account balance for the sent denom - resp, err := accountstd.QueryModule[*banktypes.QueryAllBalancesResponse](ctx, &banktypes.QueryAllBalancesRequest{Address: sender}) - if err != nil { - return nil, err - } - - return resp.Balances, nil -} - -func (bva BaseLockup) getUbdEntries(ctx context.Context, delAddr, valAddr string) ([]stakingtypes.UnbondingDelegationEntry, error) { +func (bva BaseLockup) getUnbondingEntries(ctx context.Context, delAddr, valAddr string) ([]stakingtypes.UnbondingDelegationEntry, error) { resp, err := accountstd.QueryModule[*stakingtypes.QueryUnbondingDelegationResponse]( ctx, &stakingtypes.QueryUnbondingDelegationRequest{DelegatorAddr: delAddr, ValidatorAddr: valAddr}, ) @@ -638,7 +620,7 @@ func (bva BaseLockup) IterateCoinEntries( // for a lockup account. If the coin by the provided denom are not locked, an coin with zero amount is returned. func (bva BaseLockup) GetNotBondedLockedCoin(ctx context.Context, lockedCoin sdk.Coin, denom string) (sdk.Coin, error) { // refresh the unbonding entries - err := bva.CheckUbdEntriesMature(ctx) + err := bva.checkUnbondingEntriesMature(ctx) if err != nil { return sdk.Coin{}, err } @@ -746,13 +728,13 @@ func (bva BaseLockup) QuerySpendableTokens(ctx context.Context, lockedCoins sdk. return nil, err } - balances, err := bva.getBalances(ctx, accAddr) - if err != nil { - return nil, err - } - spendables := sdk.Coins{} - for _, balance := range balances { + for _, denom := range lockedCoins.Denoms() { + balance, err := bva.getBalance(ctx, accAddr, denom) + if err != nil { + return nil, err + } + lockedAmt := lockedCoins.AmountOf(balance.Denom) // get lockedCoin from that are not bonded for the sent denom @@ -761,7 +743,7 @@ func (bva BaseLockup) QuerySpendableTokens(ctx context.Context, lockedCoins sdk. return nil, err } - spendable, hasNeg := sdk.Coins{balance}.SafeSub(notBondedLockedCoin) + spendable, hasNeg := sdk.Coins{*balance}.SafeSub(notBondedLockedCoin) if hasNeg { spendable = sdk.Coins{sdk.NewCoin(balance.Denom, math.ZeroInt())} } diff --git a/x/accounts/defaults/lockup/permanent_locking_account_test.go b/x/accounts/defaults/lockup/permanent_locking_account_test.go index cd87d3be918f..224bfbb83e0a 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account_test.go +++ b/x/accounts/defaults/lockup/permanent_locking_account_test.go @@ -84,7 +84,7 @@ func TestPermanentAccountUndelegate(t *testing.T) { require.True(t, entries.Entries[0].Amount.Amount.Equal(math.NewInt(1))) require.True(t, entries.Entries[0].ValidatorAddress == "val_address") - err = acc.CheckUbdEntriesMature(sdkCtx) + err = acc.checkUnbondingEntriesMature(sdkCtx) require.NoError(t, err) _, err = acc.UnbondEntries.Get(sdkCtx, "val_address") From ce829cf8154397e0113f8b61f100950a419a4985 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Mon, 9 Dec 2024 16:27:06 +0700 Subject: [PATCH 24/24] minor --- x/accounts/defaults/lockup/periodic_locking_account_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/accounts/defaults/lockup/periodic_locking_account_test.go b/x/accounts/defaults/lockup/periodic_locking_account_test.go index 2a2e731589ea..bff11684e7f3 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account_test.go +++ b/x/accounts/defaults/lockup/periodic_locking_account_test.go @@ -142,7 +142,7 @@ func TestPeriodicAccountUndelegate(t *testing.T) { require.True(t, entries.Entries[0].Amount.Amount.Equal(math.NewInt(1))) require.True(t, entries.Entries[0].ValidatorAddress == "val_address") - err = acc.CheckUbdEntriesMature(sdkCtx) + err = acc.checkUnbondingEntriesMature(sdkCtx) require.NoError(t, err) _, err = acc.UnbondEntries.Get(sdkCtx, "val_address")