feat(x/protocolpool)!: allow any coins in continuous funds (#21916)
This commit is contained in:
parent
d98626913c
commit
13c234f421
@ -174,6 +174,7 @@ var (
|
||||
fd_GenesisState_budget protoreflect.FieldDescriptor
|
||||
fd_GenesisState_last_balance protoreflect.FieldDescriptor
|
||||
fd_GenesisState_distributions protoreflect.FieldDescriptor
|
||||
fd_GenesisState_params protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -183,6 +184,7 @@ func init() {
|
||||
fd_GenesisState_budget = md_GenesisState.Fields().ByName("budget")
|
||||
fd_GenesisState_last_balance = md_GenesisState.Fields().ByName("last_balance")
|
||||
fd_GenesisState_distributions = md_GenesisState.Fields().ByName("distributions")
|
||||
fd_GenesisState_params = md_GenesisState.Fields().ByName("params")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_GenesisState)(nil)
|
||||
@ -262,8 +264,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
|
||||
}
|
||||
@ -274,6 +276,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor,
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.Params != nil {
|
||||
value := protoreflect.ValueOfMessage(x.Params.ProtoReflect())
|
||||
if !f(fd_GenesisState_params, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Has reports whether a field is populated.
|
||||
@ -294,9 +302,11 @@ 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
|
||||
case "cosmos.protocolpool.v1.GenesisState.params":
|
||||
return x.Params != nil
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState"))
|
||||
@ -318,9 +328,11 @@ 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
|
||||
case "cosmos.protocolpool.v1.GenesisState.params":
|
||||
x.Params = nil
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState"))
|
||||
@ -351,13 +363,16 @@ 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{})
|
||||
}
|
||||
listValue := &_GenesisState_4_list{list: &x.Distributions}
|
||||
return protoreflect.ValueOfList(listValue)
|
||||
case "cosmos.protocolpool.v1.GenesisState.params":
|
||||
value := x.Params
|
||||
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState"))
|
||||
@ -387,11 +402,13 @@ 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)
|
||||
x.Distributions = *clv.list
|
||||
case "cosmos.protocolpool.v1.GenesisState.params":
|
||||
x.Params = value.Message().Interface().(*Params)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState"))
|
||||
@ -424,14 +441,22 @@ 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"))
|
||||
case "cosmos.protocolpool.v1.GenesisState.params":
|
||||
if x.Params == nil {
|
||||
x.Params = new(Params)
|
||||
}
|
||||
return protoreflect.ValueOfMessage(x.Params.ProtoReflect())
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState"))
|
||||
@ -452,10 +477,14 @@ 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})
|
||||
case "cosmos.protocolpool.v1.GenesisState.params":
|
||||
m := new(Params)
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.protocolpool.v1.GenesisState"))
|
||||
@ -537,8 +566,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 {
|
||||
@ -547,6 +576,10 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
}
|
||||
if x.Params != nil {
|
||||
l = options.Size(x.Params)
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
@ -576,6 +609,20 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if x.Params != nil {
|
||||
encoded, err := options.Marshal(x.Params)
|
||||
if err != nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, err
|
||||
}
|
||||
i -= len(encoded)
|
||||
copy(dAtA[i:], encoded)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if len(x.Distributions) > 0 {
|
||||
for iNdEx := len(x.Distributions) - 1; iNdEx >= 0; iNdEx-- {
|
||||
encoded, err := options.Marshal(x.Distributions[iNdEx])
|
||||
@ -592,10 +639,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 +806,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 +816,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 {
|
||||
@ -814,6 +872,42 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if x.Params == nil {
|
||||
x.Params = &Params{}
|
||||
}
|
||||
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
@ -851,15 +945,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 +1021,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 +1048,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 +1068,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 +1088,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 +1114,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 +1144,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 +1161,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 +1236,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,6 +1273,20 @@ func (x *fastReflection_Distribution) ProtoMethods() *protoiface.Methods {
|
||||
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
|
||||
}
|
||||
i -= len(encoded)
|
||||
copy(dAtA[i:], encoded)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if x.Time != nil {
|
||||
encoded, err := options.Marshal(x.Time)
|
||||
if err != nil {
|
||||
@ -1187,14 +1299,7 @@ func (x *fastReflection_Distribution) ProtoMethods() *protoiface.Methods {
|
||||
copy(dAtA[i:], encoded)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
|
||||
i--
|
||||
dAtA[i] = 0x32
|
||||
}
|
||||
if len(x.Amount) > 0 {
|
||||
i -= len(x.Amount)
|
||||
copy(dAtA[i:], x.Amount)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Amount)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
if input.Buf != nil {
|
||||
input.Buf = append(input.Buf, dAtA...)
|
||||
@ -1245,39 +1350,7 @@ 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:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.Amount = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
|
||||
}
|
||||
@ -1313,6 +1386,42 @@ func (x *fastReflection_Distribution) ProtoMethods() *protoiface.Methods {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if x.Amount == nil {
|
||||
x.Amount = &DistributionAmount{}
|
||||
}
|
||||
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := runtime.Skip(dAtA[iNdEx:])
|
||||
@ -1373,11 +1482,14 @@ 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.
|
||||
Distributions []*Distribution `protobuf:"bytes,4,rep,name=distributions,proto3" json:"distributions,omitempty"`
|
||||
// params defines the parameters of this module, currently only contains the
|
||||
// denoms that will be used for continuous fund distributions.
|
||||
Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GenesisState) Reset() {
|
||||
@ -1414,11 +1526,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 {
|
||||
@ -1428,13 +1540,24 @@ func (x *GenesisState) GetDistributions() []*Distribution {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GenesisState) GetParams() *Params {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Distribution struct {
|
||||
state protoimpl.MessageState
|
||||
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 at which this distribution was made, in order to distribute to non-expired funds only
|
||||
// and funds that existed at that time. Because we don't distribute right away, we keep track
|
||||
// of the time of distribution.
|
||||
Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
|
||||
// amount is the list of coins to be distributed.
|
||||
Amount *DistributionAmount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Distribution) Reset() {
|
||||
@ -1457,13 +1580,6 @@ func (*Distribution) Descriptor() ([]byte, []int) {
|
||||
return file_cosmos_protocolpool_v1_genesis_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Distribution) GetAmount() string {
|
||||
if x != nil {
|
||||
return x.Amount
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Distribution) GetTime() *timestamppb.Timestamp {
|
||||
if x != nil {
|
||||
return x.Time
|
||||
@ -1471,6 +1587,13 @@ func (x *Distribution) GetTime() *timestamppb.Timestamp {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Distribution) GetAmount() *DistributionAmount {
|
||||
if x != nil {
|
||||
return x.Amount
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_cosmos_protocolpool_v1_genesis_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_cosmos_protocolpool_v1_genesis_proto_rawDesc = []byte{
|
||||
@ -1485,7 +1608,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, 0xf0, 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 +1617,44 @@ 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,
|
||||
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,
|
||||
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, 0x12,
|
||||
0x36, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, 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, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52,
|
||||
0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 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, 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 +1675,23 @@ 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
|
||||
(*Params)(nil), // 5: cosmos.protocolpool.v1.Params
|
||||
(*timestamppb.Timestamp)(nil), // 6: 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.GenesisState.params:type_name -> cosmos.protocolpool.v1.Params
|
||||
6, // 5: cosmos.protocolpool.v1.Distribution.time:type_name -> google.protobuf.Timestamp
|
||||
4, // 6: cosmos.protocolpool.v1.Distribution.amount:type_name -> cosmos.protocolpool.v1.DistributionAmount
|
||||
7, // [7:7] is the sub-list for method output_type
|
||||
7, // [7:7] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_cosmos_protocolpool_v1_genesis_proto_init() }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -26,6 +26,7 @@ const (
|
||||
Msg_CreateContinuousFund_FullMethodName = "/cosmos.protocolpool.v1.Msg/CreateContinuousFund"
|
||||
Msg_WithdrawContinuousFund_FullMethodName = "/cosmos.protocolpool.v1.Msg/WithdrawContinuousFund"
|
||||
Msg_CancelContinuousFund_FullMethodName = "/cosmos.protocolpool.v1.Msg/CancelContinuousFund"
|
||||
Msg_UpdateParams_FullMethodName = "/cosmos.protocolpool.v1.Msg/UpdateParams"
|
||||
)
|
||||
|
||||
// MsgClient is the client API for Msg service.
|
||||
@ -52,6 +53,9 @@ type MsgClient interface {
|
||||
WithdrawContinuousFund(ctx context.Context, in *MsgWithdrawContinuousFund, opts ...grpc.CallOption) (*MsgWithdrawContinuousFundResponse, error)
|
||||
// CancelContinuousFund defines a method for cancelling continuous fund.
|
||||
CancelContinuousFund(ctx context.Context, in *MsgCancelContinuousFund, opts ...grpc.CallOption) (*MsgCancelContinuousFundResponse, error)
|
||||
// UpdateParams defines a governance operation for updating the x/protocolpool module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@ -132,6 +136,16 @@ func (c *msgClient) CancelContinuousFund(ctx context.Context, in *MsgCancelConti
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
// All implementations must embed UnimplementedMsgServer
|
||||
// for forward compatibility.
|
||||
@ -156,6 +170,9 @@ type MsgServer interface {
|
||||
WithdrawContinuousFund(context.Context, *MsgWithdrawContinuousFund) (*MsgWithdrawContinuousFundResponse, error)
|
||||
// CancelContinuousFund defines a method for cancelling continuous fund.
|
||||
CancelContinuousFund(context.Context, *MsgCancelContinuousFund) (*MsgCancelContinuousFundResponse, error)
|
||||
// UpdateParams defines a governance operation for updating the x/protocolpool module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
}
|
||||
|
||||
@ -187,6 +204,9 @@ func (UnimplementedMsgServer) WithdrawContinuousFund(context.Context, *MsgWithdr
|
||||
func (UnimplementedMsgServer) CancelContinuousFund(context.Context, *MsgCancelContinuousFund) (*MsgCancelContinuousFundResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CancelContinuousFund not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||
func (UnimplementedMsgServer) testEmbeddedByValue() {}
|
||||
|
||||
@ -334,6 +354,24 @@ func _Msg_CancelContinuousFund_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUpdateParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Msg_UpdateParams_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -369,6 +407,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "CancelContinuousFund",
|
||||
Handler: _Msg_CancelContinuousFund_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cosmos/protocolpool/v1/tx.proto",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc (unknown)
|
||||
// source: testpb/msg.proto
|
||||
|
||||
@ -15,8 +15,13 @@ import (
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Msg_Send_FullMethodName = "/testpb.Msg/Send"
|
||||
Msg_Clawback_FullMethodName = "/testpb.Msg/Clawback"
|
||||
)
|
||||
|
||||
// MsgClient is the client API for Msg service.
|
||||
//
|
||||
@ -36,8 +41,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
||||
}
|
||||
|
||||
func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallOption) (*MsgResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(MsgResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.Msg/Send", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Msg_Send_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -45,8 +51,9 @@ func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallO
|
||||
}
|
||||
|
||||
func (c *msgClient) Clawback(ctx context.Context, in *MsgClawbackRequest, opts ...grpc.CallOption) (*MsgClawbackResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(MsgClawbackResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.Msg/Clawback", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Msg_Clawback_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -55,7 +62,7 @@ func (c *msgClient) Clawback(ctx context.Context, in *MsgClawbackRequest, opts .
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
// All implementations must embed UnimplementedMsgServer
|
||||
// for forward compatibility
|
||||
// for forward compatibility.
|
||||
type MsgServer interface {
|
||||
// Send a request and returns the request as a response.
|
||||
Send(context.Context, *MsgRequest) (*MsgResponse, error)
|
||||
@ -63,9 +70,12 @@ type MsgServer interface {
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedMsgServer struct {
|
||||
}
|
||||
// UnimplementedMsgServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedMsgServer struct{}
|
||||
|
||||
func (UnimplementedMsgServer) Send(context.Context, *MsgRequest) (*MsgResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Send not implemented")
|
||||
@ -74,6 +84,7 @@ func (UnimplementedMsgServer) Clawback(context.Context, *MsgClawbackRequest) (*M
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Clawback not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||
func (UnimplementedMsgServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MsgServer will
|
||||
@ -83,6 +94,13 @@ type UnsafeMsgServer interface {
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
|
||||
// If the following call pancis, it indicates UnimplementedMsgServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Msg_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
@ -96,7 +114,7 @@ func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.Msg/Send",
|
||||
FullMethod: Msg_Send_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).Send(ctx, req.(*MsgRequest))
|
||||
@ -114,7 +132,7 @@ func _Msg_Clawback_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.Msg/Clawback",
|
||||
FullMethod: Msg_Clawback_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).Clawback(ctx, req.(*MsgClawbackRequest))
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc (unknown)
|
||||
// source: testpb/query.proto
|
||||
|
||||
@ -15,8 +15,12 @@ import (
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Query_Echo_FullMethodName = "/testpb.Query/Echo"
|
||||
)
|
||||
|
||||
// QueryClient is the client API for Query service.
|
||||
//
|
||||
@ -35,8 +39,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
||||
}
|
||||
|
||||
func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(EchoResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.Query/Echo", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Query_Echo_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -45,21 +50,25 @@ func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.Ca
|
||||
|
||||
// QueryServer is the server API for Query service.
|
||||
// All implementations must embed UnimplementedQueryServer
|
||||
// for forward compatibility
|
||||
// for forward compatibility.
|
||||
type QueryServer interface {
|
||||
// Echo returns the request in the response
|
||||
Echo(context.Context, *EchoRequest) (*EchoResponse, error)
|
||||
mustEmbedUnimplementedQueryServer()
|
||||
}
|
||||
|
||||
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedQueryServer struct {
|
||||
}
|
||||
// UnimplementedQueryServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedQueryServer struct{}
|
||||
|
||||
func (UnimplementedQueryServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
|
||||
}
|
||||
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
||||
func (UnimplementedQueryServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to QueryServer will
|
||||
@ -69,6 +78,13 @@ type UnsafeQueryServer interface {
|
||||
}
|
||||
|
||||
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
||||
// If the following call pancis, it indicates UnimplementedQueryServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Query_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
@ -82,7 +98,7 @@ func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.Query/Echo",
|
||||
FullMethod: Query_Echo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(QueryServer).Echo(ctx, req.(*EchoRequest))
|
||||
|
||||
@ -388,7 +388,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)
|
||||
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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())
|
||||
|
||||
@ -89,6 +89,14 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
},
|
||||
GovProposal: true,
|
||||
},
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Use: "update-params-proposal <params>",
|
||||
Short: "Submit a proposal to update protocolpool module params. Note: the entire params must be provided.",
|
||||
Example: fmt.Sprintf(`%s tx protocolpool update-params-proposal '{ "enabled_distribution_denoms": ["stake", "foo"] }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}},
|
||||
GovProposal: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -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{
|
||||
|
||||
@ -2,11 +2,9 @@ package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"cosmossdk.io/math"
|
||||
"cosmossdk.io/x/protocolpool/types"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
@ -14,6 +12,12 @@ import (
|
||||
|
||||
func (k Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error {
|
||||
currentTime := k.HeaderService.HeaderInfo(ctx).Time
|
||||
|
||||
err := k.Params.Set(ctx, *data.Params)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to set params: %w", err)
|
||||
}
|
||||
|
||||
for _, cf := range data.ContinuousFund {
|
||||
// ignore expired ContinuousFunds
|
||||
if cf.Expiry != nil && cf.Expiry.Before(currentTime) {
|
||||
@ -56,19 +60,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 totalToBeDistributed.IsAnyGT(data.LastBalance.Amount) || !totalToBeDistributed.DenomsSubsetOf(data.LastBalance.Amount) {
|
||||
return fmt.Errorf("total to be distributed is greater than the last balance: %s > %s", totalToBeDistributed, data.LastBalance.Amount)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -112,12 +116,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,
|
||||
@ -129,5 +135,12 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
params, err := k.Params.Get(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
genState.Params = ¶ms
|
||||
|
||||
return genState, nil
|
||||
}
|
||||
|
||||
@ -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(101)))}
|
||||
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.NewInt(101), exportedGenState.LastBalance.Amount.AmountOf("stake"))
|
||||
}
|
||||
|
||||
@ -22,9 +22,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
|
||||
|
||||
@ -35,16 +34,17 @@ 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]
|
||||
Params collections.Item[types.Params]
|
||||
}
|
||||
|
||||
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 {
|
||||
@ -65,14 +65,14 @@ 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)),
|
||||
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
|
||||
}
|
||||
|
||||
schema, err := sb.Build()
|
||||
@ -115,34 +115,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
|
||||
return nil, err
|
||||
}
|
||||
|
||||
denom, err := k.stakingKeeper.BondDenom(ctx)
|
||||
if err != nil {
|
||||
return sdk.Coin{}, 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,31 +145,37 @@ func (k Keeper) SetToDistribute(ctx context.Context) error {
|
||||
if moduleAccount == nil {
|
||||
return errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", types.ProtocolPoolDistrAccount)
|
||||
}
|
||||
|
||||
denom, err := k.stakingKeeper.BondDenom(ctx)
|
||||
params, err := k.Params.Get(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
currentBalance := k.bankKeeper.GetAllBalances(ctx, moduleAccount.GetAddress())
|
||||
distributionBalance := currentBalance.AmountOf(denom)
|
||||
// only take into account the balances of denoms whitelisted in EnabledDistributionDenoms
|
||||
currentBalance := sdk.NewCoins()
|
||||
for _, denom := range params.EnabledDistributionDenoms {
|
||||
bal := k.bankKeeper.GetBalance(ctx, moduleAccount.GetAddress(), denom)
|
||||
currentBalance = currentBalance.Add(bal)
|
||||
}
|
||||
|
||||
// if the balance is zero, return early
|
||||
if distributionBalance.IsZero() {
|
||||
if currentBalance.IsZero() {
|
||||
return nil
|
||||
}
|
||||
|
||||
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
|
||||
@ -191,24 +190,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 {
|
||||
@ -230,36 +228,38 @@ 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()
|
||||
distributeToRecipient := map[string]sdk.Coins{}
|
||||
effectiveDistributionAmounts := sdk.NewCoins() // amount assigned to distributions
|
||||
totalDistributionAmounts := sdk.NewCoins() // total amount distributed to the pool, to then calculate the remaining pool funds
|
||||
|
||||
if err = k.Distributions.Walk(ctx, nil, func(key time.Time, amount types.DistributionAmount) (stop bool, err error) {
|
||||
totalPercentageApplied := math.LegacyZeroDec()
|
||||
totalDistributionAmounts = totalDistributionAmounts.Add(amount.Amount...)
|
||||
|
||||
if err = k.Distributions.Walk(ctx, nil, func(key time.Time, amount math.Int) (stop bool, err error) {
|
||||
percentageToDistribute := math.LegacyZeroDec()
|
||||
for _, f := range funds {
|
||||
if f.Expiry != nil && f.Expiry.Before(key) {
|
||||
continue
|
||||
}
|
||||
|
||||
percentageToDistribute = percentageToDistribute.Add(f.Percentage)
|
||||
totalPercentageApplied = totalPercentageApplied.Add(f.Percentage)
|
||||
|
||||
_, ok := toDistribute[f.Recipient]
|
||||
_, ok := distributeToRecipient[f.Recipient]
|
||||
if !ok {
|
||||
toDistribute[f.Recipient] = math.ZeroInt()
|
||||
distributeToRecipient[f.Recipient] = sdk.NewCoins()
|
||||
}
|
||||
|
||||
for _, denom := range amount.Amount.Denoms() {
|
||||
am := sdk.NewCoin(denom, f.Percentage.MulInt(amount.Amount.AmountOf(denom)).TruncateInt())
|
||||
distributeToRecipient[f.Recipient] = distributeToRecipient[f.Recipient].Add(am)
|
||||
effectiveDistributionAmounts = effectiveDistributionAmounts.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
|
||||
if percentageToDistribute.GT(math.LegacyOneDec()) {
|
||||
if totalPercentageApplied.GT(math.LegacyOneDec()) {
|
||||
return true, errors.New("total funds percentage cannot exceed 100")
|
||||
}
|
||||
|
||||
remaining := math.LegacyOneDec().Sub(percentageToDistribute).MulInt(amount).RoundInt()
|
||||
poolFunds = poolFunds.Add(remaining)
|
||||
|
||||
return false, nil
|
||||
}); err != nil {
|
||||
return err
|
||||
@ -270,33 +270,27 @@ 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))
|
||||
if !streamAmt.IsZero() {
|
||||
if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ProtocolPoolDistrAccount, types.StreamAccount, streamAmt); err != nil {
|
||||
if !effectiveDistributionAmounts.IsZero() {
|
||||
if err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ProtocolPoolDistrAccount, types.StreamAccount, effectiveDistributionAmounts); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
poolFunds := totalDistributionAmounts.Sub(effectiveDistributionAmounts...)
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
// update the recipient fund distribution, first get the keys and sort them
|
||||
recipients := make([]string, 0, len(toDistribute))
|
||||
for k2 := range toDistribute {
|
||||
recipients := make([]string, 0, len(distributeToRecipient))
|
||||
for k2 := range distributeToRecipient {
|
||||
recipients = append(recipients, k2)
|
||||
}
|
||||
sort.Strings(recipients)
|
||||
@ -311,14 +305,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(distributeToRecipient[recipient]...)
|
||||
if err = k.RecipientFundDistribution.Set(ctx, bzAddr, toClaim); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@ -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,13 +73,17 @@ func (s *KeeperTestSuite) SetupTest() {
|
||||
environment,
|
||||
accountKeeper,
|
||||
bankKeeper,
|
||||
stakingKeeper,
|
||||
authority,
|
||||
)
|
||||
s.ctx = ctx
|
||||
s.poolKeeper = poolKeeper
|
||||
s.environment = environment
|
||||
|
||||
err = s.poolKeeper.Params.Set(ctx, types.Params{
|
||||
EnabledDistributionDenoms: []string{sdk.DefaultBondDenom},
|
||||
})
|
||||
s.Require().NoError(err)
|
||||
|
||||
types.RegisterInterfaces(encCfg.InterfaceRegistry)
|
||||
queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry)
|
||||
types.RegisterQueryServer(queryHelper, poolkeeper.Querier{Keeper: poolKeeper})
|
||||
@ -98,18 +97,17 @@ func (s *KeeperTestSuite) mockSendCoinsFromModuleToAccount(accAddr sdk.AccAddres
|
||||
|
||||
func (s *KeeperTestSuite) mockWithdrawContinuousFund() {
|
||||
s.authKeeper.EXPECT().GetModuleAccount(gomock.Any(), types.ModuleName).Return(poolAcc).AnyTimes()
|
||||
distrBal := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000)))
|
||||
s.bankKeeper.EXPECT().GetAllBalances(gomock.Any(), gomock.Any()).Return(distrBal).AnyTimes()
|
||||
distrBal := sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000))
|
||||
s.bankKeeper.EXPECT().GetBalance(gomock.Any(), gomock.Any(), sdk.DefaultBondDenom).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) {
|
||||
s.authKeeper.EXPECT().GetModuleAccount(s.ctx, types.ModuleName).Return(poolAcc).AnyTimes()
|
||||
s.authKeeper.EXPECT().GetModuleAccount(s.ctx, types.ProtocolPoolDistrAccount).Return(poolDistrAcc).AnyTimes()
|
||||
s.authKeeper.EXPECT().GetModuleAddress(types.StreamAccount).Return(streamAcc.GetAddress()).AnyTimes()
|
||||
distrBal := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, distributed))
|
||||
s.bankKeeper.EXPECT().GetAllBalances(s.ctx, poolDistrAcc.GetAddress()).Return(distrBal).AnyTimes()
|
||||
distrBal := sdk.NewCoin(sdk.DefaultBondDenom, distributed)
|
||||
s.bankKeeper.EXPECT().GetBalance(s.ctx, poolDistrAcc.GetAddress(), sdk.DefaultBondDenom).Return(distrBal).AnyTimes()
|
||||
s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(s.ctx, poolDistrAcc.GetName(), streamAcc.GetName(), gomock.Any()).AnyTimes()
|
||||
s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(s.ctx, poolDistrAcc.GetName(), poolAcc.GetName(), gomock.Any()).AnyTimes()
|
||||
}
|
||||
@ -123,8 +121,8 @@ func (s *KeeperTestSuite) TestIterateAndUpdateFundsDistribution() {
|
||||
|
||||
s.SetupTest()
|
||||
s.authKeeper.EXPECT().GetModuleAccount(s.ctx, types.ProtocolPoolDistrAccount).Return(poolAcc).AnyTimes()
|
||||
distrBal := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000000)))
|
||||
s.bankKeeper.EXPECT().GetAllBalances(s.ctx, poolAcc.GetAddress()).Return(distrBal).AnyTimes()
|
||||
distrBal := sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000000))
|
||||
s.bankKeeper.EXPECT().GetBalance(s.ctx, poolAcc.GetAddress(), sdk.DefaultBondDenom).Return(distrBal).AnyTimes()
|
||||
s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(s.ctx, poolDistrAcc.GetName(), streamAcc.GetName(), sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(600000))))
|
||||
s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(s.ctx, poolDistrAcc.GetName(), poolAcc.GetName(), sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(400000))))
|
||||
|
||||
@ -147,14 +145,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
|
||||
})
|
||||
@ -182,14 +180,25 @@ func (suite *KeeperTestSuite) TestGetCommunityPool() {
|
||||
func (suite *KeeperTestSuite) TestSetToDistribute() {
|
||||
suite.SetupTest()
|
||||
|
||||
params, err := suite.poolKeeper.Params.Get(suite.ctx)
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().Equal([]string{sdk.DefaultBondDenom}, params.EnabledDistributionDenoms)
|
||||
|
||||
// add another denom
|
||||
err = suite.poolKeeper.Params.Set(suite.ctx, types.Params{
|
||||
EnabledDistributionDenoms: []string{sdk.DefaultBondDenom, "foo"},
|
||||
})
|
||||
suite.Require().NoError(err)
|
||||
|
||||
suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, types.ProtocolPoolDistrAccount).Return(poolDistrAcc).AnyTimes()
|
||||
distrBal := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000000)))
|
||||
suite.bankKeeper.EXPECT().GetAllBalances(suite.ctx, poolDistrAcc.GetAddress()).Return(distrBal).AnyTimes()
|
||||
distrBal := sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000000))
|
||||
suite.bankKeeper.EXPECT().GetBalance(suite.ctx, poolDistrAcc.GetAddress(), sdk.DefaultBondDenom).Return(distrBal).Times(2)
|
||||
suite.bankKeeper.EXPECT().GetBalance(suite.ctx, poolDistrAcc.GetAddress(), "foo").Return(sdk.NewCoin("foo", math.NewInt(1234))).Times(2)
|
||||
|
||||
// because there are no continuous funds, all are going to the community pool
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, poolDistrAcc.GetName(), poolAcc.GetName(), distrBal)
|
||||
suite.bankKeeper.EXPECT().SendCoinsFromModuleToModule(suite.ctx, poolDistrAcc.GetName(), poolAcc.GetName(), sdk.NewCoins(distrBal, sdk.NewCoin("foo", math.NewInt(1234))))
|
||||
|
||||
err := suite.poolKeeper.SetToDistribute(suite.ctx)
|
||||
err = suite.poolKeeper.SetToDistribute(suite.ctx)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
// Verify that LastBalance was not set (zero balance)
|
||||
@ -215,27 +224,28 @@ 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)), sdk.NewCoin("foo", math.NewInt(1234))), 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)), sdk.NewCoin("foo", math.NewInt(1234))), distribution.Amount)
|
||||
|
||||
// Test case when balance is zero
|
||||
zeroBal := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.ZeroInt()))
|
||||
suite.bankKeeper.EXPECT().GetAllBalances(suite.ctx, poolDistrAcc.GetAddress()).Return(zeroBal).AnyTimes()
|
||||
zeroBal := sdk.NewCoin(sdk.DefaultBondDenom, math.ZeroInt())
|
||||
suite.bankKeeper.EXPECT().GetBalance(suite.ctx, poolDistrAcc.GetAddress(), sdk.DefaultBondDenom).Return(zeroBal)
|
||||
suite.bankKeeper.EXPECT().GetBalance(suite.ctx, poolDistrAcc.GetAddress(), "foo").Return(sdk.NewCoin("foo", math.ZeroInt()))
|
||||
|
||||
err = suite.poolKeeper.SetToDistribute(suite.ctx)
|
||||
suite.Require().NoError(err)
|
||||
|
||||
// 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
|
||||
})
|
||||
|
||||
@ -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
|
||||
}
|
||||
@ -225,6 +225,18 @@ func (k MsgServer) CancelContinuousFund(ctx context.Context, msg *types.MsgCance
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (k MsgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) {
|
||||
if err := k.validateAuthority(msg.GetAuthority()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := k.Params.Set(ctx, msg.Params); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &types.MsgUpdateParamsResponse{}, nil
|
||||
}
|
||||
|
||||
func (k *Keeper) validateAuthority(authority string) error {
|
||||
if _, err := k.authKeeper.AddressCodec().StringToBytes(authority); err != nil {
|
||||
return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err)
|
||||
|
||||
@ -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() {
|
||||
@ -1039,3 +1039,15 @@ func (suite *KeeperTestSuite) TestCommunityPoolSpend() {
|
||||
})
|
||||
suite.Require().NoError(err)
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) TestUpdateParams() {
|
||||
_, err := suite.msgServer.UpdateParams(suite.ctx, &types.MsgUpdateParams{
|
||||
Authority: suite.poolKeeper.GetAuthority(),
|
||||
Params: types.Params{EnabledDistributionDenoms: []string{"stake"}},
|
||||
})
|
||||
suite.Require().NoError(err)
|
||||
|
||||
params, err := suite.poolKeeper.Params.Get(suite.ctx)
|
||||
suite.Require().NoError(err)
|
||||
suite.Require().Len(params.EnabledDistributionDenoms, 1)
|
||||
}
|
||||
|
||||
@ -17,24 +17,24 @@ 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
|
||||
// funds only.
|
||||
repeated Distribution distributions = 4;
|
||||
|
||||
// params defines the parameters of this module, currently only contains the
|
||||
// denoms that will be used for continuous fund distributions.
|
||||
Params params = 5;
|
||||
}
|
||||
|
||||
message Distribution {
|
||||
string amount = 3 [
|
||||
(cosmos_proto.scalar) = "cosmos.Int",
|
||||
(gogoproto.customtype) = "cosmossdk.io/math.Int",
|
||||
(gogoproto.nullable) = false
|
||||
];
|
||||
// time at which this distribution was made, in order to distribute to non-expired funds only
|
||||
// and funds that existed at that time. Because we don't distribute right away, we keep track
|
||||
// of the time of distribution.
|
||||
google.protobuf.Timestamp time = 1 [(gogoproto.stdtime) = true];
|
||||
|
||||
google.protobuf.Timestamp time = 6 [(gogoproto.stdtime) = true];
|
||||
// amount is the list of coins to be distributed.
|
||||
DistributionAmount amount = 2 [(gogoproto.nullable) = false];
|
||||
}
|
||||
@ -3,6 +3,7 @@ package cosmos.protocolpool.v1;
|
||||
|
||||
option go_package = "cosmossdk.io/x/protocolpool/types";
|
||||
|
||||
import "cosmos/protocolpool/v1/types.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cosmos_proto/cosmos.proto";
|
||||
@ -38,6 +39,12 @@ service Msg {
|
||||
|
||||
// CancelContinuousFund defines a method for cancelling continuous fund.
|
||||
rpc CancelContinuousFund(MsgCancelContinuousFund) returns (MsgCancelContinuousFundResponse);
|
||||
|
||||
// UpdateParams defines a governance operation for updating the x/protocolpool module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {
|
||||
option (cosmos_proto.method_added_in) = "cosmos-sdk 0.47";
|
||||
}
|
||||
}
|
||||
|
||||
// MsgFundCommunityPool allows an account to directly
|
||||
@ -155,7 +162,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 +176,24 @@ 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"];
|
||||
;
|
||||
}
|
||||
|
||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||
message MsgUpdateParams {
|
||||
option (cosmos.msg.v1.signer) = "authority";
|
||||
|
||||
// authority is the address that controls the module (defaults to x/gov unless overwritten).
|
||||
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
|
||||
// params defines the x/protocolpool parameters to update.
|
||||
//
|
||||
// NOTE: All parameters must be supplied.
|
||||
Params params = 2 [(gogoproto.nullable) = false];
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
// MsgUpdateParams message.
|
||||
message MsgUpdateParamsResponse {}
|
||||
@ -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,20 @@ 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"
|
||||
];
|
||||
}
|
||||
|
||||
// Params defines the parameters for the protocolpool module.
|
||||
message Params {
|
||||
// enabled_distribution_denoms lists the denoms that are allowed to be distributed.
|
||||
// This is to avoid spending time distributing undesired tokens to continuous funds and budgets.
|
||||
repeated string enabled_distribution_denoms = 1;
|
||||
}
|
||||
|
||||
@ -136,6 +136,20 @@ func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr any) *gomock.Call
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr)
|
||||
}
|
||||
|
||||
// GetBalance mocks base method.
|
||||
func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types.AccAddress, denom string) types.Coin {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetBalance", ctx, addr, denom)
|
||||
ret0, _ := ret[0].(types.Coin)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GetBalance indicates an expected call of GetBalance.
|
||||
func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBalance", reflect.TypeOf((*MockBankKeeper)(nil).GetBalance), ctx, addr, denom)
|
||||
}
|
||||
|
||||
// SendCoinsFromAccountToModule mocks base method.
|
||||
func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error {
|
||||
m.ctrl.T.Helper()
|
||||
@ -191,42 +205,3 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr any) *gomock.Call
|
||||
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
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// 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 any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BondDenom", reflect.TypeOf((*MockStakingKeeper)(nil).BondDenom), ctx)
|
||||
}
|
||||
|
||||
@ -17,13 +17,10 @@ type AccountKeeper interface {
|
||||
|
||||
// BankKeeper defines the expected interface needed to retrieve account balances.
|
||||
type BankKeeper interface {
|
||||
GetBalance(ctx context.Context, addr sdk.AccAddress, denom string) sdk.Coin
|
||||
GetAllBalances(ctx context.Context, addr sdk.AccAddress) sdk.Coins
|
||||
SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins
|
||||
SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
|
||||
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)
|
||||
}
|
||||
|
||||
@ -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,8 +14,9 @@ func NewGenesisState(cf []*ContinuousFund, budget []*Budget) *GenesisState {
|
||||
return &GenesisState{
|
||||
ContinuousFund: cf,
|
||||
Budget: budget,
|
||||
LastBalance: math.ZeroInt(),
|
||||
LastBalance: DistributionAmount{Amount: sdk.NewCoins()},
|
||||
Distributions: []*Distribution{},
|
||||
Params: &Params{},
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,6 +24,9 @@ func DefaultGenesisState() *GenesisState {
|
||||
return &GenesisState{
|
||||
ContinuousFund: []*ContinuousFund{},
|
||||
Budget: []*Budget{},
|
||||
Params: &Params{
|
||||
EnabledDistributionDenoms: []string{sdk.DefaultBondDenom},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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,11 +36,14 @@ 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.
|
||||
Distributions []*Distribution `protobuf:"bytes,4,rep,name=distributions,proto3" json:"distributions,omitempty"`
|
||||
// params defines the parameters of this module, currently only contains the
|
||||
// denoms that will be used for continuous fund distributions.
|
||||
Params *Params `protobuf:"bytes,5,opt,name=params,proto3" json:"params,omitempty"`
|
||||
}
|
||||
|
||||
func (m *GenesisState) Reset() { *m = GenesisState{} }
|
||||
@ -91,6 +93,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
|
||||
@ -98,9 +107,20 @@ func (m *GenesisState) GetDistributions() []*Distribution {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GenesisState) GetParams() *Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
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 at which this distribution was made, in order to distribute to non-expired funds only
|
||||
// and funds that existed at that time. Because we don't distribute right away, we keep track
|
||||
// of the time of distribution.
|
||||
Time *time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time,omitempty"`
|
||||
// amount is the list of coins to be distributed.
|
||||
Amount DistributionAmount `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"`
|
||||
}
|
||||
|
||||
func (m *Distribution) Reset() { *m = Distribution{} }
|
||||
@ -143,6 +163,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 +180,32 @@ 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, 0xd6, 0xb4, 0x73, 0x27, 0x83, 0x0c,
|
||||
0xd4, 0xd3, 0x3f, 0xbd, 0xea, 0xe9, 0x7d, 0xad, 0x5c, 0xe8, 0x45, 0xd3, 0xde, 0xf1, 0x32, 0x80,
|
||||
0xac, 0xa0, 0xda, 0x34, 0x96, 0x4b, 0x5f, 0xe4, 0x25, 0xe5, 0x22, 0x2a, 0x2b, 0x0d, 0x0c, 0xbf,
|
||||
0x5d, 0xe1, 0xfe, 0x2b, 0x9d, 0xef, 0x9d, 0x88, 0x04, 0xb5, 0xde, 0xe2, 0xdb, 0x09, 0x30, 0x91,
|
||||
0x33, 0x09, 0x92, 0x2f, 0x96, 0x92, 0xa5, 0x36, 0x1a, 0x74, 0xc6, 0xbd, 0xe9, 0x43, 0xf2, 0xff,
|
||||
0xe0, 0x64, 0xf6, 0x0f, 0x7f, 0x29, 0x59, 0x1a, 0xde, 0x4a, 0x5a, 0xdf, 0xd6, 0x33, 0x6c, 0xc6,
|
||||
0x32, 0xcd, 0xa8, 0xb0, 0xaf, 0x94, 0x8f, 0x7b, 0xc9, 0x27, 0x50, 0x54, 0x58, 0xd3, 0xd6, 0x1b,
|
||||
0xdc, 0x2f, 0x22, 0x2e, 0x16, 0x71, 0x54, 0x44, 0x2c, 0xa1, 0x76, 0x67, 0x80, 0xc6, 0x37, 0x82,
|
||||
0x47, 0xdb, 0xbd, 0x67, 0xfc, 0xda, 0x7b, 0x77, 0xb5, 0x09, 0x4f, 0x3f, 0x91, 0x1c, 0xfc, 0x32,
|
||||
0x12, 0x1f, 0xc9, 0x9c, 0x89, 0x1f, 0xdf, 0x1f, 0xe3, 0xda, 0x7d, 0xce, 0x44, 0xd8, 0x3b, 0x19,
|
||||
0x04, 0x5a, 0x6f, 0xbd, 0xc6, 0x37, 0xd3, 0x9c, 0x8b, 0x55, 0x1e, 0x4b, 0x91, 0x03, 0xe3, 0x76,
|
||||
0x57, 0xc5, 0x19, 0x5d, 0x8a, 0xf3, 0xa2, 0x01, 0x87, 0x6d, 0xe9, 0xf0, 0x2b, 0xc2, 0xfd, 0xe6,
|
||||
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,
|
||||
// 394 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x41, 0xeb, 0xd3, 0x30,
|
||||
0x18, 0x87, 0x9b, 0xad, 0xee, 0x90, 0x4d, 0x85, 0x22, 0x52, 0x7b, 0xe8, 0xe6, 0x18, 0x32, 0x3c,
|
||||
0xa4, 0x6c, 0x8a, 0x17, 0x4f, 0x56, 0x51, 0xf1, 0xa2, 0x74, 0x9e, 0xbc, 0x8c, 0xb4, 0xcd, 0x4a,
|
||||
0xb1, 0xcd, 0x5b, 0x96, 0x64, 0xe8, 0x97, 0x90, 0x7d, 0xac, 0x1d, 0x77, 0xf4, 0xa4, 0xb2, 0x7d,
|
||||
0x01, 0x3f, 0x82, 0x34, 0xe9, 0xa4, 0x03, 0x0b, 0xf2, 0xbf, 0xa5, 0x6f, 0x9f, 0xdf, 0xc3, 0xfb,
|
||||
0xe6, 0x0d, 0x9e, 0x25, 0x20, 0x4a, 0x10, 0x41, 0xb5, 0x05, 0x09, 0x09, 0x14, 0x15, 0x40, 0x11,
|
||||
0xec, 0x16, 0x41, 0xc6, 0x38, 0x13, 0xb9, 0x20, 0xba, 0xee, 0xdc, 0x37, 0x14, 0x69, 0x53, 0x64,
|
||||
0xb7, 0xf0, 0xa6, 0x1d, 0x69, 0xf9, 0xb5, 0x62, 0x0d, 0xed, 0xdd, 0xcb, 0x20, 0x03, 0x7d, 0x0c,
|
||||
0xea, 0x53, 0x53, 0x7d, 0x60, 0x92, 0x6b, 0xf3, 0xa3, 0xad, 0xf7, 0xc6, 0x19, 0x40, 0x56, 0x30,
|
||||
0x23, 0x8d, 0xd5, 0x26, 0x90, 0x79, 0xc9, 0x84, 0xa4, 0x65, 0x65, 0x80, 0xe9, 0xef, 0x1e, 0x1e,
|
||||
0xbd, 0x31, 0xfd, 0xad, 0x24, 0x95, 0xcc, 0x79, 0x8f, 0xef, 0x26, 0xc0, 0x65, 0xce, 0x15, 0x28,
|
||||
0xb1, 0xde, 0x28, 0x9e, 0xba, 0x68, 0xd2, 0x9f, 0x0f, 0x97, 0x8f, 0xc8, 0xbf, 0x1b, 0x27, 0x2f,
|
||||
0xff, 0xe2, 0xaf, 0x15, 0x4f, 0xa3, 0x3b, 0xc9, 0xd5, 0xb7, 0xf3, 0x0c, 0x0f, 0x62, 0x95, 0x66,
|
||||
0x4c, 0xba, 0x3d, 0xed, 0xf1, 0xbb, 0x3c, 0xa1, 0xa6, 0xa2, 0x86, 0x76, 0x56, 0x78, 0x54, 0x50,
|
||||
0x21, 0xd7, 0x31, 0x2d, 0x28, 0x4f, 0x98, 0xdb, 0x9f, 0xa0, 0xf9, 0x70, 0xf9, 0xb8, 0x2b, 0xfd,
|
||||
0x2a, 0x17, 0x72, 0x9b, 0xc7, 0x4a, 0xe6, 0xc0, 0x5f, 0x94, 0xa0, 0xb8, 0x0c, 0xed, 0xc3, 0x8f,
|
||||
0xb1, 0x15, 0x0d, 0x6b, 0x4b, 0x68, 0x24, 0xce, 0x3b, 0x7c, 0x3b, 0x6d, 0x81, 0xc2, 0xb5, 0x75,
|
||||
0x4f, 0xb3, 0xff, 0xb1, 0x46, 0xd7, 0xd1, 0x7a, 0xb0, 0x8a, 0x6e, 0x69, 0x29, 0xdc, 0x5b, 0xba,
|
||||
0xb5, 0xce, 0xc1, 0x3e, 0x68, 0x2a, 0x6a, 0xe8, 0xe9, 0x37, 0x84, 0x47, 0x6d, 0xaf, 0xf3, 0x14,
|
||||
0xdb, 0xf5, 0x5a, 0x5c, 0xa4, 0x35, 0x1e, 0x31, 0x3b, 0x23, 0x97, 0x9d, 0x91, 0x8f, 0x97, 0x9d,
|
||||
0x85, 0xf6, 0xfe, 0xe7, 0x18, 0x45, 0x9a, 0x76, 0xde, 0xe2, 0x01, 0xd5, 0x73, 0xba, 0xbd, 0x1b,
|
||||
0xde, 0x4c, 0x93, 0x0f, 0x9f, 0x1f, 0x4e, 0x3e, 0x3a, 0x9e, 0x7c, 0xf4, 0xeb, 0xe4, 0xa3, 0xfd,
|
||||
0xd9, 0xb7, 0x8e, 0x67, 0xdf, 0xfa, 0x7e, 0xf6, 0xad, 0x4f, 0x0f, 0x8d, 0x52, 0xa4, 0x9f, 0x49,
|
||||
0x0e, 0xc1, 0x97, 0xeb, 0xb7, 0xa9, 0x1f, 0x66, 0x3c, 0xd0, 0xb5, 0x27, 0x7f, 0x02, 0x00, 0x00,
|
||||
0xff, 0xff, 0xa2, 0x1c, 0x62, 0x0f, 0xfd, 0x02, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
|
||||
@ -201,6 +228,18 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Params != nil {
|
||||
{
|
||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
if len(m.Distributions) > 0 {
|
||||
for iNdEx := len(m.Distributions) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
@ -216,11 +255,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 +315,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 {
|
||||
n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Time):])
|
||||
if err4 != nil {
|
||||
return 0, err4
|
||||
}
|
||||
i -= n4
|
||||
i = encodeVarintGenesis(dAtA, i, uint64(n4))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
@ -336,6 +375,10 @@ func (m *GenesisState) Size() (n int) {
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
}
|
||||
if m.Params != nil {
|
||||
l = m.Params.Size()
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
@ -345,12 +388,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 +504,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 +514,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
|
||||
}
|
||||
@ -525,6 +567,42 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenesis
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Params == nil {
|
||||
m.Params = &Params{}
|
||||
}
|
||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipGenesis(dAtA[iNdEx:])
|
||||
@ -575,41 +653,7 @@ func (m *Distribution) Unmarshal(dAtA []byte) error {
|
||||
return fmt.Errorf("proto: Distribution: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenesis
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
|
||||
}
|
||||
@ -645,6 +689,39 @@ func (m *Distribution) Unmarshal(dAtA []byte) error {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowGenesis
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthGenesis
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipGenesis(dAtA[iNdEx:])
|
||||
|
||||
@ -31,4 +31,5 @@ var (
|
||||
RecipientFundDistributionKey = collections.NewPrefix(5)
|
||||
DistributionsKey = collections.NewPrefix(6)
|
||||
LastBalanceKey = collections.NewPrefix(7)
|
||||
ParamsKey = collections.NewPrefix(8)
|
||||
)
|
||||
|
||||
@ -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,13 +759,108 @@ 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
|
||||
}
|
||||
|
||||
// MsgUpdateParams is the Msg/UpdateParams request type.
|
||||
type MsgUpdateParams struct {
|
||||
// authority is the address that controls the module (defaults to x/gov unless overwritten).
|
||||
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
// params defines the x/protocolpool parameters to update.
|
||||
//
|
||||
// NOTE: All parameters must be supplied.
|
||||
Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} }
|
||||
func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParams) ProtoMessage() {}
|
||||
func (*MsgUpdateParams) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_09efe14517e7f6dc, []int{14}
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParams.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParams) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo
|
||||
|
||||
func (m *MsgUpdateParams) GetAuthority() string {
|
||||
if m != nil {
|
||||
return m.Authority
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) GetParams() Params {
|
||||
if m != nil {
|
||||
return m.Params
|
||||
}
|
||||
return Params{}
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
// MsgUpdateParams message.
|
||||
type MsgUpdateParamsResponse struct {
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} }
|
||||
func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgUpdateParamsResponse) ProtoMessage() {}
|
||||
func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_09efe14517e7f6dc, []int{15}
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgFundCommunityPool)(nil), "cosmos.protocolpool.v1.MsgFundCommunityPool")
|
||||
proto.RegisterType((*MsgFundCommunityPoolResponse)(nil), "cosmos.protocolpool.v1.MsgFundCommunityPoolResponse")
|
||||
@ -781,75 +876,83 @@ func init() {
|
||||
proto.RegisterType((*MsgCancelContinuousFundResponse)(nil), "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse")
|
||||
proto.RegisterType((*MsgWithdrawContinuousFund)(nil), "cosmos.protocolpool.v1.MsgWithdrawContinuousFund")
|
||||
proto.RegisterType((*MsgWithdrawContinuousFundResponse)(nil), "cosmos.protocolpool.v1.MsgWithdrawContinuousFundResponse")
|
||||
proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.protocolpool.v1.MsgUpdateParams")
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.protocolpool.v1.MsgUpdateParamsResponse")
|
||||
}
|
||||
|
||||
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,
|
||||
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, 0x2d,
|
||||
0x93, 0xef, 0x1b, 0xa9, 0x49, 0xa9, 0x0b, 0x07, 0x63, 0xdc, 0xc1, 0xd8, 0x6d, 0x69, 0x4b, 0x2e,
|
||||
0x75, 0x69, 0x6a, 0x34, 0x93, 0x6f, 0x62, 0x5d, 0x6b, 0xc8, 0x70, 0x3d, 0xc4, 0xb0, 0xb9, 0xdb,
|
||||
0xea, 0x61, 0x8e, 0x5a, 0xa6, 0x4d, 0x49, 0x20, 0xd7, 0x97, 0xc5, 0x7a, 0x57, 0x00, 0xc7, 0x43,
|
||||
0x6b, 0x17, 0x25, 0xd4, 0x67, 0x6e, 0x42, 0xc0, 0x67, 0xae, 0x5c, 0xd0, 0x5d, 0x4a, 0x5d, 0x0f,
|
||||
0x0b, 0x8a, 0xbd, 0xf8, 0xa6, 0xc9, 0x89, 0x8f, 0x19, 0x47, 0x7e, 0x38, 0x4c, 0x7a, 0xd4, 0xc1,
|
||||
0x89, 0x23, 0xc4, 0x09, 0x95, 0x49, 0x9b, 0xbf, 0x03, 0xb8, 0xd4, 0x61, 0xee, 0x67, 0x71, 0xe0,
|
||||
0x6c, 0x52, 0xdf, 0x8f, 0x03, 0xc2, 0x07, 0xdb, 0x94, 0x7a, 0x8a, 0x0d, 0xab, 0xc8, 0xa7, 0x71,
|
||||
0xc0, 0x55, 0xb0, 0x52, 0x5e, 0x3b, 0x77, 0x65, 0xd9, 0x90, 0x8c, 0x12, 0xfa, 0x86, 0xa4, 0x6f,
|
||||
0x6c, 0x52, 0x12, 0xb4, 0xdf, 0x7d, 0xf4, 0x54, 0x2f, 0xfd, 0xf6, 0x4c, 0x5f, 0x73, 0x09, 0xef,
|
||||
0xc7, 0x3d, 0xc3, 0xa6, 0xbe, 0xa4, 0x2f, 0x3f, 0xd6, 0x99, 0x73, 0xcb, 0xe4, 0x83, 0x10, 0xb3,
|
||||
0x14, 0xc0, 0x2c, 0x19, 0x5a, 0xb9, 0x0a, 0x6b, 0x0e, 0x0e, 0x29, 0x23, 0x9c, 0x46, 0xea, 0xc2,
|
||||
0x0a, 0x58, 0xab, 0xb5, 0xd5, 0x27, 0x0f, 0xd7, 0x97, 0x64, 0xaa, 0xeb, 0x8e, 0x13, 0x61, 0xc6,
|
||||
0x76, 0x78, 0x44, 0x02, 0xd7, 0x1a, 0xb9, 0x6e, 0xd4, 0xef, 0xde, 0xd7, 0x4b, 0xff, 0xdc, 0xd7,
|
||||
0x4b, 0xdf, 0x3f, 0x7f, 0x70, 0x79, 0x64, 0x6f, 0x36, 0xe0, 0xa5, 0xbc, 0x62, 0x2c, 0xcc, 0x42,
|
||||
0x1a, 0x30, 0xdc, 0x3c, 0x00, 0xf0, 0xf5, 0x0e, 0x73, 0x27, 0x16, 0x77, 0x42, 0x1c, 0x38, 0x09,
|
||||
0x13, 0x14, 0xf3, 0x3e, 0x8d, 0x08, 0x1f, 0xa8, 0xe0, 0x38, 0x26, 0x99, 0xab, 0x72, 0x09, 0xd6,
|
||||
0x22, 0x6c, 0x93, 0x90, 0xe0, 0x80, 0x8b, 0x0a, 0xac, 0x91, 0x61, 0x4c, 0xc4, 0xf2, 0xa9, 0x89,
|
||||
0xb8, 0xb1, 0x98, 0x8a, 0x90, 0x51, 0x6a, 0xea, 0xf0, 0xcd, 0xdc, 0x1a, 0x33, 0x15, 0x7e, 0x2a,
|
||||
0xc3, 0x8b, 0x1d, 0xe6, 0xee, 0xc4, 0x3d, 0x9f, 0xf0, 0x76, 0xec, 0xb8, 0x98, 0x6f, 0x47, 0x34,
|
||||
0xa4, 0x0c, 0x79, 0x2f, 0xad, 0xc3, 0xa7, 0xf0, 0x42, 0x56, 0x76, 0x17, 0x09, 0xaf, 0x63, 0x77,
|
||||
0xf4, 0x7c, 0x06, 0x91, 0x76, 0xe5, 0x73, 0xa8, 0xf4, 0x52, 0x42, 0xdd, 0x10, 0x47, 0x5d, 0x1e,
|
||||
0xa1, 0xc0, 0xee, 0x63, 0xb5, 0xbc, 0x02, 0x0a, 0xc5, 0xb3, 0xce, 0x0b, 0xd0, 0x36, 0x8e, 0x6e,
|
||||
0x08, 0x88, 0xf2, 0x09, 0x84, 0x8c, 0xa3, 0x88, 0x77, 0x93, 0x81, 0x50, 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, 0x21, 0xac, 0xe2, 0xfd, 0x90, 0x44, 0x83, 0x17, 0xee, 0x49, 0xe9, 0x3f,
|
||||
0xa3, 0x77, 0xf2, 0x74, 0xca, 0x7a, 0xe7, 0x57, 0x20, 0xb4, 0x44, 0x81, 0x8d, 0xbd, 0x13, 0xd2,
|
||||
0xf2, 0x64, 0x06, 0x7d, 0xaa, 0x9a, 0xbf, 0x17, 0x44, 0x39, 0x39, 0x54, 0xb3, 0xfe, 0xfb, 0x12,
|
||||
0xbe, 0x6a, 0xa7, 0xeb, 0xd8, 0x11, 0x63, 0x0d, 0x8e, 0x95, 0xf0, 0x6c, 0xb2, 0x5b, 0xa9, 0x8c,
|
||||
0xaf, 0x0c, 0xa1, 0xe9, 0x74, 0xbf, 0x0d, 0x5f, 0xcb, 0x42, 0xf5, 0x31, 0x71, 0xfb, 0xa2, 0x2f,
|
||||
0x2a, 0xd6, 0xe2, 0xd0, 0xfc, 0x45, 0x6a, 0xcd, 0x2f, 0xb7, 0x3c, 0xf7, 0xb9, 0xf6, 0x03, 0x80,
|
||||
0xea, 0x1e, 0xe1, 0x7d, 0x27, 0x42, 0x7b, 0x41, 0x17, 0x79, 0x1e, 0xb5, 0x11, 0xc7, 0x4e, 0xf7,
|
||||
0x66, 0x1c, 0x38, 0xb2, 0x13, 0x4e, 0x74, 0x9a, 0xea, 0x59, 0xb2, 0xeb, 0xc3, 0x5c, 0x89, 0x94,
|
||||
0xcd, 0xdb, 0x70, 0xb9, 0xc3, 0xdc, 0x6f, 0xe4, 0xe2, 0x91, 0x96, 0x38, 0xe5, 0x83, 0xe5, 0x2e,
|
||||
0x80, 0xab, 0x33, 0x93, 0xff, 0xaf, 0x87, 0xcc, 0x95, 0x7f, 0xab, 0xb0, 0xdc, 0x61, 0xae, 0xb2,
|
||||
0x07, 0x2f, 0x4c, 0xbf, 0x7c, 0xde, 0x31, 0xf2, 0x9f, 0x75, 0x46, 0xde, 0xd3, 0x42, 0x7b, 0x7f,
|
||||
0x1e, 0xef, 0xac, 0xca, 0xdb, 0x50, 0xc9, 0x79, 0x84, 0xac, 0x17, 0xc4, 0x9a, 0x76, 0xd7, 0x3e,
|
||||
0x98, 0xcb, 0x3d, 0xcb, 0x7d, 0x07, 0xc0, 0xa5, 0xdc, 0xbb, 0xdf, 0x2c, 0x88, 0x97, 0x07, 0xd0,
|
||||
0xae, 0xcd, 0x09, 0xc8, 0x28, 0x60, 0x78, 0x6e, 0xfc, 0x46, 0x7b, 0xab, 0xa8, 0x90, 0x91, 0x9f,
|
||||
0x66, 0xbc, 0x98, 0xdf, 0x44, 0xa5, 0xb9, 0x17, 0x49, 0x51, 0xa5, 0x79, 0x80, 0xc2, 0x4a, 0x8b,
|
||||
0x8e, 0x60, 0xe5, 0x47, 0x00, 0xeb, 0x33, 0xc6, 0xad, 0x55, 0x10, 0x33, 0x1f, 0xa2, 0x7d, 0x34,
|
||||
0x37, 0x64, 0x52, 0x8b, 0xbc, 0x8b, 0xa0, 0x50, 0x8b, 0x1c, 0x40, 0xb1, 0x16, 0x05, 0xe7, 0xb7,
|
||||
0x76, 0xe6, 0xce, 0xf3, 0x07, 0x97, 0x41, 0xfb, 0xe3, 0x47, 0x07, 0x0d, 0xf0, 0xf8, 0xa0, 0x01,
|
||||
0xfe, 0x3a, 0x68, 0x80, 0x7b, 0x87, 0x8d, 0xd2, 0xe3, 0xc3, 0x46, 0xe9, 0x8f, 0xc3, 0x46, 0xe9,
|
||||
0xdb, 0xd5, 0x89, 0x3b, 0x75, 0x7f, 0xf2, 0x8f, 0x57, 0x3a, 0xc7, 0xbd, 0x6a, 0x6a, 0x7b, 0xef,
|
||||
0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xbb, 0x27, 0x2e, 0x9c, 0x0d, 0x00, 0x00,
|
||||
// 1095 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x1b, 0xc5,
|
||||
0x1b, 0xf6, 0xc4, 0xae, 0x7f, 0xcd, 0xa4, 0xbf, 0xa4, 0x5d, 0x82, 0xbb, 0x59, 0x8a, 0x37, 0xf1,
|
||||
0x81, 0x46, 0x15, 0xde, 0xad, 0x43, 0x69, 0x20, 0x20, 0xa1, 0x3a, 0xe1, 0x9f, 0x84, 0xa5, 0xb0,
|
||||
0x29, 0x42, 0xe2, 0x62, 0x8d, 0x77, 0xa7, 0xeb, 0x51, 0xbd, 0x3b, 0xab, 0x9d, 0xd9, 0x24, 0xae,
|
||||
0x54, 0xa9, 0x42, 0x02, 0x7a, 0xec, 0x0d, 0x8e, 0x3d, 0x21, 0xc4, 0xa9, 0x87, 0x7c, 0x88, 0x0a,
|
||||
0x2e, 0x55, 0x4f, 0x88, 0x43, 0x8b, 0x12, 0xa4, 0xf2, 0x15, 0xb8, 0xa1, 0xdd, 0x1d, 0xaf, 0xed,
|
||||
0x78, 0xbd, 0x89, 0xa3, 0xe4, 0x94, 0xcd, 0x3b, 0xcf, 0xf3, 0xfe, 0x79, 0xe6, 0x7d, 0x67, 0xc6,
|
||||
0x50, 0x35, 0x29, 0x73, 0x28, 0xd3, 0x3d, 0x9f, 0x72, 0x6a, 0xd2, 0x8e, 0x47, 0x69, 0x47, 0xdf,
|
||||
0xae, 0xe9, 0x7c, 0x57, 0x8b, 0x4c, 0x52, 0x29, 0x06, 0x68, 0x83, 0x00, 0x6d, 0xbb, 0xa6, 0x54,
|
||||
0xc6, 0x11, 0xbb, 0x1e, 0x16, 0x68, 0x65, 0xde, 0xa6, 0x36, 0x8d, 0x3e, 0xf5, 0xf0, 0x4b, 0x58,
|
||||
0xcb, 0x82, 0xd9, 0x42, 0x0c, 0xeb, 0xdb, 0xb5, 0x16, 0xe6, 0xa8, 0xa6, 0x9b, 0x94, 0xb8, 0x62,
|
||||
0x7d, 0x21, 0x5e, 0x6f, 0xc6, 0xc4, 0xc1, 0xf0, 0xca, 0x65, 0x41, 0x75, 0x98, 0x1d, 0xc6, 0x72,
|
||||
0x98, 0x2d, 0x16, 0x54, 0x9b, 0x52, 0xbb, 0x83, 0xe3, 0x6c, 0x5a, 0xc1, 0x1d, 0x9d, 0x13, 0x07,
|
||||
0x33, 0x8e, 0x1c, 0xaf, 0x17, 0xf4, 0x30, 0xc0, 0x0a, 0x7c, 0xc4, 0x09, 0x15, 0x41, 0x2b, 0xbf,
|
||||
0x03, 0x38, 0xdf, 0x60, 0xf6, 0x27, 0x81, 0x6b, 0xad, 0x53, 0xc7, 0x09, 0x5c, 0xc2, 0xbb, 0x9b,
|
||||
0x94, 0x76, 0x24, 0x13, 0x16, 0x91, 0x43, 0x03, 0x97, 0xcb, 0x60, 0x31, 0xbf, 0x3c, 0xb3, 0xb2,
|
||||
0xa0, 0x89, 0x8c, 0xc2, 0xf4, 0x35, 0x91, 0xbe, 0xb6, 0x4e, 0x89, 0x5b, 0xbf, 0xfe, 0xf4, 0x85,
|
||||
0x9a, 0xfb, 0xf5, 0xa5, 0xba, 0x6c, 0x13, 0xde, 0x0e, 0x5a, 0x9a, 0x49, 0x1d, 0x91, 0xbe, 0xf8,
|
||||
0x53, 0x65, 0xd6, 0x5d, 0x21, 0x50, 0x48, 0x60, 0x86, 0x70, 0x2d, 0xdd, 0x84, 0xd3, 0x16, 0xf6,
|
||||
0x28, 0x23, 0x9c, 0xfa, 0xf2, 0xd4, 0x22, 0x58, 0x9e, 0xae, 0xcb, 0xcf, 0xf7, 0xaa, 0xf3, 0x22,
|
||||
0xd4, 0x2d, 0xcb, 0xf2, 0x31, 0x63, 0x5b, 0xdc, 0x27, 0xae, 0x6d, 0xf4, 0xa1, 0x6b, 0xa5, 0x87,
|
||||
0x8f, 0xd5, 0xdc, 0x3f, 0x8f, 0xd5, 0xdc, 0xb7, 0xaf, 0x9e, 0x5c, 0xeb, 0xdb, 0x2b, 0x65, 0x78,
|
||||
0x25, 0xad, 0x18, 0x03, 0x33, 0x8f, 0xba, 0x0c, 0x57, 0xf6, 0x01, 0x7c, 0xbd, 0xc1, 0xec, 0xa1,
|
||||
0xc5, 0x2d, 0x0f, 0xbb, 0x56, 0x98, 0x09, 0x0a, 0x78, 0x9b, 0xfa, 0x84, 0x77, 0x65, 0x70, 0x54,
|
||||
0x26, 0x09, 0x54, 0xba, 0x02, 0xa7, 0x7d, 0x6c, 0x12, 0x8f, 0x60, 0x97, 0xc7, 0x15, 0x18, 0x7d,
|
||||
0xc3, 0x80, 0x88, 0xf9, 0x33, 0x13, 0x71, 0x6d, 0x36, 0x12, 0x21, 0x49, 0xa9, 0xa2, 0xc2, 0x37,
|
||||
0x53, 0x6b, 0x4c, 0x54, 0xf8, 0x21, 0x0f, 0x2f, 0x37, 0x98, 0xbd, 0x15, 0xb4, 0x1c, 0xc2, 0xeb,
|
||||
0x81, 0x65, 0x63, 0xbe, 0xe9, 0x53, 0x8f, 0x32, 0xd4, 0x39, 0xb1, 0x0e, 0x1f, 0xc3, 0x4b, 0x49,
|
||||
0xd9, 0x4d, 0x14, 0xa3, 0x8e, 0xdc, 0xd1, 0x8b, 0x09, 0x45, 0xd8, 0xa5, 0x4f, 0xa1, 0xd4, 0x8a,
|
||||
0x12, 0x6a, 0x7a, 0xd8, 0x6f, 0x72, 0x1f, 0xb9, 0x66, 0x1b, 0xcb, 0xf9, 0x45, 0x90, 0x29, 0x9e,
|
||||
0x71, 0x31, 0x26, 0x6d, 0x62, 0xff, 0x76, 0x4c, 0x91, 0x3e, 0x82, 0x90, 0x71, 0xe4, 0xf3, 0x66,
|
||||
0x38, 0x10, 0x72, 0x21, 0x72, 0xa0, 0x68, 0xf1, 0x30, 0x68, 0xbd, 0x61, 0xd0, 0x6e, 0xf7, 0xa6,
|
||||
0xa5, 0x5e, 0x78, 0xf4, 0x52, 0x05, 0xc6, 0x74, 0xc4, 0x09, 0xad, 0x92, 0x02, 0xcf, 0x8b, 0xf0,
|
||||
0x4c, 0x3e, 0xb7, 0x08, 0x96, 0x0b, 0x46, 0xf2, 0xbf, 0xb4, 0x0a, 0x8b, 0x1e, 0xf6, 0x09, 0xb5,
|
||||
0xe4, 0xa2, 0xc8, 0xec, 0xb0, 0xe3, 0x0d, 0x31, 0x65, 0xf5, 0xc2, 0x4f, 0xa1, 0x5f, 0x01, 0x1f,
|
||||
0xd9, 0xaa, 0x25, 0xa8, 0x8e, 0xd9, 0x88, 0x64, 0xb3, 0x28, 0x9c, 0x0d, 0x77, 0xb3, 0x83, 0x88,
|
||||
0x13, 0x23, 0xd2, 0xa5, 0x06, 0x93, 0x4a, 0xbd, 0x56, 0x0a, 0x73, 0x19, 0xf5, 0x54, 0xb9, 0x0f,
|
||||
0x4b, 0xc3, 0x01, 0x7b, 0xa9, 0x0c, 0x1d, 0x09, 0xe0, 0x8c, 0xba, 0xb9, 0xf2, 0xf3, 0x54, 0xd4,
|
||||
0x9c, 0xeb, 0x3e, 0x46, 0x1c, 0xaf, 0x53, 0x97, 0x13, 0x37, 0xa0, 0x01, 0x0b, 0x67, 0xfa, 0xc4,
|
||||
0xcd, 0x79, 0x73, 0x64, 0x48, 0xb3, 0x78, 0xfd, 0xf1, 0xfd, 0x12, 0x42, 0x0f, 0xfb, 0x26, 0x76,
|
||||
0x39, 0xb2, 0xe3, 0x2e, 0x9c, 0xae, 0xd7, 0xc2, 0xca, 0xfe, 0x7c, 0xa1, 0xbe, 0x11, 0x93, 0x99,
|
||||
0x75, 0x57, 0x23, 0x54, 0x77, 0x10, 0x6f, 0x6b, 0x5f, 0x60, 0x1b, 0x99, 0xdd, 0x0d, 0x6c, 0x3e,
|
||||
0xdf, 0xab, 0x42, 0xe1, 0x7b, 0x03, 0x9b, 0xc6, 0x80, 0x13, 0xe9, 0x3d, 0x58, 0xc4, 0xbb, 0x1e,
|
||||
0xf1, 0xbb, 0xc7, 0xee, 0x49, 0x81, 0x1f, 0xd3, 0x3b, 0x69, 0x3a, 0x25, 0xbd, 0xf3, 0x0b, 0x88,
|
||||
0xb5, 0x44, 0xae, 0x89, 0x3b, 0xa7, 0xa4, 0xe5, 0xe9, 0x0c, 0xfa, 0x48, 0x35, 0x7f, 0x4f, 0xc5,
|
||||
0xe5, 0xa4, 0xa4, 0x9a, 0xf4, 0xdf, 0xe7, 0xf0, 0xff, 0x66, 0xb4, 0x8e, 0xad, 0x78, 0xac, 0xc1,
|
||||
0x91, 0x12, 0x9e, 0x0f, 0x77, 0x2b, 0x92, 0xf1, 0x42, 0x8f, 0x1a, 0x4d, 0xf7, 0x55, 0x38, 0x97,
|
||||
0xb8, 0x6a, 0x63, 0x62, 0xb7, 0xe3, 0xbe, 0x28, 0x18, 0xb3, 0x3d, 0xf3, 0x67, 0x91, 0x35, 0xbd,
|
||||
0xdc, 0xfc, 0xc4, 0xe7, 0xda, 0x77, 0x00, 0xca, 0x3b, 0x84, 0xb7, 0x2d, 0x1f, 0xed, 0xb8, 0x4d,
|
||||
0xd4, 0xe9, 0x50, 0x13, 0x71, 0x6c, 0x35, 0xef, 0x04, 0xae, 0x25, 0x17, 0x4e, 0xff, 0x6e, 0x28,
|
||||
0x25, 0xc1, 0x6e, 0xf5, 0x62, 0x85, 0x52, 0x56, 0xee, 0xc1, 0x85, 0x06, 0xb3, 0xbf, 0x16, 0x8b,
|
||||
0x87, 0x5a, 0xe2, 0x8c, 0x0f, 0x96, 0x87, 0x00, 0x2e, 0x8d, 0x0d, 0x9e, 0x7a, 0xc8, 0x9c, 0xd5,
|
||||
0x95, 0x59, 0xf9, 0x11, 0xc0, 0xb9, 0x06, 0xb3, 0xbf, 0xf2, 0x2c, 0xc4, 0xf1, 0x26, 0xf2, 0x91,
|
||||
0xc3, 0x4e, 0x3c, 0x10, 0x1f, 0xc2, 0xa2, 0x17, 0x79, 0x88, 0x3a, 0x68, 0x66, 0xa5, 0xac, 0xa5,
|
||||
0xbf, 0x1c, 0xb5, 0x38, 0x4e, 0xbd, 0x10, 0x66, 0x6d, 0x08, 0xce, 0xc8, 0x1c, 0x2c, 0x44, 0x13,
|
||||
0x3b, 0x98, 0x58, 0x4f, 0x99, 0x95, 0x7f, 0xff, 0x07, 0xf3, 0x0d, 0x66, 0x4b, 0x3b, 0xf0, 0xd2,
|
||||
0xe8, 0x73, 0xed, 0xed, 0x71, 0x51, 0xd3, 0xde, 0x43, 0xca, 0x8d, 0x49, 0xd0, 0xc9, 0xd6, 0xdc,
|
||||
0x83, 0x52, 0xca, 0xcb, 0xa9, 0x9a, 0xe1, 0x6b, 0x14, 0xae, 0xbc, 0x3b, 0x11, 0x3c, 0x89, 0xfd,
|
||||
0x00, 0xc0, 0xf9, 0xd4, 0x07, 0x8b, 0x9e, 0xe1, 0x2f, 0x8d, 0xa0, 0xac, 0x4e, 0x48, 0x48, 0x52,
|
||||
0xc0, 0x70, 0x66, 0xf0, 0x1a, 0x7e, 0x2b, 0xab, 0x90, 0x3e, 0x4e, 0xd1, 0x8e, 0x87, 0x1b, 0xaa,
|
||||
0x34, 0xf5, 0xf6, 0xcb, 0xaa, 0x34, 0x8d, 0x90, 0x59, 0x69, 0xd6, 0xbd, 0x21, 0x7d, 0x0f, 0x60,
|
||||
0x69, 0xcc, 0x19, 0x51, 0xcb, 0xf0, 0x99, 0x4e, 0x51, 0xde, 0x9f, 0x98, 0x32, 0xac, 0x45, 0xda,
|
||||
0xed, 0x95, 0xa9, 0x45, 0x0a, 0x21, 0x5b, 0x8b, 0xac, 0x4b, 0xe7, 0x3e, 0xbc, 0x30, 0x74, 0x4c,
|
||||
0x5c, 0xcd, 0x70, 0x34, 0x08, 0x54, 0xf4, 0x63, 0x02, 0x93, 0xdb, 0xfa, 0xb5, 0xdf, 0xf6, 0xaa,
|
||||
0x73, 0xfd, 0x83, 0x6b, 0xf1, 0xba, 0x76, 0x63, 0x55, 0x39, 0xf7, 0xe0, 0xd5, 0x93, 0x6b, 0xa0,
|
||||
0xfe, 0xc1, 0xd3, 0xfd, 0x32, 0x78, 0xb6, 0x5f, 0x06, 0x7f, 0xed, 0x97, 0xc1, 0xa3, 0x83, 0x72,
|
||||
0xee, 0xd9, 0x41, 0x39, 0xf7, 0xc7, 0x41, 0x39, 0xf7, 0xcd, 0xd2, 0xd0, 0x3b, 0x64, 0x77, 0xf8,
|
||||
0x77, 0x69, 0x74, 0xf6, 0xb5, 0x8a, 0x91, 0xed, 0x9d, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x45,
|
||||
0x30, 0x80, 0xf1, 0xf4, 0x0e, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@ -882,6 +985,9 @@ type MsgClient interface {
|
||||
WithdrawContinuousFund(ctx context.Context, in *MsgWithdrawContinuousFund, opts ...grpc.CallOption) (*MsgWithdrawContinuousFundResponse, error)
|
||||
// CancelContinuousFund defines a method for cancelling continuous fund.
|
||||
CancelContinuousFund(ctx context.Context, in *MsgCancelContinuousFund, opts ...grpc.CallOption) (*MsgCancelContinuousFundResponse, error)
|
||||
// UpdateParams defines a governance operation for updating the x/protocolpool module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@ -955,6 +1061,15 @@ func (c *msgClient) CancelContinuousFund(ctx context.Context, in *MsgCancelConti
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
|
||||
out := new(MsgUpdateParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.protocolpool.v1.Msg/UpdateParams", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
type MsgServer interface {
|
||||
// FundCommunityPool defines a method to allow an account to directly
|
||||
@ -975,6 +1090,9 @@ type MsgServer interface {
|
||||
WithdrawContinuousFund(context.Context, *MsgWithdrawContinuousFund) (*MsgWithdrawContinuousFundResponse, error)
|
||||
// CancelContinuousFund defines a method for cancelling continuous fund.
|
||||
CancelContinuousFund(context.Context, *MsgCancelContinuousFund) (*MsgCancelContinuousFundResponse, error)
|
||||
// UpdateParams defines a governance operation for updating the x/protocolpool module parameters.
|
||||
// The authority is defined in the keeper.
|
||||
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||
@ -1002,6 +1120,9 @@ func (*UnimplementedMsgServer) WithdrawContinuousFund(ctx context.Context, req *
|
||||
func (*UnimplementedMsgServer) CancelContinuousFund(ctx context.Context, req *MsgCancelContinuousFund) (*MsgCancelContinuousFundResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CancelContinuousFund not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||
@ -1133,6 +1254,24 @@ func _Msg_CancelContinuousFund_Handler(srv interface{}, ctx context.Context, dec
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgUpdateParams)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).UpdateParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cosmos.protocolpool.v1.Msg/UpdateParams",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var Msg_serviceDesc = _Msg_serviceDesc
|
||||
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "cosmos.protocolpool.v1.Msg",
|
||||
@ -1166,6 +1305,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "CancelContinuousFund",
|
||||
Handler: _Msg_CancelContinuousFund_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateParams",
|
||||
Handler: _Msg_UpdateParams_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cosmos/protocolpool/v1/tx.proto",
|
||||
@ -1609,16 +1752,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 +1778,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
|
||||
@ -1688,12 +1835,49 @@ func (m *MsgWithdrawContinuousFundResponse) MarshalTo(dAtA []byte) (int, error)
|
||||
}
|
||||
|
||||
func (m *MsgWithdrawContinuousFundResponse) 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 = encodeVarintTx(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
{
|
||||
size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i])
|
||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@ -1701,7 +1885,37 @@ func (m *MsgWithdrawContinuousFundResponse) MarshalToSizedBuffer(dAtA []byte) (i
|
||||
i = encodeVarintTx(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
dAtA[i] = 0x12
|
||||
if len(m.Authority) > 0 {
|
||||
i -= len(m.Authority)
|
||||
copy(dAtA[i:], m.Authority)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
@ -1905,8 +2119,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,11 +2147,39 @@ func (m *MsgWithdrawContinuousFundResponse) Size() (n int) {
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = m.Amount.Size()
|
||||
if len(m.Amount) > 0 {
|
||||
for _, e := range m.Amount {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParams) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Authority)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
l = m.Params.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgUpdateParamsResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTx(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@ -3250,7 +3496,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 +3662,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
|
||||
@ -3440,6 +3688,171 @@ func (m *MsgWithdrawContinuousFundResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Authority = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTx
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTx(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTx
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTx(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
@ -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,103 @@ 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
|
||||
}
|
||||
|
||||
// Params defines the parameters for the protocolpool module.
|
||||
type Params struct {
|
||||
// enabled_distribution_denoms lists the denoms that are allowed to be distributed.
|
||||
// This is to avoid spending time distributing undesired tokens to continuous funds and budgets.
|
||||
EnabledDistributionDenoms []string `protobuf:"bytes,1,rep,name=enabled_distribution_denoms,json=enabledDistributionDenoms,proto3" json:"enabled_distribution_denoms,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Params) Reset() { *m = Params{} }
|
||||
func (m *Params) String() string { return proto.CompactTextString(m) }
|
||||
func (*Params) ProtoMessage() {}
|
||||
func (*Params) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_c1b7d0ea246d7f44, []int{3}
|
||||
}
|
||||
func (m *Params) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Params.Merge(m, src)
|
||||
}
|
||||
func (m *Params) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Params) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Params.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Params proto.InternalMessageInfo
|
||||
|
||||
func (m *Params) GetEnabledDistributionDenoms() []string {
|
||||
if m != nil {
|
||||
return m.EnabledDistributionDenoms
|
||||
}
|
||||
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")
|
||||
proto.RegisterType((*Params)(nil), "cosmos.protocolpool.v1.Params")
|
||||
}
|
||||
|
||||
func init() {
|
||||
@ -192,39 +288,47 @@ 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, 0x60, 0xc2,
|
||||
0x44, 0xe5, 0xc4, 0xd7, 0x2c, 0x07, 0xa5, 0x69, 0x5e, 0xac, 0x0c, 0x6e, 0x12, 0x92, 0x52, 0x52,
|
||||
0xcd, 0x84, 0x35, 0xe8, 0x7d, 0xdb, 0x42, 0x8d, 0xa0, 0x4c, 0x52, 0xd0, 0xf8, 0x2d, 0x7a, 0x28,
|
||||
0x21, 0x66, 0x05, 0x03, 0xae, 0x43, 0x9a, 0x24, 0x12, 0x94, 0x72, 0x9d, 0xae, 0xd3, 0x6f, 0x06,
|
||||
0xee, 0xe5, 0xd9, 0xfe, 0xae, 0x0d, 0x76, 0x60, 0x90, 0xcf, 0x5a, 0x32, 0x9e, 0x8e, 0x77, 0xd6,
|
||||
0x12, 0x3b, 0xc7, 0x6f, 0xd0, 0x76, 0x9c, 0x51, 0x96, 0x43, 0x12, 0xd2, 0x5c, 0x94, 0x5c, 0xbb,
|
||||
0x77, 0xba, 0x4e, 0xff, 0xde, 0xb3, 0x3d, 0x62, 0x0d, 0x96, 0x5d, 0x88, 0xed, 0x42, 0x86, 0x82,
|
||||
0xf1, 0x71, 0xcb, 0x0a, 0x0e, 0x2a, 0x3e, 0xfe, 0x80, 0x1e, 0x64, 0x54, 0xe9, 0x70, 0x6d, 0xa3,
|
||||
0xdd, 0xad, 0xca, 0xa2, 0x4d, 0x4c, 0x1b, 0xb2, 0x6a, 0x43, 0x8e, 0x56, 0x75, 0x83, 0xfa, 0xe9,
|
||||
0xef, 0x8e, 0x33, 0x6e, 0x2d, 0x85, 0x43, 0xeb, 0xa6, 0xf1, 0x53, 0xd4, 0xd2, 0x92, 0xf2, 0xf8,
|
||||
0x18, 0x54, 0x98, 0xc1, 0x44, 0xbb, 0xf5, 0xae, 0xd3, 0xaf, 0x8f, 0xef, 0xaf, 0x86, 0x87, 0x30,
|
||||
0xd1, 0xf8, 0x3d, 0xc2, 0x51, 0xb5, 0x81, 0xb0, 0x00, 0x19, 0x5a, 0xc8, 0xbd, 0x7b, 0x5b, 0xe8,
|
||||
0x1d, 0x23, 0xfa, 0x08, 0xf2, 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,
|
||||
// 627 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x41, 0x4b, 0xdc, 0x4c,
|
||||
0x18, 0xde, 0x7c, 0xee, 0x17, 0xd8, 0xf9, 0xd4, 0x4f, 0x07, 0x29, 0x71, 0x85, 0xec, 0x76, 0x7b,
|
||||
0x59, 0x04, 0x13, 0xb6, 0x85, 0xb6, 0x50, 0x28, 0x35, 0x6e, 0xad, 0x07, 0x0f, 0x36, 0xf5, 0xd4,
|
||||
0x4b, 0x98, 0x24, 0xaf, 0x71, 0x30, 0x99, 0x09, 0x33, 0x13, 0x71, 0xaf, 0xfd, 0x03, 0xf5, 0x58,
|
||||
0xfa, 0x0b, 0x4a, 0x4f, 0x1e, 0xfc, 0x11, 0x1e, 0x45, 0x28, 0x94, 0x1e, 0xb4, 0xe8, 0xc1, 0xbf,
|
||||
0x51, 0x92, 0xcc, 0xda, 0xd5, 0x43, 0xed, 0x65, 0x37, 0xbc, 0xef, 0xf3, 0x3c, 0xf3, 0x3c, 0xef,
|
||||
0x9b, 0x09, 0xea, 0x45, 0x5c, 0x66, 0x5c, 0xba, 0xb9, 0xe0, 0x8a, 0x47, 0x3c, 0xcd, 0x39, 0x4f,
|
||||
0xdd, 0xfd, 0x81, 0xab, 0x46, 0x39, 0x48, 0xa7, 0xaa, 0xe2, 0x07, 0x35, 0xc6, 0x99, 0xc4, 0x38,
|
||||
0xfb, 0x83, 0xf6, 0x42, 0xc2, 0x13, 0x5e, 0x15, 0xdd, 0xf2, 0xa9, 0xee, 0xb7, 0x17, 0x6b, 0x74,
|
||||
0x50, 0x37, 0x26, 0xa9, 0x6d, 0x5b, 0x1f, 0x16, 0x12, 0x09, 0xee, 0xfe, 0x20, 0x04, 0x45, 0x06,
|
||||
0x6e, 0xc4, 0x29, 0xd3, 0xfd, 0x4e, 0xc2, 0x79, 0x92, 0x42, 0x6d, 0x26, 0x2c, 0x76, 0x5c, 0x45,
|
||||
0x33, 0x90, 0x8a, 0x64, 0xf9, 0x58, 0xe0, 0x2e, 0x20, 0x2e, 0x04, 0x51, 0x94, 0x8f, 0x05, 0xe6,
|
||||
0x49, 0x46, 0x19, 0x77, 0xab, 0xdf, 0xba, 0xd4, 0xfb, 0x30, 0x85, 0x4c, 0xaf, 0x88, 0x13, 0x50,
|
||||
0xf8, 0x35, 0x9a, 0x17, 0x10, 0xd1, 0x9c, 0x02, 0x53, 0x01, 0x89, 0x63, 0x01, 0x52, 0x5a, 0x46,
|
||||
0xd7, 0xe8, 0xb7, 0x3c, 0xeb, 0xec, 0x78, 0x65, 0x41, 0x7b, 0x5d, 0xad, 0x3b, 0xef, 0x94, 0xa0,
|
||||
0x2c, 0xf1, 0xe7, 0x6e, 0x28, 0xba, 0x8e, 0x5f, 0xa1, 0xd9, 0x28, 0x25, 0x34, 0x83, 0x38, 0x20,
|
||||
0x19, 0x2f, 0x98, 0xb2, 0xfe, 0xe9, 0x1a, 0xfd, 0xff, 0x1e, 0x2f, 0x3a, 0x5a, 0xa0, 0x8c, 0xe7,
|
||||
0xe8, 0x78, 0xce, 0x1a, 0xa7, 0xcc, 0x9f, 0xd1, 0x84, 0xd5, 0x0a, 0x8f, 0x37, 0xd0, 0xff, 0x29,
|
||||
0x91, 0x2a, 0xb8, 0x91, 0x51, 0xd6, 0x54, 0x25, 0xd1, 0x76, 0xea, 0x80, 0xce, 0x38, 0xa0, 0xb3,
|
||||
0x3d, 0x9e, 0x80, 0xd7, 0x3c, 0xbc, 0xe8, 0x18, 0xfe, 0x4c, 0x49, 0x5c, 0xd3, 0x6a, 0x0a, 0x3f,
|
||||
0x42, 0x33, 0x4a, 0x10, 0x16, 0xed, 0x82, 0x0c, 0x52, 0xd8, 0x51, 0x56, 0xb3, 0x6b, 0xf4, 0x9b,
|
||||
0xfe, 0xf4, 0xb8, 0xb8, 0x09, 0x3b, 0x0a, 0xbf, 0x41, 0x38, 0xac, 0x26, 0x10, 0xe4, 0x20, 0x02,
|
||||
0xdd, 0xb2, 0xfe, 0xbd, 0xcf, 0xf4, 0x5c, 0x4d, 0xda, 0x02, 0xb1, 0x5d, 0x53, 0xf0, 0x33, 0x64,
|
||||
0xe6, 0x20, 0x28, 0x8f, 0x2d, 0x53, 0x93, 0xef, 0xda, 0x1d, 0xea, 0x7d, 0x78, 0xcd, 0x4f, 0xa5,
|
||||
0x5b, 0x0d, 0xef, 0x7d, 0x33, 0xd0, 0xec, 0x1a, 0x67, 0x8a, 0xb2, 0x82, 0x17, 0x72, 0xbd, 0x60,
|
||||
0x31, 0x7e, 0x8a, 0x5a, 0x37, 0x93, 0xbd, 0x77, 0x09, 0xbf, 0xa1, 0xf8, 0x2d, 0x42, 0x39, 0x88,
|
||||
0x08, 0x98, 0x22, 0x09, 0x54, 0x93, 0x6f, 0x79, 0x83, 0x93, 0xf3, 0x4e, 0xe3, 0xc7, 0x79, 0x67,
|
||||
0xa9, 0x26, 0xcb, 0x78, 0xcf, 0xa1, 0xdc, 0xcd, 0x88, 0xda, 0x75, 0x36, 0x21, 0x21, 0xd1, 0x68,
|
||||
0x08, 0xd1, 0xd9, 0xf1, 0x0a, 0xd2, 0xda, 0x43, 0x88, 0xfc, 0x09, 0x11, 0xfc, 0x1c, 0x99, 0x70,
|
||||
0x90, 0x53, 0x31, 0xfa, 0xeb, 0x2d, 0x68, 0x7c, 0xef, 0xa3, 0x81, 0xf0, 0x90, 0x4a, 0x25, 0x68,
|
||||
0x58, 0x94, 0xb1, 0xf5, 0x7e, 0x47, 0xc8, 0xd4, 0x6f, 0x86, 0xd1, 0x9d, 0xfa, 0xe3, 0x90, 0xbd,
|
||||
0xf5, 0xd2, 0xfa, 0xd7, 0x8b, 0x4e, 0x3f, 0xa1, 0x6a, 0xb7, 0x08, 0x9d, 0x88, 0x67, 0xfa, 0xce,
|
||||
0xe8, 0xbf, 0x15, 0x19, 0xef, 0xe9, 0xdb, 0x58, 0x12, 0xe4, 0xe7, 0xeb, 0xa3, 0xe5, 0xe9, 0xb4,
|
||||
0x4a, 0x15, 0x94, 0x57, 0x47, 0x7e, 0xb9, 0x3e, 0x5a, 0x36, 0x7c, 0x7d, 0x60, 0x6f, 0x03, 0x99,
|
||||
0x5b, 0x44, 0x90, 0x4c, 0xe2, 0x97, 0x68, 0x09, 0x18, 0x09, 0x53, 0x88, 0x83, 0x78, 0xc2, 0x62,
|
||||
0x10, 0x03, 0xe3, 0x99, 0xac, 0x9c, 0xb5, 0xfc, 0x45, 0x0d, 0x99, 0x0c, 0x31, 0xac, 0x00, 0xde,
|
||||
0x8b, 0x93, 0x4b, 0xdb, 0x38, 0xbd, 0xb4, 0x8d, 0x9f, 0x97, 0xb6, 0x71, 0x78, 0x65, 0x37, 0x4e,
|
||||
0xaf, 0xec, 0xc6, 0xf7, 0x2b, 0xbb, 0xf1, 0xfe, 0xe1, 0xad, 0x31, 0x1f, 0xdc, 0xfe, 0x76, 0x54,
|
||||
0x56, 0x43, 0xb3, 0xaa, 0x3d, 0xf9, 0x15, 0x00, 0x00, 0xff, 0xff, 0x20, 0xd5, 0xf7, 0x00, 0x5f,
|
||||
0x04, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Budget) Marshal() (dAtA []byte, err error) {
|
||||
@ -356,6 +460,75 @@ 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 (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.EnabledDistributionDenoms) > 0 {
|
||||
for iNdEx := len(m.EnabledDistributionDenoms) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.EnabledDistributionDenoms[iNdEx])
|
||||
copy(dAtA[i:], m.EnabledDistributionDenoms[iNdEx])
|
||||
i = encodeVarintTypes(dAtA, i, uint64(len(m.EnabledDistributionDenoms[iNdEx])))
|
||||
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 +591,36 @@ 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 (m *Params) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.EnabledDistributionDenoms) > 0 {
|
||||
for _, s := range m.EnabledDistributionDenoms {
|
||||
l = len(s)
|
||||
n += 1 + l + sovTypes(uint64(l))
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovTypes(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@ -821,6 +1024,172 @@ 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 (m *Params) 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: Params: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field EnabledDistributionDenoms", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowTypes
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.EnabledDistributionDenoms = append(m.EnabledDistributionDenoms, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipTypes(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthTypes
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipTypes(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user