diff --git a/api/poktroll/tokenomics/params.pulsar.go b/api/poktroll/tokenomics/params.pulsar.go index 335b307d4..8737f4ff6 100644 --- a/api/poktroll/tokenomics/params.pulsar.go +++ b/api/poktroll/tokenomics/params.pulsar.go @@ -21,6 +21,7 @@ var ( md_Params protoreflect.MessageDescriptor fd_Params_mint_allocation_percentages protoreflect.FieldDescriptor fd_Params_dao_reward_address protoreflect.FieldDescriptor + fd_Params_global_inflation_per_claim protoreflect.FieldDescriptor ) func init() { @@ -28,6 +29,7 @@ func init() { md_Params = File_poktroll_tokenomics_params_proto.Messages().ByName("Params") fd_Params_mint_allocation_percentages = md_Params.Fields().ByName("mint_allocation_percentages") fd_Params_dao_reward_address = md_Params.Fields().ByName("dao_reward_address") + fd_Params_global_inflation_per_claim = md_Params.Fields().ByName("global_inflation_per_claim") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -107,6 +109,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.GlobalInflationPerClaim != float64(0) || math.Signbit(x.GlobalInflationPerClaim) { + value := protoreflect.ValueOfFloat64(x.GlobalInflationPerClaim) + if !f(fd_Params_global_inflation_per_claim, value) { + return + } + } } // Has reports whether a field is populated. @@ -126,6 +134,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.MintAllocationPercentages != nil case "poktroll.tokenomics.Params.dao_reward_address": return x.DaoRewardAddress != "" + case "poktroll.tokenomics.Params.global_inflation_per_claim": + return x.GlobalInflationPerClaim != float64(0) || math.Signbit(x.GlobalInflationPerClaim) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.Params")) @@ -146,6 +156,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.MintAllocationPercentages = nil case "poktroll.tokenomics.Params.dao_reward_address": x.DaoRewardAddress = "" + case "poktroll.tokenomics.Params.global_inflation_per_claim": + x.GlobalInflationPerClaim = float64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.Params")) @@ -168,6 +180,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "poktroll.tokenomics.Params.dao_reward_address": value := x.DaoRewardAddress return protoreflect.ValueOfString(value) + case "poktroll.tokenomics.Params.global_inflation_per_claim": + value := x.GlobalInflationPerClaim + return protoreflect.ValueOfFloat64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.Params")) @@ -192,6 +207,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.MintAllocationPercentages = value.Message().Interface().(*MintAllocationPercentages) case "poktroll.tokenomics.Params.dao_reward_address": x.DaoRewardAddress = value.Interface().(string) + case "poktroll.tokenomics.Params.global_inflation_per_claim": + x.GlobalInflationPerClaim = value.Float() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.Params")) @@ -219,6 +236,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore return protoreflect.ValueOfMessage(x.MintAllocationPercentages.ProtoReflect()) case "poktroll.tokenomics.Params.dao_reward_address": panic(fmt.Errorf("field dao_reward_address of message poktroll.tokenomics.Params is not mutable")) + case "poktroll.tokenomics.Params.global_inflation_per_claim": + panic(fmt.Errorf("field global_inflation_per_claim of message poktroll.tokenomics.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.Params")) @@ -237,6 +256,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.tokenomics.Params.dao_reward_address": return protoreflect.ValueOfString("") + case "poktroll.tokenomics.Params.global_inflation_per_claim": + return protoreflect.ValueOfFloat64(float64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.Params")) @@ -314,6 +335,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.GlobalInflationPerClaim != 0 || math.Signbit(x.GlobalInflationPerClaim) { + n += 9 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -343,6 +367,12 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.GlobalInflationPerClaim != 0 || math.Signbit(x.GlobalInflationPerClaim) { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(x.GlobalInflationPerClaim)))) + i-- + dAtA[i] = 0x39 + } if len(x.DaoRewardAddress) > 0 { i -= len(x.DaoRewardAddress) copy(dAtA[i:], x.DaoRewardAddress) @@ -481,6 +511,17 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.DaoRewardAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 1 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field GlobalInflationPerClaim", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + x.GlobalInflationPerClaim = float64(math.Float64frombits(v)) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1102,6 +1143,8 @@ type Params struct { // dao_reward_address is the address to which mint_allocation_dao percentage of the // minted tokens are at the end of claim settlement. DaoRewardAddress string `protobuf:"bytes,6,opt,name=dao_reward_address,json=daoRewardAddress,proto3" json:"dao_reward_address,omitempty"` // Bech32 cosmos address + // global_inflation_per_claim is the percentage of a claim's claimable uPOKT amount which will be minted on settlement. + GlobalInflationPerClaim float64 `protobuf:"fixed64,7,opt,name=global_inflation_per_claim,json=globalInflationPerClaim,proto3" json:"global_inflation_per_claim,omitempty"` } func (x *Params) Reset() { @@ -1138,6 +1181,13 @@ func (x *Params) GetDaoRewardAddress() string { return "" } +func (x *Params) GetGlobalInflationPerClaim() float64 { + if x != nil { + return x.GlobalInflationPerClaim + } + return 0 +} + // MintAllocationPercentages represents the distribution of newly minted tokens, // at the end of claim settlement, as a result of the Global Mint TLM. type MintAllocationPercentages struct { @@ -1227,7 +1277,7 @@ var file_poktroll_tokenomics_params_proto_rawDesc = []byte{ 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe3, 0x02, 0x0a, 0x06, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe6, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xb6, 0x01, 0x0a, 0x1b, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x70, @@ -1247,44 +1297,52 @@ var file_poktroll_tokenomics_params_proto_rawDesc = []byte{ 0x5f, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x64, 0x61, 0x6f, 0x52, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x25, 0xe8, 0xa0, 0x1f, 0x01, - 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x22, 0xd3, 0x02, 0x0a, 0x19, 0x4d, 0x69, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x12, - 0x27, 0x0a, 0x03, 0x64, 0x61, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x42, 0x15, 0xea, 0xde, - 0x1f, 0x03, 0x64, 0x61, 0x6f, 0xf2, 0xde, 0x1f, 0x0a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, - 0x61, 0x6f, 0x22, 0x52, 0x03, 0x64, 0x61, 0x6f, 0x12, 0x3b, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x08, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x22, 0x52, 0x08, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x08, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x42, 0x27, 0xea, 0xde, 0x1f, 0x0c, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, - 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x22, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x47, - 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x01, 0x42, 0x25, 0xea, 0xde, 0x1f, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xc1, 0x01, 0xa8, 0xe2, 0x1e, 0x01, 0xd8, 0xe2, - 0x1e, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x42, 0x0b, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, - 0xa2, 0x02, 0x03, 0x50, 0x54, 0x58, 0xaa, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xca, 0x02, 0x13, 0x50, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, - 0x63, 0x73, 0xe2, 0x02, 0x1f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, - 0x3a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x61, 0x72, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x1a, 0x67, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x70, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x42, + 0x43, 0xea, 0xde, 0x1f, 0x1a, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0xf2, + 0xde, 0x1f, 0x21, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, + 0x69, 0x6e, 0x66, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x22, 0x52, 0x17, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x3a, 0x25, 0xe8, + 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2f, 0x78, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x22, 0xd3, 0x02, 0x0a, 0x19, 0x4d, 0x69, 0x6e, 0x74, 0x41, 0x6c, 0x6c, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, + 0x65, 0x73, 0x12, 0x27, 0x0a, 0x03, 0x64, 0x61, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x42, + 0x15, 0xea, 0xde, 0x1f, 0x03, 0x64, 0x61, 0x6f, 0xf2, 0xde, 0x1f, 0x0a, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x64, 0x61, 0x6f, 0x22, 0x52, 0x03, 0x64, 0x61, 0x6f, 0x12, 0x3b, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x42, 0x1f, 0xea, + 0xde, 0x1f, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0xf2, 0xde, 0x1f, 0x0f, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x22, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x08, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x52, 0x08, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x42, 0x27, 0xea, 0xde, 0x1f, + 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0xf2, 0xde, 0x1f, + 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x22, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, + 0x72, 0x12, 0x47, 0x0a, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x42, 0x25, 0xea, 0xde, 0x1f, 0x0b, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x0b, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0xc1, 0x01, 0xa8, 0xe2, 0x1e, + 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x42, 0x0b, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, + 0x69, 0x63, 0x73, 0xa2, 0x02, 0x03, 0x50, 0x54, 0x58, 0xaa, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xca, + 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xe2, 0x02, 0x1f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x3a, 0x3a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/tokenomics/tx.pulsar.go b/api/poktroll/tokenomics/tx.pulsar.go index 8ed6b8fb7..516d78e90 100644 --- a/api/poktroll/tokenomics/tx.pulsar.go +++ b/api/poktroll/tokenomics/tx.pulsar.go @@ -4,6 +4,7 @@ package tokenomics import ( _ "cosmossdk.io/api/amino" _ "cosmossdk.io/api/cosmos/msg/v1" + binary "encoding/binary" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" @@ -12,6 +13,7 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" + math "math" reflect "reflect" sync "sync" ) @@ -877,6 +879,7 @@ var ( fd_MsgUpdateParam_name protoreflect.FieldDescriptor fd_MsgUpdateParam_as_mint_allocation_percentages protoreflect.FieldDescriptor fd_MsgUpdateParam_as_string protoreflect.FieldDescriptor + fd_MsgUpdateParam_as_float protoreflect.FieldDescriptor ) func init() { @@ -886,6 +889,7 @@ func init() { fd_MsgUpdateParam_name = md_MsgUpdateParam.Fields().ByName("name") fd_MsgUpdateParam_as_mint_allocation_percentages = md_MsgUpdateParam.Fields().ByName("as_mint_allocation_percentages") fd_MsgUpdateParam_as_string = md_MsgUpdateParam.Fields().ByName("as_string") + fd_MsgUpdateParam_as_float = md_MsgUpdateParam.Fields().ByName("as_float") } var _ protoreflect.Message = (*fastReflection_MsgUpdateParam)(nil) @@ -979,6 +983,12 @@ func (x *fastReflection_MsgUpdateParam) Range(f func(protoreflect.FieldDescripto if !f(fd_MsgUpdateParam_as_string, value) { return } + case *MsgUpdateParam_AsFloat: + v := o.AsFloat + value := protoreflect.ValueOfFloat64(v) + if !f(fd_MsgUpdateParam_as_float, value) { + return + } } } } @@ -1016,6 +1026,14 @@ func (x *fastReflection_MsgUpdateParam) Has(fd protoreflect.FieldDescriptor) boo } else { return false } + case "poktroll.tokenomics.MsgUpdateParam.as_float": + if x.AsType == nil { + return false + } else if _, ok := x.AsType.(*MsgUpdateParam_AsFloat); ok { + return true + } else { + return false + } default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParam")) @@ -1040,6 +1058,8 @@ func (x *fastReflection_MsgUpdateParam) Clear(fd protoreflect.FieldDescriptor) { x.AsType = nil case "poktroll.tokenomics.MsgUpdateParam.as_string": x.AsType = nil + case "poktroll.tokenomics.MsgUpdateParam.as_float": + x.AsType = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParam")) @@ -1078,6 +1098,14 @@ func (x *fastReflection_MsgUpdateParam) Get(descriptor protoreflect.FieldDescrip } else { return protoreflect.ValueOfString("") } + case "poktroll.tokenomics.MsgUpdateParam.as_float": + if x.AsType == nil { + return protoreflect.ValueOfFloat64(float64(0)) + } else if v, ok := x.AsType.(*MsgUpdateParam_AsFloat); ok { + return protoreflect.ValueOfFloat64(v.AsFloat) + } else { + return protoreflect.ValueOfFloat64(float64(0)) + } default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParam")) @@ -1108,6 +1136,9 @@ func (x *fastReflection_MsgUpdateParam) Set(fd protoreflect.FieldDescriptor, val case "poktroll.tokenomics.MsgUpdateParam.as_string": cv := value.Interface().(string) x.AsType = &MsgUpdateParam_AsString{AsString: cv} + case "poktroll.tokenomics.MsgUpdateParam.as_float": + cv := value.Float() + x.AsType = &MsgUpdateParam_AsFloat{AsFloat: cv} default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParam")) @@ -1150,6 +1181,8 @@ func (x *fastReflection_MsgUpdateParam) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field name of message poktroll.tokenomics.MsgUpdateParam is not mutable")) case "poktroll.tokenomics.MsgUpdateParam.as_string": panic(fmt.Errorf("field as_string of message poktroll.tokenomics.MsgUpdateParam is not mutable")) + case "poktroll.tokenomics.MsgUpdateParam.as_float": + panic(fmt.Errorf("field as_float of message poktroll.tokenomics.MsgUpdateParam is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParam")) @@ -1172,6 +1205,8 @@ func (x *fastReflection_MsgUpdateParam) NewField(fd protoreflect.FieldDescriptor return protoreflect.ValueOfMessage(value.ProtoReflect()) case "poktroll.tokenomics.MsgUpdateParam.as_string": return protoreflect.ValueOfString("") + case "poktroll.tokenomics.MsgUpdateParam.as_float": + return protoreflect.ValueOfFloat64(float64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.MsgUpdateParam")) @@ -1194,6 +1229,8 @@ func (x *fastReflection_MsgUpdateParam) WhichOneof(d protoreflect.OneofDescripto return x.Descriptor().Fields().ByName("as_mint_allocation_percentages") case *MsgUpdateParam_AsString: return x.Descriptor().Fields().ByName("as_string") + case *MsgUpdateParam_AsFloat: + return x.Descriptor().Fields().ByName("as_float") } default: panic(fmt.Errorf("%s is not a oneof field in poktroll.tokenomics.MsgUpdateParam", d.FullName())) @@ -1272,6 +1309,11 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { } l = len(x.AsString) n += 1 + l + runtime.Sov(uint64(l)) + case *MsgUpdateParam_AsFloat: + if x == nil { + break + } + n += 9 } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1322,6 +1364,11 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AsString))) i-- dAtA[i] = 0x22 + case *MsgUpdateParam_AsFloat: + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(x.AsFloat)))) + i-- + dAtA[i] = 0x29 } if len(x.Name) > 0 { i -= len(x.Name) @@ -1517,6 +1564,17 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { } x.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex + case 5: + if wireType != 1 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsFloat", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + x.AsType = &MsgUpdateParam_AsFloat{float64(math.Float64frombits(v))} default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2090,6 +2148,7 @@ type MsgUpdateParam struct { // // *MsgUpdateParam_AsMintAllocationPercentages // *MsgUpdateParam_AsString + // *MsgUpdateParam_AsFloat AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` } @@ -2148,6 +2207,13 @@ func (x *MsgUpdateParam) GetAsString() string { return "" } +func (x *MsgUpdateParam) GetAsFloat() float64 { + if x, ok := x.GetAsType().(*MsgUpdateParam_AsFloat); ok { + return x.AsFloat + } + return 0 +} + type isMsgUpdateParam_AsType interface { isMsgUpdateParam_AsType() } @@ -2160,10 +2226,16 @@ type MsgUpdateParam_AsString struct { AsString string `protobuf:"bytes,4,opt,name=as_string,json=asString,proto3,oneof"` } +type MsgUpdateParam_AsFloat struct { + AsFloat float64 `protobuf:"fixed64,5,opt,name=as_float,json=asFloat,proto3,oneof"` +} + func (*MsgUpdateParam_AsMintAllocationPercentages) isMsgUpdateParam_AsType() {} func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsFloat) isMsgUpdateParam_AsType() {} + // MsgUpdateParamResponse defines the response structure for executing a // MsgUpdateParam message after a single param update. type MsgUpdateParamResponse struct { @@ -2229,7 +2301,7 @@ var file_poktroll_tokenomics_tx_proto_rawDesc = []byte{ 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0xea, 0x02, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x6e, 0x73, 0x65, 0x22, 0x95, 0x03, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, @@ -2250,39 +2322,42 @@ var file_poktroll_tokenomics_tx_proto_rawDesc = []byte{ 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x09, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x08, 0x61, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x22, 0x4d, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x29, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x66, 0x6c, 0x6f, 0x61, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x73, 0x5f, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, 0x46, 0x6c, 0x6f, 0x61, 0x74, + 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x42, 0x09, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x4d, 0x0a, 0x16, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xd1, 0x01, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, - 0xd1, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, - 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x0b, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, - 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, - 0xb0, 0x2a, 0x01, 0x42, 0xb9, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, - 0x69, 0x63, 0x73, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, - 0x6d, 0x69, 0x63, 0x73, 0xa2, 0x02, 0x03, 0x50, 0x54, 0x58, 0xaa, 0x02, 0x13, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, - 0xca, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xe2, 0x02, 0x1f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb9, + 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x42, 0x07, + 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xa2, + 0x02, 0x03, 0x50, 0x54, 0x58, 0xaa, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xca, 0x02, 0x13, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, + 0x73, 0xe2, 0x02, 0x1f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -2380,6 +2455,7 @@ func file_poktroll_tokenomics_tx_proto_init() { file_poktroll_tokenomics_tx_proto_msgTypes[2].OneofWrappers = []interface{}{ (*MsgUpdateParam_AsMintAllocationPercentages)(nil), (*MsgUpdateParam_AsString)(nil), + (*MsgUpdateParam_AsFloat)(nil), } type x struct{} out := protoimpl.TypeBuilder{ diff --git a/config.yml b/config.yml index ccde339a4..0554fcf5d 100644 --- a/config.yml +++ b/config.yml @@ -296,6 +296,7 @@ genesis: # This is the address that will receive the dao/foundation rewards during claim settlement (global mint TLM). # TODO_MAINNET(@olshansk): Consolidate the usage of DAO/PNF throughout the configs & codebase. dao_reward_address: "pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw" + global_inflation_per_claim: 0.1 shared: params: num_blocks_per_session: 10 diff --git a/makefiles/params.mk b/makefiles/params.mk index a2968c102..e0b5ba029 100644 --- a/makefiles/params.mk +++ b/makefiles/params.mk @@ -18,6 +18,14 @@ params_update_tokenomics_all: ## Update the tokenomics module params params_update_tokenomics_mint_allocation_percentages: ## Update the tokenomics module mint_allocation_percentages param poktrolld tx authz exec ./tools/scripts/params/tokenomics_mint_allocation_percentages.json $(PARAM_FLAGS) +.PHONY: params_update_tokenomics_dao_reward_address +params_update_tokenomics_dao_reward_address: ## Update the tokenomics module dao_reward_address param + poktrolld tx authz exec ./tools/scripts/params/tokenomics_dao_reward_address.json $(PARAM_FLAGS) + +.PHONY: params_update_tokenomics_global_inflation_per_claim +params_update_tokenomics_global_inflation_per_claim: ## Update the tokenomics module global_inflation_per_claim param + poktrolld tx authz exec ./tools/scripts/params/tokenomics_global_inflation_per_claim.json $(PARAM_FLAGS) + ### Service Module Params ### .PHONY: params_get_service params_get_service: ## Get the service module params diff --git a/proto/poktroll/tokenomics/params.proto b/proto/poktroll/tokenomics/params.proto index 2263007a7..9186bfafc 100644 --- a/proto/poktroll/tokenomics/params.proto +++ b/proto/poktroll/tokenomics/params.proto @@ -23,6 +23,9 @@ message Params { // minted tokens are at the end of claim settlement. string dao_reward_address = 6 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.jsontag) = "dao_reward_address", (gogoproto.moretags) = "yaml:\"dao_reward_address\""]; // Bech32 cosmos address + // global_inflation_per_claim is the percentage of a claim's claimable uPOKT amount which will be minted on settlement. + double global_inflation_per_claim = 7 [(gogoproto.jsontag) = "global_inflation_per_claim", (gogoproto.moretags) = "yaml:\"global_inflation_per_claim\""]; + // IMPORTANT: Make sure to update all related files if you're modifying or adding a new parameter. // Try the following grep to find all related places: `grep -r compute_units_to_tokens_multiplier` // TODO_IMPROVE: Look into an opportunity to use an enum to avoid using strings throughout the codebase. diff --git a/proto/poktroll/tokenomics/tx.proto b/proto/poktroll/tokenomics/tx.proto index 7f41d1ce2..b20145c15 100644 --- a/proto/poktroll/tokenomics/tx.proto +++ b/proto/poktroll/tokenomics/tx.proto @@ -55,6 +55,7 @@ message MsgUpdateParam { oneof as_type { MintAllocationPercentages as_mint_allocation_percentages = 3 [(gogoproto.jsontag) = "as_mint_allocation_percentages", (gogoproto.moretags) = "yaml:\"as_mint_allocation_percentages\""]; string as_string = 4 [(gogoproto.jsontag) = "as_string"]; + double as_float = 5 [(gogoproto.jsontag) = "as_float"]; } } diff --git a/testutil/integration/suites/param_configs.go b/testutil/integration/suites/param_configs.go index d95a3050e..5d0d09838 100644 --- a/testutil/integration/suites/param_configs.go +++ b/testutil/integration/suites/param_configs.go @@ -236,10 +236,12 @@ var ( ValidParams: tokenomicstypes.Params{ MintAllocationPercentages: tokenomicstypes.DefaultMintAllocationPercentages, DaoRewardAddress: sample.AccAddress(), + GlobalInflationPerClaim: 0.666, }, ParamTypes: map[ParamType]any{ ParamTypeMintAllocationPercentages: tokenomicstypes.MsgUpdateParam_AsMintAllocationPercentages{}, ParamTypeString: tokenomicstypes.MsgUpdateParam_AsString{}, + ParamTypeFloat64: tokenomicstypes.MsgUpdateParam_AsFloat{}, }, DefaultParams: tokenomicstypes.DefaultParams(), NewParamClientFn: tokenomicstypes.NewQueryClient, diff --git a/tools/scripts/params/tokenomics_all.json b/tools/scripts/params/tokenomics_all.json index 2407fab74..f6dbd3c56 100644 --- a/tools/scripts/params/tokenomics_all.json +++ b/tools/scripts/params/tokenomics_all.json @@ -11,7 +11,9 @@ "supplier": 0.7, "source_owner": 0.15, "application": 0.0 - } + }, + "dao_reward_address": "pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw", + "global_inflation_per_claim": 0.1 } } ] diff --git a/tools/scripts/params/tokenomics_dao_reward_address.json b/tools/scripts/params/tokenomics_dao_reward_address.json new file mode 100644 index 000000000..cd8548fc1 --- /dev/null +++ b/tools/scripts/params/tokenomics_dao_reward_address.json @@ -0,0 +1,12 @@ +{ + "body": { + "messages": [ + { + "@type": "/poktroll.tokenomics.MsgUpdateParam", + "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", + "name": "dao_reward_address", + "as_string": "pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw" + } + ] + } +} diff --git a/tools/scripts/params/tokenomics_global_inflation_per_claim.json b/tools/scripts/params/tokenomics_global_inflation_per_claim.json new file mode 100644 index 000000000..206550461 --- /dev/null +++ b/tools/scripts/params/tokenomics_global_inflation_per_claim.json @@ -0,0 +1,12 @@ +{ + "body": { + "messages": [ + { + "@type": "/poktroll.tokenomics.MsgUpdateParam", + "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", + "name": "global_inflation_per_claim", + "as_float": 0.1 + } + ] + } +} diff --git a/x/tokenomics/keeper/msg_server_update_param.go b/x/tokenomics/keeper/msg_server_update_param.go index 643ee17a8..8c5bb0507 100644 --- a/x/tokenomics/keeper/msg_server_update_param.go +++ b/x/tokenomics/keeper/msg_server_update_param.go @@ -1,5 +1,6 @@ package keeper +// import ( "context" "fmt" @@ -44,6 +45,9 @@ func (k msgServer) UpdateParam( case tokenomicstypes.ParamDaoRewardAddress: logger = logger.With("param_value", msg.GetAsString()) params.DaoRewardAddress = msg.GetAsString() + case tokenomicstypes.ParamGlobalInflationPerClaim: + logger = logger.With("param_value", msg.GetAsFloat()) + params.GlobalInflationPerClaim = msg.GetAsFloat() default: return nil, status.Error( codes.InvalidArgument, diff --git a/x/tokenomics/keeper/msg_server_update_param_test.go b/x/tokenomics/keeper/msg_server_update_param_test.go index 987a9123e..6c358482a 100644 --- a/x/tokenomics/keeper/msg_server_update_param_test.go +++ b/x/tokenomics/keeper/msg_server_update_param_test.go @@ -12,24 +12,42 @@ import ( tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) -func TestMsgUpdateParam_UpdateMintAllocationDaoOnly(t *testing.T) { - t.Skip("since the mint allocation percentages must sum to 1, it is not possible to modify only one of them") -} +func TestMsgUpdateParam_UpdateMintAllocationPercentagesOnly(t *testing.T) { + expectedMintAllocationPercentages := tokenomicstypes.MintAllocationPercentages{ + Dao: 0.1, + Proposer: 0.2, + Supplier: 0.3, + SourceOwner: 0.4, + Application: 0.0, + } -func TestMsgUpdateParam_UpdateMintAllocationProposerOnly(t *testing.T) { - t.Skip("since the mint allocation percentages must sum to 1, it is not possible to modify only one of them") -} + // Set the parameters to their default values + k, msgSrv, ctx := setupMsgServer(t) + defaultParams := tokenomicstypes.DefaultParams() + require.NoError(t, k.SetParams(ctx, defaultParams)) -func TestMsgUpdateParam_UpdateMintAllocationSupplierOnly(t *testing.T) { - t.Skip("since the mint allocation percentages must sum to 1, it is not possible to modify only one of them") -} + // Ensure the default values are different from the new values we want to set + require.NotEqual(t, expectedMintAllocationPercentages, defaultParams.MintAllocationPercentages) -func TestMsgUpdateParam_UpdateMintAllocationSourceOwnerOnly(t *testing.T) { - t.Skip("since the mint allocation percentages must sum to 1, it is not possible to modify only one of them") -} + // Update the mint allocation percentages. + updateParamMsg := &tokenomicstypes.MsgUpdateParam{ + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + Name: tokenomicstypes.ParamMintAllocationPercentages, + AsType: &tokenomicstypes.MsgUpdateParam_AsMintAllocationPercentages{AsMintAllocationPercentages: &expectedMintAllocationPercentages}, + } + res, err := msgSrv.UpdateParam(ctx, updateParamMsg) + require.NoError(t, err) + + // Assert that the response contains the expected mint allocation percentages. + require.NotEqual(t, defaultParams.MintAllocationPercentages, res.Params.MintAllocationPercentages) + require.Equal(t, expectedMintAllocationPercentages, res.Params.MintAllocationPercentages) -func TestMsgUpdateParam_UpdateMintAllocationApplicationOnly(t *testing.T) { - t.Skip("since the mint allocation percentages must sum to 1, it is not possible to modify only one of them") + // Assert that the on-chain mint allocation percentages is updated. + params := k.GetParams(ctx) + require.Equal(t, expectedMintAllocationPercentages, params.MintAllocationPercentages) + + // Ensure the other parameters are unchanged + testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, string(tokenomicstypes.KeyMintAllocationPercentages)) } func TestMsgUpdateParam_UpdateDaoRewardAddressOnly(t *testing.T) { @@ -63,3 +81,35 @@ func TestMsgUpdateParam_UpdateDaoRewardAddressOnly(t *testing.T) { // Ensure the other parameters are unchanged testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, string(tokenomicstypes.KeyDaoRewardAddress)) } + +func TestMsgUpdateParam_UpdateGlobalInflationPerClaimOnly(t *testing.T) { + expectedGlobalInflationPerClaim := 0.666 + + // Set the parameters to their default values + k, msgSrv, ctx := setupMsgServer(t) + defaultParams := tokenomicstypes.DefaultParams() + require.NoError(t, k.SetParams(ctx, defaultParams)) + + // Ensure the default values are different from the new values we want to set + require.NotEqual(t, expectedGlobalInflationPerClaim, defaultParams.GlobalInflationPerClaim) + + // Update the dao reward address. + updateParamMsg := &tokenomicstypes.MsgUpdateParam{ + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + Name: tokenomicstypes.ParamGlobalInflationPerClaim, + AsType: &tokenomicstypes.MsgUpdateParam_AsFloat{AsFloat: expectedGlobalInflationPerClaim}, + } + res, err := msgSrv.UpdateParam(ctx, updateParamMsg) + require.NoError(t, err) + + // Assert that the response contains the expected dao reward address. + require.NotEqual(t, defaultParams.GlobalInflationPerClaim, res.Params.GlobalInflationPerClaim) + require.Equal(t, expectedGlobalInflationPerClaim, res.Params.GlobalInflationPerClaim) + + // Assert that the on-chain dao reward address is updated. + params := k.GetParams(ctx) + require.Equal(t, expectedGlobalInflationPerClaim, params.GlobalInflationPerClaim) + + // Ensure the other parameters are unchanged + testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, string(tokenomicstypes.KeyGlobalInflationPerClaim)) +} diff --git a/x/tokenomics/keeper/msg_update_params_test.go b/x/tokenomics/keeper/msg_update_params_test.go index 4266bfe41..163cb10fb 100644 --- a/x/tokenomics/keeper/msg_update_params_test.go +++ b/x/tokenomics/keeper/msg_update_params_test.go @@ -70,6 +70,33 @@ func TestMsgUpdateParams(t *testing.T) { shouldError: true, expectedErrMsg: "empty address string is not allowed", }, + { + desc: "invalid: negative global inflation per claim", + + req: &tokenomicstypes.MsgUpdateParams{ + Authority: tokenomicsKeeper.GetAuthority(), + Params: tokenomicstypes.Params{ + // GlobalInflationPerClaim MUST be positive. + GlobalInflationPerClaim: -0.1, + + // DaoRewardAddress MUST NOT be empty string + // when MintAllocationDao is greater than 0. + DaoRewardAddress: sample.AccAddress(), + + // MintAllocationXXX params MUST sum to 1. + MintAllocationPercentages: tokenomicstypes.MintAllocationPercentages{ + Dao: 0, + Proposer: 0.1, + Supplier: 0.1, + SourceOwner: 0.1, + Application: 0.7, + }, + }, + }, + + shouldError: true, + expectedErrMsg: "GlobalInflationPerClaim must be greater than or equal to 0:", + }, { desc: "valid: successful param update", diff --git a/x/tokenomics/keeper/params_test.go b/x/tokenomics/keeper/params_test.go index b7594fdca..461e4e5d5 100644 --- a/x/tokenomics/keeper/params_test.go +++ b/x/tokenomics/keeper/params_test.go @@ -211,3 +211,39 @@ func TestParams_ValidateDaoRewardAddress(t *testing.T) { }) } } + +func TestParams_ValidateGlobalInflationPerClaim(t *testing.T) { + tests := []struct { + desc string + globalInflationPerClaim any + expectedErr error + }{ + { + desc: "invalid type", + globalInflationPerClaim: float32(0.111), + expectedErr: tokenomicstypes.ErrTokenomicsParamInvalid.Wrap("invalid parameter type: float32"), + }, + { + desc: "less than zero", + globalInflationPerClaim: float64(-0.1), + expectedErr: tokenomicstypes.ErrTokenomicsParamInvalid.Wrapf( + "GlobalInflationPerClaim must be greater than or equal to 0: %f", float64(-0.1), + ), + }, + { + desc: "valid GlobalInflationPerClaim", + globalInflationPerClaim: tokenomicstypes.DefaultGlobalInflationPerClaim, + }, + } + + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := tokenomicstypes.ValidateGlobalInflationPerClaim(test.globalInflationPerClaim) + if test.expectedErr != nil { + require.ErrorContains(t, err, test.expectedErr.Error()) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/tokenomics/types/message_update_param.go b/x/tokenomics/types/message_update_param.go index 719ec842a..45e984ea4 100644 --- a/x/tokenomics/types/message_update_param.go +++ b/x/tokenomics/types/message_update_param.go @@ -16,6 +16,8 @@ func NewMsgUpdateParam(authority string, name string, asTypeAny any) (*MsgUpdate asTypeIface = &MsgUpdateParam_AsMintAllocationPercentages{AsMintAllocationPercentages: &asType} case string: asTypeIface = &MsgUpdateParam_AsString{AsString: asType} + case float64: + asTypeIface = &MsgUpdateParam_AsFloat{AsFloat: asType} default: return nil, fmt.Errorf("unexpected param value type: %T", asTypeAny) } @@ -44,28 +46,25 @@ func (msg *MsgUpdateParam) ValidateBasic() error { // Parameter name must be supported by this module. switch msg.Name { case ParamMintAllocationPercentages: - if err := msg.paramTypeIsMintAllocationPercentages(); err != nil { + if err := genericParamTypeIs[*MsgUpdateParam_AsMintAllocationPercentages](msg); err != nil { return err } return ValidateMintAllocationPercentages(*msg.GetAsMintAllocationPercentages()) case ParamDaoRewardAddress: - if err := msg.paramTypeIsString(); err != nil { + if err := genericParamTypeIs[*MsgUpdateParam_AsString](msg); err != nil { return err } return ValidateDaoRewardAddress(msg.GetAsString()) + case ParamGlobalInflationPerClaim: + if err := genericParamTypeIs[*MsgUpdateParam_AsFloat](msg); err != nil { + return err + } + return ValidateGlobalInflationPerClaim(msg.GetAsFloat()) default: return ErrTokenomicsParamNameInvalid.Wrapf("unsupported param %q", msg.Name) } } -func (msg *MsgUpdateParam) paramTypeIsMintAllocationPercentages() error { - return genericParamTypeIs[*MsgUpdateParam_AsMintAllocationPercentages](msg) -} - -func (msg *MsgUpdateParam) paramTypeIsString() error { - return genericParamTypeIs[*MsgUpdateParam_AsString](msg) -} - // genericParamTypeIs checks if the parameter type is T, returning an error if not. func genericParamTypeIs[T any](msg *MsgUpdateParam) error { if _, ok := msg.AsType.(T); !ok { diff --git a/x/tokenomics/types/message_update_param_test.go b/x/tokenomics/types/message_update_param_test.go index e060f0a47..39beb68f7 100644 --- a/x/tokenomics/types/message_update_param_test.go +++ b/x/tokenomics/types/message_update_param_test.go @@ -63,6 +63,17 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { }, expectedErr: ErrTokenomicsParamInvalid, }, + { + name: "invalid: global inflation per claim less than 0", + msg: MsgUpdateParam{ + Authority: sample.AccAddress(), + Name: ParamGlobalInflationPerClaim, + AsType: &MsgUpdateParam_AsFloat{ + AsFloat: -0.1, + }, + }, + expectedErr: ErrTokenomicsParamInvalid, + }, { name: "valid: correct address, param name, and type", msg: MsgUpdateParam{ diff --git a/x/tokenomics/types/params.go b/x/tokenomics/types/params.go index 801e31e34..e06ff7afb 100644 --- a/x/tokenomics/types/params.go +++ b/x/tokenomics/types/params.go @@ -19,7 +19,10 @@ var ( ParamDaoRewardAddress = "dao_reward_address" // DefaultDaoRewardAddress is the localnet DAO account address as specified in the config.yml. // It is only used in tests. - DefaultDaoRewardAddress = "pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw" + DefaultDaoRewardAddress = "pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw" + KeyGlobalInflationPerClaim = []byte("GlobalInflationPerClaim") + ParamGlobalInflationPerClaim = "global_inflation_per_claim" + DefaultGlobalInflationPerClaim = float64(0.1) _ paramtypes.ParamSet = (*Params)(nil) ) @@ -33,10 +36,12 @@ func ParamKeyTable() paramtypes.KeyTable { func NewParams( mintAllocationPercentages MintAllocationPercentages, daoRewardAddress string, + globalInflationPerClaim float64, ) Params { return Params{ MintAllocationPercentages: mintAllocationPercentages, DaoRewardAddress: daoRewardAddress, + GlobalInflationPerClaim: globalInflationPerClaim, } } @@ -45,6 +50,7 @@ func DefaultParams() Params { return NewParams( DefaultMintAllocationPercentages, DefaultDaoRewardAddress, + DefaultGlobalInflationPerClaim, ) } @@ -56,6 +62,11 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { &p.MintAllocationPercentages, ValidateMintAllocationPercentages, ), + paramtypes.NewParamSetPair( + KeyMintAllocationPercentages, + &p.MintAllocationPercentages, + ValidateMintAllocationPercentages, + ), } } @@ -69,6 +80,10 @@ func (params *Params) ValidateBasic() error { return err } + if err := ValidateGlobalInflationPerClaim(params.GlobalInflationPerClaim); err != nil { + return err + } + return nil } @@ -164,3 +179,17 @@ func ValidateDaoRewardAddress(daoRewardAddress any) error { return nil } + +// ValidateGlobalInflationPerClaim validates the GlobalInflationPerClaim param. +func ValidateGlobalInflationPerClaim(GlobalInflationPerClaimAny any) error { + GlobalInflationPerClaim, ok := GlobalInflationPerClaimAny.(float64) + if !ok { + return ErrTokenomicsParamInvalid.Wrapf("invalid parameter type: %T", GlobalInflationPerClaimAny) + } + + if GlobalInflationPerClaim < 0 { + return ErrTokenomicsParamInvalid.Wrapf("GlobalInflationPerClaim must be greater than or equal to 0: %f", GlobalInflationPerClaim) + } + + return nil +} diff --git a/x/tokenomics/types/params.pb.go b/x/tokenomics/types/params.pb.go index 5c94741b7..f2b933ebd 100644 --- a/x/tokenomics/types/params.pb.go +++ b/x/tokenomics/types/params.pb.go @@ -34,6 +34,8 @@ type Params struct { // dao_reward_address is the address to which mint_allocation_dao percentage of the // minted tokens are at the end of claim settlement. DaoRewardAddress string `protobuf:"bytes,6,opt,name=dao_reward_address,json=daoRewardAddress,proto3" json:"dao_reward_address" yaml:"dao_reward_address"` + // global_inflation_per_claim is the percentage of a claim's claimable uPOKT amount which will be minted on settlement. + GlobalInflationPerClaim float64 `protobuf:"fixed64,7,opt,name=global_inflation_per_claim,json=globalInflationPerClaim,proto3" json:"global_inflation_per_claim" yaml:"global_inflation_per_claim"` } func (m *Params) Reset() { *m = Params{} } @@ -79,6 +81,13 @@ func (m *Params) GetDaoRewardAddress() string { return "" } +func (m *Params) GetGlobalInflationPerClaim() float64 { + if m != nil { + return m.GlobalInflationPerClaim + } + return 0 +} + // MintAllocationPercentages represents the distribution of newly minted tokens, // at the end of claim settlement, as a result of the Global Mint TLM. type MintAllocationPercentages struct { @@ -171,39 +180,42 @@ func init() { func init() { proto.RegisterFile("poktroll/tokenomics/params.proto", fileDescriptor_df10a06914fc6eee) } var fileDescriptor_df10a06914fc6eee = []byte{ - // 505 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0x4f, 0x8b, 0xd3, 0x4c, - 0x18, 0xef, 0x74, 0xdf, 0xb7, 0xac, 0x53, 0x41, 0xcd, 0xae, 0x90, 0xae, 0x92, 0x29, 0x03, 0xcb, - 0x2e, 0xc2, 0x26, 0xe0, 0xde, 0xd6, 0xd3, 0xf6, 0xa0, 0xa0, 0x88, 0x4b, 0xc4, 0x8b, 0x97, 0x30, - 0x9b, 0x0c, 0x35, 0x34, 0xc9, 0x13, 0x66, 0xa6, 0xd4, 0x7e, 0x05, 0x4f, 0x7e, 0x04, 0x8f, 0x1e, - 0x3d, 0x88, 0x9f, 0x61, 0x8f, 0x8b, 0x5e, 0xf6, 0x34, 0x48, 0x7b, 0x50, 0x72, 0xec, 0x27, 0x90, - 0x64, 0xda, 0x34, 0xb2, 0x5d, 0x2f, 0x25, 0xcf, 0xef, 0xdf, 0x33, 0xfc, 0x1e, 0x8a, 0xfb, 0x39, - 0x8c, 0x94, 0x80, 0x24, 0xf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3, 0x73, 0x37, 0x84, 0xd4, 0x2b, 0x0f, 0x74, 0x94, 0x71, 0x35, 0x01, 0x31, 0xf2, 0x36, - 0x5f, 0x4b, 0x4d, 0x73, 0x2e, 0xcf, 0x3b, 0xd5, 0x3f, 0xe3, 0xf8, 0x4f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xad, 0x89, 0x1a, 0x85, 0x96, 0x03, 0x00, 0x00, + // 558 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xc1, 0x6b, 0xd4, 0x4e, + 0x14, 0xde, 0x69, 0x7f, 0xbf, 0x5a, 0x53, 0x41, 0x4d, 0x2b, 0x66, 0xab, 0x64, 0xd6, 0x81, 0xd2, + 0x45, 0x68, 0x02, 0xf6, 0x56, 0x4f, 0xdd, 0x82, 0xa2, 0x22, 0x2e, 0x11, 0x2f, 0x5e, 0xc2, 0x6c, + 0x32, 0xc6, 0xb0, 0x49, 0x5e, 0x98, 0x64, 0x59, 0xf7, 0xe6, 0xd9, 0x93, 0x7f, 0x82, 0x47, 0x8f, + 0x1e, 0xc4, 0xbf, 0xa1, 0xc7, 0xa2, 0x97, 0x9e, 0x06, 0xd9, 0x05, 0x95, 0x1c, 0xf3, 0x17, 0x48, + 0x32, 0x9b, 0x6c, 0xa4, 0xbb, 0xbd, 0x84, 0x79, 0xdf, 0xf7, 0xbd, 0xef, 0x0d, 0xef, 0x9b, 0x28, + 0x9d, 0x18, 0x86, 0x29, 0x87, 0x20, 0x30, 0x53, 0x18, 0xb2, 0x08, 0x42, 0xdf, 0x49, 0xcc, 0x98, + 0x72, 0x1a, 0x26, 0x46, 0xcc, 0x21, 0x05, 0x75, 0xbb, 0x52, 0x18, 0x0b, 0xc5, 0xee, 0x4d, 0x1a, + 0xfa, 0x11, 0x98, 0xe5, 0x57, 0xea, 0x76, 0x77, 0x3c, 0xf0, 0xa0, 0x3c, 0x9a, 0x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0x4c, 0x6f, 0x9d, 0xcf, 0xf4, + 0xd6, 0xeb, 0x43, 0xcf, 0x4f, 0xdf, 0x8e, 0x06, 0x86, 0x03, 0xa1, 0x59, 0x04, 0x74, 0x10, 0xb1, + 0x74, 0x0c, 0x7c, 0x68, 0x2e, 0x4f, 0x2b, 0x9d, 0xc4, 0x2c, 0x19, 0x6c, 0x94, 0x3f, 0xe7, 0xe1, + 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xd7, 0xde, 0x63, 0x19, 0x04, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -231,6 +243,9 @@ func (this *Params) Equal(that interface{}) bool { if this.DaoRewardAddress != that1.DaoRewardAddress { return false } + if this.GlobalInflationPerClaim != that1.GlobalInflationPerClaim { + return false + } return true } func (this *MintAllocationPercentages) Equal(that interface{}) bool { @@ -289,6 +304,12 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.GlobalInflationPerClaim != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.GlobalInflationPerClaim)))) + i-- + dAtA[i] = 0x39 + } if len(m.DaoRewardAddress) > 0 { i -= len(m.DaoRewardAddress) copy(dAtA[i:], m.DaoRewardAddress) @@ -385,6 +406,9 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } + if m.GlobalInflationPerClaim != 0 { + n += 9 + } return n } @@ -512,6 +536,17 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.DaoRewardAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field GlobalInflationPerClaim", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.GlobalInflationPerClaim = float64(math.Float64frombits(v)) default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/tokenomics/types/tx.pb.go b/x/tokenomics/types/tx.pb.go index 1bd29b735..a08ce9be9 100644 --- a/x/tokenomics/types/tx.pb.go +++ b/x/tokenomics/types/tx.pb.go @@ -5,6 +5,7 @@ package types import ( context "context" + encoding_binary "encoding/binary" fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" @@ -127,6 +128,7 @@ type MsgUpdateParam struct { // Types that are valid to be assigned to AsType: // *MsgUpdateParam_AsMintAllocationPercentages // *MsgUpdateParam_AsString + // *MsgUpdateParam_AsFloat AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` } @@ -171,9 +173,13 @@ type MsgUpdateParam_AsMintAllocationPercentages struct { type MsgUpdateParam_AsString struct { AsString string `protobuf:"bytes,4,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"` } +type MsgUpdateParam_AsFloat struct { + AsFloat float64 `protobuf:"fixed64,5,opt,name=as_float,json=asFloat,proto3,oneof" json:"as_float"` +} func (*MsgUpdateParam_AsMintAllocationPercentages) isMsgUpdateParam_AsType() {} func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsFloat) isMsgUpdateParam_AsType() {} func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { if m != nil { @@ -210,11 +216,19 @@ func (m *MsgUpdateParam) GetAsString() string { return "" } +func (m *MsgUpdateParam) GetAsFloat() float64 { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsFloat); ok { + return x.AsFloat + } + return 0 +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { return []interface{}{ (*MsgUpdateParam_AsMintAllocationPercentages)(nil), (*MsgUpdateParam_AsString)(nil), + (*MsgUpdateParam_AsFloat)(nil), } } @@ -270,41 +284,43 @@ func init() { func init() { proto.RegisterFile("poktroll/tokenomics/tx.proto", fileDescriptor_aa0f2fdbd9b6d7eb) } var fileDescriptor_aa0f2fdbd9b6d7eb = []byte{ - // 531 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x3f, 0x6f, 0xd3, 0x40, - 0x1c, 0xf5, 0xb5, 0xa5, 0xe0, 0x2b, 0x14, 0x61, 0x2a, 0xea, 0xba, 0xc8, 0xa9, 0x0c, 0x95, 0xaa, - 0xd0, 0xda, 0xa2, 0x91, 0x10, 0xca, 0x80, 0x54, 0x4f, 0x95, 0x50, 0xa4, 0x62, 0xc4, 0xc2, 0x62, - 0x5d, 0x9c, 0x93, 0x6b, 0xc5, 0xbe, 0xb3, 0x7c, 0x57, 0x68, 0x36, 0xc4, 0xc8, 0xc4, 0xc7, 0x60, - 0xcc, 0xc0, 0x27, 0x80, 0xa5, 0x63, 0x61, 0xea, 0x14, 0xa1, 0x64, 0x88, 0x94, 0x91, 0x4f, 0x80, - 0x7c, 0x76, 0xe2, 0xba, 0x32, 0x34, 0x62, 0xb1, 0xef, 0x7e, 0xef, 0xf7, 0xe7, 0xde, 0xbb, 0x77, - 0xf0, 0x61, 0x4c, 0xbb, 0x3c, 0xa1, 0x61, 0x68, 0x71, 0xda, 0xc5, 0x84, 0x46, 0x81, 0xc7, 0x2c, - 0x7e, 0x6a, 0xc6, 0x09, 0xe5, 0x54, 0xb9, 0x3f, 0x45, 0xcd, 0x02, 0xd5, 0xee, 0xa1, 0x28, 0x20, - 0xd4, 0x12, 0xdf, 0x2c, 0x4f, 0x5b, 0xf7, 0x28, 0x8b, 0x28, 0xb3, 0x22, 0xe6, 0x5b, 0xef, 0x9e, - 0xa6, 0xbf, 0x1c, 0xd8, 0xc8, 0x00, 0x57, 0xec, 0xac, 0x6c, 0x93, 0x43, 0x6b, 0x3e, 0xf5, 0x69, - 0x16, 0x4f, 0x57, 0x79, 0x74, 0xab, 0xea, 0x3c, 0x31, 0x4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x3d, - 0x14, 0x85, 0x4d, 0xe3, 0xdf, 0x79, 0xc6, 0xa1, 0xe4, 0x6c, 0x22, 0xf6, 0xd7, 0x59, 0xca, 0x2e, - 0x94, 0x11, 0x73, 0x99, 0x20, 0xac, 0x2e, 0x09, 0x41, 0xee, 0x4c, 0x06, 0xb5, 0x22, 0x78, 0x28, - 0x39, 0xb7, 0x50, 0xae, 0x48, 0x73, 0xb5, 0x7c, 0x4d, 0xb6, 0x0c, 0x6f, 0x22, 0xe6, 0xf2, 0x5e, - 0x8c, 0x8d, 0x16, 0x7c, 0x50, 0xd6, 0x7a, 0x7a, 0x0d, 0x4a, 0x63, 0xe6, 0x0d, 0x70, 0xad, 0x37, - 0xa6, 0x86, 0xd8, 0xff, 0x01, 0xe0, 0x62, 0x8b, 0xf9, 0x4a, 0x1b, 0xde, 0x2e, 0x19, 0xf4, 0x71, - 0xb5, 0x96, 0x65, 0x07, 0x68, 0xbb, 0xf3, 0x64, 0xcd, 0x0e, 0xe8, 0xc2, 0x95, 0xcb, 0x1e, 0x79, - 0x34, 0x47, 0xb1, 0xf6, 0x64, 0x8e, 0xa4, 0xe9, 0x00, 0xed, 0xc6, 0x87, 0xd4, 0xec, 0xf6, 0xab, - 0xb3, 0xa1, 0x0e, 0xce, 0x87, 0x3a, 0xb8, 0x18, 0xea, 0xe0, 0xd7, 0x50, 0x07, 0x9f, 0x47, 0xba, - 0x74, 0x3e, 0xd2, 0xa5, 0x8b, 0x91, 0x2e, 0xbd, 0x6d, 0xf8, 0x01, 0x3f, 0x3e, 0x69, 0x9b, 0x1e, - 0x8d, 0xac, 0xb4, 0xf7, 0x1e, 0xc1, 0xfc, 0x3d, 0x4d, 0xba, 0x56, 0xf5, 0x3b, 0x48, 0x45, 0x67, - 0xed, 0x65, 0xf1, 0x94, 0x1b, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x28, 0xe0, 0x6a, 0x63, 0x7e, - 0x04, 0x00, 0x00, + // 561 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0xf6, 0x91, 0x7e, 0xf9, 0x5a, 0x8a, 0x30, 0x15, 0x75, 0x53, 0xe4, 0x44, 0x86, 0x4a, 0x21, + 0xb4, 0xb6, 0x68, 0x24, 0x84, 0x32, 0x20, 0xd5, 0x03, 0x8a, 0x84, 0x22, 0x15, 0x23, 0x16, 0x16, + 0xeb, 0x92, 0x1c, 0xae, 0x15, 0xfb, 0xce, 0xf2, 0x5d, 0xa1, 0xd9, 0x10, 0x23, 0x13, 0x0b, 0xff, + 0x81, 0x31, 0x03, 0xbf, 0x00, 0x96, 0x8e, 0x85, 0xa9, 0x53, 0x84, 0x92, 0x21, 0x52, 0x46, 0x7e, + 0x01, 0xf2, 0x47, 0xe2, 0xba, 0x32, 0x34, 0xea, 0x62, 0xdf, 0xbd, 0xcf, 0xfb, 0x71, 0xcf, 0x73, + 0xcf, 0xc1, 0x7b, 0x3e, 0xed, 0xf2, 0x80, 0xba, 0xae, 0xce, 0x69, 0x17, 0x13, 0xea, 0x39, 0x6d, + 0xa6, 0xf3, 0x13, 0xcd, 0x0f, 0x28, 0xa7, 0xd2, 0x9d, 0x29, 0xaa, 0xa5, 0x68, 0xf1, 0x36, 0xf2, + 0x1c, 0x42, 0xf5, 0xe8, 0x1b, 0xe7, 0x15, 0x37, 0xdb, 0x94, 0x79, 0x94, 0xe9, 0x1e, 0xb3, 0xf5, + 0x77, 0x8f, 0xc3, 0x5f, 0x02, 0x6c, 0xc5, 0x80, 0x15, 0xed, 0xf4, 0x78, 0x93, 0x40, 0x1b, 0x36, + 0xb5, 0x69, 0x1c, 0x0f, 0x57, 0x49, 0xb4, 0x9c, 0x77, 0x1e, 0x1f, 0x05, 0xc8, 0x4b, 0xea, 0xd4, + 0x1f, 0x00, 0xde, 0x6a, 0x32, 0xfb, 0xb5, 0xdf, 0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00, 0x00, 0xff, 0xff, 0x4c, 0x0c, 0x38, 0xd8, 0xa9, 0x04, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -571,6 +587,19 @@ func (m *MsgUpdateParam_AsString) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0x22 return len(dAtA) - i, nil } +func (m *MsgUpdateParam_AsFloat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParam_AsFloat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.AsFloat)))) + i-- + dAtA[i] = 0x29 + return len(dAtA) - i, nil +} func (m *MsgUpdateParamResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -683,6 +712,15 @@ func (m *MsgUpdateParam_AsString) Size() (n int) { n += 1 + l + sovTx(uint64(l)) return n } +func (m *MsgUpdateParam_AsFloat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 9 + return n +} func (m *MsgUpdateParamResponse) Size() (n int) { if m == nil { return 0 @@ -1027,6 +1065,17 @@ func (m *MsgUpdateParam) Unmarshal(dAtA []byte) error { } m.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex + case 5: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field AsFloat", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.AsType = &MsgUpdateParam_AsFloat{float64(math.Float64frombits(v))} default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:])