From bfeb41b37b57c53fcf174b599cbea2aafc4e597a Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 28 Oct 2023 19:07:48 -0600 Subject: [PATCH] feat: add proto for Clawback Vesting Account (#171) --- api/cosmos/vesting/v1beta1/tx.pulsar.go | 2543 ++++++++++++++++- api/cosmos/vesting/v1beta1/tx_grpc.pb.go | 80 + api/cosmos/vesting/v1beta1/vesting.pulsar.go | 1001 ++++++- proto/cosmos/vesting/v1beta1/tx.proto | 53 + proto/cosmos/vesting/v1beta1/vesting.proto | 20 + .../auth/keeper/vesting_account_test.go | 276 ++ x/auth/vesting/msg_server.go | 73 + x/auth/vesting/types/msgs.go | 27 + x/auth/vesting/types/tx.pb.go | 1409 +++++++-- x/auth/vesting/types/vesting.pb.go | 447 ++- 10 files changed, 5626 insertions(+), 303 deletions(-) create mode 100644 tests/integration/auth/keeper/vesting_account_test.go diff --git a/api/cosmos/vesting/v1beta1/tx.pulsar.go b/api/cosmos/vesting/v1beta1/tx.pulsar.go index 3b6e23692bf3..a275ff3bd1ee 100644 --- a/api/cosmos/vesting/v1beta1/tx.pulsar.go +++ b/api/cosmos/vesting/v1beta1/tx.pulsar.go @@ -3101,6 +3101,2128 @@ func (x *fastReflection_MsgCreatePeriodicVestingAccountResponse) ProtoMethods() } } +var _ protoreflect.List = (*_MsgCreateClawbackVestingAccount_4_list)(nil) + +type _MsgCreateClawbackVestingAccount_4_list struct { + list *[]*Period +} + +func (x *_MsgCreateClawbackVestingAccount_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateClawbackVestingAccount_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCreateClawbackVestingAccount_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Period) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateClawbackVestingAccount_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Period) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateClawbackVestingAccount_4_list) AppendMutable() protoreflect.Value { + v := new(Period) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateClawbackVestingAccount_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateClawbackVestingAccount_4_list) NewElement() protoreflect.Value { + v := new(Period) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateClawbackVestingAccount_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_MsgCreateClawbackVestingAccount_5_list)(nil) + +type _MsgCreateClawbackVestingAccount_5_list struct { + list *[]*Period +} + +func (x *_MsgCreateClawbackVestingAccount_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCreateClawbackVestingAccount_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCreateClawbackVestingAccount_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Period) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCreateClawbackVestingAccount_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Period) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCreateClawbackVestingAccount_5_list) AppendMutable() protoreflect.Value { + v := new(Period) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateClawbackVestingAccount_5_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCreateClawbackVestingAccount_5_list) NewElement() protoreflect.Value { + v := new(Period) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCreateClawbackVestingAccount_5_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgCreateClawbackVestingAccount protoreflect.MessageDescriptor + fd_MsgCreateClawbackVestingAccount_from_address protoreflect.FieldDescriptor + fd_MsgCreateClawbackVestingAccount_to_address protoreflect.FieldDescriptor + fd_MsgCreateClawbackVestingAccount_start_time protoreflect.FieldDescriptor + fd_MsgCreateClawbackVestingAccount_lockup_periods protoreflect.FieldDescriptor + fd_MsgCreateClawbackVestingAccount_vesting_periods protoreflect.FieldDescriptor + fd_MsgCreateClawbackVestingAccount_merge protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_vesting_v1beta1_tx_proto_init() + md_MsgCreateClawbackVestingAccount = File_cosmos_vesting_v1beta1_tx_proto.Messages().ByName("MsgCreateClawbackVestingAccount") + fd_MsgCreateClawbackVestingAccount_from_address = md_MsgCreateClawbackVestingAccount.Fields().ByName("from_address") + fd_MsgCreateClawbackVestingAccount_to_address = md_MsgCreateClawbackVestingAccount.Fields().ByName("to_address") + fd_MsgCreateClawbackVestingAccount_start_time = md_MsgCreateClawbackVestingAccount.Fields().ByName("start_time") + fd_MsgCreateClawbackVestingAccount_lockup_periods = md_MsgCreateClawbackVestingAccount.Fields().ByName("lockup_periods") + fd_MsgCreateClawbackVestingAccount_vesting_periods = md_MsgCreateClawbackVestingAccount.Fields().ByName("vesting_periods") + fd_MsgCreateClawbackVestingAccount_merge = md_MsgCreateClawbackVestingAccount.Fields().ByName("merge") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateClawbackVestingAccount)(nil) + +type fastReflection_MsgCreateClawbackVestingAccount MsgCreateClawbackVestingAccount + +func (x *MsgCreateClawbackVestingAccount) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateClawbackVestingAccount)(x) +} + +func (x *MsgCreateClawbackVestingAccount) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_vesting_v1beta1_tx_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_MsgCreateClawbackVestingAccount_messageType fastReflection_MsgCreateClawbackVestingAccount_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateClawbackVestingAccount_messageType{} + +type fastReflection_MsgCreateClawbackVestingAccount_messageType struct{} + +func (x fastReflection_MsgCreateClawbackVestingAccount_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateClawbackVestingAccount)(nil) +} +func (x fastReflection_MsgCreateClawbackVestingAccount_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateClawbackVestingAccount) +} +func (x fastReflection_MsgCreateClawbackVestingAccount_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateClawbackVestingAccount +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateClawbackVestingAccount) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateClawbackVestingAccount +} + +// 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_MsgCreateClawbackVestingAccount) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateClawbackVestingAccount_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateClawbackVestingAccount) New() protoreflect.Message { + return new(fastReflection_MsgCreateClawbackVestingAccount) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateClawbackVestingAccount) Interface() protoreflect.ProtoMessage { + return (*MsgCreateClawbackVestingAccount)(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_MsgCreateClawbackVestingAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.FromAddress != "" { + value := protoreflect.ValueOfString(x.FromAddress) + if !f(fd_MsgCreateClawbackVestingAccount_from_address, value) { + return + } + } + if x.ToAddress != "" { + value := protoreflect.ValueOfString(x.ToAddress) + if !f(fd_MsgCreateClawbackVestingAccount_to_address, value) { + return + } + } + if x.StartTime != int64(0) { + value := protoreflect.ValueOfInt64(x.StartTime) + if !f(fd_MsgCreateClawbackVestingAccount_start_time, value) { + return + } + } + if len(x.LockupPeriods) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateClawbackVestingAccount_4_list{list: &x.LockupPeriods}) + if !f(fd_MsgCreateClawbackVestingAccount_lockup_periods, value) { + return + } + } + if len(x.VestingPeriods) != 0 { + value := protoreflect.ValueOfList(&_MsgCreateClawbackVestingAccount_5_list{list: &x.VestingPeriods}) + if !f(fd_MsgCreateClawbackVestingAccount_vesting_periods, value) { + return + } + } + if x.Merge != false { + value := protoreflect.ValueOfBool(x.Merge) + if !f(fd_MsgCreateClawbackVestingAccount_merge, 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_MsgCreateClawbackVestingAccount) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.from_address": + return x.FromAddress != "" + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.to_address": + return x.ToAddress != "" + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.start_time": + return x.StartTime != int64(0) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.lockup_periods": + return len(x.LockupPeriods) != 0 + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.vesting_periods": + return len(x.VestingPeriods) != 0 + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.merge": + return x.Merge != false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount 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_MsgCreateClawbackVestingAccount) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.from_address": + x.FromAddress = "" + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.to_address": + x.ToAddress = "" + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.start_time": + x.StartTime = int64(0) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.lockup_periods": + x.LockupPeriods = nil + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.vesting_periods": + x.VestingPeriods = nil + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.merge": + x.Merge = false + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount 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_MsgCreateClawbackVestingAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.from_address": + value := x.FromAddress + return protoreflect.ValueOfString(value) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.to_address": + value := x.ToAddress + return protoreflect.ValueOfString(value) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.start_time": + value := x.StartTime + return protoreflect.ValueOfInt64(value) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.lockup_periods": + if len(x.LockupPeriods) == 0 { + return protoreflect.ValueOfList(&_MsgCreateClawbackVestingAccount_4_list{}) + } + listValue := &_MsgCreateClawbackVestingAccount_4_list{list: &x.LockupPeriods} + return protoreflect.ValueOfList(listValue) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.vesting_periods": + if len(x.VestingPeriods) == 0 { + return protoreflect.ValueOfList(&_MsgCreateClawbackVestingAccount_5_list{}) + } + listValue := &_MsgCreateClawbackVestingAccount_5_list{list: &x.VestingPeriods} + return protoreflect.ValueOfList(listValue) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.merge": + value := x.Merge + return protoreflect.ValueOfBool(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount 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_MsgCreateClawbackVestingAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.from_address": + x.FromAddress = value.Interface().(string) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.to_address": + x.ToAddress = value.Interface().(string) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.start_time": + x.StartTime = value.Int() + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.lockup_periods": + lv := value.List() + clv := lv.(*_MsgCreateClawbackVestingAccount_4_list) + x.LockupPeriods = *clv.list + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.vesting_periods": + lv := value.List() + clv := lv.(*_MsgCreateClawbackVestingAccount_5_list) + x.VestingPeriods = *clv.list + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.merge": + x.Merge = value.Bool() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount 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_MsgCreateClawbackVestingAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.lockup_periods": + if x.LockupPeriods == nil { + x.LockupPeriods = []*Period{} + } + value := &_MsgCreateClawbackVestingAccount_4_list{list: &x.LockupPeriods} + return protoreflect.ValueOfList(value) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.vesting_periods": + if x.VestingPeriods == nil { + x.VestingPeriods = []*Period{} + } + value := &_MsgCreateClawbackVestingAccount_5_list{list: &x.VestingPeriods} + return protoreflect.ValueOfList(value) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.from_address": + panic(fmt.Errorf("field from_address of message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount is not mutable")) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.to_address": + panic(fmt.Errorf("field to_address of message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount is not mutable")) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.start_time": + panic(fmt.Errorf("field start_time of message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount is not mutable")) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.merge": + panic(fmt.Errorf("field merge of message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount 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_MsgCreateClawbackVestingAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.from_address": + return protoreflect.ValueOfString("") + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.to_address": + return protoreflect.ValueOfString("") + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.start_time": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.lockup_periods": + list := []*Period{} + return protoreflect.ValueOfList(&_MsgCreateClawbackVestingAccount_4_list{list: &list}) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.vesting_periods": + list := []*Period{} + return protoreflect.ValueOfList(&_MsgCreateClawbackVestingAccount_5_list{list: &list}) + case "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.merge": + return protoreflect.ValueOfBool(false) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount 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_MsgCreateClawbackVestingAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount", 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_MsgCreateClawbackVestingAccount) 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_MsgCreateClawbackVestingAccount) 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_MsgCreateClawbackVestingAccount) 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_MsgCreateClawbackVestingAccount) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateClawbackVestingAccount) + 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.FromAddress) + 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 x.StartTime != 0 { + n += 1 + runtime.Sov(uint64(x.StartTime)) + } + if len(x.LockupPeriods) > 0 { + for _, e := range x.LockupPeriods { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.VestingPeriods) > 0 { + for _, e := range x.VestingPeriods { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Merge { + n += 2 + } + 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().(*MsgCreateClawbackVestingAccount) + 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.Merge { + i-- + if x.Merge { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(x.VestingPeriods) > 0 { + for iNdEx := len(x.VestingPeriods) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VestingPeriods[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] = 0x2a + } + } + if len(x.LockupPeriods) > 0 { + for iNdEx := len(x.LockupPeriods) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.LockupPeriods[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] = 0x22 + } + } + if x.StartTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.StartTime)) + i-- + dAtA[i] = 0x18 + } + 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.FromAddress) > 0 { + i -= len(x.FromAddress) + copy(dAtA[i:], x.FromAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FromAddress))) + 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().(*MsgCreateClawbackVestingAccount) + 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: MsgCreateClawbackVestingAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateClawbackVestingAccount: 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 FromAddress", 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.FromAddress = 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 != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + x.StartTime = 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.StartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LockupPeriods", 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.LockupPeriods = append(x.LockupPeriods, &Period{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LockupPeriods[len(x.LockupPeriods)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VestingPeriods", 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.VestingPeriods = append(x.VestingPeriods, &Period{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VestingPeriods[len(x.VestingPeriods)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Merge", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Merge = bool(v != 0) + 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_MsgCreateClawbackVestingAccountResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_vesting_v1beta1_tx_proto_init() + md_MsgCreateClawbackVestingAccountResponse = File_cosmos_vesting_v1beta1_tx_proto.Messages().ByName("MsgCreateClawbackVestingAccountResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgCreateClawbackVestingAccountResponse)(nil) + +type fastReflection_MsgCreateClawbackVestingAccountResponse MsgCreateClawbackVestingAccountResponse + +func (x *MsgCreateClawbackVestingAccountResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgCreateClawbackVestingAccountResponse)(x) +} + +func (x *MsgCreateClawbackVestingAccountResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_vesting_v1beta1_tx_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_MsgCreateClawbackVestingAccountResponse_messageType fastReflection_MsgCreateClawbackVestingAccountResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgCreateClawbackVestingAccountResponse_messageType{} + +type fastReflection_MsgCreateClawbackVestingAccountResponse_messageType struct{} + +func (x fastReflection_MsgCreateClawbackVestingAccountResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgCreateClawbackVestingAccountResponse)(nil) +} +func (x fastReflection_MsgCreateClawbackVestingAccountResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgCreateClawbackVestingAccountResponse) +} +func (x fastReflection_MsgCreateClawbackVestingAccountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateClawbackVestingAccountResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgCreateClawbackVestingAccountResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgCreateClawbackVestingAccountResponse +} + +// 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_MsgCreateClawbackVestingAccountResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgCreateClawbackVestingAccountResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgCreateClawbackVestingAccountResponse) New() protoreflect.Message { + return new(fastReflection_MsgCreateClawbackVestingAccountResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgCreateClawbackVestingAccountResponse) Interface() protoreflect.ProtoMessage { + return (*MsgCreateClawbackVestingAccountResponse)(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_MsgCreateClawbackVestingAccountResponse) 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_MsgCreateClawbackVestingAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse 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_MsgCreateClawbackVestingAccountResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse 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_MsgCreateClawbackVestingAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse 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_MsgCreateClawbackVestingAccountResponse) 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.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse 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_MsgCreateClawbackVestingAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse 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_MsgCreateClawbackVestingAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse 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_MsgCreateClawbackVestingAccountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse", 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_MsgCreateClawbackVestingAccountResponse) 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_MsgCreateClawbackVestingAccountResponse) 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_MsgCreateClawbackVestingAccountResponse) 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_MsgCreateClawbackVestingAccountResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgCreateClawbackVestingAccountResponse) + 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().(*MsgCreateClawbackVestingAccountResponse) + 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().(*MsgCreateClawbackVestingAccountResponse) + 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: MsgCreateClawbackVestingAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgCreateClawbackVestingAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgClawback protoreflect.MessageDescriptor + fd_MsgClawback_funder_address protoreflect.FieldDescriptor + fd_MsgClawback_address protoreflect.FieldDescriptor + fd_MsgClawback_dest_address protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_vesting_v1beta1_tx_proto_init() + md_MsgClawback = File_cosmos_vesting_v1beta1_tx_proto.Messages().ByName("MsgClawback") + fd_MsgClawback_funder_address = md_MsgClawback.Fields().ByName("funder_address") + fd_MsgClawback_address = md_MsgClawback.Fields().ByName("address") + fd_MsgClawback_dest_address = md_MsgClawback.Fields().ByName("dest_address") +} + +var _ protoreflect.Message = (*fastReflection_MsgClawback)(nil) + +type fastReflection_MsgClawback MsgClawback + +func (x *MsgClawback) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClawback)(x) +} + +func (x *MsgClawback) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_vesting_v1beta1_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_MsgClawback_messageType fastReflection_MsgClawback_messageType +var _ protoreflect.MessageType = fastReflection_MsgClawback_messageType{} + +type fastReflection_MsgClawback_messageType struct{} + +func (x fastReflection_MsgClawback_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClawback)(nil) +} +func (x fastReflection_MsgClawback_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClawback) +} +func (x fastReflection_MsgClawback_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawback +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClawback) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawback +} + +// 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_MsgClawback) Type() protoreflect.MessageType { + return _fastReflection_MsgClawback_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClawback) New() protoreflect.Message { + return new(fastReflection_MsgClawback) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClawback) Interface() protoreflect.ProtoMessage { + return (*MsgClawback)(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_MsgClawback) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.FunderAddress != "" { + value := protoreflect.ValueOfString(x.FunderAddress) + if !f(fd_MsgClawback_funder_address, value) { + return + } + } + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_MsgClawback_address, value) { + return + } + } + if x.DestAddress != "" { + value := protoreflect.ValueOfString(x.DestAddress) + if !f(fd_MsgClawback_dest_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_MsgClawback) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgClawback.funder_address": + return x.FunderAddress != "" + case "cosmos.vesting.v1beta1.MsgClawback.address": + return x.Address != "" + case "cosmos.vesting.v1beta1.MsgClawback.dest_address": + return x.DestAddress != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawback")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawback 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_MsgClawback) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgClawback.funder_address": + x.FunderAddress = "" + case "cosmos.vesting.v1beta1.MsgClawback.address": + x.Address = "" + case "cosmos.vesting.v1beta1.MsgClawback.dest_address": + x.DestAddress = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawback")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawback 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_MsgClawback) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.vesting.v1beta1.MsgClawback.funder_address": + value := x.FunderAddress + return protoreflect.ValueOfString(value) + case "cosmos.vesting.v1beta1.MsgClawback.address": + value := x.Address + return protoreflect.ValueOfString(value) + case "cosmos.vesting.v1beta1.MsgClawback.dest_address": + value := x.DestAddress + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawback")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawback 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_MsgClawback) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgClawback.funder_address": + x.FunderAddress = value.Interface().(string) + case "cosmos.vesting.v1beta1.MsgClawback.address": + x.Address = value.Interface().(string) + case "cosmos.vesting.v1beta1.MsgClawback.dest_address": + x.DestAddress = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawback")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawback 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_MsgClawback) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgClawback.funder_address": + panic(fmt.Errorf("field funder_address of message cosmos.vesting.v1beta1.MsgClawback is not mutable")) + case "cosmos.vesting.v1beta1.MsgClawback.address": + panic(fmt.Errorf("field address of message cosmos.vesting.v1beta1.MsgClawback is not mutable")) + case "cosmos.vesting.v1beta1.MsgClawback.dest_address": + panic(fmt.Errorf("field dest_address of message cosmos.vesting.v1beta1.MsgClawback is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawback")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawback 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_MsgClawback) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.MsgClawback.funder_address": + return protoreflect.ValueOfString("") + case "cosmos.vesting.v1beta1.MsgClawback.address": + return protoreflect.ValueOfString("") + case "cosmos.vesting.v1beta1.MsgClawback.dest_address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawback")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawback 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_MsgClawback) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.vesting.v1beta1.MsgClawback", 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_MsgClawback) 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_MsgClawback) 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_MsgClawback) 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_MsgClawback) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClawback) + 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.FunderAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Address) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.DestAddress) + 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().(*MsgClawback) + 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.DestAddress) > 0 { + i -= len(x.DestAddress) + copy(dAtA[i:], x.DestAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DestAddress))) + i-- + dAtA[i] = 0x1a + } + if len(x.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0x12 + } + if len(x.FunderAddress) > 0 { + i -= len(x.FunderAddress) + copy(dAtA[i:], x.FunderAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FunderAddress))) + 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().(*MsgClawback) + 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: MsgClawback: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClawback: 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 FunderAddress", 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.FunderAddress = 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 Address", 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.Address = 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 DestAddress", 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.DestAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgClawbackResponse protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_vesting_v1beta1_tx_proto_init() + md_MsgClawbackResponse = File_cosmos_vesting_v1beta1_tx_proto.Messages().ByName("MsgClawbackResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgClawbackResponse)(nil) + +type fastReflection_MsgClawbackResponse MsgClawbackResponse + +func (x *MsgClawbackResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClawbackResponse)(x) +} + +func (x *MsgClawbackResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_vesting_v1beta1_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_MsgClawbackResponse_messageType fastReflection_MsgClawbackResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgClawbackResponse_messageType{} + +type fastReflection_MsgClawbackResponse_messageType struct{} + +func (x fastReflection_MsgClawbackResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClawbackResponse)(nil) +} +func (x fastReflection_MsgClawbackResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClawbackResponse) +} +func (x fastReflection_MsgClawbackResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClawbackResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackResponse +} + +// 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_MsgClawbackResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgClawbackResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClawbackResponse) New() protoreflect.Message { + return new(fastReflection_MsgClawbackResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClawbackResponse) Interface() protoreflect.ProtoMessage { + return (*MsgClawbackResponse)(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_MsgClawbackResponse) 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_MsgClawbackResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawbackResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawbackResponse 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_MsgClawbackResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawbackResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawbackResponse 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_MsgClawbackResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawbackResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawbackResponse 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_MsgClawbackResponse) 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.vesting.v1beta1.MsgClawbackResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawbackResponse 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_MsgClawbackResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawbackResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawbackResponse 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_MsgClawbackResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.MsgClawbackResponse")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.MsgClawbackResponse 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_MsgClawbackResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.vesting.v1beta1.MsgClawbackResponse", 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_MsgClawbackResponse) 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_MsgClawbackResponse) 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_MsgClawbackResponse) 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_MsgClawbackResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClawbackResponse) + 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().(*MsgClawbackResponse) + 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().(*MsgClawbackResponse) + 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: MsgClawbackResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClawbackResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -3389,6 +5511,206 @@ func (*MsgCreatePeriodicVestingAccountResponse) Descriptor() ([]byte, []int) { return file_cosmos_vesting_v1beta1_tx_proto_rawDescGZIP(), []int{5} } +// MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. +type MsgCreateClawbackVestingAccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // from_address specifies the account to provide the funds and sign the + // clawback request + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + // to_address specifies the account to receive the funds + ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` + // start_time defines the time at which the vesting period begins + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // lockup_periods defines the unlocking schedule relative to the start_time + LockupPeriods []*Period `protobuf:"bytes,4,rep,name=lockup_periods,json=lockupPeriods,proto3" json:"lockup_periods,omitempty"` + // vesting_periods defines the vesting schedule relative to the start_time + VestingPeriods []*Period `protobuf:"bytes,5,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods,omitempty"` + // merge specifies a creation mechanism for existing + // ClawbackVestingAccounts. If true, merge this new grant into an existing + // ClawbackVestingAccount, or create it if it does not exist. If false, + // creates a new account. New grants to an existing account must be from the + // same from_address. + Merge bool `protobuf:"varint,6,opt,name=merge,proto3" json:"merge,omitempty"` +} + +func (x *MsgCreateClawbackVestingAccount) Reset() { + *x = MsgCreateClawbackVestingAccount{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_vesting_v1beta1_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateClawbackVestingAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateClawbackVestingAccount) ProtoMessage() {} + +// Deprecated: Use MsgCreateClawbackVestingAccount.ProtoReflect.Descriptor instead. +func (*MsgCreateClawbackVestingAccount) Descriptor() ([]byte, []int) { + return file_cosmos_vesting_v1beta1_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgCreateClawbackVestingAccount) GetFromAddress() string { + if x != nil { + return x.FromAddress + } + return "" +} + +func (x *MsgCreateClawbackVestingAccount) GetToAddress() string { + if x != nil { + return x.ToAddress + } + return "" +} + +func (x *MsgCreateClawbackVestingAccount) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *MsgCreateClawbackVestingAccount) GetLockupPeriods() []*Period { + if x != nil { + return x.LockupPeriods + } + return nil +} + +func (x *MsgCreateClawbackVestingAccount) GetVestingPeriods() []*Period { + if x != nil { + return x.VestingPeriods + } + return nil +} + +func (x *MsgCreateClawbackVestingAccount) GetMerge() bool { + if x != nil { + return x.Merge + } + return false +} + +// MsgCreateClawbackVestingAccountResponse defines the +// MsgCreateClawbackVestingAccount response type. +type MsgCreateClawbackVestingAccountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgCreateClawbackVestingAccountResponse) Reset() { + *x = MsgCreateClawbackVestingAccountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_vesting_v1beta1_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgCreateClawbackVestingAccountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateClawbackVestingAccountResponse) ProtoMessage() {} + +// Deprecated: Use MsgCreateClawbackVestingAccountResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateClawbackVestingAccountResponse) Descriptor() ([]byte, []int) { + return file_cosmos_vesting_v1beta1_tx_proto_rawDescGZIP(), []int{7} +} + +// MsgClawback defines a message that removes unvested tokens from a +// ClawbackVestingAccount. +type MsgClawback struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // funder_address is the address which funded the account + FunderAddress string `protobuf:"bytes,1,opt,name=funder_address,json=funderAddress,proto3" json:"funder_address,omitempty"` + // address is the address of the ClawbackVestingAccount to claw back from. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // dest_address specifies where the clawed-back tokens should be transferred + // to. If empty, the tokens will be transferred back to the original funder of + // the account. + DestAddress string `protobuf:"bytes,3,opt,name=dest_address,json=destAddress,proto3" json:"dest_address,omitempty"` +} + +func (x *MsgClawback) Reset() { + *x = MsgClawback{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_vesting_v1beta1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClawback) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClawback) ProtoMessage() {} + +// Deprecated: Use MsgClawback.ProtoReflect.Descriptor instead. +func (*MsgClawback) Descriptor() ([]byte, []int) { + return file_cosmos_vesting_v1beta1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgClawback) GetFunderAddress() string { + if x != nil { + return x.FunderAddress + } + return "" +} + +func (x *MsgClawback) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *MsgClawback) GetDestAddress() string { + if x != nil { + return x.DestAddress + } + return "" +} + +// MsgClawbackResponse defines the MsgClawback response type. +type MsgClawbackResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgClawbackResponse) Reset() { + *x = MsgClawbackResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_vesting_v1beta1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClawbackResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClawbackResponse) ProtoMessage() {} + +// Deprecated: Use MsgClawbackResponse.ProtoReflect.Descriptor instead. +func (*MsgClawbackResponse) Descriptor() ([]byte, []int) { + return file_cosmos_vesting_v1beta1_tx_proto_rawDescGZIP(), []int{9} +} + var File_cosmos_vesting_v1beta1_tx_proto protoreflect.FileDescriptor var file_cosmos_vesting_v1beta1_tx_proto_rawDesc = []byte{ @@ -3476,49 +5798,104 @@ var file_cosmos_vesting_v1beta1_tx_proto_rawDesc = []byte{ 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x29, 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0xc5, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x80, 0x01, 0x0a, 0x14, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, + 0x65, 0x22, 0x91, 0x03, 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x72, 0x6f, + 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x34, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xf2, 0xde, 0x1f, + 0x11, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x22, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4b, 0x0a, + 0x0e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, + 0x65, 0x72, 0x69, 0x6f, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0d, 0x6c, 0x6f, 0x63, + 0x6b, 0x75, 0x70, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x76, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0e, 0x76, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x65, 0x72, + 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x3a, + 0x44, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x29, 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xa1, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, + 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x3a, 0x2e, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x66, 0x75, 0x6e, 0x64, 0x65, + 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, + 0x62, 0x61, 0x63, 0x6b, 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, + 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbe, 0x05, 0x0a, 0x03, + 0x4d, 0x73, 0x67, 0x12, 0x80, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x37, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x50, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x61, 0x6e, + 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x1a, 0x3f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x6b, + 0x65, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x98, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x69, 0x63, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x1a, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x56, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x3f, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x98, 0x01, 0x0a, - 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74, - 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x37, 0x2e, + 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x56, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x50, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, + 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x3f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, - 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, + 0x6b, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x77, 0x62, + 0x61, 0x63, 0x6b, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, - 0x64, 0x69, 0x63, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x1a, 0x3f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x56, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xd7, 0x01, 0x0a, 0x1a, 0x63, 0x6f, - 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x76, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x76, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x56, - 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x56, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x3a, 0x3a, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xd7, 0x01, 0x0a, + 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, + 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x56, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3533,7 +5910,7 @@ func file_cosmos_vesting_v1beta1_tx_proto_rawDescGZIP() []byte { return file_cosmos_vesting_v1beta1_tx_proto_rawDescData } -var file_cosmos_vesting_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cosmos_vesting_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_cosmos_vesting_v1beta1_tx_proto_goTypes = []interface{}{ (*MsgCreateVestingAccount)(nil), // 0: cosmos.vesting.v1beta1.MsgCreateVestingAccount (*MsgCreateVestingAccountResponse)(nil), // 1: cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse @@ -3541,24 +5918,34 @@ var file_cosmos_vesting_v1beta1_tx_proto_goTypes = []interface{}{ (*MsgCreatePermanentLockedAccountResponse)(nil), // 3: cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse (*MsgCreatePeriodicVestingAccount)(nil), // 4: cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount (*MsgCreatePeriodicVestingAccountResponse)(nil), // 5: cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse - (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin - (*Period)(nil), // 7: cosmos.vesting.v1beta1.Period + (*MsgCreateClawbackVestingAccount)(nil), // 6: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount + (*MsgCreateClawbackVestingAccountResponse)(nil), // 7: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse + (*MsgClawback)(nil), // 8: cosmos.vesting.v1beta1.MsgClawback + (*MsgClawbackResponse)(nil), // 9: cosmos.vesting.v1beta1.MsgClawbackResponse + (*v1beta1.Coin)(nil), // 10: cosmos.base.v1beta1.Coin + (*Period)(nil), // 11: cosmos.vesting.v1beta1.Period } var file_cosmos_vesting_v1beta1_tx_proto_depIdxs = []int32{ - 6, // 0: cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount:type_name -> cosmos.base.v1beta1.Coin - 6, // 1: cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount.amount:type_name -> cosmos.base.v1beta1.Coin - 7, // 2: cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount.vesting_periods:type_name -> cosmos.vesting.v1beta1.Period - 0, // 3: cosmos.vesting.v1beta1.Msg.CreateVestingAccount:input_type -> cosmos.vesting.v1beta1.MsgCreateVestingAccount - 2, // 4: cosmos.vesting.v1beta1.Msg.CreatePermanentLockedAccount:input_type -> cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount - 4, // 5: cosmos.vesting.v1beta1.Msg.CreatePeriodicVestingAccount:input_type -> cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount - 1, // 6: cosmos.vesting.v1beta1.Msg.CreateVestingAccount:output_type -> cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse - 3, // 7: cosmos.vesting.v1beta1.Msg.CreatePermanentLockedAccount:output_type -> cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse - 5, // 8: cosmos.vesting.v1beta1.Msg.CreatePeriodicVestingAccount:output_type -> cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 10, // 0: cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount:type_name -> cosmos.base.v1beta1.Coin + 10, // 1: cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount.amount:type_name -> cosmos.base.v1beta1.Coin + 11, // 2: cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount.vesting_periods:type_name -> cosmos.vesting.v1beta1.Period + 11, // 3: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.lockup_periods:type_name -> cosmos.vesting.v1beta1.Period + 11, // 4: cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount.vesting_periods:type_name -> cosmos.vesting.v1beta1.Period + 0, // 5: cosmos.vesting.v1beta1.Msg.CreateVestingAccount:input_type -> cosmos.vesting.v1beta1.MsgCreateVestingAccount + 2, // 6: cosmos.vesting.v1beta1.Msg.CreatePermanentLockedAccount:input_type -> cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount + 4, // 7: cosmos.vesting.v1beta1.Msg.CreatePeriodicVestingAccount:input_type -> cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount + 6, // 8: cosmos.vesting.v1beta1.Msg.CreateClawbackVestingAccount:input_type -> cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount + 8, // 9: cosmos.vesting.v1beta1.Msg.Clawback:input_type -> cosmos.vesting.v1beta1.MsgClawback + 1, // 10: cosmos.vesting.v1beta1.Msg.CreateVestingAccount:output_type -> cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse + 3, // 11: cosmos.vesting.v1beta1.Msg.CreatePermanentLockedAccount:output_type -> cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse + 5, // 12: cosmos.vesting.v1beta1.Msg.CreatePeriodicVestingAccount:output_type -> cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse + 7, // 13: cosmos.vesting.v1beta1.Msg.CreateClawbackVestingAccount:output_type -> cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse + 9, // 14: cosmos.vesting.v1beta1.Msg.Clawback:output_type -> cosmos.vesting.v1beta1.MsgClawbackResponse + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] 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_vesting_v1beta1_tx_proto_init() } @@ -3640,6 +6027,54 @@ func file_cosmos_vesting_v1beta1_tx_proto_init() { return nil } } + file_cosmos_vesting_v1beta1_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateClawbackVestingAccount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_vesting_v1beta1_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgCreateClawbackVestingAccountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_vesting_v1beta1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClawback); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_vesting_v1beta1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClawbackResponse); 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{ @@ -3647,7 +6082,7 @@ func file_cosmos_vesting_v1beta1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_vesting_v1beta1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/vesting/v1beta1/tx_grpc.pb.go b/api/cosmos/vesting/v1beta1/tx_grpc.pb.go index 13b9a67c5d37..d0f1f6d819d0 100644 --- a/api/cosmos/vesting/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/vesting/v1beta1/tx_grpc.pb.go @@ -22,6 +22,8 @@ const ( Msg_CreateVestingAccount_FullMethodName = "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount" Msg_CreatePermanentLockedAccount_FullMethodName = "/cosmos.vesting.v1beta1.Msg/CreatePermanentLockedAccount" Msg_CreatePeriodicVestingAccount_FullMethodName = "/cosmos.vesting.v1beta1.Msg/CreatePeriodicVestingAccount" + Msg_CreateClawbackVestingAccount_FullMethodName = "/cosmos.vesting.v1beta1.Msg/CreateClawbackVestingAccount" + Msg_Clawback_FullMethodName = "/cosmos.vesting.v1beta1.Msg/Clawback" ) // MsgClient is the client API for Msg service. @@ -41,6 +43,11 @@ type MsgClient interface { // // Since: cosmos-sdk 0.46 CreatePeriodicVestingAccount(ctx context.Context, in *MsgCreatePeriodicVestingAccount, opts ...grpc.CallOption) (*MsgCreatePeriodicVestingAccountResponse, error) + // CreateClawbackVestingAccount creats a vesting account that is subject to + // clawback and the configuration of vesting and lockup schedules. + CreateClawbackVestingAccount(ctx context.Context, in *MsgCreateClawbackVestingAccount, opts ...grpc.CallOption) (*MsgCreateClawbackVestingAccountResponse, error) + // Clawback removes the unvested tokens from a ClawbackVestingAccount. + Clawback(ctx context.Context, in *MsgClawback, opts ...grpc.CallOption) (*MsgClawbackResponse, error) } type msgClient struct { @@ -78,6 +85,24 @@ func (c *msgClient) CreatePeriodicVestingAccount(ctx context.Context, in *MsgCre return out, nil } +func (c *msgClient) CreateClawbackVestingAccount(ctx context.Context, in *MsgCreateClawbackVestingAccount, opts ...grpc.CallOption) (*MsgCreateClawbackVestingAccountResponse, error) { + out := new(MsgCreateClawbackVestingAccountResponse) + err := c.cc.Invoke(ctx, Msg_CreateClawbackVestingAccount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Clawback(ctx context.Context, in *MsgClawback, opts ...grpc.CallOption) (*MsgClawbackResponse, error) { + out := new(MsgClawbackResponse) + err := c.cc.Invoke(ctx, Msg_Clawback_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -95,6 +120,11 @@ type MsgServer interface { // // Since: cosmos-sdk 0.46 CreatePeriodicVestingAccount(context.Context, *MsgCreatePeriodicVestingAccount) (*MsgCreatePeriodicVestingAccountResponse, error) + // CreateClawbackVestingAccount creats a vesting account that is subject to + // clawback and the configuration of vesting and lockup schedules. + CreateClawbackVestingAccount(context.Context, *MsgCreateClawbackVestingAccount) (*MsgCreateClawbackVestingAccountResponse, error) + // Clawback removes the unvested tokens from a ClawbackVestingAccount. + Clawback(context.Context, *MsgClawback) (*MsgClawbackResponse, error) mustEmbedUnimplementedMsgServer() } @@ -111,6 +141,12 @@ func (UnimplementedMsgServer) CreatePermanentLockedAccount(context.Context, *Msg func (UnimplementedMsgServer) CreatePeriodicVestingAccount(context.Context, *MsgCreatePeriodicVestingAccount) (*MsgCreatePeriodicVestingAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePeriodicVestingAccount not implemented") } +func (UnimplementedMsgServer) CreateClawbackVestingAccount(context.Context, *MsgCreateClawbackVestingAccount) (*MsgCreateClawbackVestingAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateClawbackVestingAccount not implemented") +} +func (UnimplementedMsgServer) Clawback(context.Context, *MsgClawback) (*MsgClawbackResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Clawback not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -178,6 +214,42 @@ func _Msg_CreatePeriodicVestingAccount_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _Msg_CreateClawbackVestingAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateClawbackVestingAccount) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateClawbackVestingAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CreateClawbackVestingAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateClawbackVestingAccount(ctx, req.(*MsgCreateClawbackVestingAccount)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Clawback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClawback) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Clawback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Clawback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Clawback(ctx, req.(*MsgClawback)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -197,6 +269,14 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreatePeriodicVestingAccount", Handler: _Msg_CreatePeriodicVestingAccount_Handler, }, + { + MethodName: "CreateClawbackVestingAccount", + Handler: _Msg_CreateClawbackVestingAccount_Handler, + }, + { + MethodName: "Clawback", + Handler: _Msg_Clawback_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/vesting/v1beta1/tx.proto", diff --git a/api/cosmos/vesting/v1beta1/vesting.pulsar.go b/api/cosmos/vesting/v1beta1/vesting.pulsar.go index 27e5e3db8e37..a6340b1d4f68 100644 --- a/api/cosmos/vesting/v1beta1/vesting.pulsar.go +++ b/api/cosmos/vesting/v1beta1/vesting.pulsar.go @@ -3429,6 +3429,829 @@ func (x *fastReflection_PermanentLockedAccount) ProtoMethods() *protoiface.Metho } } +var _ protoreflect.List = (*_ClawbackVestingAccount_4_list)(nil) + +type _ClawbackVestingAccount_4_list struct { + list *[]*Period +} + +func (x *_ClawbackVestingAccount_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ClawbackVestingAccount_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ClawbackVestingAccount_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Period) + (*x.list)[i] = concreteValue +} + +func (x *_ClawbackVestingAccount_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Period) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ClawbackVestingAccount_4_list) AppendMutable() protoreflect.Value { + v := new(Period) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ClawbackVestingAccount_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ClawbackVestingAccount_4_list) NewElement() protoreflect.Value { + v := new(Period) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ClawbackVestingAccount_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_ClawbackVestingAccount_5_list)(nil) + +type _ClawbackVestingAccount_5_list struct { + list *[]*Period +} + +func (x *_ClawbackVestingAccount_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_ClawbackVestingAccount_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_ClawbackVestingAccount_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Period) + (*x.list)[i] = concreteValue +} + +func (x *_ClawbackVestingAccount_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Period) + *x.list = append(*x.list, concreteValue) +} + +func (x *_ClawbackVestingAccount_5_list) AppendMutable() protoreflect.Value { + v := new(Period) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ClawbackVestingAccount_5_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_ClawbackVestingAccount_5_list) NewElement() protoreflect.Value { + v := new(Period) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_ClawbackVestingAccount_5_list) IsValid() bool { + return x.list != nil +} + +var ( + md_ClawbackVestingAccount protoreflect.MessageDescriptor + fd_ClawbackVestingAccount_base_vesting_account protoreflect.FieldDescriptor + fd_ClawbackVestingAccount_funder_address protoreflect.FieldDescriptor + fd_ClawbackVestingAccount_start_time protoreflect.FieldDescriptor + fd_ClawbackVestingAccount_lockup_periods protoreflect.FieldDescriptor + fd_ClawbackVestingAccount_vesting_periods protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_vesting_v1beta1_vesting_proto_init() + md_ClawbackVestingAccount = File_cosmos_vesting_v1beta1_vesting_proto.Messages().ByName("ClawbackVestingAccount") + fd_ClawbackVestingAccount_base_vesting_account = md_ClawbackVestingAccount.Fields().ByName("base_vesting_account") + fd_ClawbackVestingAccount_funder_address = md_ClawbackVestingAccount.Fields().ByName("funder_address") + fd_ClawbackVestingAccount_start_time = md_ClawbackVestingAccount.Fields().ByName("start_time") + fd_ClawbackVestingAccount_lockup_periods = md_ClawbackVestingAccount.Fields().ByName("lockup_periods") + fd_ClawbackVestingAccount_vesting_periods = md_ClawbackVestingAccount.Fields().ByName("vesting_periods") +} + +var _ protoreflect.Message = (*fastReflection_ClawbackVestingAccount)(nil) + +type fastReflection_ClawbackVestingAccount ClawbackVestingAccount + +func (x *ClawbackVestingAccount) ProtoReflect() protoreflect.Message { + return (*fastReflection_ClawbackVestingAccount)(x) +} + +func (x *ClawbackVestingAccount) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_vesting_v1beta1_vesting_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_ClawbackVestingAccount_messageType fastReflection_ClawbackVestingAccount_messageType +var _ protoreflect.MessageType = fastReflection_ClawbackVestingAccount_messageType{} + +type fastReflection_ClawbackVestingAccount_messageType struct{} + +func (x fastReflection_ClawbackVestingAccount_messageType) Zero() protoreflect.Message { + return (*fastReflection_ClawbackVestingAccount)(nil) +} +func (x fastReflection_ClawbackVestingAccount_messageType) New() protoreflect.Message { + return new(fastReflection_ClawbackVestingAccount) +} +func (x fastReflection_ClawbackVestingAccount_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ClawbackVestingAccount +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ClawbackVestingAccount) Descriptor() protoreflect.MessageDescriptor { + return md_ClawbackVestingAccount +} + +// 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_ClawbackVestingAccount) Type() protoreflect.MessageType { + return _fastReflection_ClawbackVestingAccount_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ClawbackVestingAccount) New() protoreflect.Message { + return new(fastReflection_ClawbackVestingAccount) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ClawbackVestingAccount) Interface() protoreflect.ProtoMessage { + return (*ClawbackVestingAccount)(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_ClawbackVestingAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.BaseVestingAccount != nil { + value := protoreflect.ValueOfMessage(x.BaseVestingAccount.ProtoReflect()) + if !f(fd_ClawbackVestingAccount_base_vesting_account, value) { + return + } + } + if x.FunderAddress != "" { + value := protoreflect.ValueOfString(x.FunderAddress) + if !f(fd_ClawbackVestingAccount_funder_address, value) { + return + } + } + if x.StartTime != int64(0) { + value := protoreflect.ValueOfInt64(x.StartTime) + if !f(fd_ClawbackVestingAccount_start_time, value) { + return + } + } + if len(x.LockupPeriods) != 0 { + value := protoreflect.ValueOfList(&_ClawbackVestingAccount_4_list{list: &x.LockupPeriods}) + if !f(fd_ClawbackVestingAccount_lockup_periods, value) { + return + } + } + if len(x.VestingPeriods) != 0 { + value := protoreflect.ValueOfList(&_ClawbackVestingAccount_5_list{list: &x.VestingPeriods}) + if !f(fd_ClawbackVestingAccount_vesting_periods, 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_ClawbackVestingAccount) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.base_vesting_account": + return x.BaseVestingAccount != nil + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.funder_address": + return x.FunderAddress != "" + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.start_time": + return x.StartTime != int64(0) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.lockup_periods": + return len(x.LockupPeriods) != 0 + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.vesting_periods": + return len(x.VestingPeriods) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.ClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.ClawbackVestingAccount 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_ClawbackVestingAccount) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.base_vesting_account": + x.BaseVestingAccount = nil + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.funder_address": + x.FunderAddress = "" + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.start_time": + x.StartTime = int64(0) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.lockup_periods": + x.LockupPeriods = nil + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.vesting_periods": + x.VestingPeriods = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.ClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.ClawbackVestingAccount 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_ClawbackVestingAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.base_vesting_account": + value := x.BaseVestingAccount + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.funder_address": + value := x.FunderAddress + return protoreflect.ValueOfString(value) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.start_time": + value := x.StartTime + return protoreflect.ValueOfInt64(value) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.lockup_periods": + if len(x.LockupPeriods) == 0 { + return protoreflect.ValueOfList(&_ClawbackVestingAccount_4_list{}) + } + listValue := &_ClawbackVestingAccount_4_list{list: &x.LockupPeriods} + return protoreflect.ValueOfList(listValue) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.vesting_periods": + if len(x.VestingPeriods) == 0 { + return protoreflect.ValueOfList(&_ClawbackVestingAccount_5_list{}) + } + listValue := &_ClawbackVestingAccount_5_list{list: &x.VestingPeriods} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.ClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.ClawbackVestingAccount 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_ClawbackVestingAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.base_vesting_account": + x.BaseVestingAccount = value.Message().Interface().(*BaseVestingAccount) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.funder_address": + x.FunderAddress = value.Interface().(string) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.start_time": + x.StartTime = value.Int() + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.lockup_periods": + lv := value.List() + clv := lv.(*_ClawbackVestingAccount_4_list) + x.LockupPeriods = *clv.list + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.vesting_periods": + lv := value.List() + clv := lv.(*_ClawbackVestingAccount_5_list) + x.VestingPeriods = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.ClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.ClawbackVestingAccount 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_ClawbackVestingAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.base_vesting_account": + if x.BaseVestingAccount == nil { + x.BaseVestingAccount = new(BaseVestingAccount) + } + return protoreflect.ValueOfMessage(x.BaseVestingAccount.ProtoReflect()) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.lockup_periods": + if x.LockupPeriods == nil { + x.LockupPeriods = []*Period{} + } + value := &_ClawbackVestingAccount_4_list{list: &x.LockupPeriods} + return protoreflect.ValueOfList(value) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.vesting_periods": + if x.VestingPeriods == nil { + x.VestingPeriods = []*Period{} + } + value := &_ClawbackVestingAccount_5_list{list: &x.VestingPeriods} + return protoreflect.ValueOfList(value) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.funder_address": + panic(fmt.Errorf("field funder_address of message cosmos.vesting.v1beta1.ClawbackVestingAccount is not mutable")) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.start_time": + panic(fmt.Errorf("field start_time of message cosmos.vesting.v1beta1.ClawbackVestingAccount is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.ClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.ClawbackVestingAccount 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_ClawbackVestingAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.base_vesting_account": + m := new(BaseVestingAccount) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.funder_address": + return protoreflect.ValueOfString("") + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.start_time": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.lockup_periods": + list := []*Period{} + return protoreflect.ValueOfList(&_ClawbackVestingAccount_4_list{list: &list}) + case "cosmos.vesting.v1beta1.ClawbackVestingAccount.vesting_periods": + list := []*Period{} + return protoreflect.ValueOfList(&_ClawbackVestingAccount_5_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.vesting.v1beta1.ClawbackVestingAccount")) + } + panic(fmt.Errorf("message cosmos.vesting.v1beta1.ClawbackVestingAccount 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_ClawbackVestingAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.vesting.v1beta1.ClawbackVestingAccount", 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_ClawbackVestingAccount) 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_ClawbackVestingAccount) 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_ClawbackVestingAccount) 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_ClawbackVestingAccount) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ClawbackVestingAccount) + 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.BaseVestingAccount != nil { + l = options.Size(x.BaseVestingAccount) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.FunderAddress) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.StartTime != 0 { + n += 1 + runtime.Sov(uint64(x.StartTime)) + } + if len(x.LockupPeriods) > 0 { + for _, e := range x.LockupPeriods { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.VestingPeriods) > 0 { + for _, e := range x.VestingPeriods { + 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().(*ClawbackVestingAccount) + 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.VestingPeriods) > 0 { + for iNdEx := len(x.VestingPeriods) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.VestingPeriods[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] = 0x2a + } + } + if len(x.LockupPeriods) > 0 { + for iNdEx := len(x.LockupPeriods) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.LockupPeriods[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] = 0x22 + } + } + if x.StartTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.StartTime)) + i-- + dAtA[i] = 0x18 + } + if len(x.FunderAddress) > 0 { + i -= len(x.FunderAddress) + copy(dAtA[i:], x.FunderAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FunderAddress))) + i-- + dAtA[i] = 0x12 + } + if x.BaseVestingAccount != nil { + encoded, err := options.Marshal(x.BaseVestingAccount) + 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().(*ClawbackVestingAccount) + 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: ClawbackVestingAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ClawbackVestingAccount: 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 BaseVestingAccount", 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.BaseVestingAccount == nil { + x.BaseVestingAccount = &BaseVestingAccount{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.BaseVestingAccount); 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 FunderAddress", 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.FunderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + x.StartTime = 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.StartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LockupPeriods", 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.LockupPeriods = append(x.LockupPeriods, &Period{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LockupPeriods[len(x.LockupPeriods)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VestingPeriods", 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.VestingPeriods = append(x.VestingPeriods, &Period{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VestingPeriods[len(x.VestingPeriods)-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 @@ -3734,6 +4557,80 @@ func (x *PermanentLockedAccount) GetBaseVestingAccount() *BaseVestingAccount { return nil } +// ClawbackVestingAccount implements the VestingAccount interface. It provides +// an account that can hold contributions subject to "lockup" (like a +// PeriodicVestingAccount), or vesting which is subject to clawback +// of unvested tokens, or a combination (tokens vest, but are still locked). +type ClawbackVestingAccount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BaseVestingAccount *BaseVestingAccount `protobuf:"bytes,1,opt,name=base_vesting_account,json=baseVestingAccount,proto3" json:"base_vesting_account,omitempty"` + // funder_address specifies the account which can perform clawback. + FunderAddress string `protobuf:"bytes,2,opt,name=funder_address,json=funderAddress,proto3" json:"funder_address,omitempty"` + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // unlocking schedule relative to the BaseVestingAccount start_time. + LockupPeriods []*Period `protobuf:"bytes,4,rep,name=lockup_periods,json=lockupPeriods,proto3" json:"lockup_periods,omitempty"` + // vesting (i.e. immunity from clawback) schedule relative to the BaseVestingAccount start_time. + VestingPeriods []*Period `protobuf:"bytes,5,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods,omitempty"` +} + +func (x *ClawbackVestingAccount) Reset() { + *x = ClawbackVestingAccount{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_vesting_v1beta1_vesting_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClawbackVestingAccount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClawbackVestingAccount) ProtoMessage() {} + +// Deprecated: Use ClawbackVestingAccount.ProtoReflect.Descriptor instead. +func (*ClawbackVestingAccount) Descriptor() ([]byte, []int) { + return file_cosmos_vesting_v1beta1_vesting_proto_rawDescGZIP(), []int{6} +} + +func (x *ClawbackVestingAccount) GetBaseVestingAccount() *BaseVestingAccount { + if x != nil { + return x.BaseVestingAccount + } + return nil +} + +func (x *ClawbackVestingAccount) GetFunderAddress() string { + if x != nil { + return x.FunderAddress + } + return "" +} + +func (x *ClawbackVestingAccount) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *ClawbackVestingAccount) GetLockupPeriods() []*Period { + if x != nil { + return x.LockupPeriods + } + return nil +} + +func (x *ClawbackVestingAccount) GetVestingPeriods() []*Period { + if x != nil { + return x.VestingPeriods + } + return nil +} + var File_cosmos_vesting_v1beta1_vesting_proto protoreflect.FileDescriptor var file_cosmos_vesting_v1beta1_vesting_proto_rawDesc = []byte{ @@ -3846,21 +4743,53 @@ var file_cosmos_vesting_v1beta1_vesting_proto_rawDesc = []byte{ 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x2a, 0x88, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x50, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0xdc, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xf3, 0x03, 0x0a, 0x16, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, + 0x63, 0x6b, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x62, 0x0a, 0x14, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, + 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x56, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, + 0x52, 0x12, 0x62, 0x61, 0x73, 0x65, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x0e, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x19, 0xf2, 0xde, + 0x1f, 0x15, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0d, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x34, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x15, 0xf2, 0xde, 0x1f, 0x11, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x22, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x64, 0x0a, 0x0e, + 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x42, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x15, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x73, 0x22, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x50, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x73, 0x12, 0x67, 0x0a, 0x0f, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, + 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x76, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x76, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x56, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x56, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x42, 0x1e, 0xc8, 0xde, 0x1f, + 0x00, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x76, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x22, 0x52, 0x0e, 0x76, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x3a, 0x2e, 0x88, 0xa0, 0x1f, + 0x00, 0x98, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x56, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0xdc, 0x01, 0x0a, 0x1a, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x76, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x56, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x3b, 0x76, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x56, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x56, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x56, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -3875,7 +4804,7 @@ func file_cosmos_vesting_v1beta1_vesting_proto_rawDescGZIP() []byte { return file_cosmos_vesting_v1beta1_vesting_proto_rawDescData } -var file_cosmos_vesting_v1beta1_vesting_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cosmos_vesting_v1beta1_vesting_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_cosmos_vesting_v1beta1_vesting_proto_goTypes = []interface{}{ (*BaseVestingAccount)(nil), // 0: cosmos.vesting.v1beta1.BaseVestingAccount (*ContinuousVestingAccount)(nil), // 1: cosmos.vesting.v1beta1.ContinuousVestingAccount @@ -3883,25 +4812,29 @@ var file_cosmos_vesting_v1beta1_vesting_proto_goTypes = []interface{}{ (*Period)(nil), // 3: cosmos.vesting.v1beta1.Period (*PeriodicVestingAccount)(nil), // 4: cosmos.vesting.v1beta1.PeriodicVestingAccount (*PermanentLockedAccount)(nil), // 5: cosmos.vesting.v1beta1.PermanentLockedAccount - (*v1beta11.BaseAccount)(nil), // 6: cosmos.auth.v1beta1.BaseAccount - (*v1beta1.Coin)(nil), // 7: cosmos.base.v1beta1.Coin + (*ClawbackVestingAccount)(nil), // 6: cosmos.vesting.v1beta1.ClawbackVestingAccount + (*v1beta11.BaseAccount)(nil), // 7: cosmos.auth.v1beta1.BaseAccount + (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin } var file_cosmos_vesting_v1beta1_vesting_proto_depIdxs = []int32{ - 6, // 0: cosmos.vesting.v1beta1.BaseVestingAccount.base_account:type_name -> cosmos.auth.v1beta1.BaseAccount - 7, // 1: cosmos.vesting.v1beta1.BaseVestingAccount.original_vesting:type_name -> cosmos.base.v1beta1.Coin - 7, // 2: cosmos.vesting.v1beta1.BaseVestingAccount.delegated_free:type_name -> cosmos.base.v1beta1.Coin - 7, // 3: cosmos.vesting.v1beta1.BaseVestingAccount.delegated_vesting:type_name -> cosmos.base.v1beta1.Coin + 7, // 0: cosmos.vesting.v1beta1.BaseVestingAccount.base_account:type_name -> cosmos.auth.v1beta1.BaseAccount + 8, // 1: cosmos.vesting.v1beta1.BaseVestingAccount.original_vesting:type_name -> cosmos.base.v1beta1.Coin + 8, // 2: cosmos.vesting.v1beta1.BaseVestingAccount.delegated_free:type_name -> cosmos.base.v1beta1.Coin + 8, // 3: cosmos.vesting.v1beta1.BaseVestingAccount.delegated_vesting:type_name -> cosmos.base.v1beta1.Coin 0, // 4: cosmos.vesting.v1beta1.ContinuousVestingAccount.base_vesting_account:type_name -> cosmos.vesting.v1beta1.BaseVestingAccount 0, // 5: cosmos.vesting.v1beta1.DelayedVestingAccount.base_vesting_account:type_name -> cosmos.vesting.v1beta1.BaseVestingAccount - 7, // 6: cosmos.vesting.v1beta1.Period.amount:type_name -> cosmos.base.v1beta1.Coin + 8, // 6: cosmos.vesting.v1beta1.Period.amount:type_name -> cosmos.base.v1beta1.Coin 0, // 7: cosmos.vesting.v1beta1.PeriodicVestingAccount.base_vesting_account:type_name -> cosmos.vesting.v1beta1.BaseVestingAccount 3, // 8: cosmos.vesting.v1beta1.PeriodicVestingAccount.vesting_periods:type_name -> cosmos.vesting.v1beta1.Period 0, // 9: cosmos.vesting.v1beta1.PermanentLockedAccount.base_vesting_account:type_name -> cosmos.vesting.v1beta1.BaseVestingAccount - 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 + 0, // 10: cosmos.vesting.v1beta1.ClawbackVestingAccount.base_vesting_account:type_name -> cosmos.vesting.v1beta1.BaseVestingAccount + 3, // 11: cosmos.vesting.v1beta1.ClawbackVestingAccount.lockup_periods:type_name -> cosmos.vesting.v1beta1.Period + 3, // 12: cosmos.vesting.v1beta1.ClawbackVestingAccount.vesting_periods:type_name -> cosmos.vesting.v1beta1.Period + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_cosmos_vesting_v1beta1_vesting_proto_init() } @@ -3982,6 +4915,18 @@ func file_cosmos_vesting_v1beta1_vesting_proto_init() { return nil } } + file_cosmos_vesting_v1beta1_vesting_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClawbackVestingAccount); 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{ @@ -3989,7 +4934,7 @@ func file_cosmos_vesting_v1beta1_vesting_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_vesting_v1beta1_vesting_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto index 67008724c4d1..fab5b4e31d9b 100644 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -27,6 +27,11 @@ service Msg { // // Since: cosmos-sdk 0.46 rpc CreatePeriodicVestingAccount(MsgCreatePeriodicVestingAccount) returns (MsgCreatePeriodicVestingAccountResponse); + // CreateClawbackVestingAccount creats a vesting account that is subject to + // clawback and the configuration of vesting and lockup schedules. + rpc CreateClawbackVestingAccount(MsgCreateClawbackVestingAccount) returns (MsgCreateClawbackVestingAccountResponse); + // Clawback removes the unvested tokens from a ClawbackVestingAccount. + rpc Clawback(MsgClawback) returns (MsgClawbackResponse); } // MsgCreateVestingAccount defines a message that enables creating a vesting @@ -100,3 +105,51 @@ message MsgCreatePeriodicVestingAccount { // // Since: cosmos-sdk 0.46 message MsgCreatePeriodicVestingAccountResponse {} +// MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. +message MsgCreateClawbackVestingAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreateClawbackVestingAccount"; + + option (gogoproto.equal) = false; + + // from_address specifies the account to provide the funds and sign the + // clawback request + string from_address = 1; + // to_address specifies the account to receive the funds + string to_address = 2; + // start_time defines the time at which the vesting period begins + int64 start_time = 3 [(gogoproto.moretags) = "yaml:\"start_time\""]; + // lockup_periods defines the unlocking schedule relative to the start_time + repeated Period lockup_periods = 4 [(gogoproto.nullable) = false]; + // vesting_periods defines the vesting schedule relative to the start_time + repeated Period vesting_periods = 5 [(gogoproto.nullable) = false]; + // merge specifies a creation mechanism for existing + // ClawbackVestingAccounts. If true, merge this new grant into an existing + // ClawbackVestingAccount, or create it if it does not exist. If false, + // creates a new account. New grants to an existing account must be from the + // same from_address. + bool merge = 6; +} + +// MsgCreateClawbackVestingAccountResponse defines the +// MsgCreateClawbackVestingAccount response type. +message MsgCreateClawbackVestingAccountResponse {} + +// MsgClawback defines a message that removes unvested tokens from a +// ClawbackVestingAccount. +message MsgClawback { + option (cosmos.msg.v1.signer) = "funder_address"; + option (amino.name) = "cosmos-sdk/MsgClawback"; + + // funder_address is the address which funded the account + string funder_address = 1; + // address is the address of the ClawbackVestingAccount to claw back from. + string address = 2; + // dest_address specifies where the clawed-back tokens should be transferred + // to. If empty, the tokens will be transferred back to the original funder of + // the account. + string dest_address = 3; +} + +// MsgClawbackResponse defines the MsgClawback response type. +message MsgClawbackResponse {} diff --git a/proto/cosmos/vesting/v1beta1/vesting.proto b/proto/cosmos/vesting/v1beta1/vesting.proto index 12e9cdd2e092..fdd31c012454 100644 --- a/proto/cosmos/vesting/v1beta1/vesting.proto +++ b/proto/cosmos/vesting/v1beta1/vesting.proto @@ -92,3 +92,23 @@ message PermanentLockedAccount { BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; } + +// ClawbackVestingAccount implements the VestingAccount interface. It provides +// an account that can hold contributions subject to "lockup" (like a +// PeriodicVestingAccount), or vesting which is subject to clawback +// of unvested tokens, or a combination (tokens vest, but are still locked). +message ClawbackVestingAccount { + option (amino.name) = "cosmos-sdk/ClawbackVestingAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + + // funder_address specifies the account which can perform clawback. + string funder_address = 2 [(gogoproto.moretags) = "yaml:\"funder_address\""]; + int64 start_time = 3 [(gogoproto.moretags) = "yaml:\"start_time\""]; + // unlocking schedule relative to the BaseVestingAccount start_time. + repeated Period lockup_periods = 4 [(gogoproto.moretags) = "yaml:\"lockup_periods\"", (gogoproto.nullable) = false]; + // vesting (i.e. immunity from clawback) schedule relative to the BaseVestingAccount start_time. + repeated Period vesting_periods = 5 [(gogoproto.moretags) = "yaml:\"vesting_periods\"", (gogoproto.nullable) = false]; +} diff --git a/tests/integration/auth/keeper/vesting_account_test.go b/tests/integration/auth/keeper/vesting_account_test.go new file mode 100644 index 000000000000..46119a8e1e22 --- /dev/null +++ b/tests/integration/auth/keeper/vesting_account_test.go @@ -0,0 +1,276 @@ +package keeper_test + +import ( + "testing" + "time" + + "cosmossdk.io/math" + "cosmossdk.io/simapp" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/require" + "gotest.tools/v3/assert" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/keeper" + "github.com/cosmos/cosmos-sdk/x/auth/testutil" + "github.com/cosmos/cosmos-sdk/x/auth/types" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + tmtime "github.com/cometbft/cometbft/types/time" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +var ( + stakeDenom = "stake" + feeDenom = "fee" +) + +type fixture struct { + ctx sdk.Context + app *runtime.App + + bankKeeper bankkeeper.Keeper + accountKeeper keeper.AccountKeeper + slashingKeeper slashingkeeper.Keeper + stakingKeeper *stakingkeeper.Keeper + interfaceRegistry codectypes.InterfaceRegistry +} + +func initFixture(t assert.TestingT) *fixture { + f := &fixture{} + var accountKeeper keeper.AccountKeeper + + app, err := simtestutil.Setup(testutil.AppConfig, + &accountKeeper, + &f.interfaceRegistry, + &f.accountKeeper, + &f.bankKeeper, + &f.slashingKeeper, + &f.stakingKeeper, + ) + assert.NilError(t, err) + + f.ctx = app.BaseApp.NewContextLegacy(false, tmproto.Header{Height: 1}) + f.app = app + f.accountKeeper = accountKeeper + + return f +} + +func TestAddGrantClawbackVestingAcc(t *testing.T) { + c := sdk.NewCoins + fee := func(amt int64) sdk.Coin { return sdk.NewInt64Coin(feeDenom, amt) } + now := tmtime.Now() + + // set up simapp + app := simapp.Setup(t, false) + ctx := app.BaseApp.NewContextLegacy(false, tmproto.Header{}).WithBlockTime((now)) + bondDenom, err := app.StakingKeeper.BondDenom(ctx) + require.NoError(t, err) + require.Equal(t, "stake", bondDenom) + + // create an account with an initial grant + _, _, funder := testdata.KeyTestPubAddr() + lockupPeriods := vesting.Periods{{Length: int64(12 * 3600), Amount: c(fee(1000))}} // noon + vestingPeriods := vesting.Periods{ + {Length: int64(8 * 3600), Amount: c(fee(200))}, // 8am + {Length: int64(1 * 3600), Amount: c(fee(200))}, // 9am + {Length: int64(6 * 3600), Amount: c(fee(200))}, // 3pm + {Length: int64(2 * 3600), Amount: c(fee(200))}, // 5pm + {Length: int64(1 * 3600), Amount: c(fee(200))}, // 6pm + } + bacc, origCoins := initBaseAccount() + va := vesting.NewClawbackVestingAccount(bacc, funder, origCoins, now.Unix(), lockupPeriods, vestingPeriods) + addr := va.GetAddress() + + ctx = ctx.WithBlockTime(now.Add(11 * time.Hour)) + require.Equal(t, int64(1000), va.GetVestingCoins(ctx.BlockTime()).AmountOf(feeDenom).Int64()) + + // Add a new grant(1000fee, 100stake) while all slashing is covered by unvested tokens + grantAction := vesting.NewClawbackGrantAction(funder.String(), ctx.BlockTime().Unix(), + lockupPeriods, vestingPeriods, origCoins) + err = va.AddGrant(ctx, grantAction) + require.NoError(t, err) + + // locked coin is expected to be 2000feetoken(1000fee + 1000fee) + require.Equal(t, int64(2000), va.GetVestingCoins(ctx.BlockTime()).AmountOf(feeDenom).Int64()) + require.Equal(t, int64(0), va.DelegatedVesting.AmountOf(feeDenom).Int64()) + require.Equal(t, int64(0), va.DelegatedFree.AmountOf(feeDenom).Int64()) + + ctx = ctx.WithBlockTime(now.Add(13 * time.Hour)) + require.Equal(t, int64(1600), va.GetVestingCoins(ctx.BlockTime()).AmountOf(feeDenom).Int64()) + + ctx = ctx.WithBlockTime(now.Add(17 * time.Hour)) + require.Equal(t, int64(1200), va.GetVestingCoins(ctx.BlockTime()).AmountOf(feeDenom).Int64()) + + ctx = ctx.WithBlockTime(now.Add(20 * time.Hour)) + require.Equal(t, int64(1000), va.GetVestingCoins(ctx.BlockTime()).AmountOf(feeDenom).Int64()) + + ctx = ctx.WithBlockTime(now.Add(22 * time.Hour)) + require.Equal(t, int64(1000), va.GetVestingCoins(ctx.BlockTime()).AmountOf(feeDenom).Int64()) + + // fund the vesting account with new grant (old has vested and transferred out) + err = banktestutil.FundAccount(ctx, app.BankKeeper, addr, origCoins) + require.NoError(t, err) + require.Equal(t, int64(100), app.BankKeeper.GetBalance(ctx, addr, stakeDenom).Amount.Int64()) + + feeAmt := app.BankKeeper.GetBalance(ctx, addr, feeDenom).Amount + require.Equal(t, int64(1000), feeAmt.Int64()) +} + +func TestClawback(t *testing.T) { + c := sdk.NewCoins + fee := func(x int64) sdk.Coin { return sdk.NewInt64Coin(feeDenom, x) } + stake := func(x int64) sdk.Coin { return sdk.NewInt64Coin(stakeDenom, x) } + now := tmtime.Now() + + lockupPeriods := vesting.Periods{ + {Length: int64(12 * 3600), Amount: c(fee(1000), stake(100))}, // noon + } + vestingPeriods := vesting.Periods{ + {Length: int64(8 * 3600), Amount: c(fee(200))}, // 8am + {Length: int64(1 * 3600), Amount: c(fee(200), stake(50))}, // 9am + {Length: int64(6 * 3600), Amount: c(fee(200), stake(50))}, // 3pm + {Length: int64(2 * 3600), Amount: c(fee(200))}, // 5pm + {Length: int64(1 * 3600), Amount: c(fee(200))}, // 6pm + } + // each test creates a new clawback vesting account, with the lockup and vesting periods defined above. + // the clawback is executed at the test case's provided time, and expects that post clawback, + // the address has a total of `vestingAccBalance` coins, but only `spendableCoins` are spendable. + // It expects the clawback acct funder to have `funderBalance` (aka that amt clawed back) + testCases := []struct { + name string + ctxTime time.Time + vestingAccBalance sdk.Coins + spendableCoins sdk.Coins + funderBalance sdk.Coins + }{ + { + "clawback before all vesting periods, before cliff ended", + now.Add(7 * time.Hour), + // vesting account should not have funds after clawback + sdk.NewCoins(), + sdk.Coins{}, + // all funds should be returned to funder account + sdk.NewCoins(sdk.NewCoin(feeDenom, math.NewInt(1000)), sdk.NewCoin(stakeDenom, math.NewInt(100))), + }, + { + "clawback after two vesting periods, before cliff ended", + now.Add(10 * time.Hour), + sdk.NewCoins(fee(400), stake(50)), + sdk.Coins{}, + // everything but first two vesting periods of fund should be returned to sender + sdk.NewCoins(sdk.NewCoin(feeDenom, math.NewInt(600)), sdk.NewCoin(stakeDenom, math.NewInt(50))), + }, + { + "clawback right after cliff has finsihed", + now.Add(13 * time.Hour), + sdk.NewCoins(sdk.NewCoin(feeDenom, math.NewInt(400)), sdk.NewCoin(stakeDenom, math.NewInt(50))), + sdk.NewCoins(sdk.NewCoin(feeDenom, math.NewInt(400)), sdk.NewCoin(stakeDenom, math.NewInt(50))), + sdk.NewCoins(sdk.NewCoin(feeDenom, math.NewInt(600)), sdk.NewCoin(stakeDenom, math.NewInt(50))), + }, + { + "clawback after cliff has finished, 3 vesting periods have finished", + now.Add(16 * time.Hour), + sdk.NewCoins(sdk.NewCoin(feeDenom, math.NewInt(600)), sdk.NewCoin(stakeDenom, math.NewInt(100))), + sdk.NewCoins(sdk.NewCoin(feeDenom, math.NewInt(600)), sdk.NewCoin(stakeDenom, math.NewInt(100))), + sdk.NewCoins(sdk.NewCoin(feeDenom, math.NewInt(400))), + }, + } + + for _, tc := range testCases { + tc := tc + + t.Run(tc.name, func(t *testing.T) { + // set up simapp and validators + app := simapp.Setup(t, false) + ctx := app.BaseApp.NewContextLegacy(false, tmproto.Header{}).WithBlockTime((now)) + valAddr, val := createValidator(t, ctx, app, 100) + bondDenom, err := app.StakingKeeper.BondDenom(ctx) + require.NoError(t, err) + require.Equal(t, "stake", bondDenom) + + bacc, origCoins := initBaseAccount() + _, _, funder := testdata.KeyTestPubAddr() + va := vesting.NewClawbackVestingAccount(bacc, funder, origCoins, now.Unix(), lockupPeriods, vestingPeriods) + addr := va.GetAddress() + app.AccountKeeper.SetAccount(ctx, va) + + // fund the vesting account + err = banktestutil.FundAccount(ctx, app.BankKeeper, addr, c(fee(1000), stake(100))) + require.NoError(t, err) + require.Equal(t, int64(1000), app.BankKeeper.GetBalance(ctx, addr, feeDenom).Amount.Int64()) + require.Equal(t, int64(100), app.BankKeeper.GetBalance(ctx, addr, stakeDenom).Amount.Int64()) + + // try delegating, clawback vesting account not allowed to delegate + _, err = app.StakingKeeper.Delegate(ctx, addr, math.NewInt(65), stakingtypes.Unbonded, val, true) + require.Error(t, err) + + // undelegation should emit an error(delegator does not contain delegation) + _, _, err = app.StakingKeeper.Undelegate(ctx, addr, valAddr, math.LegacyNewDec(5)) + require.Error(t, err) + + ctx = ctx.WithBlockTime(tc.ctxTime) + va = app.AccountKeeper.GetAccount(ctx, addr).(*vesting.ClawbackVestingAccount) + clawbackAction := vesting.NewClawbackAction(funder, funder, app.AccountKeeper, app.BankKeeper) + err = va.Clawback(ctx, clawbackAction) + require.NoError(t, err) + app.AccountKeeper.SetAccount(ctx, va) + + vestingAccBalance := app.BankKeeper.GetAllBalances(ctx, addr) + require.Equal(t, tc.vestingAccBalance, vestingAccBalance, "vesting account balance test") + + funderBalance := app.BankKeeper.GetAllBalances(ctx, funder) + require.Equal(t, tc.funderBalance, funderBalance, "funder account balance test") + + spendableCoins := app.BankKeeper.SpendableCoins(ctx, addr) + require.Equal(t, tc.spendableCoins, spendableCoins, "vesting account spendable test") + }) + } +} + +// createValidator creates a validator in the given SimApp. +func createValidator(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers int64) (sdk.ValAddress, stakingtypes.Validator) { + valTokens := sdk.TokensFromConsensusPower(powers, sdk.DefaultPowerReduction) + addrs := simapp.AddTestAddrsIncremental(app, ctx, 1, valTokens) + valAddrs := simtestutil.ConvertAddrsToValAddrs(addrs) + pks := simtestutil.CreateTestPubKeys(1) + cdc := app.AppCodec() //simapp.MakeTestEncodingConfig().Marshaler + + authority := authtypes.NewModuleAddress("gov") + app.StakingKeeper = stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(app.GetKey(stakingtypes.StoreKey)), app.AccountKeeper, app.BankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) + + val, err := stakingtypes.NewValidator(valAddrs[0].String(), pks[0], stakingtypes.Description{}) + require.NoError(t, err) + + app.StakingKeeper.SetValidator(ctx, val) + require.NoError(t, app.StakingKeeper.SetValidatorByConsAddr(ctx, val)) + app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val) + + _, err = app.StakingKeeper.Delegate(ctx, addrs[0], valTokens, stakingtypes.Unbonded, val, true) + require.NoError(t, err) + + _, err = app.StakingKeeper.EndBlocker(ctx) + require.NoError(t, err) + + return valAddrs[0], val +} + +func initBaseAccount() (*types.BaseAccount, sdk.Coins) { + _, _, addr := testdata.KeyTestPubAddr() + origCoins := sdk.Coins{sdk.NewInt64Coin(feeDenom, 1000), sdk.NewInt64Coin(stakeDenom, 100)} + bacc := types.NewBaseAccountWithAddress(addr) + + return bacc, origCoins +} diff --git a/x/auth/vesting/msg_server.go b/x/auth/vesting/msg_server.go index 222fc262a291..c16f8a9fd340 100644 --- a/x/auth/vesting/msg_server.go +++ b/x/auth/vesting/msg_server.go @@ -226,6 +226,79 @@ func (s msgServer) CreatePeriodicVestingAccount(goCtx context.Context, msg *type return &types.MsgCreatePeriodicVestingAccountResponse{}, nil } +func (s msgServer) CreateClawbackVestingAccount(goCtx context.Context, msg *types.MsgCreateClawbackVestingAccount) (*types.MsgCreateClawbackVestingAccountResponse, error) { + from, err := sdk.AccAddressFromBech32(msg.FromAddress) + if err != nil { + return nil, err + } + to, err := sdk.AccAddressFromBech32(msg.ToAddress) + if err != nil { + return nil, err + } + if err := sdk.VerifyAddressFormat(from); err != nil { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address: %s", err) + } + + if err := sdk.VerifyAddressFormat(to); err != nil { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address: %s", err) + } + + lockupCoins := sdk.NewCoins() + for i, period := range msg.LockupPeriods { + if period.Length < 1 { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid period length of %d in period %d, length must be greater than 0", period.Length, i) + } + lockupCoins = lockupCoins.Add(period.Amount...) + } + + vestingCoins := sdk.NewCoins() + for i, period := range msg.VestingPeriods { + if period.Length < 1 { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "invalid period length of %d in period %d, length must be greater than 0", period.Length, i) + } + vestingCoins = vestingCoins.Add(period.Amount...) + } + + // If both schedules are present, the must describe the same total amount. + // IsEqual can panic, so use (a == b) <=> (a <= b && b <= a). + if len(msg.LockupPeriods) > 0 && len(msg.VestingPeriods) > 0 && + !(lockupCoins.IsAllLTE(vestingCoins) && vestingCoins.IsAllLTE(lockupCoins)) { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "vesting and lockup schedules must have same total coins") + } + + return &types.MsgCreateClawbackVestingAccountResponse{}, nil +} + +func (s msgServer) Clawback(goCtx context.Context, msg *types.MsgClawback) (*types.MsgClawbackResponse, error) { + funder, err := sdk.AccAddressFromBech32(msg.GetFunderAddress()) + if err != nil { + return nil, err + } + if err := sdk.VerifyAddressFormat(funder); err != nil { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid funder address: %s", err) + } + + addr, err := sdk.AccAddressFromBech32(msg.GetAddress()) + if err != nil { + return nil, err + } + if err := sdk.VerifyAddressFormat(addr); err != nil { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid account address: %s", err) + } + + if msg.GetDestAddress() != "" { + dest, err := sdk.AccAddressFromBech32(msg.GetDestAddress()) + if err != nil { + return nil, err + } + if err := sdk.VerifyAddressFormat(dest); err != nil { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid destination address: %s", err) + } + } + + return &types.MsgClawbackResponse{}, nil +} + func validateAmount(amount sdk.Coins) error { if !amount.IsValid() { return sdkerrors.ErrInvalidCoins.Wrap(amount.String()) diff --git a/x/auth/vesting/types/msgs.go b/x/auth/vesting/types/msgs.go index 296fa8845921..1a285b5f12e5 100644 --- a/x/auth/vesting/types/msgs.go +++ b/x/auth/vesting/types/msgs.go @@ -8,6 +8,8 @@ var ( _ sdk.Msg = &MsgCreateVestingAccount{} _ sdk.Msg = &MsgCreatePermanentLockedAccount{} _ sdk.Msg = &MsgCreatePeriodicVestingAccount{} + _ sdk.Msg = &MsgClawback{} + _ sdk.Msg = &MsgCreateClawbackVestingAccount{} ) // NewMsgCreateVestingAccount returns a reference to a new MsgCreateVestingAccount. @@ -39,3 +41,28 @@ func NewMsgCreatePeriodicVestingAccount(fromAddr, toAddr sdk.AccAddress, startTi VestingPeriods: periods, } } + +// NewMsgClawback returns a reference to a new MsgClawback. +func NewMsgClawback(funder, addr, dest sdk.AccAddress) *MsgClawback { + var destString string + if dest != nil { + destString = dest.String() + } + return &MsgClawback{ + FunderAddress: funder.String(), + Address: addr.String(), + DestAddress: destString, + } +} + +// NewMsgCreateClawbackVestingAccount returns a reference to a new MsgCreateClawbackVestingAccount. +func NewMsgCreateClawbackVestingAccount(fromAddr, toAddr sdk.AccAddress, startTime int64, lockupPeriods, vestingPeriods []Period, merge bool) *MsgCreateClawbackVestingAccount { + return &MsgCreateClawbackVestingAccount{ + FromAddress: fromAddr.String(), + ToAddress: toAddr.String(), + StartTime: startTime, + LockupPeriods: lockupPeriods, + VestingPeriods: vestingPeriods, + Merge: merge, + } +} diff --git a/x/auth/vesting/types/tx.pb.go b/x/auth/vesting/types/tx.pb.go index 2d46bb32daca..18c151505a55 100644 --- a/x/auth/vesting/types/tx.pb.go +++ b/x/auth/vesting/types/tx.pb.go @@ -369,6 +369,246 @@ func (m *MsgCreatePeriodicVestingAccountResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreatePeriodicVestingAccountResponse proto.InternalMessageInfo +// MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. +type MsgCreateClawbackVestingAccount struct { + // from_address specifies the account to provide the funds and sign the + // clawback request + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + // to_address specifies the account to receive the funds + ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` + // start_time defines the time at which the vesting period begins + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty" yaml:"start_time"` + // lockup_periods defines the unlocking schedule relative to the start_time + LockupPeriods []Period `protobuf:"bytes,4,rep,name=lockup_periods,json=lockupPeriods,proto3" json:"lockup_periods"` + // vesting_periods defines the vesting schedule relative to the start_time + VestingPeriods []Period `protobuf:"bytes,5,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods"` + // merge specifies a creation mechanism for existing + // ClawbackVestingAccounts. If true, merge this new grant into an existing + // ClawbackVestingAccount, or create it if it does not exist. If false, + // creates a new account. New grants to an existing account must be from the + // same from_address. + Merge bool `protobuf:"varint,6,opt,name=merge,proto3" json:"merge,omitempty"` +} + +func (m *MsgCreateClawbackVestingAccount) Reset() { *m = MsgCreateClawbackVestingAccount{} } +func (m *MsgCreateClawbackVestingAccount) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClawbackVestingAccount) ProtoMessage() {} +func (*MsgCreateClawbackVestingAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{6} +} +func (m *MsgCreateClawbackVestingAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClawbackVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClawbackVestingAccount.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 *MsgCreateClawbackVestingAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClawbackVestingAccount.Merge(m, src) +} +func (m *MsgCreateClawbackVestingAccount) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClawbackVestingAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClawbackVestingAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClawbackVestingAccount proto.InternalMessageInfo + +func (m *MsgCreateClawbackVestingAccount) GetFromAddress() string { + if m != nil { + return m.FromAddress + } + return "" +} + +func (m *MsgCreateClawbackVestingAccount) GetToAddress() string { + if m != nil { + return m.ToAddress + } + return "" +} + +func (m *MsgCreateClawbackVestingAccount) GetStartTime() int64 { + if m != nil { + return m.StartTime + } + return 0 +} + +func (m *MsgCreateClawbackVestingAccount) GetLockupPeriods() []Period { + if m != nil { + return m.LockupPeriods + } + return nil +} + +func (m *MsgCreateClawbackVestingAccount) GetVestingPeriods() []Period { + if m != nil { + return m.VestingPeriods + } + return nil +} + +func (m *MsgCreateClawbackVestingAccount) GetMerge() bool { + if m != nil { + return m.Merge + } + return false +} + +// MsgCreateClawbackVestingAccountResponse defines the +// MsgCreateClawbackVestingAccount response type. +type MsgCreateClawbackVestingAccountResponse struct { +} + +func (m *MsgCreateClawbackVestingAccountResponse) Reset() { + *m = MsgCreateClawbackVestingAccountResponse{} +} +func (m *MsgCreateClawbackVestingAccountResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClawbackVestingAccountResponse) ProtoMessage() {} +func (*MsgCreateClawbackVestingAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{7} +} +func (m *MsgCreateClawbackVestingAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClawbackVestingAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClawbackVestingAccountResponse.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 *MsgCreateClawbackVestingAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClawbackVestingAccountResponse.Merge(m, src) +} +func (m *MsgCreateClawbackVestingAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClawbackVestingAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClawbackVestingAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClawbackVestingAccountResponse proto.InternalMessageInfo + +// MsgClawback defines a message that removes unvested tokens from a +// ClawbackVestingAccount. +type MsgClawback struct { + // funder_address is the address which funded the account + FunderAddress string `protobuf:"bytes,1,opt,name=funder_address,json=funderAddress,proto3" json:"funder_address,omitempty"` + // address is the address of the ClawbackVestingAccount to claw back from. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // dest_address specifies where the clawed-back tokens should be transferred + // to. If empty, the tokens will be transferred back to the original funder of + // the account. + DestAddress string `protobuf:"bytes,3,opt,name=dest_address,json=destAddress,proto3" json:"dest_address,omitempty"` +} + +func (m *MsgClawback) Reset() { *m = MsgClawback{} } +func (m *MsgClawback) String() string { return proto.CompactTextString(m) } +func (*MsgClawback) ProtoMessage() {} +func (*MsgClawback) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{8} +} +func (m *MsgClawback) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClawback) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClawback.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 *MsgClawback) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClawback.Merge(m, src) +} +func (m *MsgClawback) XXX_Size() int { + return m.Size() +} +func (m *MsgClawback) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClawback.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClawback proto.InternalMessageInfo + +func (m *MsgClawback) GetFunderAddress() string { + if m != nil { + return m.FunderAddress + } + return "" +} + +func (m *MsgClawback) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *MsgClawback) GetDestAddress() string { + if m != nil { + return m.DestAddress + } + return "" +} + +// MsgClawbackResponse defines the MsgClawback response type. +type MsgClawbackResponse struct { +} + +func (m *MsgClawbackResponse) Reset() { *m = MsgClawbackResponse{} } +func (m *MsgClawbackResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClawbackResponse) ProtoMessage() {} +func (*MsgClawbackResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{9} +} +func (m *MsgClawbackResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClawbackResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClawbackResponse.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 *MsgClawbackResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClawbackResponse.Merge(m, src) +} +func (m *MsgClawbackResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClawbackResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClawbackResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClawbackResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateVestingAccount)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccount") proto.RegisterType((*MsgCreateVestingAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse") @@ -376,54 +616,70 @@ func init() { proto.RegisterType((*MsgCreatePermanentLockedAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse") proto.RegisterType((*MsgCreatePeriodicVestingAccount)(nil), "cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount") proto.RegisterType((*MsgCreatePeriodicVestingAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse") + proto.RegisterType((*MsgCreateClawbackVestingAccount)(nil), "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccount") + proto.RegisterType((*MsgCreateClawbackVestingAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreateClawbackVestingAccountResponse") + proto.RegisterType((*MsgClawback)(nil), "cosmos.vesting.v1beta1.MsgClawback") + proto.RegisterType((*MsgClawbackResponse)(nil), "cosmos.vesting.v1beta1.MsgClawbackResponse") } func init() { proto.RegisterFile("cosmos/vesting/v1beta1/tx.proto", fileDescriptor_5338ca97811f9792) } var fileDescriptor_5338ca97811f9792 = []byte{ - // 670 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0xe3, 0xba, 0xbf, 0x72, 0xad, 0x40, 0x35, 0x85, 0xba, 0x11, 0xb5, 0x53, 0x0b, 0x44, - 0xa8, 0x54, 0x5b, 0x2d, 0x48, 0x95, 0x02, 0x52, 0xd5, 0x54, 0x62, 0x81, 0x4a, 0xc8, 0x20, 0x06, - 0x96, 0xe8, 0x62, 0x1f, 0xae, 0xd5, 0xda, 0x17, 0xf9, 0xae, 0x55, 0xb3, 0x55, 0x8c, 0x4c, 0x6c, - 0x20, 0x26, 0x46, 0xc4, 0xd4, 0x81, 0x7f, 0x01, 0xa9, 0x1b, 0x15, 0x13, 0x53, 0x40, 0xc9, 0x10, - 0xe6, 0xee, 0x48, 0xe8, 0x7c, 0xe7, 0x90, 0x14, 0x3b, 0x69, 0x99, 0x58, 0xe2, 0xf8, 0xde, 0xf7, - 0xfb, 0xee, 0xf9, 0xf3, 0xee, 0xd9, 0x40, 0x77, 0x30, 0x09, 0x30, 0xb1, 0xf6, 0x11, 0xa1, 0x7e, - 0xe8, 0x59, 0xfb, 0x2b, 0x35, 0x44, 0xe1, 0x8a, 0x45, 0x0f, 0xcc, 0x7a, 0x84, 0x29, 0x56, 0xae, - 0x71, 0x81, 0x29, 0x04, 0xa6, 0x10, 0x14, 0x66, 0x3d, 0xec, 0xe1, 0x58, 0x62, 0xb1, 0x7f, 0x5c, - 0x5d, 0xd0, 0x44, 0xba, 0x1a, 0x24, 0xa8, 0x9b, 0xcb, 0xc1, 0x7e, 0x28, 0xe2, 0xf3, 0x3c, 0x5e, - 0xe5, 0x46, 0x91, 0x9a, 0x87, 0x6e, 0x64, 0x54, 0x92, 0x6c, 0xcc, 0x55, 0x73, 0x42, 0x15, 0x10, - 0xa6, 0x60, 0x17, 0x11, 0x98, 0x81, 0x81, 0x1f, 0x62, 0x2b, 0xfe, 0xe5, 0x4b, 0xc6, 0xaf, 0x11, - 0x30, 0xb7, 0x45, 0xbc, 0xcd, 0x08, 0x41, 0x8a, 0x9e, 0xf1, 0x34, 0x1b, 0x8e, 0x83, 0xf7, 0x42, - 0xaa, 0xdc, 0x03, 0xd3, 0x2f, 0x22, 0x1c, 0x54, 0xa1, 0xeb, 0x46, 0x88, 0x10, 0x55, 0x2a, 0x4a, - 0xa5, 0x7c, 0x45, 0xfd, 0xfa, 0x69, 0x79, 0x56, 0x54, 0xb5, 0xc1, 0x23, 0x4f, 0x68, 0xe4, 0x87, - 0x9e, 0x3d, 0xc5, 0xd4, 0x62, 0x49, 0x59, 0x03, 0x80, 0xe2, 0xae, 0x75, 0x64, 0x88, 0x35, 0x4f, - 0x71, 0x62, 0x6c, 0x80, 0x71, 0x18, 0xb0, 0xfd, 0x55, 0xb9, 0x28, 0x97, 0xa6, 0x56, 0xe7, 0x4d, - 0xe1, 0x60, 0xbc, 0x12, 0xb4, 0xe6, 0x26, 0xf6, 0xc3, 0xca, 0x83, 0xe3, 0xa6, 0x9e, 0xfb, 0xf8, - 0x5d, 0x2f, 0x79, 0x3e, 0xdd, 0xde, 0xab, 0x99, 0x0e, 0x0e, 0x04, 0x2f, 0x71, 0x59, 0x26, 0xee, - 0x8e, 0x45, 0x1b, 0x75, 0x44, 0x62, 0x03, 0x79, 0xd7, 0x39, 0x5a, 0x9a, 0xde, 0x45, 0x1e, 0x74, - 0x1a, 0x55, 0x46, 0x9c, 0x7c, 0xe8, 0x1c, 0x2d, 0x49, 0xb6, 0xd8, 0x50, 0x99, 0x07, 0x93, 0x28, - 0x74, 0xab, 0xd4, 0x0f, 0x90, 0x3a, 0x5a, 0x94, 0x4a, 0xb2, 0x3d, 0x81, 0x42, 0xf7, 0xa9, 0x1f, - 0x20, 0x45, 0x05, 0x13, 0x2e, 0xda, 0x85, 0x0d, 0xe4, 0xaa, 0x63, 0x45, 0xa9, 0x34, 0x69, 0x27, - 0xb7, 0xe5, 0xfb, 0x3f, 0xdf, 0xeb, 0xd2, 0x4b, 0x96, 0xb8, 0x17, 0xd6, 0xab, 0xce, 0xd1, 0x92, - 0xd1, 0x53, 0x44, 0x06, 0x63, 0x63, 0x11, 0xe8, 0x19, 0x21, 0x1b, 0x91, 0x3a, 0x0e, 0x09, 0x32, - 0xbe, 0x8c, 0xf4, 0x68, 0x1e, 0xa3, 0x28, 0x80, 0x21, 0x0a, 0xe9, 0x23, 0xec, 0xec, 0x20, 0x37, - 0x69, 0x55, 0x39, 0xb5, 0x55, 0x73, 0xa7, 0x4d, 0xfd, 0x4a, 0x03, 0x06, 0xbb, 0x65, 0xa3, 0x37, - 0x6a, 0xf4, 0x77, 0xea, 0x6e, 0x4a, 0xa7, 0xae, 0x9e, 0x36, 0xf5, 0x19, 0xee, 0xfc, 0x13, 0x33, - 0xfe, 0x8f, 0x36, 0x95, 0xd7, 0x33, 0x89, 0xdf, 0x4c, 0x23, 0xce, 0x90, 0xf5, 0xd1, 0x32, 0x6e, - 0x83, 0x5b, 0x43, 0x80, 0x76, 0xe1, 0xbf, 0x39, 0x03, 0xdf, 0xc7, 0xae, 0xef, 0x9c, 0x99, 0x93, - 0xc5, 0x34, 0xf8, 0xfd, 0x8c, 0x17, 0xfe, 0x66, 0xdc, 0x0b, 0x73, 0x01, 0x00, 0x42, 0x61, 0x44, - 0xf9, 0xd1, 0x93, 0xe3, 0xa3, 0x97, 0x8f, 0x57, 0xe2, 0xc3, 0x67, 0x83, 0xcb, 0x62, 0xc2, 0xab, - 0xf5, 0xb8, 0x04, 0xa2, 0x8e, 0xc6, 0xd0, 0x35, 0x33, 0xfd, 0xcd, 0x63, 0xf2, 0x4a, 0x2b, 0x79, - 0x46, 0x9e, 0xc3, 0xbb, 0x24, 0x24, 0x3c, 0x42, 0x62, 0x88, 0xb9, 0x0b, 0x41, 0xf4, 0xb1, 0xcb, - 0x1e, 0x3c, 0x03, 0x62, 0x0a, 0x98, 0x04, 0xe2, 0xea, 0x67, 0x19, 0xc8, 0x5b, 0xc4, 0x53, 0x0e, - 0x25, 0x30, 0x9b, 0xfa, 0xa6, 0xb1, 0xb2, 0x9e, 0x23, 0x63, 0x36, 0x0a, 0x6b, 0x17, 0x34, 0x24, - 0xa5, 0x28, 0x6f, 0x25, 0x70, 0x7d, 0xe0, 0x24, 0x0d, 0xcf, 0x9c, 0x6e, 0x2c, 0xac, 0xff, 0xa3, - 0x31, 0xbd, 0xb4, 0xb4, 0x73, 0x76, 0xae, 0xd2, 0x52, 0x8c, 0xe7, 0x2b, 0x6d, 0x40, 0x03, 0x0b, - 0x63, 0x87, 0xec, 0x0c, 0x55, 0x1e, 0x1e, 0xb7, 0x34, 0xe9, 0xa4, 0xa5, 0x49, 0x3f, 0x5a, 0x9a, - 0xf4, 0xba, 0xad, 0xe5, 0x4e, 0xda, 0x5a, 0xee, 0x5b, 0x5b, 0xcb, 0x3d, 0x5f, 0x19, 0x38, 0xda, - 0x07, 0x16, 0xdc, 0xa3, 0xdb, 0xdd, 0xaf, 0x56, 0x3c, 0xe9, 0xb5, 0xf1, 0xf8, 0x03, 0x74, 0xe7, - 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, 0x64, 0x77, 0xbb, 0x5e, 0x07, 0x00, 0x00, + // 854 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x96, 0x3d, 0x4c, 0xeb, 0x56, + 0x14, 0xc7, 0x63, 0x42, 0x80, 0x5c, 0x3e, 0x2a, 0x4c, 0x00, 0x13, 0x15, 0x27, 0xb8, 0x45, 0x4d, + 0x53, 0x61, 0x0b, 0x8a, 0x84, 0x94, 0x56, 0x42, 0x84, 0xaa, 0x0b, 0x45, 0xaa, 0xd2, 0xaa, 0x43, + 0x55, 0x29, 0x72, 0xec, 0x8b, 0xb1, 0x12, 0xfb, 0x46, 0xbe, 0x37, 0x94, 0x6c, 0xa8, 0x63, 0xa7, + 0x76, 0x6a, 0xd5, 0xa9, 0xdd, 0xaa, 0x4e, 0x0c, 0x9d, 0x3b, 0xb3, 0x15, 0x75, 0xea, 0xc4, 0x7b, + 0x82, 0x81, 0x37, 0xb3, 0x3f, 0xe9, 0xe9, 0xfa, 0x5e, 0x1b, 0x27, 0xd8, 0xf9, 0x78, 0x7a, 0xc3, + 0x5b, 0x08, 0xbe, 0xe7, 0x7f, 0x8e, 0x8f, 0x7f, 0xff, 0x7b, 0x8f, 0x0d, 0x0a, 0x06, 0xc2, 0x0e, + 0xc2, 0xda, 0x19, 0xc4, 0xc4, 0x76, 0x2d, 0xed, 0x6c, 0xbb, 0x01, 0x89, 0xbe, 0xad, 0x91, 0x73, + 0xb5, 0xed, 0x21, 0x82, 0xc4, 0x15, 0x26, 0x50, 0xb9, 0x40, 0xe5, 0x82, 0x7c, 0xce, 0x42, 0x16, + 0xf2, 0x25, 0x1a, 0xfd, 0x8f, 0xa9, 0xf3, 0x32, 0x2f, 0xd7, 0xd0, 0x31, 0x0c, 0x6b, 0x19, 0xc8, + 0x76, 0x79, 0x7c, 0x8d, 0xc5, 0xeb, 0x2c, 0x91, 0x97, 0x66, 0xa1, 0xf7, 0x13, 0x3a, 0x09, 0x6e, + 0xcc, 0x54, 0xab, 0x5c, 0xe5, 0x60, 0xaa, 0xa0, 0x3f, 0x3c, 0xb0, 0xa8, 0x3b, 0xb6, 0x8b, 0x34, + 0xff, 0x2f, 0x5b, 0x52, 0x5e, 0x4e, 0x80, 0xd5, 0x63, 0x6c, 0x1d, 0x7a, 0x50, 0x27, 0xf0, 0x1b, + 0x56, 0xe6, 0xc0, 0x30, 0x50, 0xc7, 0x25, 0xe2, 0x27, 0x60, 0xee, 0xc4, 0x43, 0x4e, 0x5d, 0x37, + 0x4d, 0x0f, 0x62, 0x2c, 0x09, 0x45, 0xa1, 0x94, 0xad, 0x4a, 0xff, 0xfd, 0xbd, 0x95, 0xe3, 0x5d, + 0x1d, 0xb0, 0xc8, 0x57, 0xc4, 0xb3, 0x5d, 0xab, 0x36, 0x4b, 0xd5, 0x7c, 0x49, 0xdc, 0x03, 0x80, + 0xa0, 0x30, 0x75, 0x62, 0x48, 0x6a, 0x96, 0xa0, 0x20, 0xb1, 0x0b, 0xa6, 0x74, 0x87, 0xde, 0x5f, + 0x4a, 0x17, 0xd3, 0xa5, 0xd9, 0x9d, 0x35, 0x95, 0x67, 0x50, 0x5e, 0x01, 0x5a, 0xf5, 0x10, 0xd9, + 0x6e, 0xf5, 0xf3, 0xab, 0x9b, 0x42, 0xea, 0xaf, 0x67, 0x85, 0x92, 0x65, 0x93, 0xd3, 0x4e, 0x43, + 0x35, 0x90, 0xc3, 0x79, 0xf1, 0x9f, 0x2d, 0x6c, 0x36, 0x35, 0xd2, 0x6d, 0x43, 0xec, 0x27, 0xe0, + 0xdf, 0xee, 0x2f, 0xcb, 0x73, 0x2d, 0x68, 0xe9, 0x46, 0xb7, 0x4e, 0x89, 0xe3, 0x3f, 0xef, 0x2f, + 0xcb, 0x42, 0x8d, 0xdf, 0x50, 0x5c, 0x03, 0x33, 0xd0, 0x35, 0xeb, 0xc4, 0x76, 0xa0, 0x34, 0x59, + 0x14, 0x4a, 0xe9, 0xda, 0x34, 0x74, 0xcd, 0xaf, 0x6d, 0x07, 0x8a, 0x12, 0x98, 0x36, 0x61, 0x4b, + 0xef, 0x42, 0x53, 0xca, 0x14, 0x85, 0xd2, 0x4c, 0x2d, 0xb8, 0xac, 0x7c, 0xfa, 0xe2, 0xf7, 0x82, + 0xf0, 0x03, 0x2d, 0x1c, 0x85, 0xf5, 0xe3, 0xfd, 0x65, 0x59, 0x89, 0x34, 0x91, 0xc0, 0x58, 0xd9, + 0x00, 0x85, 0x84, 0x50, 0x0d, 0xe2, 0x36, 0x72, 0x31, 0x54, 0xfe, 0x9d, 0x88, 0x68, 0xbe, 0x84, + 0x9e, 0xa3, 0xbb, 0xd0, 0x25, 0x5f, 0x20, 0xa3, 0x09, 0xcd, 0xc0, 0xaa, 0x4a, 0xac, 0x55, 0xab, + 0x0f, 0x37, 0x85, 0xa5, 0xae, 0xee, 0xb4, 0x2a, 0x4a, 0x34, 0xaa, 0xf4, 0x3a, 0xb5, 0x1b, 0xe3, + 0xd4, 0xf2, 0xc3, 0x4d, 0x61, 0x91, 0x65, 0x3e, 0xc6, 0x94, 0xb7, 0xc3, 0xa6, 0xca, 0x7e, 0x22, + 0xf1, 0xcd, 0x38, 0xe2, 0x14, 0x59, 0x0f, 0x2d, 0xe5, 0x43, 0xf0, 0xc1, 0x10, 0xa0, 0x21, 0xfc, + 0x5f, 0xfa, 0xe0, 0xdb, 0xc8, 0xb4, 0x8d, 0xbe, 0x73, 0xb2, 0x11, 0x07, 0xbf, 0x97, 0xf1, 0xfa, + 0x53, 0xc6, 0x51, 0x98, 0xeb, 0x00, 0x60, 0xa2, 0x7b, 0x84, 0x6d, 0xbd, 0xb4, 0xbf, 0xf5, 0xb2, + 0xfe, 0x8a, 0xbf, 0xf9, 0x6a, 0xe0, 0x1d, 0x7e, 0xc2, 0xeb, 0x6d, 0xbf, 0x05, 0x2c, 0x4d, 0xfa, + 0xd0, 0x65, 0x35, 0x7e, 0xf2, 0xa8, 0xac, 0xd3, 0x6a, 0x96, 0x92, 0x67, 0xf0, 0x16, 0xb8, 0x84, + 0x45, 0xb0, 0x0f, 0x31, 0x35, 0x16, 0x44, 0x1b, 0x99, 0xf4, 0xc1, 0x13, 0x20, 0xc6, 0x80, 0x09, + 0x21, 0xfe, 0x9c, 0x8e, 0x40, 0x3c, 0x6c, 0xe9, 0xdf, 0x37, 0x74, 0xa3, 0xf9, 0xc6, 0x21, 0xee, + 0x3e, 0x85, 0x18, 0xdd, 0xc7, 0x8f, 0x31, 0x25, 0xca, 0xf6, 0x08, 0x2c, 0xb4, 0x90, 0xd1, 0xec, + 0xb4, 0xc7, 0x44, 0x3b, 0x49, 0xd1, 0xd6, 0xe6, 0x59, 0x2e, 0x87, 0x2a, 0x1e, 0x3f, 0x35, 0x2a, + 0x33, 0x46, 0xb5, 0x3e, 0x8f, 0xc4, 0x1c, 0xc8, 0x38, 0xd0, 0xb3, 0xa0, 0x34, 0xe5, 0x8f, 0x1c, + 0x76, 0x51, 0xf9, 0x2c, 0xd1, 0xb9, 0x72, 0x9c, 0x73, 0xf1, 0xbc, 0x7b, 0xec, 0x8b, 0x97, 0x84, + 0xf6, 0xfd, 0x21, 0x80, 0x59, 0xaa, 0xe5, 0x2a, 0x71, 0x13, 0x2c, 0x9c, 0x74, 0x5c, 0x13, 0x7a, + 0x7d, 0x66, 0xcd, 0xb3, 0xd5, 0xc0, 0x0f, 0x09, 0x4c, 0xf7, 0x7a, 0x15, 0x5c, 0x52, 0xaf, 0x4d, + 0x88, 0x49, 0x98, 0x9e, 0x66, 0x5e, 0xd3, 0x35, 0x9e, 0x5c, 0x51, 0xe9, 0x03, 0xf6, 0xdd, 0x86, + 0x3e, 0xe2, 0x4a, 0xdf, 0x23, 0xf2, 0x9e, 0x94, 0x65, 0xb0, 0x14, 0xb9, 0x0c, 0x5a, 0xdf, 0xf9, + 0x27, 0x03, 0xd2, 0xc7, 0xd8, 0x12, 0x2f, 0x04, 0x90, 0x8b, 0x7d, 0xc7, 0x69, 0x49, 0xc6, 0x24, + 0x4c, 0xe5, 0xfc, 0xde, 0x98, 0x09, 0x41, 0x2b, 0xe2, 0xaf, 0x02, 0x78, 0x77, 0xe0, 0x0c, 0x1f, + 0x5e, 0x39, 0x3e, 0x31, 0xbf, 0xff, 0x9a, 0x89, 0xf1, 0xad, 0xc5, 0x4d, 0xb8, 0x91, 0x5a, 0x8b, + 0x49, 0x1c, 0xad, 0xb5, 0x01, 0xa3, 0x23, 0xd2, 0x5a, 0xc2, 0xdc, 0x18, 0xde, 0x5a, 0x7c, 0xe2, + 0x08, 0xad, 0x0d, 0x3e, 0x16, 0xe2, 0x77, 0x60, 0x26, 0x3c, 0x12, 0xef, 0x0d, 0x2a, 0xc6, 0x45, + 0xf9, 0x8f, 0x46, 0x10, 0x05, 0xd5, 0xf3, 0x99, 0x0b, 0x3a, 0xb6, 0xab, 0x47, 0x57, 0xb7, 0xb2, + 0x70, 0x7d, 0x2b, 0x0b, 0xcf, 0x6f, 0x65, 0xe1, 0xa7, 0x3b, 0x39, 0x75, 0x7d, 0x27, 0xa7, 0xfe, + 0xbf, 0x93, 0x53, 0xdf, 0x6e, 0x0f, 0x7c, 0x9b, 0x9e, 0x6b, 0x7a, 0x87, 0x9c, 0x86, 0x1f, 0x8a, + 0xfe, 0xcb, 0xb5, 0x31, 0xe5, 0x7f, 0xf3, 0x7d, 0xfc, 0x2a, 0x00, 0x00, 0xff, 0xff, 0xea, 0x55, + 0x09, 0x51, 0xd1, 0x0a, 0x00, 0x00, } func (this *MsgCreateVestingAccount) Equal(that interface{}) bool { @@ -528,6 +784,11 @@ type MsgClient interface { // // Since: cosmos-sdk 0.46 CreatePeriodicVestingAccount(ctx context.Context, in *MsgCreatePeriodicVestingAccount, opts ...grpc.CallOption) (*MsgCreatePeriodicVestingAccountResponse, error) + // CreateClawbackVestingAccount creats a vesting account that is subject to + // clawback and the configuration of vesting and lockup schedules. + CreateClawbackVestingAccount(ctx context.Context, in *MsgCreateClawbackVestingAccount, opts ...grpc.CallOption) (*MsgCreateClawbackVestingAccountResponse, error) + // Clawback removes the unvested tokens from a ClawbackVestingAccount. + Clawback(ctx context.Context, in *MsgClawback, opts ...grpc.CallOption) (*MsgClawbackResponse, error) } type msgClient struct { @@ -565,6 +826,24 @@ func (c *msgClient) CreatePeriodicVestingAccount(ctx context.Context, in *MsgCre return out, nil } +func (c *msgClient) CreateClawbackVestingAccount(ctx context.Context, in *MsgCreateClawbackVestingAccount, opts ...grpc.CallOption) (*MsgCreateClawbackVestingAccountResponse, error) { + out := new(MsgCreateClawbackVestingAccountResponse) + err := c.cc.Invoke(ctx, "/cosmos.vesting.v1beta1.Msg/CreateClawbackVestingAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Clawback(ctx context.Context, in *MsgClawback, opts ...grpc.CallOption) (*MsgClawbackResponse, error) { + out := new(MsgClawbackResponse) + err := c.cc.Invoke(ctx, "/cosmos.vesting.v1beta1.Msg/Clawback", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // CreateVestingAccount defines a method that enables creating a vesting @@ -580,6 +859,11 @@ type MsgServer interface { // // Since: cosmos-sdk 0.46 CreatePeriodicVestingAccount(context.Context, *MsgCreatePeriodicVestingAccount) (*MsgCreatePeriodicVestingAccountResponse, error) + // CreateClawbackVestingAccount creats a vesting account that is subject to + // clawback and the configuration of vesting and lockup schedules. + CreateClawbackVestingAccount(context.Context, *MsgCreateClawbackVestingAccount) (*MsgCreateClawbackVestingAccountResponse, error) + // Clawback removes the unvested tokens from a ClawbackVestingAccount. + Clawback(context.Context, *MsgClawback) (*MsgClawbackResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -595,6 +879,12 @@ func (*UnimplementedMsgServer) CreatePermanentLockedAccount(ctx context.Context, func (*UnimplementedMsgServer) CreatePeriodicVestingAccount(ctx context.Context, req *MsgCreatePeriodicVestingAccount) (*MsgCreatePeriodicVestingAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePeriodicVestingAccount not implemented") } +func (*UnimplementedMsgServer) CreateClawbackVestingAccount(ctx context.Context, req *MsgCreateClawbackVestingAccount) (*MsgCreateClawbackVestingAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateClawbackVestingAccount not implemented") +} +func (*UnimplementedMsgServer) Clawback(ctx context.Context, req *MsgClawback) (*MsgClawbackResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Clawback not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -654,6 +944,42 @@ func _Msg_CreatePeriodicVestingAccount_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _Msg_CreateClawbackVestingAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateClawbackVestingAccount) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateClawbackVestingAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.vesting.v1beta1.Msg/CreateClawbackVestingAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateClawbackVestingAccount(ctx, req.(*MsgCreateClawbackVestingAccount)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Clawback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClawback) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Clawback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.vesting.v1beta1.Msg/Clawback", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Clawback(ctx, req.(*MsgClawback)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.vesting.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -670,6 +996,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CreatePeriodicVestingAccount", Handler: _Msg_CreatePeriodicVestingAccount_Handler, }, + { + MethodName: "CreateClawbackVestingAccount", + Handler: _Msg_CreateClawbackVestingAccount_Handler, + }, + { + MethodName: "Clawback", + Handler: _Msg_Clawback_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/vesting/v1beta1/tx.proto", @@ -917,46 +1251,216 @@ func (m *MsgCreatePeriodicVestingAccountResponse) MarshalToSizedBuffer(dAtA []by return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgCreateClawbackVestingAccount) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgCreateVestingAccount) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgCreateClawbackVestingAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClawbackVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.Merge { + i-- + if m.Merge { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.VestingPeriods) > 0 { + for iNdEx := len(m.VestingPeriods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VestingPeriods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) + if len(m.LockupPeriods) > 0 { + for iNdEx := len(m.LockupPeriods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LockupPeriods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } } - if m.EndTime != 0 { - n += 1 + sovTx(uint64(m.EndTime)) + if m.StartTime != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.StartTime)) + i-- + dAtA[i] = 0x18 } - if m.Delayed { - n += 2 + 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 } - return n -} - + if len(m.FromAddress) > 0 { + i -= len(m.FromAddress) + copy(dAtA[i:], m.FromAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.FromAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateClawbackVestingAccountResponse) 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 *MsgCreateClawbackVestingAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateClawbackVestingAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgClawback) 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 *MsgClawback) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClawback) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DestAddress) > 0 { + i -= len(m.DestAddress) + copy(dAtA[i:], m.DestAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DestAddress))) + i-- + dAtA[i] = 0x1a + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.FunderAddress) > 0 { + i -= len(m.FunderAddress) + copy(dAtA[i:], m.FunderAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.FunderAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgClawbackResponse) 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 *MsgClawbackResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClawbackResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateVestingAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FromAddress) + 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.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if m.EndTime != 0 { + n += 1 + sovTx(uint64(m.EndTime)) + } + if m.Delayed { + n += 2 + } + return n +} + func (m *MsgCreateVestingAccountResponse) Size() (n int) { if m == nil { return 0 @@ -1021,25 +1525,534 @@ func (m *MsgCreatePeriodicVestingAccount) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } - return n -} + return n +} + +func (m *MsgCreatePeriodicVestingAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateClawbackVestingAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FromAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ToAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.StartTime != 0 { + n += 1 + sovTx(uint64(m.StartTime)) + } + if len(m.LockupPeriods) > 0 { + for _, e := range m.LockupPeriods { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.VestingPeriods) > 0 { + for _, e := range m.VestingPeriods { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if m.Merge { + n += 2 + } + return n +} + +func (m *MsgCreateClawbackVestingAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgClawback) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FunderAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DestAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgClawbackResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateVestingAccount) 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: MsgCreateVestingAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", 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.FromAddress = 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 Amount", 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.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 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + } + m.EndTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Delayed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Delayed = bool(v != 0) + 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 *MsgCreateVestingAccountResponse) 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: MsgCreateVestingAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateVestingAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreatePermanentLockedAccount) 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: MsgCreatePermanentLockedAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreatePermanentLockedAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", 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.FromAddress = 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 Amount", 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.Amount = append(m.Amount, types.Coin{}) + if err := m.Amount[len(m.Amount)-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 (m *MsgCreatePermanentLockedAccountResponse) 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: MsgCreatePermanentLockedAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreatePermanentLockedAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } -func (m *MsgCreatePeriodicVestingAccountResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error { +func (m *MsgCreatePeriodicVestingAccount) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1062,10 +2075,10 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateVestingAccount: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreatePeriodicVestingAccount: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreatePeriodicVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1133,10 +2146,10 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error { m.ToAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) } - var msglen int + m.StartTime = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1146,31 +2159,16 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.StartTime |= int64(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.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 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingPeriods", wireType) } - m.EndTime = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1180,31 +2178,26 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.EndTime |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Delayed", wireType) + if msglen < 0 { + return ErrInvalidLengthTx } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx } - m.Delayed = bool(v != 0) + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VestingPeriods = append(m.VestingPeriods, Period{}) + if err := m.VestingPeriods[len(m.VestingPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1226,7 +2219,7 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateVestingAccountResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCreatePeriodicVestingAccountResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1249,10 +2242,10 @@ func (m *MsgCreateVestingAccountResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateVestingAccountResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreatePeriodicVestingAccountResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateVestingAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreatePeriodicVestingAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1276,7 +2269,7 @@ func (m *MsgCreateVestingAccountResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreatePermanentLockedAccount) Unmarshal(dAtA []byte) error { +func (m *MsgCreateClawbackVestingAccount) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1299,10 +2292,10 @@ func (m *MsgCreatePermanentLockedAccount) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreatePermanentLockedAccount: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateClawbackVestingAccount: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreatePermanentLockedAccount: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateClawbackVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1370,8 +2363,27 @@ func (m *MsgCreatePermanentLockedAccount) Unmarshal(dAtA []byte) error { m.ToAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + m.StartTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LockupPeriods", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1398,11 +2410,65 @@ func (m *MsgCreatePermanentLockedAccount) 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 { + m.LockupPeriods = append(m.LockupPeriods, Period{}) + if err := m.LockupPeriods[len(m.LockupPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingPeriods", 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.VestingPeriods = append(m.VestingPeriods, Period{}) + if err := m.VestingPeriods[len(m.VestingPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Merge", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Merge = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1424,7 +2490,7 @@ func (m *MsgCreatePermanentLockedAccount) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreatePermanentLockedAccountResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCreateClawbackVestingAccountResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1447,10 +2513,10 @@ func (m *MsgCreatePermanentLockedAccountResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreatePermanentLockedAccountResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateClawbackVestingAccountResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreatePermanentLockedAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateClawbackVestingAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1474,7 +2540,7 @@ func (m *MsgCreatePermanentLockedAccountResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreatePeriodicVestingAccount) Unmarshal(dAtA []byte) error { +func (m *MsgClawback) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1497,15 +2563,15 @@ func (m *MsgCreatePeriodicVestingAccount) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreatePeriodicVestingAccount: wiretype end group for non-group") + return fmt.Errorf("proto: MsgClawback: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreatePeriodicVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgClawback: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FunderAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1533,11 +2599,11 @@ func (m *MsgCreatePeriodicVestingAccount) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FromAddress = string(dAtA[iNdEx:postIndex]) + m.FunderAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1565,32 +2631,13 @@ func (m *MsgCreatePeriodicVestingAccount) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ToAddress = string(dAtA[iNdEx:postIndex]) + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - m.StartTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VestingPeriods", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DestAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1600,25 +2647,23 @@ func (m *MsgCreatePeriodicVestingAccount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.VestingPeriods = append(m.VestingPeriods, Period{}) - if err := m.VestingPeriods[len(m.VestingPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.DestAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1641,7 +2686,7 @@ func (m *MsgCreatePeriodicVestingAccount) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreatePeriodicVestingAccountResponse) Unmarshal(dAtA []byte) error { +func (m *MsgClawbackResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1664,10 +2709,10 @@ func (m *MsgCreatePeriodicVestingAccountResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreatePeriodicVestingAccountResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgClawbackResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreatePeriodicVestingAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgClawbackResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/auth/vesting/types/vesting.pb.go b/x/auth/vesting/types/vesting.pb.go index 0bf8f8a22fdc..69dc95688390 100644 --- a/x/auth/vesting/types/vesting.pb.go +++ b/x/auth/vesting/types/vesting.pb.go @@ -289,6 +289,53 @@ func (m *PermanentLockedAccount) XXX_DiscardUnknown() { var xxx_messageInfo_PermanentLockedAccount proto.InternalMessageInfo +// ClawbackVestingAccount implements the VestingAccount interface. It provides +// an account that can hold contributions subject to "lockup" (like a +// PeriodicVestingAccount), or vesting which is subject to clawback +// of unvested tokens, or a combination (tokens vest, but are still locked). +type ClawbackVestingAccount struct { + *BaseVestingAccount `protobuf:"bytes,1,opt,name=base_vesting_account,json=baseVestingAccount,proto3,embedded=base_vesting_account" json:"base_vesting_account,omitempty"` + // funder_address specifies the account which can perform clawback. + FunderAddress string `protobuf:"bytes,2,opt,name=funder_address,json=funderAddress,proto3" json:"funder_address,omitempty" yaml:"funder_address"` + StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty" yaml:"start_time"` + // unlocking schedule relative to the BaseVestingAccount start_time. + LockupPeriods []Period `protobuf:"bytes,4,rep,name=lockup_periods,json=lockupPeriods,proto3" json:"lockup_periods" yaml:"lockup_periods"` + // vesting (i.e. immunity from clawback) schedule relative to the BaseVestingAccount start_time. + VestingPeriods []Period `protobuf:"bytes,5,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods" yaml:"vesting_periods"` +} + +func (m *ClawbackVestingAccount) Reset() { *m = ClawbackVestingAccount{} } +func (*ClawbackVestingAccount) ProtoMessage() {} +func (*ClawbackVestingAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_89e80273ca606d6e, []int{6} +} +func (m *ClawbackVestingAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClawbackVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClawbackVestingAccount.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 *ClawbackVestingAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClawbackVestingAccount.Merge(m, src) +} +func (m *ClawbackVestingAccount) XXX_Size() int { + return m.Size() +} +func (m *ClawbackVestingAccount) XXX_DiscardUnknown() { + xxx_messageInfo_ClawbackVestingAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_ClawbackVestingAccount proto.InternalMessageInfo + func init() { proto.RegisterType((*BaseVestingAccount)(nil), "cosmos.vesting.v1beta1.BaseVestingAccount") proto.RegisterType((*ContinuousVestingAccount)(nil), "cosmos.vesting.v1beta1.ContinuousVestingAccount") @@ -296,6 +343,7 @@ func init() { proto.RegisterType((*Period)(nil), "cosmos.vesting.v1beta1.Period") proto.RegisterType((*PeriodicVestingAccount)(nil), "cosmos.vesting.v1beta1.PeriodicVestingAccount") proto.RegisterType((*PermanentLockedAccount)(nil), "cosmos.vesting.v1beta1.PermanentLockedAccount") + proto.RegisterType((*ClawbackVestingAccount)(nil), "cosmos.vesting.v1beta1.ClawbackVestingAccount") } func init() { @@ -303,45 +351,54 @@ func init() { } var fileDescriptor_89e80273ca606d6e = []byte{ - // 605 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x4d, 0x6b, 0x13, 0x41, - 0x18, 0xce, 0x34, 0x35, 0xda, 0x69, 0xed, 0xc7, 0x52, 0x43, 0x5a, 0xe8, 0x26, 0xae, 0x22, 0x31, - 0xe8, 0x2e, 0xa9, 0xb7, 0xdc, 0x4c, 0xa5, 0x20, 0x7a, 0x90, 0x20, 0x1e, 0xbc, 0x84, 0xd9, 0xdd, - 0x71, 0x33, 0x34, 0x3b, 0x13, 0x76, 0x26, 0xc5, 0xfc, 0x83, 0x22, 0x22, 0x9e, 0xed, 0xc5, 0x93, - 0x14, 0x4f, 0xf9, 0x19, 0x05, 0x11, 0x72, 0xf4, 0x54, 0x25, 0x39, 0xe4, 0x6f, 0xc8, 0xce, 0xcc, - 0x6e, 0x43, 0x3e, 0x3c, 0x06, 0x2f, 0xc9, 0xbe, 0x1f, 0xf3, 0x3e, 0xcf, 0xf3, 0xe6, 0xd9, 0x0c, - 0xbc, 0xef, 0x31, 0x1e, 0x32, 0xee, 0x9c, 0x62, 0x2e, 0x08, 0x0d, 0x9c, 0xd3, 0xaa, 0x8b, 0x05, - 0xaa, 0x26, 0xb1, 0xdd, 0x89, 0x98, 0x60, 0x46, 0x5e, 0x75, 0xd9, 0x49, 0x56, 0x77, 0xed, 0xef, - 0xa0, 0x90, 0x50, 0xe6, 0xc8, 0x4f, 0xd5, 0xba, 0xbf, 0x1b, 0xb0, 0x80, 0xc9, 0x47, 0x27, 0x7e, - 0xd2, 0x59, 0x53, 0xc3, 0xb8, 0x88, 0xe3, 0x14, 0xc3, 0x63, 0x84, 0x4e, 0xd5, 0x51, 0x57, 0xb4, - 0xd2, 0x7a, 0x1c, 0xa8, 0xba, 0xf5, 0x73, 0x15, 0x1a, 0x75, 0xc4, 0xf1, 0x1b, 0x45, 0xe0, 0xa9, - 0xe7, 0xb1, 0x2e, 0x15, 0xc6, 0x73, 0xb8, 0x11, 0x4f, 0x6c, 0x22, 0x15, 0x17, 0x40, 0x09, 0x94, - 0xd7, 0x0f, 0x4b, 0xb6, 0xa6, 0x2b, 0x07, 0xe8, 0x69, 0x76, 0x7c, 0x5c, 0x9f, 0xab, 0xaf, 0x0e, - 0xae, 0x8a, 0xa0, 0xb1, 0xee, 0x5e, 0xa7, 0x8c, 0x8f, 0x00, 0x6e, 0xb3, 0x88, 0x04, 0x84, 0xa2, - 0x76, 0x53, 0xeb, 0x2c, 0xac, 0x94, 0xb2, 0xe5, 0xf5, 0xc3, 0xbd, 0x64, 0x5e, 0xdc, 0x9f, 0xce, - 0x3b, 0x62, 0x84, 0xd6, 0x8f, 0x2f, 0xaf, 0x8a, 0x99, 0xef, 0xbf, 0x8b, 0xe5, 0x80, 0x88, 0x56, - 0xd7, 0xb5, 0x3d, 0x16, 0x3a, 0x5a, 0x8a, 0xfa, 0x7a, 0xcc, 0xfd, 0x13, 0x47, 0xf4, 0x3a, 0x98, - 0xcb, 0x03, 0xfc, 0xcb, 0xb8, 0x5f, 0xd9, 0x68, 0xe3, 0x00, 0x79, 0xbd, 0x66, 0xac, 0x9f, 0x5f, - 0x8c, 0xfb, 0x15, 0xd0, 0xd8, 0x4a, 0xa0, 0xb5, 0x40, 0xe3, 0x0c, 0xc0, 0x4d, 0x1f, 0xc7, 0x8d, - 0x02, 0xfb, 0xcd, 0x77, 0x11, 0xc6, 0x85, 0xec, 0xb2, 0xc8, 0xdc, 0x4e, 0x81, 0x8f, 0x23, 0x8c, - 0x8d, 0x4f, 0x00, 0xee, 0x5c, 0x53, 0x49, 0x56, 0xb3, 0xba, 0x2c, 0x36, 0xdb, 0x29, 0x76, 0xb2, - 0x9b, 0x3d, 0x78, 0x0b, 0x53, 0xbf, 0x29, 0x48, 0x88, 0x0b, 0x37, 0x4a, 0xa0, 0x9c, 0x6d, 0xdc, - 0xc4, 0xd4, 0x7f, 0x4d, 0x42, 0x5c, 0x7b, 0x70, 0xf6, 0xb5, 0x98, 0xf9, 0x30, 0xee, 0x57, 0x0e, - 0x26, 0x30, 0x66, 0x8d, 0x63, 0xfd, 0x00, 0xb0, 0x70, 0xc4, 0xa8, 0x20, 0xb4, 0xcb, 0xba, 0x7c, - 0xca, 0x55, 0x2e, 0xdc, 0x95, 0xae, 0xd2, 0x52, 0xa7, 0xdc, 0x55, 0xb1, 0xe7, 0xbf, 0x0c, 0xf6, - 0x2c, 0x8c, 0xf6, 0x99, 0xe1, 0xce, 0x3a, 0xf7, 0x00, 0x42, 0x2e, 0x50, 0x24, 0x94, 0x8a, 0x15, - 0xa9, 0x62, 0x4d, 0x66, 0xa4, 0x8e, 0x47, 0x89, 0x8e, 0x7b, 0x13, 0x3a, 0x16, 0x11, 0xb6, 0xbe, - 0x01, 0x78, 0xe7, 0x19, 0x6e, 0xa3, 0x5e, 0xba, 0xa3, 0x25, 0x4a, 0xa9, 0x3d, 0x4c, 0xb8, 0x96, - 0x26, 0xb8, 0xce, 0xa5, 0x63, 0x9d, 0x03, 0x98, 0x7b, 0x85, 0x23, 0xc2, 0x7c, 0x23, 0x0f, 0x73, - 0x6d, 0x4c, 0x03, 0xd1, 0x92, 0x5c, 0xb2, 0x0d, 0x1d, 0x19, 0x3d, 0x98, 0x43, 0xa1, 0xe4, 0xb8, - 0xb4, 0x97, 0x4f, 0x03, 0x5a, 0xe7, 0x2b, 0x30, 0xaf, 0xd8, 0x11, 0xef, 0xbf, 0xb3, 0x84, 0xd1, - 0x80, 0x5b, 0x09, 0x7a, 0x47, 0x92, 0xe4, 0xfa, 0x1f, 0xc1, 0x5c, 0x84, 0xae, 0xb4, 0xd4, 0xd7, - 0xe2, 0x35, 0x29, 0xa5, 0x9b, 0xba, 0x45, 0x55, 0x78, 0xad, 0x92, 0xfc, 0x74, 0x77, 0x27, 0x16, - 0x36, 0x7f, 0x05, 0xd6, 0x05, 0x90, 0xdb, 0x09, 0x11, 0xc5, 0x54, 0xbc, 0x64, 0xde, 0x09, 0xf6, - 0x97, 0xe9, 0xb2, 0x45, 0x54, 0xe7, 0xf0, 0xa9, 0xbf, 0xb8, 0x1c, 0x9a, 0x60, 0x30, 0x34, 0xc1, - 0x9f, 0xa1, 0x09, 0x3e, 0x8f, 0xcc, 0xcc, 0x60, 0x64, 0x66, 0x7e, 0x8d, 0xcc, 0xcc, 0xdb, 0xea, - 0x3f, 0xad, 0xf2, 0x5e, 0xdf, 0x3f, 0xfa, 0x2e, 0x94, 0xce, 0x71, 0x73, 0xf2, 0x06, 0x7a, 0xf2, - 0x37, 0x00, 0x00, 0xff, 0xff, 0x47, 0xcb, 0xcd, 0xc9, 0x2a, 0x07, 0x00, 0x00, + // 740 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xc1, 0x6e, 0xd3, 0x4a, + 0x14, 0xcd, 0x34, 0x69, 0xde, 0xeb, 0xb4, 0x4d, 0x5b, 0xab, 0x8d, 0xd2, 0x4a, 0x75, 0xf2, 0xfc, + 0x9e, 0x9e, 0x42, 0x04, 0x8e, 0x5a, 0x58, 0x65, 0x45, 0x53, 0x54, 0x09, 0xc1, 0x02, 0x45, 0x88, + 0x05, 0x9b, 0x68, 0x6c, 0x4f, 0x5d, 0x2b, 0xf1, 0x4c, 0xe4, 0x19, 0x17, 0xf2, 0x07, 0x15, 0x42, + 0x88, 0x25, 0xa2, 0x1b, 0x56, 0xa8, 0x62, 0xd5, 0xcf, 0xa8, 0x84, 0x90, 0xba, 0x64, 0x15, 0x50, + 0xbb, 0xe8, 0xbe, 0xfc, 0x00, 0xf2, 0xcc, 0xd8, 0x49, 0x93, 0x14, 0x75, 0x15, 0xd8, 0x24, 0x9e, + 0xb9, 0x77, 0xee, 0x39, 0xe7, 0xde, 0x63, 0x6b, 0xe0, 0x7f, 0x36, 0x65, 0x3e, 0x65, 0xd5, 0x7d, + 0xcc, 0xb8, 0x47, 0xdc, 0xea, 0xfe, 0x86, 0x85, 0x39, 0xda, 0x88, 0xd7, 0x66, 0x27, 0xa0, 0x9c, + 0x6a, 0x79, 0x99, 0x65, 0xc6, 0xbb, 0x2a, 0x6b, 0x6d, 0x09, 0xf9, 0x1e, 0xa1, 0x55, 0xf1, 0x2b, + 0x53, 0xd7, 0x96, 0x5d, 0xea, 0x52, 0xf1, 0x58, 0x8d, 0x9e, 0xd4, 0xae, 0xae, 0x60, 0x2c, 0xc4, + 0x70, 0x82, 0x61, 0x53, 0x8f, 0x0c, 0xc5, 0x51, 0xc8, 0xf7, 0x92, 0x78, 0xb4, 0x90, 0x71, 0xe3, + 0x4b, 0x06, 0x6a, 0x75, 0xc4, 0xf0, 0x33, 0x49, 0x60, 0xcb, 0xb6, 0x69, 0x48, 0xb8, 0xf6, 0x10, + 0xce, 0x45, 0x15, 0x9b, 0x48, 0xae, 0x0b, 0xa0, 0x04, 0xca, 0xb3, 0x9b, 0x25, 0x53, 0xd1, 0x15, + 0x05, 0x54, 0x35, 0x33, 0x3a, 0xae, 0xce, 0xd5, 0x33, 0xa7, 0xbd, 0x22, 0x68, 0xcc, 0x5a, 0xfd, + 0x2d, 0xed, 0x35, 0x80, 0x8b, 0x34, 0xf0, 0x5c, 0x8f, 0xa0, 0x76, 0x53, 0xe9, 0x2c, 0x4c, 0x95, + 0xd2, 0xe5, 0xd9, 0xcd, 0xd5, 0xb8, 0x5e, 0x94, 0x9f, 0xd4, 0xdb, 0xa6, 0x1e, 0xa9, 0xef, 0x9c, + 0xf4, 0x8a, 0xa9, 0x4f, 0xdf, 0x8a, 0x65, 0xd7, 0xe3, 0x7b, 0xa1, 0x65, 0xda, 0xd4, 0xaf, 0x2a, + 0x29, 0xf2, 0xef, 0x0e, 0x73, 0x5a, 0x55, 0xde, 0xed, 0x60, 0x26, 0x0e, 0xb0, 0xf7, 0x17, 0xc7, + 0x95, 0xb9, 0x36, 0x76, 0x91, 0xdd, 0x6d, 0x46, 0xfa, 0xd9, 0xd1, 0xc5, 0x71, 0x05, 0x34, 0x16, + 0x62, 0x68, 0x25, 0x50, 0x3b, 0x00, 0x30, 0xe7, 0xe0, 0x28, 0x91, 0x63, 0xa7, 0xb9, 0x1b, 0x60, + 0x5c, 0x48, 0x4f, 0x8a, 0xcc, 0x7c, 0x02, 0xbc, 0x13, 0x60, 0xac, 0xbd, 0x01, 0x70, 0xa9, 0x4f, + 0x25, 0x6e, 0x4d, 0x66, 0x52, 0x6c, 0x16, 0x13, 0xec, 0xb8, 0x37, 0xab, 0xf0, 0x6f, 0x4c, 0x9c, + 0x26, 0xf7, 0x7c, 0x5c, 0x98, 0x2e, 0x81, 0x72, 0xba, 0xf1, 0x17, 0x26, 0xce, 0x53, 0xcf, 0xc7, + 0xb5, 0xff, 0x0f, 0x3e, 0x14, 0x53, 0xaf, 0x2e, 0x8e, 0x2b, 0xeb, 0x03, 0x18, 0xa3, 0xc6, 0x31, + 0x3e, 0x03, 0x58, 0xd8, 0xa6, 0x84, 0x7b, 0x24, 0xa4, 0x21, 0x1b, 0x72, 0x95, 0x05, 0x97, 0x85, + 0xab, 0x94, 0xd4, 0x21, 0x77, 0x55, 0xcc, 0xf1, 0x2f, 0x83, 0x39, 0x0a, 0xa3, 0x7c, 0xa6, 0x59, + 0xa3, 0xce, 0x5d, 0x87, 0x90, 0x71, 0x14, 0x70, 0xa9, 0x62, 0x4a, 0xa8, 0x98, 0x11, 0x3b, 0x42, + 0xc7, 0xed, 0x58, 0xc7, 0xbf, 0x03, 0x3a, 0xae, 0x23, 0x6c, 0x7c, 0x04, 0x70, 0xe5, 0x01, 0x6e, + 0xa3, 0x6e, 0xd2, 0xa3, 0x09, 0x4a, 0xa9, 0xdd, 0x8a, 0xb9, 0x96, 0x06, 0xb8, 0x8e, 0xa5, 0x63, + 0x1c, 0x02, 0x98, 0x7d, 0x82, 0x03, 0x8f, 0x3a, 0x5a, 0x1e, 0x66, 0xdb, 0x98, 0xb8, 0x7c, 0x4f, + 0x70, 0x49, 0x37, 0xd4, 0x4a, 0xeb, 0xc2, 0x2c, 0xf2, 0x05, 0xc7, 0x89, 0xbd, 0x7c, 0x0a, 0xd0, + 0x38, 0x9c, 0x82, 0x79, 0xc9, 0xce, 0xb3, 0xff, 0x38, 0x4b, 0x68, 0x0d, 0xb8, 0x10, 0xa3, 0x77, + 0x04, 0x49, 0xa6, 0xbe, 0x08, 0xfa, 0x75, 0xe8, 0x52, 0x4b, 0x7d, 0x26, 0x6a, 0x93, 0x54, 0x9a, + 0x53, 0x29, 0x32, 0xc2, 0x6a, 0x95, 0x78, 0x74, 0xff, 0x0c, 0x34, 0x6c, 0x7c, 0x0b, 0x8c, 0x23, + 0x20, 0xba, 0xe3, 0x23, 0x82, 0x09, 0x7f, 0x4c, 0xed, 0x16, 0x76, 0x26, 0xe9, 0xb2, 0xeb, 0xa8, + 0x8e, 0xe1, 0x63, 0xfc, 0x48, 0xc3, 0xfc, 0x76, 0x1b, 0xbd, 0xb0, 0x90, 0xdd, 0xfa, 0x0d, 0x83, + 0xbc, 0x0f, 0x73, 0xbb, 0x21, 0x71, 0x70, 0xd0, 0x44, 0x8e, 0x13, 0x60, 0xc6, 0xc4, 0x30, 0x67, + 0xea, 0xab, 0x97, 0xbd, 0xe2, 0x4a, 0x17, 0xf9, 0xed, 0x9a, 0x71, 0x35, 0x6e, 0x34, 0xe6, 0xe5, + 0xc6, 0x96, 0x5c, 0x6b, 0xf7, 0xae, 0x58, 0x21, 0x1d, 0x59, 0xa1, 0xbe, 0x72, 0xd9, 0x2b, 0x2e, + 0xc9, 0xd3, 0xfd, 0x98, 0x31, 0xe8, 0x10, 0x07, 0xe6, 0xda, 0xd4, 0x6e, 0x85, 0x9d, 0xc4, 0x20, + 0x99, 0x1b, 0x19, 0x64, 0x3d, 0x32, 0x48, 0x9f, 0xdb, 0xd5, 0x1a, 0x46, 0x63, 0x5e, 0x6e, 0x28, + 0xcf, 0x68, 0xee, 0xa8, 0x0f, 0xa7, 0x6f, 0x04, 0xa3, 0x2b, 0x98, 0xbc, 0x84, 0x19, 0x2a, 0x62, + 0x8c, 0x98, 0xd3, 0x8c, 0x26, 0xfe, 0x6e, 0xcc, 0xd4, 0xc7, 0x8f, 0xb6, 0xfe, 0xe8, 0xe4, 0x4c, + 0x07, 0xa7, 0x67, 0x3a, 0xf8, 0x7e, 0xa6, 0x83, 0xb7, 0xe7, 0x7a, 0xea, 0xf4, 0x5c, 0x4f, 0x7d, + 0x3d, 0xd7, 0x53, 0xcf, 0x37, 0x7e, 0xf9, 0x81, 0x78, 0xa9, 0x6e, 0x1d, 0xea, 0x06, 0x24, 0xbe, + 0x17, 0x56, 0x56, 0xdc, 0x3b, 0xee, 0xfe, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x6a, 0x5b, 0x06, + 0x20, 0x09, 0x00, 0x00, } func (m *BaseVestingAccount) Marshal() (dAtA []byte, err error) { @@ -632,6 +689,81 @@ func (m *PermanentLockedAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *ClawbackVestingAccount) 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 *ClawbackVestingAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClawbackVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VestingPeriods) > 0 { + for iNdEx := len(m.VestingPeriods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VestingPeriods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVesting(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.LockupPeriods) > 0 { + for iNdEx := len(m.LockupPeriods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LockupPeriods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVesting(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.StartTime != 0 { + i = encodeVarintVesting(dAtA, i, uint64(m.StartTime)) + i-- + dAtA[i] = 0x18 + } + if len(m.FunderAddress) > 0 { + i -= len(m.FunderAddress) + copy(dAtA[i:], m.FunderAddress) + i = encodeVarintVesting(dAtA, i, uint64(len(m.FunderAddress))) + i-- + dAtA[i] = 0x12 + } + if m.BaseVestingAccount != nil { + { + size, err := m.BaseVestingAccount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVesting(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintVesting(dAtA []byte, offset int, v uint64) int { offset -= sovVesting(v) base := offset @@ -759,6 +891,38 @@ func (m *PermanentLockedAccount) Size() (n int) { return n } +func (m *ClawbackVestingAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BaseVestingAccount != nil { + l = m.BaseVestingAccount.Size() + n += 1 + l + sovVesting(uint64(l)) + } + l = len(m.FunderAddress) + if l > 0 { + n += 1 + l + sovVesting(uint64(l)) + } + if m.StartTime != 0 { + n += 1 + sovVesting(uint64(m.StartTime)) + } + if len(m.LockupPeriods) > 0 { + for _, e := range m.LockupPeriods { + l = e.Size() + n += 1 + l + sovVesting(uint64(l)) + } + } + if len(m.VestingPeriods) > 0 { + for _, e := range m.VestingPeriods { + l = e.Size() + n += 1 + l + sovVesting(uint64(l)) + } + } + return n +} + func sovVesting(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1491,6 +1655,211 @@ func (m *PermanentLockedAccount) Unmarshal(dAtA []byte) error { } return nil } +func (m *ClawbackVestingAccount) 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 ErrIntOverflowVesting + } + 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: ClawbackVestingAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClawbackVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseVestingAccount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVesting + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVesting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BaseVestingAccount == nil { + m.BaseVestingAccount = &BaseVestingAccount{} + } + if err := m.BaseVestingAccount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FunderAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + 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 ErrInvalidLengthVesting + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVesting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FunderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + m.StartTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LockupPeriods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVesting + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVesting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LockupPeriods = append(m.LockupPeriods, Period{}) + if err := m.LockupPeriods[len(m.LockupPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingPeriods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVesting + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVesting + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVesting + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VestingPeriods = append(m.VestingPeriods, Period{}) + if err := m.VestingPeriods[len(m.VestingPeriods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVesting(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthVesting + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipVesting(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0