diff --git a/api/cosmos/protocolpool/v1/genesis.pulsar.go b/api/cosmos/protocolpool/v1/genesis.pulsar.go index 3a7ff075f2a2..f8c605d6d62b 100644 --- a/api/cosmos/protocolpool/v1/genesis.pulsar.go +++ b/api/cosmos/protocolpool/v1/genesis.pulsar.go @@ -262,8 +262,8 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } - if x.LastBalance != "" { - value := protoreflect.ValueOfString(x.LastBalance) + if x.LastBalance != nil { + value := protoreflect.ValueOfMessage(x.LastBalance.ProtoReflect()) if !f(fd_GenesisState_last_balance, value) { return } @@ -294,7 +294,7 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool case "cosmos.protocolpool.v1.GenesisState.budget": return len(x.Budget) != 0 case "cosmos.protocolpool.v1.GenesisState.last_balance": - return x.LastBalance != "" + return x.LastBalance != nil case "cosmos.protocolpool.v1.GenesisState.distributions": return len(x.Distributions) != 0 default: @@ -318,7 +318,7 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { case "cosmos.protocolpool.v1.GenesisState.budget": x.Budget = nil case "cosmos.protocolpool.v1.GenesisState.last_balance": - x.LastBalance = "" + x.LastBalance = nil case "cosmos.protocolpool.v1.GenesisState.distributions": x.Distributions = nil default: @@ -351,7 +351,7 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto return protoreflect.ValueOfList(listValue) case "cosmos.protocolpool.v1.GenesisState.last_balance": value := x.LastBalance - return protoreflect.ValueOfString(value) + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cosmos.protocolpool.v1.GenesisState.distributions": if len(x.Distributions) == 0 { return protoreflect.ValueOfList(&_GenesisState_4_list{}) @@ -387,7 +387,7 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value clv := lv.(*_GenesisState_2_list) x.Budget = *clv.list case "cosmos.protocolpool.v1.GenesisState.last_balance": - x.LastBalance = value.Interface().(string) + x.LastBalance = value.Message().Interface().(*DistributionAmount) case "cosmos.protocolpool.v1.GenesisState.distributions": lv := value.List() clv := lv.(*_GenesisState_4_list) @@ -424,14 +424,17 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p } value := &_GenesisState_2_list{list: &x.Budget} return protoreflect.ValueOfList(value) + case "cosmos.protocolpool.v1.GenesisState.last_balance": + if x.LastBalance == nil { + x.LastBalance = new(DistributionAmount) + } + return protoreflect.ValueOfMessage(x.LastBalance.ProtoReflect()) case "cosmos.protocolpool.v1.GenesisState.distributions": if x.Distributions == nil { x.Distributions = []*Distribution{} } value := &_GenesisState_4_list{list: &x.Distributions} return protoreflect.ValueOfList(value) - case "cosmos.protocolpool.v1.GenesisState.last_balance": - panic(fmt.Errorf("field last_balance of message cosmos.protocolpool.v1.GenesisState is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState")) @@ -452,7 +455,8 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) list := []*Budget{} return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) case "cosmos.protocolpool.v1.GenesisState.last_balance": - return protoreflect.ValueOfString("") + m := new(DistributionAmount) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.protocolpool.v1.GenesisState.distributions": list := []*Distribution{} return protoreflect.ValueOfList(&_GenesisState_4_list{list: &list}) @@ -537,8 +541,8 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } - l = len(x.LastBalance) - if l > 0 { + if x.LastBalance != nil { + l = options.Size(x.LastBalance) n += 1 + l + runtime.Sov(uint64(l)) } if len(x.Distributions) > 0 { @@ -592,10 +596,17 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { dAtA[i] = 0x22 } } - if len(x.LastBalance) > 0 { - i -= len(x.LastBalance) - copy(dAtA[i:], x.LastBalance) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.LastBalance))) + if x.LastBalance != nil { + encoded, err := options.Marshal(x.LastBalance) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0x1a } @@ -752,7 +763,7 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LastBalance", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -762,23 +773,27 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + 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.LastBalance = string(dAtA[iNdEx:postIndex]) + if x.LastBalance == nil { + x.LastBalance = &DistributionAmount{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LastBalance); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex case 4: if wireType != 2 { @@ -851,15 +866,15 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { var ( md_Distribution protoreflect.MessageDescriptor - fd_Distribution_amount protoreflect.FieldDescriptor fd_Distribution_time protoreflect.FieldDescriptor + fd_Distribution_amount protoreflect.FieldDescriptor ) func init() { file_cosmos_protocolpool_v1_genesis_proto_init() md_Distribution = File_cosmos_protocolpool_v1_genesis_proto.Messages().ByName("Distribution") - fd_Distribution_amount = md_Distribution.Fields().ByName("amount") fd_Distribution_time = md_Distribution.Fields().ByName("time") + fd_Distribution_amount = md_Distribution.Fields().ByName("amount") } var _ protoreflect.Message = (*fastReflection_Distribution)(nil) @@ -927,18 +942,18 @@ func (x *fastReflection_Distribution) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Distribution) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Amount != "" { - value := protoreflect.ValueOfString(x.Amount) - if !f(fd_Distribution_amount, value) { - return - } - } if x.Time != nil { value := protoreflect.ValueOfMessage(x.Time.ProtoReflect()) if !f(fd_Distribution_time, value) { return } } + if x.Amount != nil { + value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + if !f(fd_Distribution_amount, value) { + return + } + } } // Has reports whether a field is populated. @@ -954,10 +969,10 @@ func (x *fastReflection_Distribution) Range(f func(protoreflect.FieldDescriptor, // a repeated field is populated if it is non-empty. func (x *fastReflection_Distribution) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.protocolpool.v1.Distribution.amount": - return x.Amount != "" case "cosmos.protocolpool.v1.Distribution.time": return x.Time != nil + case "cosmos.protocolpool.v1.Distribution.amount": + return x.Amount != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Distribution")) @@ -974,10 +989,10 @@ func (x *fastReflection_Distribution) Has(fd protoreflect.FieldDescriptor) bool // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Distribution) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.protocolpool.v1.Distribution.amount": - x.Amount = "" case "cosmos.protocolpool.v1.Distribution.time": x.Time = nil + case "cosmos.protocolpool.v1.Distribution.amount": + x.Amount = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Distribution")) @@ -994,12 +1009,12 @@ func (x *fastReflection_Distribution) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Distribution) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.protocolpool.v1.Distribution.amount": - value := x.Amount - return protoreflect.ValueOfString(value) case "cosmos.protocolpool.v1.Distribution.time": value := x.Time return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.protocolpool.v1.Distribution.amount": + value := x.Amount + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Distribution")) @@ -1020,10 +1035,10 @@ func (x *fastReflection_Distribution) Get(descriptor protoreflect.FieldDescripto // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Distribution) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.protocolpool.v1.Distribution.amount": - x.Amount = value.Interface().(string) case "cosmos.protocolpool.v1.Distribution.time": x.Time = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.protocolpool.v1.Distribution.amount": + x.Amount = value.Message().Interface().(*DistributionAmount) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Distribution")) @@ -1050,7 +1065,10 @@ func (x *fastReflection_Distribution) Mutable(fd protoreflect.FieldDescriptor) p } return protoreflect.ValueOfMessage(x.Time.ProtoReflect()) case "cosmos.protocolpool.v1.Distribution.amount": - panic(fmt.Errorf("field amount of message cosmos.protocolpool.v1.Distribution is not mutable")) + if x.Amount == nil { + x.Amount = new(DistributionAmount) + } + return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Distribution")) @@ -1064,11 +1082,12 @@ func (x *fastReflection_Distribution) Mutable(fd protoreflect.FieldDescriptor) p // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Distribution) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.protocolpool.v1.Distribution.amount": - return protoreflect.ValueOfString("") case "cosmos.protocolpool.v1.Distribution.time": m := new(timestamppb.Timestamp) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.protocolpool.v1.Distribution.amount": + m := new(DistributionAmount) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.Distribution")) @@ -1138,14 +1157,14 @@ func (x *fastReflection_Distribution) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Amount) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } if x.Time != nil { l = options.Size(x.Time) n += 1 + l + runtime.Sov(uint64(l)) } + if x.Amount != nil { + l = options.Size(x.Amount) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1175,8 +1194,8 @@ func (x *fastReflection_Distribution) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Time != nil { - encoded, err := options.Marshal(x.Time) + if x.Amount != nil { + encoded, err := options.Marshal(x.Amount) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1187,14 +1206,21 @@ func (x *fastReflection_Distribution) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x12 } - if len(x.Amount) > 0 { - i -= len(x.Amount) - copy(dAtA[i:], x.Amount) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount))) + if x.Time != nil { + encoded, err := options.Marshal(x.Time) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0xa } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -1245,11 +1271,11 @@ func (x *fastReflection_Distribution) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Distribution: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 3: + case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1259,27 +1285,31 @@ func (x *fastReflection_Distribution) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Amount = string(dAtA[iNdEx:postIndex]) + if x.Time == nil { + x.Time = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Time); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1306,10 +1336,10 @@ func (x *fastReflection_Distribution) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Time == nil { - x.Time = ×tamppb.Timestamp{} + if x.Amount == nil { + x.Amount = &DistributionAmount{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Time); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -1373,7 +1403,7 @@ type GenesisState struct { Budget []*Budget `protobuf:"bytes,2,rep,name=budget,proto3" json:"budget,omitempty"` // last_balance contains the amount of tokens yet to be distributed, will be zero if // there are no funds to distribute. - LastBalance string `protobuf:"bytes,3,opt,name=last_balance,json=lastBalance,proto3" json:"last_balance,omitempty"` + LastBalance *DistributionAmount `protobuf:"bytes,3,opt,name=last_balance,json=lastBalance,proto3" json:"last_balance,omitempty"` // distributions contains the list of distributions to be made to continuous // funds and budgets. It contains time in order to distribute to non-expired // funds only. @@ -1414,11 +1444,11 @@ func (x *GenesisState) GetBudget() []*Budget { return nil } -func (x *GenesisState) GetLastBalance() string { +func (x *GenesisState) GetLastBalance() *DistributionAmount { if x != nil { return x.LastBalance } - return "" + return nil } func (x *GenesisState) GetDistributions() []*Distribution { @@ -1433,8 +1463,8 @@ type Distribution struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` - Time *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=time,proto3" json:"time,omitempty"` + Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` + Amount *DistributionAmount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` } func (x *Distribution) Reset() { @@ -1457,16 +1487,16 @@ func (*Distribution) Descriptor() ([]byte, []int) { return file_cosmos_protocolpool_v1_genesis_proto_rawDescGZIP(), []int{1} } -func (x *Distribution) GetAmount() string { +func (x *Distribution) GetTime() *timestamppb.Timestamp { if x != nil { - return x.Amount + return x.Time } - return "" + return nil } -func (x *Distribution) GetTime() *timestamppb.Timestamp { +func (x *Distribution) GetAmount() *DistributionAmount { if x != nil { - return x.Time + return x.Amount } return nil } @@ -1485,7 +1515,7 @@ var file_cosmos_protocolpool_v1_genesis_proto_rawDesc = []byte{ 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, 0x02, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb8, 0x02, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x4f, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, @@ -1494,40 +1524,41 @@ var file_cosmos_protocolpool_v1_genesis_proto_rawDesc = []byte{ 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x12, 0x36, 0x0a, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x4e, + 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x53, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, - 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, - 0x74, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x4a, - 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x44, - 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x64, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x0c, 0x44, - 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x06, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2b, 0xc8, 0xde, 0x1f, - 0x00, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x34, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0d, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, + 0x8e, 0x01, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x34, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, - 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x42, 0xdc, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, - 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 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, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x43, 0x50, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, - 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, - 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x42, 0xdc, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, + 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 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, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x50, 0x58, 0xaa, 0x02, 0x16, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, + 0x6f, 0x6f, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1548,18 +1579,21 @@ var file_cosmos_protocolpool_v1_genesis_proto_goTypes = []interface{}{ (*Distribution)(nil), // 1: cosmos.protocolpool.v1.Distribution (*ContinuousFund)(nil), // 2: cosmos.protocolpool.v1.ContinuousFund (*Budget)(nil), // 3: cosmos.protocolpool.v1.Budget - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*DistributionAmount)(nil), // 4: cosmos.protocolpool.v1.DistributionAmount + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp } var file_cosmos_protocolpool_v1_genesis_proto_depIdxs = []int32{ 2, // 0: cosmos.protocolpool.v1.GenesisState.continuous_fund:type_name -> cosmos.protocolpool.v1.ContinuousFund 3, // 1: cosmos.protocolpool.v1.GenesisState.budget:type_name -> cosmos.protocolpool.v1.Budget - 1, // 2: cosmos.protocolpool.v1.GenesisState.distributions:type_name -> cosmos.protocolpool.v1.Distribution - 4, // 3: cosmos.protocolpool.v1.Distribution.time:type_name -> google.protobuf.Timestamp - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 4, // 2: cosmos.protocolpool.v1.GenesisState.last_balance:type_name -> cosmos.protocolpool.v1.DistributionAmount + 1, // 3: cosmos.protocolpool.v1.GenesisState.distributions:type_name -> cosmos.protocolpool.v1.Distribution + 5, // 4: cosmos.protocolpool.v1.Distribution.time:type_name -> google.protobuf.Timestamp + 4, // 5: cosmos.protocolpool.v1.Distribution.amount:type_name -> cosmos.protocolpool.v1.DistributionAmount + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_protocolpool_v1_genesis_proto_init() } diff --git a/api/cosmos/protocolpool/v1/tx.pulsar.go b/api/cosmos/protocolpool/v1/tx.pulsar.go index 025971ccb8b5..fd7221843fa3 100644 --- a/api/cosmos/protocolpool/v1/tx.pulsar.go +++ b/api/cosmos/protocolpool/v1/tx.pulsar.go @@ -5357,6 +5357,57 @@ func (x *fastReflection_MsgCancelContinuousFund) ProtoMethods() *protoiface.Meth } } +var _ protoreflect.List = (*_MsgCancelContinuousFundResponse_4_list)(nil) + +type _MsgCancelContinuousFundResponse_4_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgCancelContinuousFundResponse_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgCancelContinuousFundResponse_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgCancelContinuousFundResponse_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgCancelContinuousFundResponse_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgCancelContinuousFundResponse_4_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCancelContinuousFundResponse_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgCancelContinuousFundResponse_4_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgCancelContinuousFundResponse_4_list) IsValid() bool { + return x.list != nil +} + var ( md_MsgCancelContinuousFundResponse protoreflect.MessageDescriptor fd_MsgCancelContinuousFundResponse_canceled_time protoreflect.FieldDescriptor @@ -5457,8 +5508,8 @@ func (x *fastReflection_MsgCancelContinuousFundResponse) Range(f func(protorefle return } } - if x.WithdrawnAllocatedFund != nil { - value := protoreflect.ValueOfMessage(x.WithdrawnAllocatedFund.ProtoReflect()) + if len(x.WithdrawnAllocatedFund) != 0 { + value := protoreflect.ValueOfList(&_MsgCancelContinuousFundResponse_4_list{list: &x.WithdrawnAllocatedFund}) if !f(fd_MsgCancelContinuousFundResponse_withdrawn_allocated_fund, value) { return } @@ -5485,7 +5536,7 @@ func (x *fastReflection_MsgCancelContinuousFundResponse) Has(fd protoreflect.Fie case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient_address": return x.RecipientAddress != "" case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.withdrawn_allocated_fund": - return x.WithdrawnAllocatedFund != nil + return len(x.WithdrawnAllocatedFund) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) @@ -5536,8 +5587,11 @@ func (x *fastReflection_MsgCancelContinuousFundResponse) Get(descriptor protoref value := x.RecipientAddress return protoreflect.ValueOfString(value) case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.withdrawn_allocated_fund": - value := x.WithdrawnAllocatedFund - return protoreflect.ValueOfMessage(value.ProtoReflect()) + if len(x.WithdrawnAllocatedFund) == 0 { + return protoreflect.ValueOfList(&_MsgCancelContinuousFundResponse_4_list{}) + } + listValue := &_MsgCancelContinuousFundResponse_4_list{list: &x.WithdrawnAllocatedFund} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) @@ -5565,7 +5619,9 @@ func (x *fastReflection_MsgCancelContinuousFundResponse) Set(fd protoreflect.Fie case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient_address": x.RecipientAddress = value.Interface().(string) case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.withdrawn_allocated_fund": - x.WithdrawnAllocatedFund = value.Message().Interface().(*v1beta1.Coin) + lv := value.List() + clv := lv.(*_MsgCancelContinuousFundResponse_4_list) + x.WithdrawnAllocatedFund = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) @@ -5593,9 +5649,10 @@ func (x *fastReflection_MsgCancelContinuousFundResponse) Mutable(fd protoreflect return protoreflect.ValueOfMessage(x.CanceledTime.ProtoReflect()) case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.withdrawn_allocated_fund": if x.WithdrawnAllocatedFund == nil { - x.WithdrawnAllocatedFund = new(v1beta1.Coin) + x.WithdrawnAllocatedFund = []*v1beta1.Coin{} } - return protoreflect.ValueOfMessage(x.WithdrawnAllocatedFund.ProtoReflect()) + value := &_MsgCancelContinuousFundResponse_4_list{list: &x.WithdrawnAllocatedFund} + return protoreflect.ValueOfList(value) case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.canceled_height": panic(fmt.Errorf("field canceled_height of message cosmos.protocolpool.v1.MsgCancelContinuousFundResponse is not mutable")) case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient_address": @@ -5621,8 +5678,8 @@ func (x *fastReflection_MsgCancelContinuousFundResponse) NewField(fd protoreflec case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.recipient_address": return protoreflect.ValueOfString("") case "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse.withdrawn_allocated_fund": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgCancelContinuousFundResponse_4_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")) @@ -5703,9 +5760,11 @@ func (x *fastReflection_MsgCancelContinuousFundResponse) ProtoMethods() *protoif if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.WithdrawnAllocatedFund != nil { - l = options.Size(x.WithdrawnAllocatedFund) - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.WithdrawnAllocatedFund) > 0 { + for _, e := range x.WithdrawnAllocatedFund { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -5736,19 +5795,21 @@ func (x *fastReflection_MsgCancelContinuousFundResponse) ProtoMethods() *protoif i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.WithdrawnAllocatedFund != nil { - encoded, err := options.Marshal(x.WithdrawnAllocatedFund) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err + if len(x.WithdrawnAllocatedFund) > 0 { + for iNdEx := len(x.WithdrawnAllocatedFund) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.WithdrawnAllocatedFund[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 } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x22 } if len(x.RecipientAddress) > 0 { i -= len(x.RecipientAddress) @@ -5941,10 +6002,8 @@ func (x *fastReflection_MsgCancelContinuousFundResponse) ProtoMethods() *protoif if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.WithdrawnAllocatedFund == nil { - x.WithdrawnAllocatedFund = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.WithdrawnAllocatedFund); err != nil { + x.WithdrawnAllocatedFund = append(x.WithdrawnAllocatedFund, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.WithdrawnAllocatedFund[len(x.WithdrawnAllocatedFund)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -6403,6 +6462,57 @@ func (x *fastReflection_MsgWithdrawContinuousFund) ProtoMethods() *protoiface.Me } } +var _ protoreflect.List = (*_MsgWithdrawContinuousFundResponse_1_list)(nil) + +type _MsgWithdrawContinuousFundResponse_1_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgWithdrawContinuousFundResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgWithdrawContinuousFundResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgWithdrawContinuousFundResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgWithdrawContinuousFundResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgWithdrawContinuousFundResponse_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgWithdrawContinuousFundResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgWithdrawContinuousFundResponse_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgWithdrawContinuousFundResponse_1_list) IsValid() bool { + return x.list != nil +} + var ( md_MsgWithdrawContinuousFundResponse protoreflect.MessageDescriptor fd_MsgWithdrawContinuousFundResponse_amount protoreflect.FieldDescriptor @@ -6479,8 +6589,8 @@ func (x *fastReflection_MsgWithdrawContinuousFundResponse) Interface() protorefl // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgWithdrawContinuousFundResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Amount != nil { - value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + if len(x.Amount) != 0 { + value := protoreflect.ValueOfList(&_MsgWithdrawContinuousFundResponse_1_list{list: &x.Amount}) if !f(fd_MsgWithdrawContinuousFundResponse_amount, value) { return } @@ -6501,7 +6611,7 @@ func (x *fastReflection_MsgWithdrawContinuousFundResponse) Range(f func(protoref func (x *fastReflection_MsgWithdrawContinuousFundResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse.amount": - return x.Amount != nil + return len(x.Amount) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse")) @@ -6537,8 +6647,11 @@ func (x *fastReflection_MsgWithdrawContinuousFundResponse) Clear(fd protoreflect func (x *fastReflection_MsgWithdrawContinuousFundResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { case "cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse.amount": - value := x.Amount - return protoreflect.ValueOfMessage(value.ProtoReflect()) + if len(x.Amount) == 0 { + return protoreflect.ValueOfList(&_MsgWithdrawContinuousFundResponse_1_list{}) + } + listValue := &_MsgWithdrawContinuousFundResponse_1_list{list: &x.Amount} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse")) @@ -6560,7 +6673,9 @@ func (x *fastReflection_MsgWithdrawContinuousFundResponse) Get(descriptor protor func (x *fastReflection_MsgWithdrawContinuousFundResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse.amount": - x.Amount = value.Message().Interface().(*v1beta1.Coin) + lv := value.List() + clv := lv.(*_MsgWithdrawContinuousFundResponse_1_list) + x.Amount = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse")) @@ -6583,9 +6698,10 @@ func (x *fastReflection_MsgWithdrawContinuousFundResponse) Mutable(fd protorefle switch fd.FullName() { case "cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse.amount": if x.Amount == nil { - x.Amount = new(v1beta1.Coin) + x.Amount = []*v1beta1.Coin{} } - return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) + value := &_MsgWithdrawContinuousFundResponse_1_list{list: &x.Amount} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse")) @@ -6600,8 +6716,8 @@ func (x *fastReflection_MsgWithdrawContinuousFundResponse) Mutable(fd protorefle func (x *fastReflection_MsgWithdrawContinuousFundResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse.amount": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgWithdrawContinuousFundResponse_1_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse")) @@ -6671,9 +6787,11 @@ func (x *fastReflection_MsgWithdrawContinuousFundResponse) ProtoMethods() *proto var n int var l int _ = l - if x.Amount != nil { - l = options.Size(x.Amount) - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.Amount) > 0 { + for _, e := range x.Amount { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.unknownFields != nil { n += len(x.unknownFields) @@ -6704,19 +6822,21 @@ func (x *fastReflection_MsgWithdrawContinuousFundResponse) ProtoMethods() *proto i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Amount != nil { - encoded, err := options.Marshal(x.Amount) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err + if len(x.Amount) > 0 { + for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Amount[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa } - 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...) @@ -6796,10 +6916,8 @@ func (x *fastReflection_MsgWithdrawContinuousFundResponse) ProtoMethods() *proto if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.Amount == nil { - x.Amount = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil { + x.Amount = append(x.Amount, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -7346,7 +7464,7 @@ type MsgCancelContinuousFundResponse struct { // withdrawnAllocatedFund represents the fund allocated to this recipient (if any) that have not been withdrawn yet, // before a cancellation request has been initiated. // It involves first withdrawing the funds and then canceling the request. - WithdrawnAllocatedFund *v1beta1.Coin `protobuf:"bytes,4,opt,name=withdrawn_allocated_fund,json=withdrawnAllocatedFund,proto3" json:"withdrawn_allocated_fund,omitempty"` + WithdrawnAllocatedFund []*v1beta1.Coin `protobuf:"bytes,4,rep,name=withdrawn_allocated_fund,json=withdrawnAllocatedFund,proto3" json:"withdrawn_allocated_fund,omitempty"` } func (x *MsgCancelContinuousFundResponse) Reset() { @@ -7390,7 +7508,7 @@ func (x *MsgCancelContinuousFundResponse) GetRecipientAddress() string { return "" } -func (x *MsgCancelContinuousFundResponse) GetWithdrawnAllocatedFund() *v1beta1.Coin { +func (x *MsgCancelContinuousFundResponse) GetWithdrawnAllocatedFund() []*v1beta1.Coin { if x != nil { return x.WithdrawnAllocatedFund } @@ -7440,7 +7558,7 @@ type MsgWithdrawContinuousFundResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Amount *v1beta1.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + Amount []*v1beta1.Coin `protobuf:"bytes,1,rep,name=amount,proto3" json:"amount,omitempty"` } func (x *MsgWithdrawContinuousFundResponse) Reset() { @@ -7463,7 +7581,7 @@ func (*MsgWithdrawContinuousFundResponse) Descriptor() ([]byte, []int) { return file_cosmos_protocolpool_v1_tx_proto_rawDescGZIP(), []int{13} } -func (x *MsgWithdrawContinuousFundResponse) GetAmount() *v1beta1.Coin { +func (x *MsgWithdrawContinuousFundResponse) GetAmount() []*v1beta1.Coin { if x != nil { return x.Amount } @@ -7607,7 +7725,7 @@ var file_cosmos_protocolpool_v1_tx_proto_rawDesc = []byte{ 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x18, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x6e, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x74, 0x65, 0x64, 0x5f, 0x66, 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, @@ -7625,7 +7743,7 @@ var file_cosmos_protocolpool_v1_tx_proto_rawDesc = []byte{ 0x88, 0x01, 0x0a, 0x21, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, diff --git a/api/cosmos/protocolpool/v1/types.pulsar.go b/api/cosmos/protocolpool/v1/types.pulsar.go index 06ec3cde662c..97a6d5e58f91 100644 --- a/api/cosmos/protocolpool/v1/types.pulsar.go +++ b/api/cosmos/protocolpool/v1/types.pulsar.go @@ -2,6 +2,7 @@ package protocolpoolv1 import ( + _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" fmt "fmt" _ "github.com/cosmos/cosmos-proto" @@ -1364,6 +1365,500 @@ func (x *fastReflection_ContinuousFund) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_DistributionAmount_1_list)(nil) + +type _DistributionAmount_1_list struct { + list *[]*v1beta1.Coin +} + +func (x *_DistributionAmount_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DistributionAmount_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DistributionAmount_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_DistributionAmount_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DistributionAmount_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DistributionAmount_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DistributionAmount_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DistributionAmount_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DistributionAmount protoreflect.MessageDescriptor + fd_DistributionAmount_amount protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_protocolpool_v1_types_proto_init() + md_DistributionAmount = File_cosmos_protocolpool_v1_types_proto.Messages().ByName("DistributionAmount") + fd_DistributionAmount_amount = md_DistributionAmount.Fields().ByName("amount") +} + +var _ protoreflect.Message = (*fastReflection_DistributionAmount)(nil) + +type fastReflection_DistributionAmount DistributionAmount + +func (x *DistributionAmount) ProtoReflect() protoreflect.Message { + return (*fastReflection_DistributionAmount)(x) +} + +func (x *DistributionAmount) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_protocolpool_v1_types_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DistributionAmount_messageType fastReflection_DistributionAmount_messageType +var _ protoreflect.MessageType = fastReflection_DistributionAmount_messageType{} + +type fastReflection_DistributionAmount_messageType struct{} + +func (x fastReflection_DistributionAmount_messageType) Zero() protoreflect.Message { + return (*fastReflection_DistributionAmount)(nil) +} +func (x fastReflection_DistributionAmount_messageType) New() protoreflect.Message { + return new(fastReflection_DistributionAmount) +} +func (x fastReflection_DistributionAmount_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DistributionAmount +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DistributionAmount) Descriptor() protoreflect.MessageDescriptor { + return md_DistributionAmount +} + +// 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_DistributionAmount) Type() protoreflect.MessageType { + return _fastReflection_DistributionAmount_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DistributionAmount) New() protoreflect.Message { + return new(fastReflection_DistributionAmount) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DistributionAmount) Interface() protoreflect.ProtoMessage { + return (*DistributionAmount)(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_DistributionAmount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Amount) != 0 { + value := protoreflect.ValueOfList(&_DistributionAmount_1_list{list: &x.Amount}) + if !f(fd_DistributionAmount_amount, 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_DistributionAmount) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.protocolpool.v1.DistributionAmount.amount": + return len(x.Amount) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.DistributionAmount")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.DistributionAmount 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_DistributionAmount) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.DistributionAmount.amount": + x.Amount = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.DistributionAmount")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.DistributionAmount 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_DistributionAmount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.protocolpool.v1.DistributionAmount.amount": + if len(x.Amount) == 0 { + return protoreflect.ValueOfList(&_DistributionAmount_1_list{}) + } + listValue := &_DistributionAmount_1_list{list: &x.Amount} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.DistributionAmount")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.DistributionAmount 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_DistributionAmount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.protocolpool.v1.DistributionAmount.amount": + lv := value.List() + clv := lv.(*_DistributionAmount_1_list) + x.Amount = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.DistributionAmount")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.DistributionAmount 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_DistributionAmount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.DistributionAmount.amount": + if x.Amount == nil { + x.Amount = []*v1beta1.Coin{} + } + value := &_DistributionAmount_1_list{list: &x.Amount} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.DistributionAmount")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.DistributionAmount 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_DistributionAmount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.protocolpool.v1.DistributionAmount.amount": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_DistributionAmount_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.DistributionAmount")) + } + panic(fmt.Errorf("message cosmos.protocolpool.v1.DistributionAmount 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_DistributionAmount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.protocolpool.v1.DistributionAmount", 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_DistributionAmount) 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_DistributionAmount) 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_DistributionAmount) 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_DistributionAmount) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DistributionAmount) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Amount) > 0 { + for _, e := range x.Amount { + 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().(*DistributionAmount) + 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.Amount) > 0 { + for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Amount[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 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().(*DistributionAmount) + 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: DistributionAmount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DistributionAmount: 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 Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Amount = append(x.Amount, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + 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 @@ -1517,6 +2012,42 @@ func (x *ContinuousFund) GetExpiry() *timestamppb.Timestamp { return nil } +// DistributionAmount is used to store the coins of periodic distributions. +type DistributionAmount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Amount []*v1beta1.Coin `protobuf:"bytes,1,rep,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *DistributionAmount) Reset() { + *x = DistributionAmount{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_protocolpool_v1_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DistributionAmount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DistributionAmount) ProtoMessage() {} + +// Deprecated: Use DistributionAmount.ProtoReflect.Descriptor instead. +func (*DistributionAmount) Descriptor() ([]byte, []int) { + return file_cosmos_protocolpool_v1_types_proto_rawDescGZIP(), []int{2} +} + +func (x *DistributionAmount) GetAmount() []*v1beta1.Coin { + if x != nil { + return x.Amount + } + return nil +} + var File_cosmos_protocolpool_v1_types_proto protoreflect.FileDescriptor var file_cosmos_protocolpool_v1_types_proto_rawDesc = []byte{ @@ -1532,59 +2063,70 @@ var file_cosmos_protocolpool_v1_types_proto_rawDesc = []byte{ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82, - 0x03, 0x0a, 0x06, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x45, 0x0a, 0x11, 0x72, 0x65, 0x63, - 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, - 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x40, 0x0a, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x52, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0d, 0x6c, - 0x61, 0x73, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x4c, 0x65, 0x66, - 0x74, 0x12, 0x47, 0x0a, 0x12, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x5f, - 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x10, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, - 0x50, 0x65, 0x72, 0x54, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x70, 0x65, - 0x72, 0x69, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x06, 0x70, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x22, 0xd5, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x6f, - 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, - 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x51, - 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, - 0x65, 0x12, 0x38, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, - 0xdf, 0x1f, 0x01, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x42, 0xda, 0x01, 0x0a, 0x1a, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, - 0x73, 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, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2f, 0x76, - 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x50, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x70, 0x6f, 0x6f, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x82, 0x03, 0x0a, 0x06, 0x42, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x45, 0x0a, 0x11, + 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x10, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x40, 0x0a, 0x0e, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x48, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, + 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x23, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, + 0x4c, 0x65, 0x66, 0x74, 0x12, 0x47, 0x0a, 0x12, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x70, + 0x65, 0x72, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x10, 0x62, 0x75, 0x64, + 0x67, 0x65, 0x74, 0x50, 0x65, 0x72, 0x54, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x12, 0x37, 0x0a, + 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x06, + 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0xd5, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x69, + 0x6e, 0x75, 0x6f, 0x75, 0x73, 0x46, 0x75, 0x6e, 0x64, 0x12, 0x36, 0x0a, 0x09, 0x72, 0x65, 0x63, + 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x12, 0x51, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x22, 0x8f, + 0x01, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x41, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, + 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, + 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x42, 0xda, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x76, 0x31, 0x42, + 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 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, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, + 0x6f, 0x6f, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, + 0x6f, 0x6f, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x50, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, + 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x22, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, + 0x6f, 0x6f, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x70, 0x6f, 0x6f, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1599,25 +2141,27 @@ func file_cosmos_protocolpool_v1_types_proto_rawDescGZIP() []byte { return file_cosmos_protocolpool_v1_types_proto_rawDescData } -var file_cosmos_protocolpool_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_protocolpool_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cosmos_protocolpool_v1_types_proto_goTypes = []interface{}{ (*Budget)(nil), // 0: cosmos.protocolpool.v1.Budget (*ContinuousFund)(nil), // 1: cosmos.protocolpool.v1.ContinuousFund - (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 4: google.protobuf.Duration + (*DistributionAmount)(nil), // 2: cosmos.protocolpool.v1.DistributionAmount + (*v1beta1.Coin)(nil), // 3: cosmos.base.v1beta1.Coin + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 5: google.protobuf.Duration } var file_cosmos_protocolpool_v1_types_proto_depIdxs = []int32{ - 2, // 0: cosmos.protocolpool.v1.Budget.claimed_amount:type_name -> cosmos.base.v1beta1.Coin - 3, // 1: cosmos.protocolpool.v1.Budget.last_claimed_at:type_name -> google.protobuf.Timestamp - 2, // 2: cosmos.protocolpool.v1.Budget.budget_per_tranche:type_name -> cosmos.base.v1beta1.Coin - 4, // 3: cosmos.protocolpool.v1.Budget.period:type_name -> google.protobuf.Duration - 3, // 4: cosmos.protocolpool.v1.ContinuousFund.expiry:type_name -> google.protobuf.Timestamp - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 3, // 0: cosmos.protocolpool.v1.Budget.claimed_amount:type_name -> cosmos.base.v1beta1.Coin + 4, // 1: cosmos.protocolpool.v1.Budget.last_claimed_at:type_name -> google.protobuf.Timestamp + 3, // 2: cosmos.protocolpool.v1.Budget.budget_per_tranche:type_name -> cosmos.base.v1beta1.Coin + 5, // 3: cosmos.protocolpool.v1.Budget.period:type_name -> google.protobuf.Duration + 4, // 4: cosmos.protocolpool.v1.ContinuousFund.expiry:type_name -> google.protobuf.Timestamp + 3, // 5: cosmos.protocolpool.v1.DistributionAmount.amount:type_name -> cosmos.base.v1beta1.Coin + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_protocolpool_v1_types_proto_init() } @@ -1650,6 +2194,18 @@ func file_cosmos_protocolpool_v1_types_proto_init() { return nil } } + file_cosmos_protocolpool_v1_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DistributionAmount); 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{ @@ -1657,7 +2213,7 @@ func file_cosmos_protocolpool_v1_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_protocolpool_v1_types_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/simapp/app.go b/simapp/app.go index b02c5e14599f..ede8c8dccf4f 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -377,7 +377,7 @@ func NewSimApp( panic(err) } - app.PoolKeeper = poolkeeper.NewKeeper(appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[pooltypes.StoreKey]), logger.With(log.ModuleKey, "x/protocolpool")), app.AuthKeeper, app.BankKeeper, app.StakingKeeper, govModuleAddr) + app.PoolKeeper = poolkeeper.NewKeeper(appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[pooltypes.StoreKey]), logger.With(log.ModuleKey, "x/protocolpool")), app.AuthKeeper, app.BankKeeper, govModuleAddr) app.DistrKeeper = distrkeeper.NewKeeper(appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[distrtypes.StoreKey]), logger.With(log.ModuleKey, "x/distribution")), app.AuthKeeper, app.BankKeeper, app.StakingKeeper, cometService, authtypes.FeeCollectorName, govModuleAddr) diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index 7ab94c01a3e1..b942275d61bc 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -138,7 +138,7 @@ func initFixture(t *testing.T) *fixture { stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcRouter), runtime.EnvWithMsgRouterService(msgRouter)), accountKeeper, bankKeeper, consensusParamsKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), cometService) require.NoError(t, stakingKeeper.Params.Set(newCtx, stakingtypes.DefaultParams())) - poolKeeper := poolkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[pooltypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, stakingKeeper, authority.String()) + poolKeeper := poolkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[pooltypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, authority.String()) distrKeeper := distrkeeper.NewKeeper( cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[distrtypes.StoreKey]), logger), accountKeeper, bankKeeper, stakingKeeper, cometService, distrtypes.ModuleName, authority.String(), diff --git a/tests/integration/gov/keeper/keeper_test.go b/tests/integration/gov/keeper/keeper_test.go index f1f94f575d58..314a5ed5909f 100644 --- a/tests/integration/gov/keeper/keeper_test.go +++ b/tests/integration/gov/keeper/keeper_test.go @@ -119,7 +119,7 @@ func initFixture(tb testing.TB) *fixture { stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, consensusParamsKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), runtime.NewContextAwareCometInfoService()) - poolKeeper := poolkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[pooltypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, stakingKeeper, authority.String()) + poolKeeper := poolkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[pooltypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, authority.String()) // set default staking params err := stakingKeeper.Params.Set(newCtx, stakingtypes.DefaultParams()) diff --git a/x/protocolpool/depinject.go b/x/protocolpool/depinject.go index a2dc1c950c63..bc49c3381809 100644 --- a/x/protocolpool/depinject.go +++ b/x/protocolpool/depinject.go @@ -37,7 +37,6 @@ type ModuleInputs struct { AccountKeeper types.AccountKeeper BankKeeper types.BankKeeper - StakingKeeper types.StakingKeeper } type ModuleOutputs struct { @@ -59,7 +58,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { panic(err) } - k := keeper.NewKeeper(in.Codec, in.Environment, in.AccountKeeper, in.BankKeeper, in.StakingKeeper, authorityAddr) + k := keeper.NewKeeper(in.Codec, in.Environment, in.AccountKeeper, in.BankKeeper, authorityAddr) m := NewAppModule(in.Codec, k, in.AccountKeeper, in.BankKeeper) return ModuleOutputs{ diff --git a/x/protocolpool/keeper/genesis.go b/x/protocolpool/keeper/genesis.go index 0a371f453103..d2086d5a35c1 100644 --- a/x/protocolpool/keeper/genesis.go +++ b/x/protocolpool/keeper/genesis.go @@ -6,7 +6,6 @@ import ( "fmt" "time" - "cosmossdk.io/math" "cosmossdk.io/x/protocolpool/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -56,19 +55,19 @@ func (k Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error return fmt.Errorf("failed to set last balance: %w", err) } - totalToBeDistributed := math.ZeroInt() + totalToBeDistributed := sdk.NewCoins() for _, distribution := range data.Distributions { - totalToBeDistributed = totalToBeDistributed.Add(distribution.Amount) + totalToBeDistributed = totalToBeDistributed.Add(distribution.Amount.Amount...) if err := k.Distributions.Set(ctx, *distribution.Time, distribution.Amount); err != nil { return fmt.Errorf("failed to set distribution: %w", err) } } // sanity check to avoid trying to distribute more than what is available - if data.LastBalance.LT(totalToBeDistributed) { - return errors.New("total to be distributed is greater than the last balance") - } + if data.LastBalance.Amount.IsAnyGT(totalToBeDistributed) || !totalToBeDistributed.DenomsSubsetOf(data.LastBalance.Amount) { + return errors.New("total to be distributed is greater than the last balance" + fmt.Sprint(data.LastBalance.Amount, totalToBeDistributed)) + } return nil } @@ -112,12 +111,14 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) genState := types.NewGenesisState(cf, budget) - genState.LastBalance, err = k.LastBalance.Get(ctx) + lastBalance, err := k.LastBalance.Get(ctx) if err != nil { return nil, err } - err = k.Distributions.Walk(ctx, nil, func(key time.Time, value math.Int) (stop bool, err error) { + genState.LastBalance = lastBalance + + err = k.Distributions.Walk(ctx, nil, func(key time.Time, value types.DistributionAmount) (stop bool, err error) { genState.Distributions = append(genState.Distributions, &types.Distribution{ Time: &key, Amount: value, diff --git a/x/protocolpool/keeper/genesis_test.go b/x/protocolpool/keeper/genesis_test.go index f0149f662787..3a54ba84ce4b 100644 --- a/x/protocolpool/keeper/genesis_test.go +++ b/x/protocolpool/keeper/genesis_test.go @@ -32,7 +32,7 @@ func (suite *KeeperTestSuite) TestInitGenesis() { ) gs.Distributions = append(gs.Distributions, &types.Distribution{ - Amount: math.OneInt(), + Amount: types.DistributionAmount{Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100)))}, Time: &time.Time{}, }) @@ -40,7 +40,7 @@ func (suite *KeeperTestSuite) TestInitGenesis() { suite.Require().ErrorContains(err, "total to be distributed is greater than the last balance") // Set last balance - gs.LastBalance = math.NewInt(1) + gs.LastBalance = types.DistributionAmount{Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(1)))} err = suite.poolKeeper.InitGenesis(suite.ctx, gs) suite.Require().NoError(err) @@ -49,5 +49,5 @@ func (suite *KeeperTestSuite) TestInitGenesis() { suite.Require().NoError(err) suite.Require().Equal(gs.ContinuousFund, exportedGenState.ContinuousFund) suite.Require().Equal(gs.Budget, exportedGenState.Budget) - suite.Require().Equal(math.OneInt(), exportedGenState.LastBalance) + suite.Require().Equal(math.OneInt(), exportedGenState.LastBalance.Amount.AmountOf("stake")) } diff --git a/x/protocolpool/keeper/keeper.go b/x/protocolpool/keeper/keeper.go index f0d6cff755a7..3054e75df102 100644 --- a/x/protocolpool/keeper/keeper.go +++ b/x/protocolpool/keeper/keeper.go @@ -21,9 +21,8 @@ import ( type Keeper struct { appmodule.Environment - authKeeper types.AccountKeeper - bankKeeper types.BankKeeper - stakingKeeper types.StakingKeeper + authKeeper types.AccountKeeper + bankKeeper types.BankKeeper cdc codec.BinaryCodec @@ -34,16 +33,16 @@ type Keeper struct { BudgetProposal collections.Map[sdk.AccAddress, types.Budget] ContinuousFund collections.Map[sdk.AccAddress, types.ContinuousFund] // RecipientFundDistribution key: RecipientAddr | value: Claimable amount - RecipientFundDistribution collections.Map[sdk.AccAddress, math.Int] - Distributions collections.Map[time.Time, math.Int] // key: time.Time | value: amount - LastBalance collections.Item[math.Int] + RecipientFundDistribution collections.Map[sdk.AccAddress, types.DistributionAmount] + Distributions collections.Map[time.Time, types.DistributionAmount] // key: time.Time, denom | value: amounts + LastBalance collections.Item[types.DistributionAmount] } const ( errModuleAccountNotSet = "%s module account has not been set" ) -func NewKeeper(cdc codec.BinaryCodec, env appmodule.Environment, ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, authority string, +func NewKeeper(cdc codec.BinaryCodec, env appmodule.Environment, ak types.AccountKeeper, bk types.BankKeeper, authority string, ) Keeper { // ensure pool module account is set if addr := ak.GetModuleAddress(types.ModuleName); addr == nil { @@ -64,14 +63,13 @@ func NewKeeper(cdc codec.BinaryCodec, env appmodule.Environment, ak types.Accoun Environment: env, authKeeper: ak, bankKeeper: bk, - stakingKeeper: sk, cdc: cdc, authority: authority, BudgetProposal: collections.NewMap(sb, types.BudgetKey, "budget", sdk.AccAddressKey, codec.CollValue[types.Budget](cdc)), ContinuousFund: collections.NewMap(sb, types.ContinuousFundKey, "continuous_fund", sdk.AccAddressKey, codec.CollValue[types.ContinuousFund](cdc)), - RecipientFundDistribution: collections.NewMap(sb, types.RecipientFundDistributionKey, "recipient_fund_distribution", sdk.AccAddressKey, sdk.IntValue), - Distributions: collections.NewMap(sb, types.DistributionsKey, "distributions", sdk.TimeKey, sdk.IntValue), - LastBalance: collections.NewItem(sb, types.LastBalanceKey, "last_balance", sdk.IntValue), + RecipientFundDistribution: collections.NewMap(sb, types.RecipientFundDistributionKey, "recipient_fund_distribution", sdk.AccAddressKey, codec.CollValue[types.DistributionAmount](cdc)), + Distributions: collections.NewMap(sb, types.DistributionsKey, "distributions", sdk.TimeKey, codec.CollValue[types.DistributionAmount](cdc)), + LastBalance: collections.NewItem(sb, types.LastBalanceKey, "last_balance", codec.CollValue[types.DistributionAmount](cdc)), } schema, err := sb.Build() @@ -114,34 +112,27 @@ func (k Keeper) GetCommunityPool(ctx context.Context) (sdk.Coins, error) { return k.bankKeeper.GetAllBalances(ctx, moduleAccount.GetAddress()), nil } -func (k Keeper) withdrawRecipientFunds(ctx context.Context, recipient []byte) (sdk.Coin, error) { +func (k Keeper) withdrawRecipientFunds(ctx context.Context, recipient []byte) (sdk.Coins, error) { // get allocated continuous fund fundsAllocated, err := k.RecipientFundDistribution.Get(ctx, recipient) if err != nil { if errors.Is(err, collections.ErrNotFound) { - return sdk.Coin{}, types.ErrNoRecipientFound + return nil, types.ErrNoRecipientFound } - return sdk.Coin{}, err - } - - denom, err := k.stakingKeeper.BondDenom(ctx) - if err != nil { - return sdk.Coin{}, err + return nil, err } - // Distribute funds to the recipient from pool module account - withdrawnAmount := sdk.NewCoin(denom, fundsAllocated) - err = k.DistributeFromStreamFunds(ctx, sdk.NewCoins(withdrawnAmount), recipient) + err = k.DistributeFromStreamFunds(ctx, fundsAllocated.Amount, recipient) if err != nil { - return sdk.Coin{}, fmt.Errorf("error while distributing funds: %w", err) + return nil, fmt.Errorf("error while distributing funds: %w", err) } // reset fund distribution - err = k.RecipientFundDistribution.Set(ctx, recipient, math.ZeroInt()) + err = k.RecipientFundDistribution.Set(ctx, recipient, types.DistributionAmount{Amount: sdk.NewCoins()}) if err != nil { - return sdk.Coin{}, err + return nil, err } - return withdrawnAmount, nil + return fundsAllocated.Amount, nil } // SetToDistribute sets the amount to be distributed among recipients. @@ -152,30 +143,29 @@ func (k Keeper) SetToDistribute(ctx context.Context) error { return errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", types.ProtocolPoolDistrAccount) } - denom, err := k.stakingKeeper.BondDenom(ctx) - if err != nil { - return err - } - currentBalance := k.bankKeeper.GetAllBalances(ctx, moduleAccount.GetAddress()) - distributionBalance := currentBalance.AmountOf(denom) // if the balance is zero, return early - if distributionBalance.IsZero() { + if currentBalance.IsZero() { return nil } + // if the balance does not have any of the allowed denoms, return early // TODO + lastBalance, err := k.LastBalance.Get(ctx) if err != nil { if errors.Is(err, collections.ErrNotFound) { - lastBalance = math.ZeroInt() + lastBalance = types.DistributionAmount{Amount: sdk.NewCoins()} } else { return err } } // Calculate the amount to be distributed - amountToDistribute := distributionBalance.Sub(lastBalance) + amountToDistribute, anyNegative := currentBalance.SafeSub(lastBalance.Amount...) + if anyNegative { + return errors.New("error while calculating the amount to distribute, result can't be negative") + } // Check if there are any recipients to distribute to, if not, send straight to the community pool and avoid // setting the distributions @@ -190,24 +180,23 @@ func (k Keeper) SetToDistribute(ctx context.Context) error { // if there are no continuous funds, send all the funds to the community pool and reset the last balance if !hasContinuousFunds { - poolCoins := sdk.NewCoins(sdk.NewCoin(denom, amountToDistribute)) - if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ProtocolPoolDistrAccount, types.ModuleName, poolCoins); err != nil { + if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ProtocolPoolDistrAccount, types.ModuleName, amountToDistribute); err != nil { return err } - if !lastBalance.IsZero() { // only reset if the last balance is not zero (so we leave it at zero/nil) - return k.LastBalance.Set(ctx, math.ZeroInt()) + if !lastBalance.Amount.IsZero() { // only reset if the last balance is not zero (so we leave it at zero) + return k.LastBalance.Set(ctx, types.DistributionAmount{Amount: sdk.NewCoins()}) } return nil } - if err = k.Distributions.Set(ctx, k.HeaderService.HeaderInfo(ctx).Time, amountToDistribute); err != nil { + if err = k.Distributions.Set(ctx, k.HeaderService.HeaderInfo(ctx).Time, types.DistributionAmount{Amount: amountToDistribute}); err != nil { return fmt.Errorf("error while setting Distributions: %w", err) } // Update the last balance - return k.LastBalance.Set(ctx, distributionBalance) + return k.LastBalance.Set(ctx, types.DistributionAmount{Amount: currentBalance}) } func (k Keeper) IterateAndUpdateFundsDistribution(ctx context.Context) error { @@ -229,11 +218,11 @@ func (k Keeper) IterateAndUpdateFundsDistribution(ctx context.Context) error { } // next we iterate over the distributions, calculate each recipient's share and the remaining pool funds - toDistribute := map[string]math.Int{} - poolFunds := math.ZeroInt() - fullAmountToDistribute := math.ZeroInt() + toDistribute := map[string]sdk.Coins{} + poolFunds := sdk.NewCoins() + fullAmountToDistribute := sdk.NewCoins() - if err = k.Distributions.Walk(ctx, nil, func(key time.Time, amount math.Int) (stop bool, err error) { + if err = k.Distributions.Walk(ctx, nil, func(key time.Time, amount types.DistributionAmount) (stop bool, err error) { percentageToDistribute := math.LegacyZeroDec() for _, f := range funds { if f.Expiry != nil && f.Expiry.Before(key) { @@ -244,11 +233,14 @@ func (k Keeper) IterateAndUpdateFundsDistribution(ctx context.Context) error { _, ok := toDistribute[f.Recipient] if !ok { - toDistribute[f.Recipient] = math.ZeroInt() + toDistribute[f.Recipient] = sdk.NewCoins() + } + + for _, denom := range amount.Amount.Denoms() { + am := sdk.NewCoin(denom, f.Percentage.MulInt(amount.Amount.AmountOf(denom)).TruncateInt()) + toDistribute[f.Recipient] = toDistribute[f.Recipient].Add(am) + fullAmountToDistribute = fullAmountToDistribute.Add(am) } - amountToDistribute := f.Percentage.MulInt(amount).TruncateInt() - toDistribute[f.Recipient] = toDistribute[f.Recipient].Add(amountToDistribute) - fullAmountToDistribute = fullAmountToDistribute.Add(amountToDistribute) } // sanity check for max percentage @@ -256,8 +248,10 @@ func (k Keeper) IterateAndUpdateFundsDistribution(ctx context.Context) error { return true, errors.New("total funds percentage cannot exceed 100") } - remaining := math.LegacyOneDec().Sub(percentageToDistribute).MulInt(amount).RoundInt() - poolFunds = poolFunds.Add(remaining) + for _, denom := range amount.Amount.Denoms() { + remaining := sdk.NewCoin(denom, math.LegacyOneDec().Sub(percentageToDistribute).MulInt(amount.Amount.AmountOf(denom)).TruncateInt()) + poolFunds = poolFunds.Add(remaining) + } return false, nil }); err != nil { @@ -269,17 +263,12 @@ func (k Keeper) IterateAndUpdateFundsDistribution(ctx context.Context) error { return err } - if err = k.LastBalance.Set(ctx, math.ZeroInt()); err != nil { + if err = k.LastBalance.Set(ctx, types.DistributionAmount{Amount: sdk.NewCoins()}); err != nil { return err } // send the funds to the stream account to be distributed later, and the remaining to the community pool - bondDenom, err := k.stakingKeeper.BondDenom(ctx) - if err != nil { - return err - } - - streamAmt := sdk.NewCoins(sdk.NewCoin(bondDenom, fullAmountToDistribute)) + streamAmt := fullAmountToDistribute if !streamAmt.IsZero() { if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ProtocolPoolDistrAccount, types.StreamAccount, streamAmt); err != nil { return err @@ -287,8 +276,7 @@ func (k Keeper) IterateAndUpdateFundsDistribution(ctx context.Context) error { } if !poolFunds.IsZero() { - poolCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, poolFunds)) - if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ProtocolPoolDistrAccount, types.ModuleName, poolCoins); err != nil { + if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ProtocolPoolDistrAccount, types.ModuleName, poolFunds); err != nil { return err } } @@ -310,14 +298,14 @@ func (k Keeper) IterateAndUpdateFundsDistribution(ctx context.Context) error { toClaim, err := k.RecipientFundDistribution.Get(ctx, bzAddr) if err != nil { if errors.Is(err, collections.ErrNotFound) { - toClaim = math.ZeroInt() + toClaim = types.DistributionAmount{Amount: sdk.NewCoins()} } else { return err } } - amount := toClaim.Add(toDistribute[recipient]) - if err = k.RecipientFundDistribution.Set(ctx, bzAddr, amount); err != nil { + toClaim.Amount = toClaim.Amount.Add(toDistribute[recipient]...) + if err = k.RecipientFundDistribution.Set(ctx, bzAddr, toClaim); err != nil { return err } } diff --git a/x/protocolpool/keeper/keeper_test.go b/x/protocolpool/keeper/keeper_test.go index e4fc05d1a6a3..894cd0903da7 100644 --- a/x/protocolpool/keeper/keeper_test.go +++ b/x/protocolpool/keeper/keeper_test.go @@ -35,12 +35,11 @@ var ( type KeeperTestSuite struct { suite.Suite - ctx sdk.Context - environment appmodule.Environment - poolKeeper poolkeeper.Keeper - authKeeper *pooltestutil.MockAccountKeeper - bankKeeper *pooltestutil.MockBankKeeper - stakingKeeper *pooltestutil.MockStakingKeeper + ctx sdk.Context + environment appmodule.Environment + poolKeeper poolkeeper.Keeper + authKeeper *pooltestutil.MockAccountKeeper + bankKeeper *pooltestutil.MockBankKeeper msgServer types.MsgServer queryServer types.QueryServer @@ -66,10 +65,6 @@ func (s *KeeperTestSuite) SetupTest() { bankKeeper := pooltestutil.NewMockBankKeeper(ctrl) s.bankKeeper = bankKeeper - stakingKeeper := pooltestutil.NewMockStakingKeeper(ctrl) - stakingKeeper.EXPECT().BondDenom(ctx).Return("stake", nil).AnyTimes() - s.stakingKeeper = stakingKeeper - authority, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress(types.GovModuleName)) s.Require().NoError(err) @@ -78,7 +73,6 @@ func (s *KeeperTestSuite) SetupTest() { environment, accountKeeper, bankKeeper, - stakingKeeper, authority, ) s.ctx = ctx @@ -101,7 +95,6 @@ func (s *KeeperTestSuite) mockWithdrawContinuousFund() { distrBal := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000))) s.bankKeeper.EXPECT().GetAllBalances(gomock.Any(), gomock.Any()).Return(distrBal).AnyTimes() s.bankKeeper.EXPECT().SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() - s.stakingKeeper.EXPECT().BondDenom(gomock.Any()).Return("stake", nil).AnyTimes() } func (s *KeeperTestSuite) mockStreamFunds(distributed math.Int) { @@ -147,14 +140,14 @@ func (s *KeeperTestSuite) TestIterateAndUpdateFundsDistribution() { err = s.poolKeeper.IterateAndUpdateFundsDistribution(s.ctx) s.Require().NoError(err) - err = s.poolKeeper.RecipientFundDistribution.Walk(s.ctx, nil, func(key sdk.AccAddress, value math.Int) (stop bool, err error) { + err = s.poolKeeper.RecipientFundDistribution.Walk(s.ctx, nil, func(key sdk.AccAddress, value types.DistributionAmount) (stop bool, err error) { strAddr, err := s.authKeeper.AddressCodec().BytesToString(key) s.Require().NoError(err) if strAddr == "cosmos1qypq2q2l8z4wz2z2l8z4wz2z2l8z4wz2srklj6" { - s.Require().Equal(value, math.NewInt(300000)) + s.Require().Equal(value.Amount, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(300000)))) } else if strAddr == "cosmos1tygms3xhhs3yv487phx3dw4a95jn7t7lpm470r" { - s.Require().Equal(value, math.NewInt(300000)) + s.Require().Equal(value.Amount, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(300000)))) } return false, nil }) @@ -215,16 +208,16 @@ func (suite *KeeperTestSuite) TestSetToDistribute() { // Verify that LastBalance was set correctly lastBalance, err := suite.poolKeeper.LastBalance.Get(suite.ctx) suite.Require().NoError(err) - suite.Require().Equal(math.NewInt(1000000), lastBalance) + suite.Require().Equal(sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(1000000))), lastBalance.Amount) // Verify that a distribution was set - var distribution math.Int - err = suite.poolKeeper.Distributions.Walk(suite.ctx, nil, func(key time.Time, value math.Int) (bool, error) { + var distribution types.DistributionAmount + err = suite.poolKeeper.Distributions.Walk(suite.ctx, nil, func(key time.Time, value types.DistributionAmount) (bool, error) { distribution = value return true, nil }) suite.Require().NoError(err) - suite.Require().Equal(math.NewInt(1000000), distribution) + suite.Require().Equal(sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(1000000))), distribution.Amount) // Test case when balance is zero zeroBal := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.ZeroInt())) @@ -235,7 +228,7 @@ func (suite *KeeperTestSuite) TestSetToDistribute() { // Verify that no new distribution was set count := 0 - err = suite.poolKeeper.Distributions.Walk(suite.ctx, nil, func(key time.Time, value math.Int) (bool, error) { + err = suite.poolKeeper.Distributions.Walk(suite.ctx, nil, func(key time.Time, value types.DistributionAmount) (bool, error) { count++ return false, nil }) diff --git a/x/protocolpool/keeper/msg_server.go b/x/protocolpool/keeper/msg_server.go index 43caff3e42a2..ca53384e48c8 100644 --- a/x/protocolpool/keeper/msg_server.go +++ b/x/protocolpool/keeper/msg_server.go @@ -157,7 +157,7 @@ func (k MsgServer) CreateContinuousFund(ctx context.Context, msg *types.MsgCreat return nil, err } - err = k.RecipientFundDistribution.Set(ctx, recipient, math.ZeroInt()) + err = k.RecipientFundDistribution.Set(ctx, recipient, types.DistributionAmount{Amount: sdk.NewCoins()}) if err != nil { return nil, err } diff --git a/x/protocolpool/keeper/msg_server_test.go b/x/protocolpool/keeper/msg_server_test.go index b053ef9ff681..452b2263dad3 100644 --- a/x/protocolpool/keeper/msg_server_test.go +++ b/x/protocolpool/keeper/msg_server_test.go @@ -395,7 +395,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { recipientAddress []sdk.AccAddress expErr bool expErrMsg string - withdrawnAmount sdk.Coin + withdrawnAmount sdk.Coins }{ "empty recipient": { recipientAddress: []sdk.AccAddress{sdk.AccAddress([]byte(""))}, @@ -423,7 +423,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient, cf) suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) // Set fund 2 @@ -439,11 +439,11 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution suite.Require().NoError(err) - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient2, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient2, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) // Set ToDistribute - err = suite.poolKeeper.Distributions.Set(suite.ctx, suite.ctx.HeaderInfo().Time, math.NewInt(100000)) + err = suite.poolKeeper.Distributions.Set(suite.ctx, suite.ctx.HeaderInfo().Time, types.DistributionAmount{Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000)))}) suite.Require().NoError(err) }, recipientAddress: []sdk.AccAddress{recipient}, @@ -483,15 +483,15 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient, cf) suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) - err = suite.poolKeeper.Distributions.Set(suite.ctx, suite.ctx.HeaderInfo().Time, math.ZeroInt()) + err = suite.poolKeeper.Distributions.Set(suite.ctx, suite.ctx.HeaderInfo().Time, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) suite.mockStreamFunds(math.NewInt(0)) }, recipientAddress: []sdk.AccAddress{recipient}, expErr: false, - withdrawnAmount: sdk.NewCoin(sdk.DefaultBondDenom, math.ZeroInt()), + withdrawnAmount: nil, }, "valid case with empty expiry": { preRun: func() { @@ -505,7 +505,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient, cf) suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) suite.mockStreamFunds(math.NewInt(100000)) err = suite.poolKeeper.SetToDistribute(suite.ctx) @@ -513,7 +513,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { }, recipientAddress: []sdk.AccAddress{recipient}, expErr: false, - withdrawnAmount: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(20000)), + withdrawnAmount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(20000))), }, "valid case": { preRun: func() { @@ -530,7 +530,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient, cf) suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) suite.mockStreamFunds(math.NewInt(100000)) err = suite.poolKeeper.SetToDistribute(suite.ctx) @@ -538,7 +538,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { }, recipientAddress: []sdk.AccAddress{recipient}, expErr: false, - withdrawnAmount: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(20000)), + withdrawnAmount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(20000))), }, "valid case with multiple funds": { preRun: func() { @@ -556,7 +556,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient, cf) suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) // Set continuous fund 2 @@ -571,7 +571,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient2, cf) suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient2, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient2, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) // Set continuous fund 3 @@ -586,7 +586,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient3, cf) suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient3, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient3, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) suite.mockStreamFunds(math.NewInt(100000)) @@ -595,7 +595,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { }, recipientAddress: []sdk.AccAddress{recipient, recipient2, recipient3}, expErr: false, - withdrawnAmount: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(30000)), + withdrawnAmount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(30000))), }, } @@ -625,10 +625,10 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { if len(tc.recipientAddress) > 1 { toClaim, err := suite.poolKeeper.RecipientFundDistribution.Get(suite.ctx, tc.recipientAddress[1]) suite.Require().NoError(err) - suite.Require().Equal(toClaim, math.NewInt(20000)) + suite.Require().Equal(toClaim.Amount, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(20000)))) toClaim, err = suite.poolKeeper.RecipientFundDistribution.Get(suite.ctx, tc.recipientAddress[2]) suite.Require().NoError(err) - suite.Require().Equal(toClaim, math.NewInt(30000)) + suite.Require().Equal(toClaim.Amount, sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(30000)))) } } }) @@ -794,7 +794,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { expErr bool expErrMsg string postRun func() - withdrawnFunds sdk.Coin + withdrawnFunds sdk.Coins }{ "empty recipient": { preRun: func() { @@ -829,7 +829,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipientAddr, cf) suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipientAddr, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipientAddr, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) // Set fund 2 @@ -844,7 +844,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient2, cf) suite.Require().NoError(err) // Set recipient fund percentage and recipient fund distribution - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient2, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient2, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) // Set ToDistribute @@ -865,7 +865,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { suite.Require().Error(err) suite.Require().ErrorIs(err, collections.ErrNotFound) }, - withdrawnFunds: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(20000)), + withdrawnFunds: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(20000))), }, "all good": { preRun: func() { @@ -881,7 +881,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { suite.mockWithdrawContinuousFund() err = suite.poolKeeper.ContinuousFund.Set(suite.ctx, recipient3, cf) suite.Require().NoError(err) - err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient3, math.ZeroInt()) + err = suite.poolKeeper.RecipientFundDistribution.Set(suite.ctx, recipient3, types.DistributionAmount{Amount: sdk.NewCoins()}) suite.Require().NoError(err) }, recipientAddr: recipient3, @@ -891,7 +891,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { suite.Require().Error(err) suite.Require().ErrorIs(err, collections.ErrNotFound) }, - withdrawnFunds: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)), + withdrawnFunds: nil, }, } @@ -988,7 +988,7 @@ func (suite *KeeperTestSuite) TestWithdrawExpiredFunds() { RecipientAddress: recipient2StrAddr, }) suite.Require().NoError(err) - suite.Require().Equal(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)), res.WithdrawnAllocatedFund) + suite.Require().Nil(res.WithdrawnAllocatedFund) // canceling an expired continuous fund, won't error res, err = suite.msgServer.CancelContinuousFund(suite.ctx, &types.MsgCancelContinuousFund{ @@ -996,7 +996,7 @@ func (suite *KeeperTestSuite) TestWithdrawExpiredFunds() { RecipientAddress: recipientStrAddr, }) suite.Require().NoError(err) - suite.Require().Equal(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)), res.WithdrawnAllocatedFund) + suite.Require().Nil(res.WithdrawnAllocatedFund) // if we try to cancel again the same continuout fund, it won't error, it will still distribute funds if needed. res, err = suite.msgServer.CancelContinuousFund(suite.ctx, &types.MsgCancelContinuousFund{ @@ -1004,7 +1004,7 @@ func (suite *KeeperTestSuite) TestWithdrawExpiredFunds() { RecipientAddress: recipientStrAddr, }) suite.Require().NoError(err) - suite.Require().True(res.WithdrawnAllocatedFund.IsNil()) + suite.Require().True(res.WithdrawnAllocatedFund.IsZero()) } func (suite *KeeperTestSuite) TestFundCommunityPool() { diff --git a/x/protocolpool/proto/cosmos/protocolpool/v1/genesis.proto b/x/protocolpool/proto/cosmos/protocolpool/v1/genesis.proto index d9df6870a7a4..d201fa197280 100644 --- a/x/protocolpool/proto/cosmos/protocolpool/v1/genesis.proto +++ b/x/protocolpool/proto/cosmos/protocolpool/v1/genesis.proto @@ -17,11 +17,7 @@ message GenesisState { // last_balance contains the amount of tokens yet to be distributed, will be zero if // there are no funds to distribute. - string last_balance = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false - ]; + DistributionAmount last_balance = 3 [(gogoproto.nullable) = false]; // distributions contains the list of distributions to be made to continuous // funds and budgets. It contains time in order to distribute to non-expired @@ -30,11 +26,7 @@ message GenesisState { } message Distribution { - string amount = 3 [ - (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false - ]; + google.protobuf.Timestamp time = 1 [(gogoproto.stdtime) = true]; - google.protobuf.Timestamp time = 6 [(gogoproto.stdtime) = true]; + DistributionAmount amount = 2 [(gogoproto.nullable) = false]; } \ No newline at end of file diff --git a/x/protocolpool/proto/cosmos/protocolpool/v1/tx.proto b/x/protocolpool/proto/cosmos/protocolpool/v1/tx.proto index df8949d9ac99..eb2beab336b7 100644 --- a/x/protocolpool/proto/cosmos/protocolpool/v1/tx.proto +++ b/x/protocolpool/proto/cosmos/protocolpool/v1/tx.proto @@ -155,7 +155,7 @@ message MsgCancelContinuousFundResponse { // withdrawnAllocatedFund represents the fund allocated to this recipient (if any) that have not been withdrawn yet, // before a cancellation request has been initiated. // It involves first withdrawing the funds and then canceling the request. - cosmos.base.v1beta1.Coin withdrawn_allocated_fund = 4 + repeated cosmos.base.v1beta1.Coin withdrawn_allocated_fund = 4 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; ; } @@ -169,7 +169,7 @@ message MsgWithdrawContinuousFund { // MsgWithdrawContinuousFundResponse defines the response to executing a // MsgWithdrawContinuousFund message. message MsgWithdrawContinuousFundResponse { - cosmos.base.v1beta1.Coin amount = 1 + repeated cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; ; } diff --git a/x/protocolpool/proto/cosmos/protocolpool/v1/types.proto b/x/protocolpool/proto/cosmos/protocolpool/v1/types.proto index 008c1bd3d171..dd1360f348ea 100644 --- a/x/protocolpool/proto/cosmos/protocolpool/v1/types.proto +++ b/x/protocolpool/proto/cosmos/protocolpool/v1/types.proto @@ -8,6 +8,7 @@ import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; +import "amino/amino.proto"; // Budget defines the fields of a budget proposal. message Budget { @@ -41,3 +42,13 @@ message ContinuousFund { // Optional, if expiry is set, removes the state object when expired. google.protobuf.Timestamp expiry = 3 [(gogoproto.stdtime) = true]; } + +// DistributionAmount is used to store the coins of periodic distributions. +message DistributionAmount { + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" + ]; +} \ No newline at end of file diff --git a/x/protocolpool/testutil/expected_keepers_mocks.go b/x/protocolpool/testutil/expected_keepers_mocks.go index 9bbdfc58284b..bd775d35bdc1 100644 --- a/x/protocolpool/testutil/expected_keepers_mocks.go +++ b/x/protocolpool/testutil/expected_keepers_mocks.go @@ -184,41 +184,3 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } - -// MockStakingKeeper is a mock of StakingKeeper interface. -type MockStakingKeeper struct { - ctrl *gomock.Controller - recorder *MockStakingKeeperMockRecorder -} - -// MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. -type MockStakingKeeperMockRecorder struct { - mock *MockStakingKeeper -} - -// NewMockStakingKeeper creates a new mock instance. -func NewMockStakingKeeper(ctrl *gomock.Controller) *MockStakingKeeper { - mock := &MockStakingKeeper{ctrl: ctrl} - mock.recorder = &MockStakingKeeperMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { - return m.recorder -} - -// BondDenom mocks base method. -func (m *MockStakingKeeper) BondDenom(ctx context.Context) (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BondDenom", ctx) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// BondDenom indicates an expected call of BondDenom. -func (mr *MockStakingKeeperMockRecorder) BondDenom(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BondDenom", reflect.TypeOf((*MockStakingKeeper)(nil).BondDenom), ctx) -} diff --git a/x/protocolpool/types/expected_keepers.go b/x/protocolpool/types/expected_keepers.go index d967ca5c1a1a..ae7adc3a3d80 100644 --- a/x/protocolpool/types/expected_keepers.go +++ b/x/protocolpool/types/expected_keepers.go @@ -23,7 +23,3 @@ type BankKeeper interface { SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error } - -type StakingKeeper interface { - BondDenom(ctx context.Context) (string, error) -} diff --git a/x/protocolpool/types/genesis.go b/x/protocolpool/types/genesis.go index 08ad95eaf4bd..32640a754aa0 100644 --- a/x/protocolpool/types/genesis.go +++ b/x/protocolpool/types/genesis.go @@ -6,6 +6,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -13,7 +14,7 @@ func NewGenesisState(cf []*ContinuousFund, budget []*Budget) *GenesisState { return &GenesisState{ ContinuousFund: cf, Budget: budget, - LastBalance: math.ZeroInt(), + LastBalance: DistributionAmount{Amount: sdk.NewCoins()}, Distributions: []*Distribution{}, } } diff --git a/x/protocolpool/types/genesis.pb.go b/x/protocolpool/types/genesis.pb.go index 8118de396b5e..91578a02ea9e 100644 --- a/x/protocolpool/types/genesis.pb.go +++ b/x/protocolpool/types/genesis.pb.go @@ -4,7 +4,6 @@ package types import ( - cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/gogoproto/gogoproto" @@ -37,7 +36,7 @@ type GenesisState struct { Budget []*Budget `protobuf:"bytes,2,rep,name=budget,proto3" json:"budget,omitempty"` // last_balance contains the amount of tokens yet to be distributed, will be zero if // there are no funds to distribute. - LastBalance cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=last_balance,json=lastBalance,proto3,customtype=cosmossdk.io/math.Int" json:"last_balance"` + LastBalance DistributionAmount `protobuf:"bytes,3,opt,name=last_balance,json=lastBalance,proto3" json:"last_balance"` // distributions contains the list of distributions to be made to continuous // funds and budgets. It contains time in order to distribute to non-expired // funds only. @@ -91,6 +90,13 @@ func (m *GenesisState) GetBudget() []*Budget { return nil } +func (m *GenesisState) GetLastBalance() DistributionAmount { + if m != nil { + return m.LastBalance + } + return DistributionAmount{} +} + func (m *GenesisState) GetDistributions() []*Distribution { if m != nil { return m.Distributions @@ -99,8 +105,8 @@ func (m *GenesisState) GetDistributions() []*Distribution { } type Distribution struct { - Amount cosmossdk_io_math.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` - Time *time.Time `protobuf:"bytes,6,opt,name=time,proto3,stdtime" json:"time,omitempty"` + Time *time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time,omitempty"` + Amount DistributionAmount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` } func (m *Distribution) Reset() { *m = Distribution{} } @@ -143,6 +149,13 @@ func (m *Distribution) GetTime() *time.Time { return nil } +func (m *Distribution) GetAmount() DistributionAmount { + if m != nil { + return m.Amount + } + return DistributionAmount{} +} + func init() { proto.RegisterType((*GenesisState)(nil), "cosmos.protocolpool.v1.GenesisState") proto.RegisterType((*Distribution)(nil), "cosmos.protocolpool.v1.Distribution") @@ -153,32 +166,31 @@ func init() { } var fileDescriptor_72560a99455b4146 = []byte{ - // 393 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xcf, 0xca, 0xd3, 0x40, - 0x14, 0xc5, 0x33, 0x5f, 0x4b, 0xc0, 0x69, 0x55, 0x08, 0x2a, 0x31, 0x8b, 0xa4, 0x96, 0x22, 0x05, - 0x71, 0x42, 0xab, 0xb8, 0x71, 0x97, 0x8a, 0x52, 0x17, 0x0a, 0xd1, 0x95, 0x9b, 0x92, 0x3f, 0xd3, - 0x18, 0x4c, 0xe6, 0x86, 0xce, 0x4c, 0xd1, 0x47, 0x70, 0xd7, 0x77, 0xd1, 0x87, 0xe8, 0xb2, 0xb8, - 0x12, 0x17, 0x55, 0xda, 0x17, 0x91, 0xce, 0xa4, 0x92, 0x80, 0xdd, 0x7c, 0xbb, 0xc9, 0xbd, 0xbf, - 0x73, 0x72, 0xe0, 0x5c, 0x3c, 0x4a, 0x80, 0x97, 0xc0, 0xfd, 0x6a, 0x05, 0x02, 0x12, 0x28, 0x2a, - 0x80, 0xc2, 0x5f, 0x4f, 0xfc, 0x8c, 0x32, 0xca, 0x73, 0x4e, 0xd4, 0xdc, 0xba, 0xa7, 0x29, 0xd2, - 0xa4, 0xc8, 0x7a, 0xe2, 0x0c, 0x2f, 0xa8, 0xc5, 0x97, 0x8a, 0xd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- 0xde, 0x9a, 0x61, 0x33, 0x2a, 0x41, 0x32, 0x71, 0x9d, 0x98, 0xb5, 0xd4, 0x7a, 0x8a, 0xbb, 0xa7, - 0x7a, 0x6c, 0x73, 0x80, 0xc6, 0xbd, 0xa9, 0x43, 0x74, 0x77, 0xe4, 0xdc, 0x1d, 0x79, 0x7f, 0xee, - 0x2e, 0xe8, 0x6e, 0x7e, 0x7b, 0x28, 0x54, 0x74, 0xf0, 0x7c, 0x7b, 0x70, 0xd1, 0xee, 0xe0, 0xa2, - 0x3f, 0x07, 0x17, 0x6d, 0x8e, 0xae, 0xb1, 0x3b, 0xba, 0xc6, 0xcf, 0xa3, 0x6b, 0x7c, 0x78, 0xd0, - 0xfa, 0xf9, 0xe7, 0xf6, 0x65, 0xa9, 0xb3, 0x8a, 0x4d, 0x35, 0x7b, 0xf2, 0x37, 0x00, 0x00, 0xff, - 0xff, 0x0c, 0x77, 0xdd, 0xf7, 0xbb, 0x02, 0x00, 0x00, + // 380 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x4f, 0x6b, 0xdb, 0x30, + 0x18, 0xc6, 0xad, 0xc4, 0xe4, 0xa0, 0x64, 0x1b, 0x98, 0x31, 0x3c, 0x1f, 0x9c, 0x2c, 0x84, 0x11, + 0x76, 0x90, 0x49, 0x36, 0x76, 0xd9, 0x69, 0xde, 0xd8, 0x4a, 0x2f, 0x05, 0xa7, 0xa7, 0x5e, 0x82, + 0xff, 0x28, 0xc6, 0xd4, 0xd6, 0x6b, 0x22, 0x29, 0xb4, 0x5f, 0xa2, 0xe4, 0xe3, 0xf4, 0x23, 0xe4, + 0x98, 0x63, 0x4f, 0x6d, 0x49, 0xbe, 0x48, 0x89, 0xe4, 0x14, 0x07, 0x1a, 0x28, 0xbd, 0xc9, 0xaf, + 0x7e, 0xcf, 0x8f, 0xc7, 0x2f, 0xc2, 0x83, 0x18, 0x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25, 0x35, + 0x90, 0xdb, 0xa6, 0xea, 0x34, 0x78, 0x8d, 0x35, 0x38, 0x8c, 0xf6, 0x6f, 0x10, 0xee, 0xd4, 0xef, + 0xad, 0x1f, 0xd8, 0xdc, 0xad, 0xd7, 0x46, 0xaa, 0xa9, 0x43, 0xf4, 0xee, 0xc9, 0x7e, 0xf7, 0xe4, + 0x7c, 0xbf, 0x7b, 0xdf, 0x5c, 0x3e, 0x74, 0x51, 0xa0, 0x68, 0xeb, 0x04, 0xb7, 0x42, 0xd5, 0xd7, + 0x6e, 0xbc, 0xf1, 0x0f, 0xab, 0xbc, 0xff, 0x6b, 0xb5, 0x71, 0xd1, 0x7a, 0xe3, 0xa2, 0xc7, 0x8d, + 0x8b, 0x96, 0x5b, 0xd7, 0x58, 0x6f, 0x5d, 0xe3, 0x6e, 0xeb, 0x1a, 0x17, 0x5f, 0xb4, 0x92, 0x27, + 0x97, 0x24, 0x03, 0xef, 0xea, 0xf0, 0x8d, 0xa9, 0x07, 0x16, 0xb5, 0xd4, 0xec, 0xfb, 0x53, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xbb, 0x84, 0x93, 0x27, 0xc5, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -216,11 +228,11 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { } } { - size := m.LastBalance.Size() - i -= size - if _, err := m.LastBalance.MarshalTo(dAtA[i:]); err != nil { + size, err := m.LastBalance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- @@ -276,26 +288,26 @@ func (m *Distribution) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Time != nil { - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Time):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintGenesis(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x32 - } { - size := m.Amount.Size() - i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 + if m.Time != nil { + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Time):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintGenesis(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -345,12 +357,12 @@ func (m *Distribution) Size() (n int) { } var l int _ = l - l = m.Amount.Size() - n += 1 + l + sovGenesis(uint64(l)) if m.Time != nil { l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Time) n += 1 + l + sovGenesis(uint64(l)) } + l = m.Amount.Size() + n += 1 + l + sovGenesis(uint64(l)) return n } @@ -461,7 +473,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastBalance", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -471,16 +483,15 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } @@ -575,11 +586,11 @@ func (m *Distribution) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Distribution: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 3: + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -589,29 +600,31 @@ func (m *Distribution) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenesis } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenesis } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Time == nil { + m.Time = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Time, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -638,10 +651,7 @@ func (m *Distribution) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Time == nil { - m.Time = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Time, dAtA[iNdEx:postIndex]); err != nil { + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/protocolpool/types/tx.pb.go b/x/protocolpool/types/tx.pb.go index c6269e973942..4dedd8f29c1e 100644 --- a/x/protocolpool/types/tx.pb.go +++ b/x/protocolpool/types/tx.pb.go @@ -611,7 +611,7 @@ type MsgCancelContinuousFundResponse struct { // withdrawnAllocatedFund represents the fund allocated to this recipient (if any) that have not been withdrawn yet, // before a cancellation request has been initiated. // It involves first withdrawing the funds and then canceling the request. - WithdrawnAllocatedFund types.Coin `protobuf:"bytes,4,opt,name=withdrawn_allocated_fund,json=withdrawnAllocatedFund,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"withdrawn_allocated_fund"` + WithdrawnAllocatedFund github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=withdrawn_allocated_fund,json=withdrawnAllocatedFund,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"withdrawn_allocated_fund"` } func (m *MsgCancelContinuousFundResponse) Reset() { *m = MsgCancelContinuousFundResponse{} } @@ -668,11 +668,11 @@ func (m *MsgCancelContinuousFundResponse) GetRecipientAddress() string { return "" } -func (m *MsgCancelContinuousFundResponse) GetWithdrawnAllocatedFund() types.Coin { +func (m *MsgCancelContinuousFundResponse) GetWithdrawnAllocatedFund() github_com_cosmos_cosmos_sdk_types.Coins { if m != nil { return m.WithdrawnAllocatedFund } - return types.Coin{} + return nil } // MsgWithdrawContinuousFund defines a message for withdrawing the continuous fund allocated to it. @@ -723,7 +723,7 @@ func (m *MsgWithdrawContinuousFund) GetRecipientAddress() string { // MsgWithdrawContinuousFundResponse defines the response to executing a // MsgWithdrawContinuousFund message. type MsgWithdrawContinuousFundResponse struct { - Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` } func (m *MsgWithdrawContinuousFundResponse) Reset() { *m = MsgWithdrawContinuousFundResponse{} } @@ -759,11 +759,11 @@ func (m *MsgWithdrawContinuousFundResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawContinuousFundResponse proto.InternalMessageInfo -func (m *MsgWithdrawContinuousFundResponse) GetAmount() types.Coin { +func (m *MsgWithdrawContinuousFundResponse) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { if m != nil { return m.Amount } - return types.Coin{} + return nil } func init() { @@ -786,70 +786,70 @@ func init() { func init() { proto.RegisterFile("cosmos/protocolpool/v1/tx.proto", fileDescriptor_09efe14517e7f6dc) } var fileDescriptor_09efe14517e7f6dc = []byte{ - // 1006 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcf, 0x6f, 0x1b, 0x45, + // 1008 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, 0x14, 0xf6, 0xc4, 0xae, 0x55, 0x4f, 0x21, 0xb4, 0xab, 0xe0, 0x6e, 0x96, 0xe2, 0x4d, 0x7c, 0x80, 0xa8, 0x22, 0xbb, 0xb8, 0x40, 0x0b, 0xe1, 0x80, 0xea, 0x84, 0x5f, 0x12, 0x96, 0xc2, 0xa6, 0x12, 0x12, 0x17, 0x6b, 0xbc, 0x3b, 0x5d, 0x8f, 0xba, 0xbb, 0xb3, 0xda, 0x99, 0x4d, 0xe2, 0x4a, 0x48, 0x15, 0x12, 0xd0, 0x63, 0x8f, 0x1c, 0x7b, 0x42, 0x88, 0x53, 0x0f, 0xfd, 0x23, 0x2a, 0x71, 0xa9, - 0x7a, 0x42, 0x1c, 0x5a, 0x94, 0x20, 0x95, 0xbf, 0x81, 0x13, 0xda, 0x9d, 0xf1, 0xda, 0x8e, 0xd7, - 0x9b, 0xba, 0x4a, 0x38, 0xd9, 0x7e, 0xf3, 0xbe, 0xf7, 0xbe, 0xf7, 0xcd, 0x7b, 0x33, 0x63, 0xa8, - 0xdb, 0x94, 0xf9, 0x94, 0x99, 0x61, 0x44, 0x39, 0xb5, 0xa9, 0x17, 0x52, 0xea, 0x99, 0xbb, 0x2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x50, 0x2b, 0x69, 0x00, 0xcd, - 0x10, 0xc3, 0x60, 0x0c, 0x87, 0xc1, 0xb8, 0x31, 0x9c, 0x96, 0x76, 0xe5, 0xde, 0x33, 0x1d, 0x58, - 0xb5, 0x14, 0x93, 0x58, 0x15, 0x0d, 0x9e, 0x95, 0xe9, 0x99, 0x7a, 0x66, 0x05, 0xac, 0x55, 0xac, - 0xec, 0xb7, 0x72, 0x0d, 0x56, 0x43, 0x1c, 0x11, 0xea, 0xa8, 0x55, 0xc9, 0xec, 0x68, 0xe0, 0x2d, - 0x39, 0x65, 0xed, 0xca, 0xcf, 0x49, 0x5c, 0xe9, 0x3e, 0xb5, 0x55, 0xab, 0x50, 0x9f, 0xb1, 0x11, - 0xd9, 0x66, 0x51, 0xb8, 0x98, 0xec, 0xa6, 0x87, 0x88, 0x2f, 0x3c, 0xf2, 0xa5, 0x06, 0xf3, 0x4a, - 0xbd, 0x51, 0x4f, 0xb8, 0x4c, 0x47, 0x6a, 0x7e, 0x07, 0xeb, 0x93, 0x09, 0x87, 0x54, 0x26, 0x8e, - 0x04, 0x70, 0x4a, 0xdd, 0xdc, 0xfc, 0x65, 0x21, 0x6d, 0xce, 0xcd, 0x08, 0x23, 0x8e, 0x37, 0x69, - 0xc0, 0x49, 0x10, 0xd3, 0x98, 0x25, 0x33, 0xfd, 0xd2, 0xcd, 0x79, 0x75, 0x6a, 0x48, 0x8b, 0x70, - 0xa3, 0xf1, 0xfd, 0x1a, 0xc2, 0x10, 0x47, 0x36, 0x0e, 0x38, 0x72, 0x45, 0x17, 0xd6, 0xda, 0xad, - 0xa4, 0xb2, 0x3f, 0x9f, 0xea, 0x6f, 0x08, 0x30, 0x73, 0x6e, 0x19, 0x84, 0x9a, 0x3e, 0xe2, 0x7d, - 0xe3, 0x2b, 0xec, 0x22, 0x7b, 0xb0, 0x85, 0xed, 0x27, 0x0f, 0xd7, 0xa1, 0x8c, 0xbd, 0x85, 0x6d, - 0x6b, 0x2c, 0x88, 0xf2,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 0x90, 0x3f, 0xeb, 0x0c, 0xd9, 0xd3, + 0x42, 0xfb, 0x70, 0x16, 0xef, 0xbc, 0xca, 0xdb, 0x50, 0x91, 0x3c, 0x42, 0xd6, 0x0b, 0x62, 0x4d, + 0xbb, 0x6b, 0x1f, 0xcd, 0xe4, 0x9e, 0xe7, 0xbe, 0x03, 0xe0, 0x92, 0xf4, 0xee, 0x37, 0x0b, 0xe2, + 0xc9, 0x00, 0xda, 0xb5, 0x19, 0x01, 0x39, 0x05, 0x0c, 0xcf, 0x8d, 0xdf, 0x68, 0xef, 0x14, 0x15, + 0x32, 0xf2, 0xd3, 0x8c, 0x97, 0xf3, 0x9b, 0xa8, 0x54, 0x7a, 0x91, 0x14, 0x55, 0x2a, 0x03, 0x14, + 0x56, 0x5a, 0x74, 0x04, 0x2b, 0x3f, 0x03, 0x58, 0x3f, 0x66, 0xdc, 0x5a, 0x05, 0x31, 0xe5, 0x10, + 0xed, 0x93, 0x99, 0x21, 0x93, 0x5a, 0xc8, 0x2e, 0x82, 0x42, 0x2d, 0x24, 0x80, 0x62, 0x2d, 0x0a, + 0xce, 0x6f, 0xed, 0xcc, 0x9d, 0xe7, 0x0f, 0x2e, 0x83, 0xf6, 0xa7, 0x8f, 0x0e, 0x1a, 0xe0, 0xf1, + 0x41, 0x03, 0xfc, 0x73, 0xd0, 0x00, 0xf7, 0x0e, 0x1b, 0xa5, 0xc7, 0x87, 0x8d, 0xd2, 0x5f, 0x87, + 0x8d, 0xd2, 0xf7, 0xab, 0x13, 0x77, 0xea, 0xfe, 0xe4, 0x1f, 0xaf, 0x74, 0x8e, 0x7b, 0xd5, 0xd4, + 0xf6, 0xc1, 0x8b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x51, 0x4c, 0x11, 0xbb, 0x9c, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1609,16 +1609,20 @@ func (m *MsgCancelContinuousFundResponse) MarshalToSizedBuffer(dAtA []byte) (int _ = i var l int _ = l - { - size, err := m.WithdrawnAllocatedFund.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.WithdrawnAllocatedFund) > 0 { + for iNdEx := len(m.WithdrawnAllocatedFund) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.WithdrawnAllocatedFund[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x22 if len(m.RecipientAddress) > 0 { i -= len(m.RecipientAddress) copy(dAtA[i:], m.RecipientAddress) @@ -1631,12 +1635,12 @@ func (m *MsgCancelContinuousFundResponse) MarshalToSizedBuffer(dAtA []byte) (int i-- dAtA[i] = 0x10 } - n7, err7 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CanceledTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CanceledTime):]) - if err7 != nil { - return 0, err7 + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CanceledTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CanceledTime):]) + if err6 != nil { + return 0, err6 } - i -= n7 - i = encodeVarintTx(dAtA, i, uint64(n7)) + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -1692,16 +1696,20 @@ func (m *MsgWithdrawContinuousFundResponse) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l - { - size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1905,8 +1913,12 @@ func (m *MsgCancelContinuousFundResponse) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.WithdrawnAllocatedFund.Size() - n += 1 + l + sovTx(uint64(l)) + if len(m.WithdrawnAllocatedFund) > 0 { + for _, e := range m.WithdrawnAllocatedFund { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -1929,8 +1941,12 @@ func (m *MsgWithdrawContinuousFundResponse) Size() (n int) { } var l int _ = l - l = m.Amount.Size() - 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)) + } + } return n } @@ -3250,7 +3266,8 @@ func (m *MsgCancelContinuousFundResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WithdrawnAllocatedFund.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.WithdrawnAllocatedFund = append(m.WithdrawnAllocatedFund, types.Coin{}) + if err := m.WithdrawnAllocatedFund[len(m.WithdrawnAllocatedFund)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3415,7 +3432,8 @@ func (m *MsgWithdrawContinuousFundResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + 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 diff --git a/x/protocolpool/types/types.pb.go b/x/protocolpool/types/types.pb.go index a5780df1d27b..30043d3f2102 100644 --- a/x/protocolpool/types/types.pb.go +++ b/x/protocolpool/types/types.pb.go @@ -7,7 +7,9 @@ import ( cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" @@ -182,9 +184,55 @@ func (m *ContinuousFund) GetExpiry() *time.Time { return nil } +// DistributionAmount is used to store the coins of periodic distributions. +type DistributionAmount struct { + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` +} + +func (m *DistributionAmount) Reset() { *m = DistributionAmount{} } +func (m *DistributionAmount) String() string { return proto.CompactTextString(m) } +func (*DistributionAmount) ProtoMessage() {} +func (*DistributionAmount) Descriptor() ([]byte, []int) { + return fileDescriptor_c1b7d0ea246d7f44, []int{2} +} +func (m *DistributionAmount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DistributionAmount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DistributionAmount.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 *DistributionAmount) XXX_Merge(src proto.Message) { + xxx_messageInfo_DistributionAmount.Merge(m, src) +} +func (m *DistributionAmount) XXX_Size() int { + return m.Size() +} +func (m *DistributionAmount) XXX_DiscardUnknown() { + xxx_messageInfo_DistributionAmount.DiscardUnknown(m) +} + +var xxx_messageInfo_DistributionAmount proto.InternalMessageInfo + +func (m *DistributionAmount) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Amount + } + return nil +} + func init() { proto.RegisterType((*Budget)(nil), "cosmos.protocolpool.v1.Budget") proto.RegisterType((*ContinuousFund)(nil), "cosmos.protocolpool.v1.ContinuousFund") + proto.RegisterType((*DistributionAmount)(nil), "cosmos.protocolpool.v1.DistributionAmount") } func init() { @@ -192,39 +240,44 @@ func init() { } var fileDescriptor_c1b7d0ea246d7f44 = []byte{ - // 502 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0x8e, 0x69, 0x88, 0x94, 0x83, 0x94, 0x72, 0xaa, 0x90, 0x1b, 0x24, 0x27, 0x84, 0x25, 0x4b, - 0xcf, 0x0a, 0x48, 0x80, 0xc4, 0x42, 0x9d, 0xf0, 0x31, 0x74, 0x80, 0xd0, 0x89, 0xc5, 0x3a, 0xdb, - 0x6f, 0xdc, 0x13, 0xf6, 0x9d, 0x75, 0x77, 0x8e, 0x9a, 0x95, 0x5f, 0xd0, 0x91, 0x1f, 0xd2, 0x1f, - 0xd1, 0xb1, 0xaa, 0x84, 0x84, 0x18, 0x0a, 0x4a, 0xfe, 0x08, 0x8a, 0xef, 0x12, 0xd2, 0x2e, 0x65, - 0xb3, 0xde, 0xe7, 0xc3, 0xcf, 0xf3, 0x9e, 0x5e, 0xd4, 0x8b, 0x85, 0xca, 0x85, 0xf2, 0x0b, 0x29, - 0xb4, 0x88, 0x45, 0x56, 0x08, 0x91, 0xf9, 0xd3, 0x81, 0xaf, 0x67, 0x05, 0x28, 0x52, 0x4d, 0xf1, - 0x23, 0xc3, 0x21, 0x9b, 0x1c, 0x32, 0x1d, 0xb4, 0x77, 0x53, 0x91, 0x8a, 0x6a, 0xe8, 0x2f, 0xbf, - 0x0c, 0xde, 0xde, 0x33, 0xec, 0xd0, 0x00, 0x9b, 0xd2, 0xb6, 0x67, 0x7f, 0x16, 0x51, 0x05, 0xfe, - 0x74, 0x10, 0x81, 0xa6, 0x03, 0x3f, 0x16, 0x8c, 0x5b, 0xbc, 0x93, 0x0a, 0x91, 0x66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xf2, 0xc8, 0x48, 0xf0, 0x4b, 0xd4, 0x28, 0x40, 0x32, 0x91, 0xb8, 0x0d, - 0x2b, 0xbe, 0x19, 0x77, 0x64, 0x97, 0x1f, 0xd4, 0xbf, 0x2f, 0xd3, 0x5a, 0x7a, 0xef, 0x87, 0x83, - 0xb6, 0x87, 0x82, 0x6b, 0xc6, 0x4b, 0x51, 0xaa, 0x77, 0x25, 0x4f, 0xf0, 0x0b, 0xd4, 0x5c, 0x6f, - 0xf6, 0xd6, 0x47, 0xf8, 0x47, 0xc5, 0x9f, 0x10, 0x2a, 0x40, 0xc6, 0xc0, 0x35, 0x4d, 0xa1, 0xda, - 0x7c, 0x33, 0x18, 0x9c, 0x5f, 0x75, 0x6a, 0xbf, 0xae, 0x3a, 0x8f, 0x8d, 0x58, 0x25, 0x5f, 0x09, - 0x13, 0x7e, 0x4e, 0xf5, 0x31, 0x39, 0x84, 0x94, 0xc6, 0xb3, 0x11, 0xc4, 0x97, 0x67, 0xfb, 0xc8, - 0x7a, 0x8f, 0x20, 0x1e, 0x6f, 0x98, 0xe0, 0x57, 0xa8, 0x01, 0x27, 0x05, 0x93, 0xb3, 0xff, 0x7e, - 0x05, 0xcb, 0x0f, 0x5e, 0x9f, 0xcf, 0x3d, 0xe7, 0x62, 0xee, 0x39, 0x7f, 0xe6, 0x9e, 0x73, 0xba, - 0xf0, 0x6a, 0x17, 0x0b, 0xaf, 0xf6, 0x73, 0xe1, 0xd5, 0xbe, 0x3c, 0xb9, 0x16, 0xe5, 0xe4, 0xfa, - 0x31, 0x55, 0x97, 0x14, 0x35, 0xaa, 0xd9, 0xf3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x86, 0x82, - 0x01, 0x87, 0x70, 0x03, 0x00, 0x00, + // 589 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0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 0xf5, 0x8b, 0x2f, 0x0b, 0xf8, 0x46, 0x19, 0x7b, 0xfa, + 0x27, 0x00, 0x00, 0xff, 0xff, 0x60, 0xfd, 0x14, 0xf1, 0x15, 0x04, 0x00, 0x00, } func (m *Budget) Marshal() (dAtA []byte, err error) { @@ -356,6 +409,43 @@ func (m *ContinuousFund) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DistributionAmount) 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 *DistributionAmount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DistributionAmount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -418,6 +508,21 @@ func (m *ContinuousFund) Size() (n int) { return n } +func (m *DistributionAmount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + return n +} + func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -821,6 +926,90 @@ func (m *ContinuousFund) Unmarshal(dAtA []byte) error { } return nil } +func (m *DistributionAmount) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DistributionAmount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DistributionAmount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.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 := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0