diff --git a/api/poktroll/application/tx.pulsar.go b/api/poktroll/application/tx.pulsar.go index 866f5acf4..d0e0c31e7 100644 --- a/api/poktroll/application/tx.pulsar.go +++ b/api/poktroll/application/tx.pulsar.go @@ -5403,7 +5403,7 @@ var ( md_MsgUpdateParam protoreflect.MessageDescriptor fd_MsgUpdateParam_authority protoreflect.FieldDescriptor fd_MsgUpdateParam_name protoreflect.FieldDescriptor - fd_MsgUpdateParam_as_int64 protoreflect.FieldDescriptor + fd_MsgUpdateParam_as_uint64 protoreflect.FieldDescriptor fd_MsgUpdateParam_as_coin protoreflect.FieldDescriptor ) @@ -5412,7 +5412,7 @@ func init() { md_MsgUpdateParam = File_poktroll_application_tx_proto.Messages().ByName("MsgUpdateParam") fd_MsgUpdateParam_authority = md_MsgUpdateParam.Fields().ByName("authority") fd_MsgUpdateParam_name = md_MsgUpdateParam.Fields().ByName("name") - fd_MsgUpdateParam_as_int64 = md_MsgUpdateParam.Fields().ByName("as_int64") + fd_MsgUpdateParam_as_uint64 = md_MsgUpdateParam.Fields().ByName("as_uint64") fd_MsgUpdateParam_as_coin = md_MsgUpdateParam.Fields().ByName("as_coin") } @@ -5495,10 +5495,10 @@ func (x *fastReflection_MsgUpdateParam) Range(f func(protoreflect.FieldDescripto } if x.AsType != nil { switch o := x.AsType.(type) { - case *MsgUpdateParam_AsInt64: - v := o.AsInt64 - value := protoreflect.ValueOfInt64(v) - if !f(fd_MsgUpdateParam_as_int64, value) { + case *MsgUpdateParam_AsUint64: + v := o.AsUint64 + value := protoreflect.ValueOfUint64(v) + if !f(fd_MsgUpdateParam_as_uint64, value) { return } case *MsgUpdateParam_AsCoin: @@ -5528,10 +5528,10 @@ func (x *fastReflection_MsgUpdateParam) Has(fd protoreflect.FieldDescriptor) boo return x.Authority != "" case "poktroll.application.MsgUpdateParam.name": return x.Name != "" - case "poktroll.application.MsgUpdateParam.as_int64": + case "poktroll.application.MsgUpdateParam.as_uint64": if x.AsType == nil { return false - } else if _, ok := x.AsType.(*MsgUpdateParam_AsInt64); ok { + } else if _, ok := x.AsType.(*MsgUpdateParam_AsUint64); ok { return true } else { return false @@ -5564,7 +5564,7 @@ func (x *fastReflection_MsgUpdateParam) Clear(fd protoreflect.FieldDescriptor) { x.Authority = "" case "poktroll.application.MsgUpdateParam.name": x.Name = "" - case "poktroll.application.MsgUpdateParam.as_int64": + case "poktroll.application.MsgUpdateParam.as_uint64": x.AsType = nil case "poktroll.application.MsgUpdateParam.as_coin": x.AsType = nil @@ -5590,13 +5590,13 @@ func (x *fastReflection_MsgUpdateParam) Get(descriptor protoreflect.FieldDescrip case "poktroll.application.MsgUpdateParam.name": value := x.Name return protoreflect.ValueOfString(value) - case "poktroll.application.MsgUpdateParam.as_int64": + case "poktroll.application.MsgUpdateParam.as_uint64": if x.AsType == nil { - return protoreflect.ValueOfInt64(int64(0)) - } else if v, ok := x.AsType.(*MsgUpdateParam_AsInt64); ok { - return protoreflect.ValueOfInt64(v.AsInt64) + return protoreflect.ValueOfUint64(uint64(0)) + } else if v, ok := x.AsType.(*MsgUpdateParam_AsUint64); ok { + return protoreflect.ValueOfUint64(v.AsUint64) } else { - return protoreflect.ValueOfInt64(int64(0)) + return protoreflect.ValueOfUint64(uint64(0)) } case "poktroll.application.MsgUpdateParam.as_coin": if x.AsType == nil { @@ -5630,9 +5630,9 @@ func (x *fastReflection_MsgUpdateParam) Set(fd protoreflect.FieldDescriptor, val x.Authority = value.Interface().(string) case "poktroll.application.MsgUpdateParam.name": x.Name = value.Interface().(string) - case "poktroll.application.MsgUpdateParam.as_int64": - cv := value.Int() - x.AsType = &MsgUpdateParam_AsInt64{AsInt64: cv} + case "poktroll.application.MsgUpdateParam.as_uint64": + cv := value.Uint() + x.AsType = &MsgUpdateParam_AsUint64{AsUint64: cv} case "poktroll.application.MsgUpdateParam.as_coin": cv := value.Message().Interface().(*v1beta1.Coin) x.AsType = &MsgUpdateParam_AsCoin{AsCoin: cv} @@ -5676,8 +5676,8 @@ func (x *fastReflection_MsgUpdateParam) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field authority of message poktroll.application.MsgUpdateParam is not mutable")) case "poktroll.application.MsgUpdateParam.name": panic(fmt.Errorf("field name of message poktroll.application.MsgUpdateParam is not mutable")) - case "poktroll.application.MsgUpdateParam.as_int64": - panic(fmt.Errorf("field as_int64 of message poktroll.application.MsgUpdateParam is not mutable")) + case "poktroll.application.MsgUpdateParam.as_uint64": + panic(fmt.Errorf("field as_uint64 of message poktroll.application.MsgUpdateParam is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.application.MsgUpdateParam")) @@ -5695,8 +5695,8 @@ func (x *fastReflection_MsgUpdateParam) NewField(fd protoreflect.FieldDescriptor return protoreflect.ValueOfString("") case "poktroll.application.MsgUpdateParam.name": return protoreflect.ValueOfString("") - case "poktroll.application.MsgUpdateParam.as_int64": - return protoreflect.ValueOfInt64(int64(0)) + case "poktroll.application.MsgUpdateParam.as_uint64": + return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.application.MsgUpdateParam.as_coin": value := &v1beta1.Coin{} return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -5718,8 +5718,8 @@ func (x *fastReflection_MsgUpdateParam) WhichOneof(d protoreflect.OneofDescripto return nil } switch x.AsType.(type) { - case *MsgUpdateParam_AsInt64: - return x.Descriptor().Fields().ByName("as_int64") + case *MsgUpdateParam_AsUint64: + return x.Descriptor().Fields().ByName("as_uint64") case *MsgUpdateParam_AsCoin: return x.Descriptor().Fields().ByName("as_coin") } @@ -5788,11 +5788,11 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } switch x := x.AsType.(type) { - case *MsgUpdateParam_AsInt64: + case *MsgUpdateParam_AsUint64: if x == nil { break } - n += 1 + runtime.Sov(uint64(x.AsInt64)) + n += 1 + runtime.Sov(uint64(x.AsUint64)) case *MsgUpdateParam_AsCoin: if x == nil { break @@ -5830,8 +5830,8 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.unknownFields) } switch x := x.AsType.(type) { - case *MsgUpdateParam_AsInt64: - i = runtime.EncodeVarint(dAtA, i, uint64(x.AsInt64)) + case *MsgUpdateParam_AsUint64: + i = runtime.EncodeVarint(dAtA, i, uint64(x.AsUint64)) i-- dAtA[i] = 0x18 case *MsgUpdateParam_AsCoin: @@ -5977,9 +5977,9 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 3: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsUint64", wireType) } - var v int64 + var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -5989,12 +5989,12 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + v |= uint64(b&0x7F) << shift if b < 0x80 { break } } - x.AsType = &MsgUpdateParam_AsInt64{v} + x.AsType = &MsgUpdateParam_AsUint64{v} case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsCoin", wireType) @@ -6970,7 +6970,7 @@ type MsgUpdateParam struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Types that are assignable to AsType: // - // *MsgUpdateParam_AsInt64 + // *MsgUpdateParam_AsUint64 // *MsgUpdateParam_AsCoin AsType isMsgUpdateParam_AsType `protobuf_oneof:"asType"` } @@ -7016,9 +7016,9 @@ func (x *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { return nil } -func (x *MsgUpdateParam) GetAsInt64() int64 { - if x, ok := x.GetAsType().(*MsgUpdateParam_AsInt64); ok { - return x.AsInt64 +func (x *MsgUpdateParam) GetAsUint64() uint64 { + if x, ok := x.GetAsType().(*MsgUpdateParam_AsUint64); ok { + return x.AsUint64 } return 0 } @@ -7034,15 +7034,15 @@ type isMsgUpdateParam_AsType interface { isMsgUpdateParam_AsType() } -type MsgUpdateParam_AsInt64 struct { - AsInt64 int64 `protobuf:"varint,3,opt,name=as_int64,json=asInt64,proto3,oneof"` +type MsgUpdateParam_AsUint64 struct { + AsUint64 uint64 `protobuf:"varint,3,opt,name=as_uint64,json=asUint64,proto3,oneof"` } type MsgUpdateParam_AsCoin struct { AsCoin *v1beta1.Coin `protobuf:"bytes,4,opt,name=as_coin,json=asCoin,proto3,oneof"` } -func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsUint64) isMsgUpdateParam_AsType() {} func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} @@ -7189,88 +7189,90 @@ var file_poktroll_application_tx_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0xc9, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0xe7, 0x01, 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, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, - 0x34, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, - 0x73, 0x43, 0x6f, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x22, - 0x4e, 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, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, - 0xb0, 0x06, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2d, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x70, 0x0a, - 0x10, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, - 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x31, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x76, 0x0a, 0x12, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x61, 0x73, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x73, 0x5f, 0x75, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x48, 0x00, 0x52, 0x08, 0x61, 0x73, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x12, 0x41, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x0b, 0xea, 0xde, + 0x1f, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, 0x43, + 0x6f, 0x69, 0x6e, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4e, 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, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xb0, 0x06, + 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x64, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x1a, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, - 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2a, 0x2e, 0x70, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, - 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x32, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, - 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x15, - 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x36, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, - 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, + 0x69, 0x6f, 0x6e, 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, 0x70, 0x0a, 0x10, 0x53, + 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x31, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, + 0x12, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x33, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, + 0x6b, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, + 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x1a, 0x32, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, + 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x47, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x15, 0x55, 0x6e, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x12, 0x2e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x1a, 0x36, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, + 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x79, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x1a, 0x34, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, + 0x6f, 0x6e, 0x12, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x2c, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 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, 0xbf, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, - 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, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0xca, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x50, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x34, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x2c, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 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, 0xbf, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 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, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x50, 0x41, 0x58, 0xaa, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0xca, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0xe2, 0x02, 0x20, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x5c, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7514,7 +7516,7 @@ func file_poktroll_application_tx_proto_init() { } } file_poktroll_application_tx_proto_msgTypes[12].OneofWrappers = []interface{}{ - (*MsgUpdateParam_AsInt64)(nil), + (*MsgUpdateParam_AsUint64)(nil), (*MsgUpdateParam_AsCoin)(nil), } type x struct{} diff --git a/api/poktroll/proof/event.pulsar.go b/api/poktroll/proof/event.pulsar.go index 50fdd4646..2954b58b7 100644 --- a/api/poktroll/proof/event.pulsar.go +++ b/api/poktroll/proof/event.pulsar.go @@ -2,6 +2,7 @@ package proof import ( + v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" @@ -14,10 +15,12 @@ import ( ) var ( - md_EventClaimCreated protoreflect.MessageDescriptor - fd_EventClaimCreated_claim protoreflect.FieldDescriptor - fd_EventClaimCreated_num_relays protoreflect.FieldDescriptor - fd_EventClaimCreated_num_compute_units protoreflect.FieldDescriptor + md_EventClaimCreated protoreflect.MessageDescriptor + fd_EventClaimCreated_claim protoreflect.FieldDescriptor + fd_EventClaimCreated_num_relays protoreflect.FieldDescriptor + fd_EventClaimCreated_num_claimed_compute_units protoreflect.FieldDescriptor + fd_EventClaimCreated_num_estimated_compute_units protoreflect.FieldDescriptor + fd_EventClaimCreated_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -25,7 +28,9 @@ func init() { md_EventClaimCreated = File_poktroll_proof_event_proto.Messages().ByName("EventClaimCreated") fd_EventClaimCreated_claim = md_EventClaimCreated.Fields().ByName("claim") fd_EventClaimCreated_num_relays = md_EventClaimCreated.Fields().ByName("num_relays") - fd_EventClaimCreated_num_compute_units = md_EventClaimCreated.Fields().ByName("num_compute_units") + fd_EventClaimCreated_num_claimed_compute_units = md_EventClaimCreated.Fields().ByName("num_claimed_compute_units") + fd_EventClaimCreated_num_estimated_compute_units = md_EventClaimCreated.Fields().ByName("num_estimated_compute_units") + fd_EventClaimCreated_claimed_upokt = md_EventClaimCreated.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventClaimCreated)(nil) @@ -105,9 +110,21 @@ func (x *fastReflection_EventClaimCreated) Range(f func(protoreflect.FieldDescri return } } - if x.NumComputeUnits != uint64(0) { - value := protoreflect.ValueOfUint64(x.NumComputeUnits) - if !f(fd_EventClaimCreated_num_compute_units, value) { + if x.NumClaimedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumClaimedComputeUnits) + if !f(fd_EventClaimCreated_num_claimed_compute_units, value) { + return + } + } + if x.NumEstimatedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumEstimatedComputeUnits) + if !f(fd_EventClaimCreated_num_estimated_compute_units, value) { + return + } + } + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventClaimCreated_claimed_upokt, value) { return } } @@ -130,8 +147,12 @@ func (x *fastReflection_EventClaimCreated) Has(fd protoreflect.FieldDescriptor) return x.Claim != nil case "poktroll.proof.EventClaimCreated.num_relays": return x.NumRelays != uint64(0) - case "poktroll.proof.EventClaimCreated.num_compute_units": - return x.NumComputeUnits != uint64(0) + case "poktroll.proof.EventClaimCreated.num_claimed_compute_units": + return x.NumClaimedComputeUnits != uint64(0) + case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": + return x.NumEstimatedComputeUnits != uint64(0) + case "poktroll.proof.EventClaimCreated.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimCreated")) @@ -152,8 +173,12 @@ func (x *fastReflection_EventClaimCreated) Clear(fd protoreflect.FieldDescriptor x.Claim = nil case "poktroll.proof.EventClaimCreated.num_relays": x.NumRelays = uint64(0) - case "poktroll.proof.EventClaimCreated.num_compute_units": - x.NumComputeUnits = uint64(0) + case "poktroll.proof.EventClaimCreated.num_claimed_compute_units": + x.NumClaimedComputeUnits = uint64(0) + case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": + x.NumEstimatedComputeUnits = uint64(0) + case "poktroll.proof.EventClaimCreated.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimCreated")) @@ -176,9 +201,15 @@ func (x *fastReflection_EventClaimCreated) Get(descriptor protoreflect.FieldDesc case "poktroll.proof.EventClaimCreated.num_relays": value := x.NumRelays return protoreflect.ValueOfUint64(value) - case "poktroll.proof.EventClaimCreated.num_compute_units": - value := x.NumComputeUnits + case "poktroll.proof.EventClaimCreated.num_claimed_compute_units": + value := x.NumClaimedComputeUnits return protoreflect.ValueOfUint64(value) + case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": + value := x.NumEstimatedComputeUnits + return protoreflect.ValueOfUint64(value) + case "poktroll.proof.EventClaimCreated.claimed_upokt": + value := x.ClaimedUpokt + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimCreated")) @@ -203,8 +234,12 @@ func (x *fastReflection_EventClaimCreated) Set(fd protoreflect.FieldDescriptor, x.Claim = value.Message().Interface().(*Claim) case "poktroll.proof.EventClaimCreated.num_relays": x.NumRelays = value.Uint() - case "poktroll.proof.EventClaimCreated.num_compute_units": - x.NumComputeUnits = value.Uint() + case "poktroll.proof.EventClaimCreated.num_claimed_compute_units": + x.NumClaimedComputeUnits = value.Uint() + case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": + x.NumEstimatedComputeUnits = value.Uint() + case "poktroll.proof.EventClaimCreated.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimCreated")) @@ -230,10 +265,17 @@ func (x *fastReflection_EventClaimCreated) Mutable(fd protoreflect.FieldDescript x.Claim = new(Claim) } return protoreflect.ValueOfMessage(x.Claim.ProtoReflect()) + case "poktroll.proof.EventClaimCreated.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.proof.EventClaimCreated.num_relays": panic(fmt.Errorf("field num_relays of message poktroll.proof.EventClaimCreated is not mutable")) - case "poktroll.proof.EventClaimCreated.num_compute_units": - panic(fmt.Errorf("field num_compute_units of message poktroll.proof.EventClaimCreated is not mutable")) + case "poktroll.proof.EventClaimCreated.num_claimed_compute_units": + panic(fmt.Errorf("field num_claimed_compute_units of message poktroll.proof.EventClaimCreated is not mutable")) + case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": + panic(fmt.Errorf("field num_estimated_compute_units of message poktroll.proof.EventClaimCreated is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimCreated")) @@ -252,8 +294,13 @@ func (x *fastReflection_EventClaimCreated) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.proof.EventClaimCreated.num_relays": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.proof.EventClaimCreated.num_compute_units": + case "poktroll.proof.EventClaimCreated.num_claimed_compute_units": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": + return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.proof.EventClaimCreated.claimed_upokt": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimCreated")) @@ -330,8 +377,15 @@ func (x *fastReflection_EventClaimCreated) ProtoMethods() *protoiface.Methods { if x.NumRelays != 0 { n += 1 + runtime.Sov(uint64(x.NumRelays)) } - if x.NumComputeUnits != 0 { - n += 1 + runtime.Sov(uint64(x.NumComputeUnits)) + if x.NumClaimedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumClaimedComputeUnits)) + } + if x.NumEstimatedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) + } + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -362,10 +416,29 @@ func (x *fastReflection_EventClaimCreated) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.NumComputeUnits != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.NumComputeUnits)) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) + 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] = 0x32 + } + if x.NumEstimatedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumEstimatedComputeUnits)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x28 + } + if x.NumClaimedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumClaimedComputeUnits)) + i-- + dAtA[i] = 0x20 } if x.NumRelays != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.NumRelays)) @@ -490,11 +563,49 @@ func (x *fastReflection_EventClaimCreated) ProtoMethods() *protoiface.Methods { break } } - case 3: + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) + } + x.NumClaimedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumClaimedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + x.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } - x.NumComputeUnits = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -504,11 +615,28 @@ func (x *fastReflection_EventClaimCreated) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.NumComputeUnits |= uint64(b&0x7F) << shift + 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.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -545,10 +673,12 @@ func (x *fastReflection_EventClaimCreated) ProtoMethods() *protoiface.Methods { } var ( - md_EventClaimUpdated protoreflect.MessageDescriptor - fd_EventClaimUpdated_claim protoreflect.FieldDescriptor - fd_EventClaimUpdated_num_relays protoreflect.FieldDescriptor - fd_EventClaimUpdated_num_compute_units protoreflect.FieldDescriptor + md_EventClaimUpdated protoreflect.MessageDescriptor + fd_EventClaimUpdated_claim protoreflect.FieldDescriptor + fd_EventClaimUpdated_num_relays protoreflect.FieldDescriptor + fd_EventClaimUpdated_num_claimed_compute_units protoreflect.FieldDescriptor + fd_EventClaimUpdated_num_estimated_compute_units protoreflect.FieldDescriptor + fd_EventClaimUpdated_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -556,7 +686,9 @@ func init() { md_EventClaimUpdated = File_poktroll_proof_event_proto.Messages().ByName("EventClaimUpdated") fd_EventClaimUpdated_claim = md_EventClaimUpdated.Fields().ByName("claim") fd_EventClaimUpdated_num_relays = md_EventClaimUpdated.Fields().ByName("num_relays") - fd_EventClaimUpdated_num_compute_units = md_EventClaimUpdated.Fields().ByName("num_compute_units") + fd_EventClaimUpdated_num_claimed_compute_units = md_EventClaimUpdated.Fields().ByName("num_claimed_compute_units") + fd_EventClaimUpdated_num_estimated_compute_units = md_EventClaimUpdated.Fields().ByName("num_estimated_compute_units") + fd_EventClaimUpdated_claimed_upokt = md_EventClaimUpdated.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventClaimUpdated)(nil) @@ -636,9 +768,21 @@ func (x *fastReflection_EventClaimUpdated) Range(f func(protoreflect.FieldDescri return } } - if x.NumComputeUnits != uint64(0) { - value := protoreflect.ValueOfUint64(x.NumComputeUnits) - if !f(fd_EventClaimUpdated_num_compute_units, value) { + if x.NumClaimedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumClaimedComputeUnits) + if !f(fd_EventClaimUpdated_num_claimed_compute_units, value) { + return + } + } + if x.NumEstimatedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumEstimatedComputeUnits) + if !f(fd_EventClaimUpdated_num_estimated_compute_units, value) { + return + } + } + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventClaimUpdated_claimed_upokt, value) { return } } @@ -661,8 +805,12 @@ func (x *fastReflection_EventClaimUpdated) Has(fd protoreflect.FieldDescriptor) return x.Claim != nil case "poktroll.proof.EventClaimUpdated.num_relays": return x.NumRelays != uint64(0) - case "poktroll.proof.EventClaimUpdated.num_compute_units": - return x.NumComputeUnits != uint64(0) + case "poktroll.proof.EventClaimUpdated.num_claimed_compute_units": + return x.NumClaimedComputeUnits != uint64(0) + case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": + return x.NumEstimatedComputeUnits != uint64(0) + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimUpdated")) @@ -683,8 +831,12 @@ func (x *fastReflection_EventClaimUpdated) Clear(fd protoreflect.FieldDescriptor x.Claim = nil case "poktroll.proof.EventClaimUpdated.num_relays": x.NumRelays = uint64(0) - case "poktroll.proof.EventClaimUpdated.num_compute_units": - x.NumComputeUnits = uint64(0) + case "poktroll.proof.EventClaimUpdated.num_claimed_compute_units": + x.NumClaimedComputeUnits = uint64(0) + case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": + x.NumEstimatedComputeUnits = uint64(0) + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimUpdated")) @@ -707,9 +859,15 @@ func (x *fastReflection_EventClaimUpdated) Get(descriptor protoreflect.FieldDesc case "poktroll.proof.EventClaimUpdated.num_relays": value := x.NumRelays return protoreflect.ValueOfUint64(value) - case "poktroll.proof.EventClaimUpdated.num_compute_units": - value := x.NumComputeUnits + case "poktroll.proof.EventClaimUpdated.num_claimed_compute_units": + value := x.NumClaimedComputeUnits return protoreflect.ValueOfUint64(value) + case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": + value := x.NumEstimatedComputeUnits + return protoreflect.ValueOfUint64(value) + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + value := x.ClaimedUpokt + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimUpdated")) @@ -734,8 +892,12 @@ func (x *fastReflection_EventClaimUpdated) Set(fd protoreflect.FieldDescriptor, x.Claim = value.Message().Interface().(*Claim) case "poktroll.proof.EventClaimUpdated.num_relays": x.NumRelays = value.Uint() - case "poktroll.proof.EventClaimUpdated.num_compute_units": - x.NumComputeUnits = value.Uint() + case "poktroll.proof.EventClaimUpdated.num_claimed_compute_units": + x.NumClaimedComputeUnits = value.Uint() + case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": + x.NumEstimatedComputeUnits = value.Uint() + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimUpdated")) @@ -761,10 +923,17 @@ func (x *fastReflection_EventClaimUpdated) Mutable(fd protoreflect.FieldDescript x.Claim = new(Claim) } return protoreflect.ValueOfMessage(x.Claim.ProtoReflect()) + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.proof.EventClaimUpdated.num_relays": panic(fmt.Errorf("field num_relays of message poktroll.proof.EventClaimUpdated is not mutable")) - case "poktroll.proof.EventClaimUpdated.num_compute_units": - panic(fmt.Errorf("field num_compute_units of message poktroll.proof.EventClaimUpdated is not mutable")) + case "poktroll.proof.EventClaimUpdated.num_claimed_compute_units": + panic(fmt.Errorf("field num_claimed_compute_units of message poktroll.proof.EventClaimUpdated is not mutable")) + case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": + panic(fmt.Errorf("field num_estimated_compute_units of message poktroll.proof.EventClaimUpdated is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimUpdated")) @@ -783,8 +952,13 @@ func (x *fastReflection_EventClaimUpdated) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.proof.EventClaimUpdated.num_relays": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.proof.EventClaimUpdated.num_compute_units": + case "poktroll.proof.EventClaimUpdated.num_claimed_compute_units": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": + return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimUpdated")) @@ -861,8 +1035,15 @@ func (x *fastReflection_EventClaimUpdated) ProtoMethods() *protoiface.Methods { if x.NumRelays != 0 { n += 1 + runtime.Sov(uint64(x.NumRelays)) } - if x.NumComputeUnits != 0 { - n += 1 + runtime.Sov(uint64(x.NumComputeUnits)) + if x.NumClaimedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumClaimedComputeUnits)) + } + if x.NumEstimatedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) + } + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -893,10 +1074,29 @@ func (x *fastReflection_EventClaimUpdated) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.NumComputeUnits != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.NumComputeUnits)) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) + 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] = 0x32 + } + if x.NumEstimatedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumEstimatedComputeUnits)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x28 + } + if x.NumClaimedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumClaimedComputeUnits)) + i-- + dAtA[i] = 0x20 } if x.NumRelays != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.NumRelays)) @@ -1021,11 +1221,30 @@ func (x *fastReflection_EventClaimUpdated) ProtoMethods() *protoiface.Methods { break } } - case 3: + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) + } + x.NumClaimedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumClaimedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) } - x.NumComputeUnits = 0 + x.NumEstimatedComputeUnits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1035,11 +1254,47 @@ func (x *fastReflection_EventClaimUpdated) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.NumComputeUnits |= uint64(b&0x7F) << shift + x.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift if b < 0x80 { break } } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", 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.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1076,11 +1331,13 @@ func (x *fastReflection_EventClaimUpdated) ProtoMethods() *protoiface.Methods { } var ( - md_EventProofSubmitted protoreflect.MessageDescriptor - fd_EventProofSubmitted_claim protoreflect.FieldDescriptor - fd_EventProofSubmitted_proof protoreflect.FieldDescriptor - fd_EventProofSubmitted_num_relays protoreflect.FieldDescriptor - fd_EventProofSubmitted_num_compute_units protoreflect.FieldDescriptor + md_EventProofSubmitted protoreflect.MessageDescriptor + fd_EventProofSubmitted_claim protoreflect.FieldDescriptor + fd_EventProofSubmitted_proof protoreflect.FieldDescriptor + fd_EventProofSubmitted_num_relays protoreflect.FieldDescriptor + fd_EventProofSubmitted_num_claimed_compute_units protoreflect.FieldDescriptor + fd_EventProofSubmitted_num_estimated_compute_units protoreflect.FieldDescriptor + fd_EventProofSubmitted_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -1089,7 +1346,9 @@ func init() { fd_EventProofSubmitted_claim = md_EventProofSubmitted.Fields().ByName("claim") fd_EventProofSubmitted_proof = md_EventProofSubmitted.Fields().ByName("proof") fd_EventProofSubmitted_num_relays = md_EventProofSubmitted.Fields().ByName("num_relays") - fd_EventProofSubmitted_num_compute_units = md_EventProofSubmitted.Fields().ByName("num_compute_units") + fd_EventProofSubmitted_num_claimed_compute_units = md_EventProofSubmitted.Fields().ByName("num_claimed_compute_units") + fd_EventProofSubmitted_num_estimated_compute_units = md_EventProofSubmitted.Fields().ByName("num_estimated_compute_units") + fd_EventProofSubmitted_claimed_upokt = md_EventProofSubmitted.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventProofSubmitted)(nil) @@ -1175,9 +1434,21 @@ func (x *fastReflection_EventProofSubmitted) Range(f func(protoreflect.FieldDesc return } } - if x.NumComputeUnits != uint64(0) { - value := protoreflect.ValueOfUint64(x.NumComputeUnits) - if !f(fd_EventProofSubmitted_num_compute_units, value) { + if x.NumClaimedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumClaimedComputeUnits) + if !f(fd_EventProofSubmitted_num_claimed_compute_units, value) { + return + } + } + if x.NumEstimatedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumEstimatedComputeUnits) + if !f(fd_EventProofSubmitted_num_estimated_compute_units, value) { + return + } + } + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventProofSubmitted_claimed_upokt, value) { return } } @@ -1202,8 +1473,12 @@ func (x *fastReflection_EventProofSubmitted) Has(fd protoreflect.FieldDescriptor return x.Proof != nil case "poktroll.proof.EventProofSubmitted.num_relays": return x.NumRelays != uint64(0) - case "poktroll.proof.EventProofSubmitted.num_compute_units": - return x.NumComputeUnits != uint64(0) + case "poktroll.proof.EventProofSubmitted.num_claimed_compute_units": + return x.NumClaimedComputeUnits != uint64(0) + case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": + return x.NumEstimatedComputeUnits != uint64(0) + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofSubmitted")) @@ -1226,8 +1501,12 @@ func (x *fastReflection_EventProofSubmitted) Clear(fd protoreflect.FieldDescript x.Proof = nil case "poktroll.proof.EventProofSubmitted.num_relays": x.NumRelays = uint64(0) - case "poktroll.proof.EventProofSubmitted.num_compute_units": - x.NumComputeUnits = uint64(0) + case "poktroll.proof.EventProofSubmitted.num_claimed_compute_units": + x.NumClaimedComputeUnits = uint64(0) + case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": + x.NumEstimatedComputeUnits = uint64(0) + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofSubmitted")) @@ -1253,9 +1532,15 @@ func (x *fastReflection_EventProofSubmitted) Get(descriptor protoreflect.FieldDe case "poktroll.proof.EventProofSubmitted.num_relays": value := x.NumRelays return protoreflect.ValueOfUint64(value) - case "poktroll.proof.EventProofSubmitted.num_compute_units": - value := x.NumComputeUnits + case "poktroll.proof.EventProofSubmitted.num_claimed_compute_units": + value := x.NumClaimedComputeUnits return protoreflect.ValueOfUint64(value) + case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": + value := x.NumEstimatedComputeUnits + return protoreflect.ValueOfUint64(value) + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + value := x.ClaimedUpokt + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofSubmitted")) @@ -1282,8 +1567,12 @@ func (x *fastReflection_EventProofSubmitted) Set(fd protoreflect.FieldDescriptor x.Proof = value.Message().Interface().(*Proof) case "poktroll.proof.EventProofSubmitted.num_relays": x.NumRelays = value.Uint() - case "poktroll.proof.EventProofSubmitted.num_compute_units": - x.NumComputeUnits = value.Uint() + case "poktroll.proof.EventProofSubmitted.num_claimed_compute_units": + x.NumClaimedComputeUnits = value.Uint() + case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": + x.NumEstimatedComputeUnits = value.Uint() + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofSubmitted")) @@ -1314,10 +1603,17 @@ func (x *fastReflection_EventProofSubmitted) Mutable(fd protoreflect.FieldDescri x.Proof = new(Proof) } return protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.proof.EventProofSubmitted.num_relays": panic(fmt.Errorf("field num_relays of message poktroll.proof.EventProofSubmitted is not mutable")) - case "poktroll.proof.EventProofSubmitted.num_compute_units": - panic(fmt.Errorf("field num_compute_units of message poktroll.proof.EventProofSubmitted is not mutable")) + case "poktroll.proof.EventProofSubmitted.num_claimed_compute_units": + panic(fmt.Errorf("field num_claimed_compute_units of message poktroll.proof.EventProofSubmitted is not mutable")) + case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": + panic(fmt.Errorf("field num_estimated_compute_units of message poktroll.proof.EventProofSubmitted is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofSubmitted")) @@ -1339,8 +1635,13 @@ func (x *fastReflection_EventProofSubmitted) NewField(fd protoreflect.FieldDescr return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.proof.EventProofSubmitted.num_relays": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.proof.EventProofSubmitted.num_compute_units": + case "poktroll.proof.EventProofSubmitted.num_claimed_compute_units": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": + return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofSubmitted")) @@ -1421,8 +1722,15 @@ func (x *fastReflection_EventProofSubmitted) ProtoMethods() *protoiface.Methods if x.NumRelays != 0 { n += 1 + runtime.Sov(uint64(x.NumRelays)) } - if x.NumComputeUnits != 0 { - n += 1 + runtime.Sov(uint64(x.NumComputeUnits)) + if x.NumClaimedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumClaimedComputeUnits)) + } + if x.NumEstimatedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) + } + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1453,8 +1761,27 @@ func (x *fastReflection_EventProofSubmitted) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.NumComputeUnits != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.NumComputeUnits)) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) + 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] = 0x32 + } + if x.NumEstimatedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumEstimatedComputeUnits)) + i-- + dAtA[i] = 0x28 + } + if x.NumClaimedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumClaimedComputeUnits)) i-- dAtA[i] = 0x20 } @@ -1633,9 +1960,47 @@ func (x *fastReflection_EventProofSubmitted) ProtoMethods() *protoiface.Methods } case 4: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) + } + x.NumClaimedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumClaimedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + x.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } - x.NumComputeUnits = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1645,11 +2010,28 @@ func (x *fastReflection_EventProofSubmitted) ProtoMethods() *protoiface.Methods } b := dAtA[iNdEx] iNdEx++ - x.NumComputeUnits |= uint64(b&0x7F) << shift + 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.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1686,11 +2068,13 @@ func (x *fastReflection_EventProofSubmitted) ProtoMethods() *protoiface.Methods } var ( - md_EventProofUpdated protoreflect.MessageDescriptor - fd_EventProofUpdated_claim protoreflect.FieldDescriptor - fd_EventProofUpdated_proof protoreflect.FieldDescriptor - fd_EventProofUpdated_num_relays protoreflect.FieldDescriptor - fd_EventProofUpdated_num_compute_units protoreflect.FieldDescriptor + md_EventProofUpdated protoreflect.MessageDescriptor + fd_EventProofUpdated_claim protoreflect.FieldDescriptor + fd_EventProofUpdated_proof protoreflect.FieldDescriptor + fd_EventProofUpdated_num_relays protoreflect.FieldDescriptor + fd_EventProofUpdated_num_claimed_compute_units protoreflect.FieldDescriptor + fd_EventProofUpdated_num_estimated_compute_units protoreflect.FieldDescriptor + fd_EventProofUpdated_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -1699,7 +2083,9 @@ func init() { fd_EventProofUpdated_claim = md_EventProofUpdated.Fields().ByName("claim") fd_EventProofUpdated_proof = md_EventProofUpdated.Fields().ByName("proof") fd_EventProofUpdated_num_relays = md_EventProofUpdated.Fields().ByName("num_relays") - fd_EventProofUpdated_num_compute_units = md_EventProofUpdated.Fields().ByName("num_compute_units") + fd_EventProofUpdated_num_claimed_compute_units = md_EventProofUpdated.Fields().ByName("num_claimed_compute_units") + fd_EventProofUpdated_num_estimated_compute_units = md_EventProofUpdated.Fields().ByName("num_estimated_compute_units") + fd_EventProofUpdated_claimed_upokt = md_EventProofUpdated.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventProofUpdated)(nil) @@ -1785,9 +2171,21 @@ func (x *fastReflection_EventProofUpdated) Range(f func(protoreflect.FieldDescri return } } - if x.NumComputeUnits != uint64(0) { - value := protoreflect.ValueOfUint64(x.NumComputeUnits) - if !f(fd_EventProofUpdated_num_compute_units, value) { + if x.NumClaimedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumClaimedComputeUnits) + if !f(fd_EventProofUpdated_num_claimed_compute_units, value) { + return + } + } + if x.NumEstimatedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumEstimatedComputeUnits) + if !f(fd_EventProofUpdated_num_estimated_compute_units, value) { + return + } + } + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventProofUpdated_claimed_upokt, value) { return } } @@ -1812,8 +2210,12 @@ func (x *fastReflection_EventProofUpdated) Has(fd protoreflect.FieldDescriptor) return x.Proof != nil case "poktroll.proof.EventProofUpdated.num_relays": return x.NumRelays != uint64(0) - case "poktroll.proof.EventProofUpdated.num_compute_units": - return x.NumComputeUnits != uint64(0) + case "poktroll.proof.EventProofUpdated.num_claimed_compute_units": + return x.NumClaimedComputeUnits != uint64(0) + case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": + return x.NumEstimatedComputeUnits != uint64(0) + case "poktroll.proof.EventProofUpdated.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofUpdated")) @@ -1836,8 +2238,12 @@ func (x *fastReflection_EventProofUpdated) Clear(fd protoreflect.FieldDescriptor x.Proof = nil case "poktroll.proof.EventProofUpdated.num_relays": x.NumRelays = uint64(0) - case "poktroll.proof.EventProofUpdated.num_compute_units": - x.NumComputeUnits = uint64(0) + case "poktroll.proof.EventProofUpdated.num_claimed_compute_units": + x.NumClaimedComputeUnits = uint64(0) + case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": + x.NumEstimatedComputeUnits = uint64(0) + case "poktroll.proof.EventProofUpdated.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofUpdated")) @@ -1863,9 +2269,15 @@ func (x *fastReflection_EventProofUpdated) Get(descriptor protoreflect.FieldDesc case "poktroll.proof.EventProofUpdated.num_relays": value := x.NumRelays return protoreflect.ValueOfUint64(value) - case "poktroll.proof.EventProofUpdated.num_compute_units": - value := x.NumComputeUnits + case "poktroll.proof.EventProofUpdated.num_claimed_compute_units": + value := x.NumClaimedComputeUnits return protoreflect.ValueOfUint64(value) + case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": + value := x.NumEstimatedComputeUnits + return protoreflect.ValueOfUint64(value) + case "poktroll.proof.EventProofUpdated.claimed_upokt": + value := x.ClaimedUpokt + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofUpdated")) @@ -1892,8 +2304,12 @@ func (x *fastReflection_EventProofUpdated) Set(fd protoreflect.FieldDescriptor, x.Proof = value.Message().Interface().(*Proof) case "poktroll.proof.EventProofUpdated.num_relays": x.NumRelays = value.Uint() - case "poktroll.proof.EventProofUpdated.num_compute_units": - x.NumComputeUnits = value.Uint() + case "poktroll.proof.EventProofUpdated.num_claimed_compute_units": + x.NumClaimedComputeUnits = value.Uint() + case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": + x.NumEstimatedComputeUnits = value.Uint() + case "poktroll.proof.EventProofUpdated.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofUpdated")) @@ -1924,10 +2340,17 @@ func (x *fastReflection_EventProofUpdated) Mutable(fd protoreflect.FieldDescript x.Proof = new(Proof) } return protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) + case "poktroll.proof.EventProofUpdated.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.proof.EventProofUpdated.num_relays": panic(fmt.Errorf("field num_relays of message poktroll.proof.EventProofUpdated is not mutable")) - case "poktroll.proof.EventProofUpdated.num_compute_units": - panic(fmt.Errorf("field num_compute_units of message poktroll.proof.EventProofUpdated is not mutable")) + case "poktroll.proof.EventProofUpdated.num_claimed_compute_units": + panic(fmt.Errorf("field num_claimed_compute_units of message poktroll.proof.EventProofUpdated is not mutable")) + case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": + panic(fmt.Errorf("field num_estimated_compute_units of message poktroll.proof.EventProofUpdated is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofUpdated")) @@ -1949,8 +2372,13 @@ func (x *fastReflection_EventProofUpdated) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.proof.EventProofUpdated.num_relays": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.proof.EventProofUpdated.num_compute_units": + case "poktroll.proof.EventProofUpdated.num_claimed_compute_units": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": + return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.proof.EventProofUpdated.claimed_upokt": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofUpdated")) @@ -2031,8 +2459,15 @@ func (x *fastReflection_EventProofUpdated) ProtoMethods() *protoiface.Methods { if x.NumRelays != 0 { n += 1 + runtime.Sov(uint64(x.NumRelays)) } - if x.NumComputeUnits != 0 { - n += 1 + runtime.Sov(uint64(x.NumComputeUnits)) + if x.NumClaimedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumClaimedComputeUnits)) + } + if x.NumEstimatedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) + } + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -2063,8 +2498,27 @@ func (x *fastReflection_EventProofUpdated) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.NumComputeUnits != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.NumComputeUnits)) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) + 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] = 0x32 + } + if x.NumEstimatedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumEstimatedComputeUnits)) + i-- + dAtA[i] = 0x28 + } + if x.NumClaimedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumClaimedComputeUnits)) i-- dAtA[i] = 0x20 } @@ -2243,9 +2697,9 @@ func (x *fastReflection_EventProofUpdated) ProtoMethods() *protoiface.Methods { } case 4: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) } - x.NumComputeUnits = 0 + x.NumClaimedComputeUnits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -2255,11 +2709,66 @@ func (x *fastReflection_EventProofUpdated) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.NumComputeUnits |= uint64(b&0x7F) << shift + x.NumClaimedComputeUnits |= uint64(b&0x7F) << shift if b < 0x80 { break } } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + x.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", 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.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -2313,9 +2822,11 @@ type EventClaimCreated struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` - NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` - NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units,omitempty"` + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` + NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventClaimCreated) Reset() { @@ -2352,22 +2863,38 @@ func (x *EventClaimCreated) GetNumRelays() uint64 { return 0 } -func (x *EventClaimCreated) GetNumComputeUnits() uint64 { +func (x *EventClaimCreated) GetNumClaimedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumClaimedComputeUnits } return 0 } +func (x *EventClaimCreated) GetNumEstimatedComputeUnits() uint64 { + if x != nil { + return x.NumEstimatedComputeUnits + } + return 0 +} + +func (x *EventClaimCreated) GetClaimedUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedUpokt + } + return nil +} + // TODO_TEST: Add coverage for claim updates. type EventClaimUpdated struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` - NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` - NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units,omitempty"` + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` + NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventClaimUpdated) Reset() { @@ -2404,22 +2931,38 @@ func (x *EventClaimUpdated) GetNumRelays() uint64 { return 0 } -func (x *EventClaimUpdated) GetNumComputeUnits() uint64 { +func (x *EventClaimUpdated) GetNumClaimedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumClaimedComputeUnits } return 0 } +func (x *EventClaimUpdated) GetNumEstimatedComputeUnits() uint64 { + if x != nil { + return x.NumEstimatedComputeUnits + } + return 0 +} + +func (x *EventClaimUpdated) GetClaimedUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedUpokt + } + return nil +} + type EventProofSubmitted struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` - NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units,omitempty"` + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` + Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventProofSubmitted) Reset() { @@ -2463,23 +3006,39 @@ func (x *EventProofSubmitted) GetNumRelays() uint64 { return 0 } -func (x *EventProofSubmitted) GetNumComputeUnits() uint64 { +func (x *EventProofSubmitted) GetNumClaimedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumClaimedComputeUnits } return 0 } +func (x *EventProofSubmitted) GetNumEstimatedComputeUnits() uint64 { + if x != nil { + return x.NumEstimatedComputeUnits + } + return 0 +} + +func (x *EventProofSubmitted) GetClaimedUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedUpokt + } + return nil +} + // TODO_TEST: Add coverage for proof updates. type EventProofUpdated struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` - NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units,omitempty"` + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim,omitempty"` + Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` + NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventProofUpdated) Reset() { @@ -2523,88 +3082,155 @@ func (x *EventProofUpdated) GetNumRelays() uint64 { return 0 } -func (x *EventProofUpdated) GetNumComputeUnits() uint64 { +func (x *EventProofUpdated) GetNumClaimedComputeUnits() uint64 { + if x != nil { + return x.NumClaimedComputeUnits + } + return 0 +} + +func (x *EventProofUpdated) GetNumEstimatedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumEstimatedComputeUnits } return 0 } +func (x *EventProofUpdated) GetClaimedUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedUpokt + } + return nil +} + var File_poktroll_proof_event_proto protoreflect.FileDescriptor var file_poktroll_proof_event_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x14, 0x67, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x1e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, - 0x01, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x43, 0x72, 0x65, + 0x6f, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, + 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, - 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6e, - 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6e, 0x75, 0x6d, 0x5f, - 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x0f, 0x6e, - 0x75, 0x6d, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x22, 0xbd, - 0x01, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x2d, 0x0a, 0x0a, - 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, - 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6e, - 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6e, 0x75, 0x6d, 0x5f, - 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x0f, 0x6e, - 0x75, 0x6d, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x22, 0xf7, - 0x01, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x53, 0x75, 0x62, - 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, - 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x36, - 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, - 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, - 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, - 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, - 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, - 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x0f, 0x6e, 0x75, 0x6d, 0x43, 0x6f, 0x6d, 0x70, - 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x22, 0xf5, 0x01, 0x0a, 0x11, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, + 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, + 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, + 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, + 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, + 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, + 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, + 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0x87, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, - 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x09, 0xea, 0xde, - 0x1f, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, - 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, - 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x41, 0x0a, - 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, - 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6e, 0x75, - 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, - 0x0f, 0x6e, 0x75, 0x6d, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, - 0x42, 0x9e, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x0a, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 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, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, - 0xaa, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0xca, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, - 0x6f, 0x66, 0xe2, 0x02, 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, + 0x6c, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, + 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, + 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, + 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, + 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, + 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, + 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, + 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, + 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, + 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, + 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, + 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, + 0x6b, 0x74, 0x22, 0xc1, 0x03, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, + 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, + 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, + 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, 0x75, 0x6d, + 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, 0xea, 0xde, + 0x1f, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, 0x75, 0x6d, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, + 0x69, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, + 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, 0x6e, 0x75, + 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, + 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, + 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, + 0x69, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, + 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, + 0x64, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0xbf, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x0a, + 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, + 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, + 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, + 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, + 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, + 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, + 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, + 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x42, 0x9e, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x1f, 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, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, 0x02, 0x1a, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -2626,20 +3252,25 @@ var file_poktroll_proof_event_proto_goTypes = []interface{}{ (*EventProofSubmitted)(nil), // 2: poktroll.proof.EventProofSubmitted (*EventProofUpdated)(nil), // 3: poktroll.proof.EventProofUpdated (*Claim)(nil), // 4: poktroll.proof.Claim - (*Proof)(nil), // 5: poktroll.proof.Proof + (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin + (*Proof)(nil), // 6: poktroll.proof.Proof } var file_poktroll_proof_event_proto_depIdxs = []int32{ - 4, // 0: poktroll.proof.EventClaimCreated.claim:type_name -> poktroll.proof.Claim - 4, // 1: poktroll.proof.EventClaimUpdated.claim:type_name -> poktroll.proof.Claim - 4, // 2: poktroll.proof.EventProofSubmitted.claim:type_name -> poktroll.proof.Claim - 5, // 3: poktroll.proof.EventProofSubmitted.proof:type_name -> poktroll.proof.Proof - 4, // 4: poktroll.proof.EventProofUpdated.claim:type_name -> poktroll.proof.Claim - 5, // 5: poktroll.proof.EventProofUpdated.proof:type_name -> poktroll.proof.Proof - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 4, // 0: poktroll.proof.EventClaimCreated.claim:type_name -> poktroll.proof.Claim + 5, // 1: poktroll.proof.EventClaimCreated.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin + 4, // 2: poktroll.proof.EventClaimUpdated.claim:type_name -> poktroll.proof.Claim + 5, // 3: poktroll.proof.EventClaimUpdated.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin + 4, // 4: poktroll.proof.EventProofSubmitted.claim:type_name -> poktroll.proof.Claim + 6, // 5: poktroll.proof.EventProofSubmitted.proof:type_name -> poktroll.proof.Proof + 5, // 6: poktroll.proof.EventProofSubmitted.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin + 4, // 7: poktroll.proof.EventProofUpdated.claim:type_name -> poktroll.proof.Claim + 6, // 8: poktroll.proof.EventProofUpdated.proof:type_name -> poktroll.proof.Proof + 5, // 9: poktroll.proof.EventProofUpdated.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_poktroll_proof_event_proto_init() } diff --git a/api/poktroll/proof/params.pulsar.go b/api/poktroll/proof/params.pulsar.go index f5d9f9c75..36039d344 100644 --- a/api/poktroll/proof/params.pulsar.go +++ b/api/poktroll/proof/params.pulsar.go @@ -18,18 +18,16 @@ import ( ) var ( - md_Params protoreflect.MessageDescriptor - fd_Params_relay_difficulty_target_hash protoreflect.FieldDescriptor - fd_Params_proof_request_probability protoreflect.FieldDescriptor - fd_Params_proof_requirement_threshold protoreflect.FieldDescriptor - fd_Params_proof_missing_penalty protoreflect.FieldDescriptor - fd_Params_proof_submission_fee protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_proof_request_probability protoreflect.FieldDescriptor + fd_Params_proof_requirement_threshold protoreflect.FieldDescriptor + fd_Params_proof_missing_penalty protoreflect.FieldDescriptor + fd_Params_proof_submission_fee protoreflect.FieldDescriptor ) func init() { file_poktroll_proof_params_proto_init() md_Params = File_poktroll_proof_params_proto.Messages().ByName("Params") - fd_Params_relay_difficulty_target_hash = md_Params.Fields().ByName("relay_difficulty_target_hash") fd_Params_proof_request_probability = md_Params.Fields().ByName("proof_request_probability") fd_Params_proof_requirement_threshold = md_Params.Fields().ByName("proof_requirement_threshold") fd_Params_proof_missing_penalty = md_Params.Fields().ByName("proof_missing_penalty") @@ -101,12 +99,6 @@ func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.RelayDifficultyTargetHash) != 0 { - value := protoreflect.ValueOfBytes(x.RelayDifficultyTargetHash) - if !f(fd_Params_relay_difficulty_target_hash, value) { - return - } - } if x.ProofRequestProbability != float32(0) || math.Signbit(float64(x.ProofRequestProbability)) { value := protoreflect.ValueOfFloat32(x.ProofRequestProbability) if !f(fd_Params_proof_request_probability, value) { @@ -146,8 +138,6 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.proof.Params.relay_difficulty_target_hash": - return len(x.RelayDifficultyTargetHash) != 0 case "poktroll.proof.Params.proof_request_probability": return x.ProofRequestProbability != float32(0) || math.Signbit(float64(x.ProofRequestProbability)) case "poktroll.proof.Params.proof_requirement_threshold": @@ -172,8 +162,6 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.proof.Params.relay_difficulty_target_hash": - x.RelayDifficultyTargetHash = nil case "poktroll.proof.Params.proof_request_probability": x.ProofRequestProbability = float32(0) case "poktroll.proof.Params.proof_requirement_threshold": @@ -198,9 +186,6 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.proof.Params.relay_difficulty_target_hash": - value := x.RelayDifficultyTargetHash - return protoreflect.ValueOfBytes(value) case "poktroll.proof.Params.proof_request_probability": value := x.ProofRequestProbability return protoreflect.ValueOfFloat32(value) @@ -233,8 +218,6 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.proof.Params.relay_difficulty_target_hash": - x.RelayDifficultyTargetHash = value.Bytes() case "poktroll.proof.Params.proof_request_probability": x.ProofRequestProbability = float32(value.Float()) case "poktroll.proof.Params.proof_requirement_threshold": @@ -278,8 +261,6 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore x.ProofSubmissionFee = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.ProofSubmissionFee.ProtoReflect()) - case "poktroll.proof.Params.relay_difficulty_target_hash": - panic(fmt.Errorf("field relay_difficulty_target_hash of message poktroll.proof.Params is not mutable")) case "poktroll.proof.Params.proof_request_probability": panic(fmt.Errorf("field proof_request_probability of message poktroll.proof.Params is not mutable")) default: @@ -295,8 +276,6 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.proof.Params.relay_difficulty_target_hash": - return protoreflect.ValueOfBytes(nil) case "poktroll.proof.Params.proof_request_probability": return protoreflect.ValueOfFloat32(float32(0)) case "poktroll.proof.Params.proof_requirement_threshold": @@ -377,10 +356,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.RelayDifficultyTargetHash) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } if x.ProofRequestProbability != 0 || math.Signbit(float64(x.ProofRequestProbability)) { n += 5 } @@ -473,13 +448,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x15 } - if len(x.RelayDifficultyTargetHash) > 0 { - i -= len(x.RelayDifficultyTargetHash) - copy(dAtA[i:], x.RelayDifficultyTargetHash) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RelayDifficultyTargetHash))) - i-- - dAtA[i] = 0xa - } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -529,40 +497,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RelayDifficultyTargetHash", wireType) - } - var byteLen 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++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - 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.RelayDifficultyTargetHash = append(x.RelayDifficultyTargetHash[:0], dAtA[iNdEx:postIndex]...) - if x.RelayDifficultyTargetHash == nil { - x.RelayDifficultyTargetHash = []byte{} - } - iNdEx = postIndex case 2: if wireType != 5 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProofRequestProbability", wireType) @@ -736,9 +670,6 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // TODO_FOLLOWUP(@olshansk, #690): Either delete this or change it to be named "minimum" - // relay_difficulty_target_hash is the maximum value a relay hash must be less than to be volume/reward applicable. - RelayDifficultyTargetHash []byte `protobuf:"bytes,1,opt,name=relay_difficulty_target_hash,json=relayDifficultyTargetHash,proto3" json:"relay_difficulty_target_hash,omitempty"` // proof_request_probability is the probability of a session requiring a proof // if it's cost (i.e. compute unit consumption) is below the ProofRequirementThreshold. ProofRequestProbability float32 `protobuf:"fixed32,2,opt,name=proof_request_probability,json=proofRequestProbability,proto3" json:"proof_request_probability,omitempty"` @@ -782,13 +713,6 @@ func (*Params) Descriptor() ([]byte, []int) { return file_poktroll_proof_params_proto_rawDescGZIP(), []int{0} } -func (x *Params) GetRelayDifficultyTargetHash() []byte { - if x != nil { - return x.RelayDifficultyTargetHash - } - return nil -} - func (x *Params) GetProofRequestProbability() float32 { if x != nil { return x.ProofRequestProbability @@ -827,53 +751,47 @@ var file_poktroll_proof_params_proto_rawDesc = []byte{ 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb5, 0x04, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x61, 0x0a, 0x1c, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, - 0x63, 0x75, 0x6c, 0x74, 0x79, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x20, 0xea, 0xde, 0x1f, 0x1c, 0x72, 0x65, 0x6c, - 0x61, 0x79, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x5f, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x52, 0x19, 0x72, 0x65, 0x6c, 0x61, 0x79, - 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x59, 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x42, 0x1d, 0xea, 0xde, 0x1f, 0x19, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x62, 0x61, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x17, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, - 0x7a, 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x1f, 0xea, 0xde, 0x1f, 0x1b, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x52, 0x19, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x68, 0x0a, 0x15, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x6e, - 0x61, 0x6c, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x19, 0xea, 0xde, 0x1f, 0x15, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, - 0x52, 0x13, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x50, 0x65, - 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x12, 0x65, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x73, - 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, - 0xea, 0xde, 0x1f, 0x14, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x65, 0x65, 0x52, 0x12, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x53, - 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x46, 0x65, 0x65, 0x3a, 0x20, 0xe8, 0xa0, - 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x17, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x9f, - 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 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, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, - 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0xca, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0xe2, 0x02, 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, - 0x6f, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x59, 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x02, 0x42, 0x1d, 0xea, 0xde, 0x1f, 0x19, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x52, 0x17, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x50, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x7a, 0x0a, 0x1b, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x1f, 0xea, 0xde, + 0x1f, 0x1b, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x19, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x68, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x19, 0xea, 0xde, 0x1f, 0x15, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x6e, 0x61, 0x6c, 0x74, 0x79, 0x52, 0x13, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x6e, 0x61, 0x6c, + 0x74, 0x79, 0x12, 0x65, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x73, 0x75, 0x62, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, 0xea, 0xde, 0x1f, + 0x14, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x66, 0x65, 0x65, 0x52, 0x12, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x46, 0x65, 0x65, 0x3a, 0x20, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, + 0xe7, 0xb0, 0x2a, 0x17, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x9f, 0x01, 0xd8, 0xe2, + 0x1e, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 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, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, 0x0e, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, 0x02, + 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/proof/tx.pulsar.go b/api/poktroll/proof/tx.pulsar.go index 0b815b1ae..3be72003c 100644 --- a/api/poktroll/proof/tx.pulsar.go +++ b/api/poktroll/proof/tx.pulsar.go @@ -880,8 +880,6 @@ var ( md_MsgUpdateParam protoreflect.MessageDescriptor fd_MsgUpdateParam_authority protoreflect.FieldDescriptor fd_MsgUpdateParam_name protoreflect.FieldDescriptor - fd_MsgUpdateParam_as_string protoreflect.FieldDescriptor - fd_MsgUpdateParam_as_int64 protoreflect.FieldDescriptor fd_MsgUpdateParam_as_bytes protoreflect.FieldDescriptor fd_MsgUpdateParam_as_float protoreflect.FieldDescriptor fd_MsgUpdateParam_as_coin protoreflect.FieldDescriptor @@ -892,8 +890,6 @@ func init() { md_MsgUpdateParam = File_poktroll_proof_tx_proto.Messages().ByName("MsgUpdateParam") fd_MsgUpdateParam_authority = md_MsgUpdateParam.Fields().ByName("authority") fd_MsgUpdateParam_name = md_MsgUpdateParam.Fields().ByName("name") - fd_MsgUpdateParam_as_string = md_MsgUpdateParam.Fields().ByName("as_string") - fd_MsgUpdateParam_as_int64 = md_MsgUpdateParam.Fields().ByName("as_int64") fd_MsgUpdateParam_as_bytes = md_MsgUpdateParam.Fields().ByName("as_bytes") fd_MsgUpdateParam_as_float = md_MsgUpdateParam.Fields().ByName("as_float") fd_MsgUpdateParam_as_coin = md_MsgUpdateParam.Fields().ByName("as_coin") @@ -978,18 +974,6 @@ func (x *fastReflection_MsgUpdateParam) Range(f func(protoreflect.FieldDescripto } if x.AsType != nil { switch o := x.AsType.(type) { - case *MsgUpdateParam_AsString: - v := o.AsString - value := protoreflect.ValueOfString(v) - if !f(fd_MsgUpdateParam_as_string, value) { - return - } - case *MsgUpdateParam_AsInt64: - v := o.AsInt64 - value := protoreflect.ValueOfInt64(v) - if !f(fd_MsgUpdateParam_as_int64, value) { - return - } case *MsgUpdateParam_AsBytes: v := o.AsBytes value := protoreflect.ValueOfBytes(v) @@ -1029,22 +1013,6 @@ func (x *fastReflection_MsgUpdateParam) Has(fd protoreflect.FieldDescriptor) boo return x.Authority != "" case "poktroll.proof.MsgUpdateParam.name": return x.Name != "" - case "poktroll.proof.MsgUpdateParam.as_string": - if x.AsType == nil { - return false - } else if _, ok := x.AsType.(*MsgUpdateParam_AsString); ok { - return true - } else { - return false - } - case "poktroll.proof.MsgUpdateParam.as_int64": - if x.AsType == nil { - return false - } else if _, ok := x.AsType.(*MsgUpdateParam_AsInt64); ok { - return true - } else { - return false - } case "poktroll.proof.MsgUpdateParam.as_bytes": if x.AsType == nil { return false @@ -1089,10 +1057,6 @@ func (x *fastReflection_MsgUpdateParam) Clear(fd protoreflect.FieldDescriptor) { x.Authority = "" case "poktroll.proof.MsgUpdateParam.name": x.Name = "" - case "poktroll.proof.MsgUpdateParam.as_string": - x.AsType = nil - case "poktroll.proof.MsgUpdateParam.as_int64": - x.AsType = nil case "poktroll.proof.MsgUpdateParam.as_bytes": x.AsType = nil case "poktroll.proof.MsgUpdateParam.as_float": @@ -1121,22 +1085,6 @@ func (x *fastReflection_MsgUpdateParam) Get(descriptor protoreflect.FieldDescrip case "poktroll.proof.MsgUpdateParam.name": value := x.Name return protoreflect.ValueOfString(value) - case "poktroll.proof.MsgUpdateParam.as_string": - if x.AsType == nil { - return protoreflect.ValueOfString("") - } else if v, ok := x.AsType.(*MsgUpdateParam_AsString); ok { - return protoreflect.ValueOfString(v.AsString) - } else { - return protoreflect.ValueOfString("") - } - case "poktroll.proof.MsgUpdateParam.as_int64": - if x.AsType == nil { - return protoreflect.ValueOfInt64(int64(0)) - } else if v, ok := x.AsType.(*MsgUpdateParam_AsInt64); ok { - return protoreflect.ValueOfInt64(v.AsInt64) - } else { - return protoreflect.ValueOfInt64(int64(0)) - } case "poktroll.proof.MsgUpdateParam.as_bytes": if x.AsType == nil { return protoreflect.ValueOfBytes(nil) @@ -1185,12 +1133,6 @@ func (x *fastReflection_MsgUpdateParam) Set(fd protoreflect.FieldDescriptor, val x.Authority = value.Interface().(string) case "poktroll.proof.MsgUpdateParam.name": x.Name = value.Interface().(string) - case "poktroll.proof.MsgUpdateParam.as_string": - cv := value.Interface().(string) - x.AsType = &MsgUpdateParam_AsString{AsString: cv} - case "poktroll.proof.MsgUpdateParam.as_int64": - cv := value.Int() - x.AsType = &MsgUpdateParam_AsInt64{AsInt64: cv} case "poktroll.proof.MsgUpdateParam.as_bytes": cv := value.Bytes() x.AsType = &MsgUpdateParam_AsBytes{AsBytes: cv} @@ -1240,10 +1182,6 @@ func (x *fastReflection_MsgUpdateParam) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field authority of message poktroll.proof.MsgUpdateParam is not mutable")) case "poktroll.proof.MsgUpdateParam.name": panic(fmt.Errorf("field name of message poktroll.proof.MsgUpdateParam is not mutable")) - case "poktroll.proof.MsgUpdateParam.as_string": - panic(fmt.Errorf("field as_string of message poktroll.proof.MsgUpdateParam is not mutable")) - case "poktroll.proof.MsgUpdateParam.as_int64": - panic(fmt.Errorf("field as_int64 of message poktroll.proof.MsgUpdateParam is not mutable")) case "poktroll.proof.MsgUpdateParam.as_bytes": panic(fmt.Errorf("field as_bytes of message poktroll.proof.MsgUpdateParam is not mutable")) case "poktroll.proof.MsgUpdateParam.as_float": @@ -1265,10 +1203,6 @@ func (x *fastReflection_MsgUpdateParam) NewField(fd protoreflect.FieldDescriptor return protoreflect.ValueOfString("") case "poktroll.proof.MsgUpdateParam.name": return protoreflect.ValueOfString("") - case "poktroll.proof.MsgUpdateParam.as_string": - return protoreflect.ValueOfString("") - case "poktroll.proof.MsgUpdateParam.as_int64": - return protoreflect.ValueOfInt64(int64(0)) case "poktroll.proof.MsgUpdateParam.as_bytes": return protoreflect.ValueOfBytes(nil) case "poktroll.proof.MsgUpdateParam.as_float": @@ -1294,10 +1228,6 @@ func (x *fastReflection_MsgUpdateParam) WhichOneof(d protoreflect.OneofDescripto return nil } switch x.AsType.(type) { - case *MsgUpdateParam_AsString: - return x.Descriptor().Fields().ByName("as_string") - case *MsgUpdateParam_AsInt64: - return x.Descriptor().Fields().ByName("as_int64") case *MsgUpdateParam_AsBytes: return x.Descriptor().Fields().ByName("as_bytes") case *MsgUpdateParam_AsFloat: @@ -1370,17 +1300,6 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } switch x := x.AsType.(type) { - case *MsgUpdateParam_AsString: - if x == nil { - break - } - l = len(x.AsString) - n += 1 + l + runtime.Sov(uint64(l)) - case *MsgUpdateParam_AsInt64: - if x == nil { - break - } - n += 1 + runtime.Sov(uint64(x.AsInt64)) case *MsgUpdateParam_AsBytes: if x == nil { break @@ -1429,16 +1348,6 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.unknownFields) } switch x := x.AsType.(type) { - case *MsgUpdateParam_AsString: - i -= len(x.AsString) - copy(dAtA[i:], x.AsString) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AsString))) - i-- - dAtA[i] = 0x1a - case *MsgUpdateParam_AsInt64: - i = runtime.EncodeVarint(dAtA, i, uint64(x.AsInt64)) - i-- - dAtA[i] = 0x30 case *MsgUpdateParam_AsBytes: i -= len(x.AsBytes) copy(dAtA[i:], x.AsBytes) @@ -1591,58 +1500,6 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { } x.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsString", 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.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 6: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.AsType = &MsgUpdateParam_AsInt64{v} case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) @@ -4293,8 +4150,6 @@ type MsgUpdateParam struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Types that are assignable to AsType: // - // *MsgUpdateParam_AsString - // *MsgUpdateParam_AsInt64 // *MsgUpdateParam_AsBytes // *MsgUpdateParam_AsFloat // *MsgUpdateParam_AsCoin @@ -4342,20 +4197,6 @@ func (x *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { return nil } -func (x *MsgUpdateParam) GetAsString() string { - if x, ok := x.GetAsType().(*MsgUpdateParam_AsString); ok { - return x.AsString - } - return "" -} - -func (x *MsgUpdateParam) GetAsInt64() int64 { - if x, ok := x.GetAsType().(*MsgUpdateParam_AsInt64); ok { - return x.AsInt64 - } - return 0 -} - func (x *MsgUpdateParam) GetAsBytes() []byte { if x, ok := x.GetAsType().(*MsgUpdateParam_AsBytes); ok { return x.AsBytes @@ -4381,14 +4222,6 @@ type isMsgUpdateParam_AsType interface { isMsgUpdateParam_AsType() } -type MsgUpdateParam_AsString struct { - AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof"` -} - -type MsgUpdateParam_AsInt64 struct { - AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof"` -} - type MsgUpdateParam_AsBytes struct { AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof"` } @@ -4401,10 +4234,6 @@ type MsgUpdateParam_AsCoin struct { AsCoin *v1beta1.Coin `protobuf:"bytes,9,opt,name=as_coin,json=asCoin,proto3,oneof"` } -func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} - -func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} - func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} func (*MsgUpdateParam_AsFloat) isMsgUpdateParam_AsType() {} @@ -4656,105 +4485,100 @@ var file_poktroll_proof_tx_proto_rawDesc = []byte{ 0x2f, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 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, 0xe9, 0x02, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x6e, 0x73, 0x65, 0x22, 0x90, 0x02, 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, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, - 0x03, 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, - 0x12, 0x29, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, - 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x29, 0x0a, 0x08, 0x61, - 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0c, 0xea, - 0xde, 0x1f, 0x08, 0x61, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x48, 0x00, 0x52, 0x07, 0x61, - 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x66, 0x6c, 0x6f, - 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x02, 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, 0x12, 0x41, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x0b, 0xea, - 0xde, 0x1f, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, - 0x43, 0x6f, 0x69, 0x6e, 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, - 0x48, 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, 0x2e, 0x0a, 0x06, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xeb, 0x01, 0x0a, 0x0e, 0x4d, 0x73, - 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x54, 0x0a, 0x19, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0d, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, - 0x6f, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, - 0x6f, 0x6f, 0x74, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x1e, 0x82, 0xe7, 0xb0, 0x2a, 0x19, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x45, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x22, 0xe4, - 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x12, 0x54, 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x3a, 0x1e, 0x82, 0xe7, 0xb0, 0x2a, 0x19, 0x73, 0x75, 0x70, 0x70, + 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, 0x73, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x29, 0x0a, + 0x08, 0x61, 0x73, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x02, 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, 0x12, 0x41, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x63, + 0x6f, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x0b, 0xea, 0xde, 0x1f, 0x07, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x69, + 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, 0x43, 0x6f, 0x69, 0x6e, 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, 0x48, 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, 0x2e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x22, 0xeb, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x12, 0x54, 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x17, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x74, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x1e, + 0x82, 0xe7, 0xb0, 0x2a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x45, + 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x22, 0xe4, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x54, 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x45, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x2b, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x32, 0xeb, 0x02, 0x0a, - 0x03, 0x4d, 0x73, 0x67, 0x12, 0x58, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 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, 0x55, - 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x1e, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, - 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x1a, 0x26, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, - 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x6f, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, + 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x3a, 0x1e, 0x82, 0xe7, + 0xb0, 0x2a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x45, 0x0a, 0x16, + 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x32, 0xeb, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x58, 0x0a, 0x0c, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 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, 0x55, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x26, 0x2e, 0x70, 0x6f, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 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, 0x9b, 0x01, 0xd8, 0xe2, 0x1e, - 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x1f, 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, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, 0x02, 0x1a, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 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, 0x9b, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x07, 0x54, 0x78, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 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, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, + 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, + 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0xe2, 0x02, 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4914,8 +4738,6 @@ func file_poktroll_proof_tx_proto_init() { } } file_poktroll_proof_tx_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*MsgUpdateParam_AsString)(nil), - (*MsgUpdateParam_AsInt64)(nil), (*MsgUpdateParam_AsBytes)(nil), (*MsgUpdateParam_AsFloat)(nil), (*MsgUpdateParam_AsCoin)(nil), diff --git a/api/poktroll/service/event.pulsar.go b/api/poktroll/service/event.pulsar.go new file mode 100644 index 000000000..20d2d484e --- /dev/null +++ b/api/poktroll/service/event.pulsar.go @@ -0,0 +1,842 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package service + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EventRelayMiningDifficultyUpdated protoreflect.MessageDescriptor + fd_EventRelayMiningDifficultyUpdated_service_id protoreflect.FieldDescriptor + fd_EventRelayMiningDifficultyUpdated_prev_target_hash_hex_encoded protoreflect.FieldDescriptor + fd_EventRelayMiningDifficultyUpdated_new_target_hash_hex_encoded protoreflect.FieldDescriptor + fd_EventRelayMiningDifficultyUpdated_prev_num_relays_ema protoreflect.FieldDescriptor + fd_EventRelayMiningDifficultyUpdated_new_num_relays_ema protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_service_event_proto_init() + md_EventRelayMiningDifficultyUpdated = File_poktroll_service_event_proto.Messages().ByName("EventRelayMiningDifficultyUpdated") + fd_EventRelayMiningDifficultyUpdated_service_id = md_EventRelayMiningDifficultyUpdated.Fields().ByName("service_id") + fd_EventRelayMiningDifficultyUpdated_prev_target_hash_hex_encoded = md_EventRelayMiningDifficultyUpdated.Fields().ByName("prev_target_hash_hex_encoded") + fd_EventRelayMiningDifficultyUpdated_new_target_hash_hex_encoded = md_EventRelayMiningDifficultyUpdated.Fields().ByName("new_target_hash_hex_encoded") + fd_EventRelayMiningDifficultyUpdated_prev_num_relays_ema = md_EventRelayMiningDifficultyUpdated.Fields().ByName("prev_num_relays_ema") + fd_EventRelayMiningDifficultyUpdated_new_num_relays_ema = md_EventRelayMiningDifficultyUpdated.Fields().ByName("new_num_relays_ema") +} + +var _ protoreflect.Message = (*fastReflection_EventRelayMiningDifficultyUpdated)(nil) + +type fastReflection_EventRelayMiningDifficultyUpdated EventRelayMiningDifficultyUpdated + +func (x *EventRelayMiningDifficultyUpdated) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventRelayMiningDifficultyUpdated)(x) +} + +func (x *EventRelayMiningDifficultyUpdated) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_service_event_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventRelayMiningDifficultyUpdated_messageType fastReflection_EventRelayMiningDifficultyUpdated_messageType +var _ protoreflect.MessageType = fastReflection_EventRelayMiningDifficultyUpdated_messageType{} + +type fastReflection_EventRelayMiningDifficultyUpdated_messageType struct{} + +func (x fastReflection_EventRelayMiningDifficultyUpdated_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventRelayMiningDifficultyUpdated)(nil) +} +func (x fastReflection_EventRelayMiningDifficultyUpdated_messageType) New() protoreflect.Message { + return new(fastReflection_EventRelayMiningDifficultyUpdated) +} +func (x fastReflection_EventRelayMiningDifficultyUpdated_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventRelayMiningDifficultyUpdated +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) Descriptor() protoreflect.MessageDescriptor { + return md_EventRelayMiningDifficultyUpdated +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) Type() protoreflect.MessageType { + return _fastReflection_EventRelayMiningDifficultyUpdated_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) New() protoreflect.Message { + return new(fastReflection_EventRelayMiningDifficultyUpdated) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) Interface() protoreflect.ProtoMessage { + return (*EventRelayMiningDifficultyUpdated)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ServiceId != "" { + value := protoreflect.ValueOfString(x.ServiceId) + if !f(fd_EventRelayMiningDifficultyUpdated_service_id, value) { + return + } + } + if x.PrevTargetHashHexEncoded != "" { + value := protoreflect.ValueOfString(x.PrevTargetHashHexEncoded) + if !f(fd_EventRelayMiningDifficultyUpdated_prev_target_hash_hex_encoded, value) { + return + } + } + if x.NewTargetHashHexEncoded != "" { + value := protoreflect.ValueOfString(x.NewTargetHashHexEncoded) + if !f(fd_EventRelayMiningDifficultyUpdated_new_target_hash_hex_encoded, value) { + return + } + } + if x.PrevNumRelaysEma != uint64(0) { + value := protoreflect.ValueOfUint64(x.PrevNumRelaysEma) + if !f(fd_EventRelayMiningDifficultyUpdated_prev_num_relays_ema, value) { + return + } + } + if x.NewNumRelaysEma != uint64(0) { + value := protoreflect.ValueOfUint64(x.NewNumRelaysEma) + if !f(fd_EventRelayMiningDifficultyUpdated_new_num_relays_ema, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.service.EventRelayMiningDifficultyUpdated.service_id": + return x.ServiceId != "" + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": + return x.PrevTargetHashHexEncoded != "" + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": + return x.NewTargetHashHexEncoded != "" + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": + return x.PrevNumRelaysEma != uint64(0) + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_num_relays_ema": + return x.NewNumRelaysEma != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.EventRelayMiningDifficultyUpdated")) + } + panic(fmt.Errorf("message poktroll.service.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.service.EventRelayMiningDifficultyUpdated.service_id": + x.ServiceId = "" + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": + x.PrevTargetHashHexEncoded = "" + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": + x.NewTargetHashHexEncoded = "" + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": + x.PrevNumRelaysEma = uint64(0) + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_num_relays_ema": + x.NewNumRelaysEma = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.EventRelayMiningDifficultyUpdated")) + } + panic(fmt.Errorf("message poktroll.service.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.service.EventRelayMiningDifficultyUpdated.service_id": + value := x.ServiceId + return protoreflect.ValueOfString(value) + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": + value := x.PrevTargetHashHexEncoded + return protoreflect.ValueOfString(value) + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": + value := x.NewTargetHashHexEncoded + return protoreflect.ValueOfString(value) + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": + value := x.PrevNumRelaysEma + return protoreflect.ValueOfUint64(value) + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_num_relays_ema": + value := x.NewNumRelaysEma + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.EventRelayMiningDifficultyUpdated")) + } + panic(fmt.Errorf("message poktroll.service.EventRelayMiningDifficultyUpdated does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.service.EventRelayMiningDifficultyUpdated.service_id": + x.ServiceId = value.Interface().(string) + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": + x.PrevTargetHashHexEncoded = value.Interface().(string) + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": + x.NewTargetHashHexEncoded = value.Interface().(string) + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": + x.PrevNumRelaysEma = value.Uint() + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_num_relays_ema": + x.NewNumRelaysEma = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.EventRelayMiningDifficultyUpdated")) + } + panic(fmt.Errorf("message poktroll.service.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.EventRelayMiningDifficultyUpdated.service_id": + panic(fmt.Errorf("field service_id of message poktroll.service.EventRelayMiningDifficultyUpdated is not mutable")) + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": + panic(fmt.Errorf("field prev_target_hash_hex_encoded of message poktroll.service.EventRelayMiningDifficultyUpdated is not mutable")) + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": + panic(fmt.Errorf("field new_target_hash_hex_encoded of message poktroll.service.EventRelayMiningDifficultyUpdated is not mutable")) + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": + panic(fmt.Errorf("field prev_num_relays_ema of message poktroll.service.EventRelayMiningDifficultyUpdated is not mutable")) + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_num_relays_ema": + panic(fmt.Errorf("field new_num_relays_ema of message poktroll.service.EventRelayMiningDifficultyUpdated is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.EventRelayMiningDifficultyUpdated")) + } + panic(fmt.Errorf("message poktroll.service.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.EventRelayMiningDifficultyUpdated.service_id": + return protoreflect.ValueOfString("") + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": + return protoreflect.ValueOfString("") + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": + return protoreflect.ValueOfString("") + case "poktroll.service.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": + return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.service.EventRelayMiningDifficultyUpdated.new_num_relays_ema": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.EventRelayMiningDifficultyUpdated")) + } + panic(fmt.Errorf("message poktroll.service.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.service.EventRelayMiningDifficultyUpdated", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventRelayMiningDifficultyUpdated) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ServiceId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PrevTargetHashHexEncoded) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.NewTargetHashHexEncoded) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.PrevNumRelaysEma != 0 { + n += 1 + runtime.Sov(uint64(x.PrevNumRelaysEma)) + } + if x.NewNumRelaysEma != 0 { + n += 1 + runtime.Sov(uint64(x.NewNumRelaysEma)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventRelayMiningDifficultyUpdated) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.NewNumRelaysEma != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NewNumRelaysEma)) + i-- + dAtA[i] = 0x28 + } + if x.PrevNumRelaysEma != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.PrevNumRelaysEma)) + i-- + dAtA[i] = 0x20 + } + if len(x.NewTargetHashHexEncoded) > 0 { + i -= len(x.NewTargetHashHexEncoded) + copy(dAtA[i:], x.NewTargetHashHexEncoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NewTargetHashHexEncoded))) + i-- + dAtA[i] = 0x1a + } + if len(x.PrevTargetHashHexEncoded) > 0 { + i -= len(x.PrevTargetHashHexEncoded) + copy(dAtA[i:], x.PrevTargetHashHexEncoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PrevTargetHashHexEncoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.ServiceId) > 0 { + i -= len(x.ServiceId) + copy(dAtA[i:], x.ServiceId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceId))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventRelayMiningDifficultyUpdated) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRelayMiningDifficultyUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRelayMiningDifficultyUpdated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PrevTargetHashHexEncoded", 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.PrevTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NewTargetHashHexEncoded", 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.NewTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PrevNumRelaysEma", wireType) + } + x.PrevNumRelaysEma = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.PrevNumRelaysEma |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NewNumRelaysEma", wireType) + } + x.NewNumRelaysEma = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NewNumRelaysEma |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/service/event.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventRelayMiningDifficultyUpdated is an event emitted whenever the relay mining difficulty is updated +// for a given service. +type EventRelayMiningDifficultyUpdated struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + PrevTargetHashHexEncoded string `protobuf:"bytes,2,opt,name=prev_target_hash_hex_encoded,json=prevTargetHashHexEncoded,proto3" json:"prev_target_hash_hex_encoded,omitempty"` + NewTargetHashHexEncoded string `protobuf:"bytes,3,opt,name=new_target_hash_hex_encoded,json=newTargetHashHexEncoded,proto3" json:"new_target_hash_hex_encoded,omitempty"` + PrevNumRelaysEma uint64 `protobuf:"varint,4,opt,name=prev_num_relays_ema,json=prevNumRelaysEma,proto3" json:"prev_num_relays_ema,omitempty"` + NewNumRelaysEma uint64 `protobuf:"varint,5,opt,name=new_num_relays_ema,json=newNumRelaysEma,proto3" json:"new_num_relays_ema,omitempty"` +} + +func (x *EventRelayMiningDifficultyUpdated) Reset() { + *x = EventRelayMiningDifficultyUpdated{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_service_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventRelayMiningDifficultyUpdated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventRelayMiningDifficultyUpdated) ProtoMessage() {} + +// Deprecated: Use EventRelayMiningDifficultyUpdated.ProtoReflect.Descriptor instead. +func (*EventRelayMiningDifficultyUpdated) Descriptor() ([]byte, []int) { + return file_poktroll_service_event_proto_rawDescGZIP(), []int{0} +} + +func (x *EventRelayMiningDifficultyUpdated) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *EventRelayMiningDifficultyUpdated) GetPrevTargetHashHexEncoded() string { + if x != nil { + return x.PrevTargetHashHexEncoded + } + return "" +} + +func (x *EventRelayMiningDifficultyUpdated) GetNewTargetHashHexEncoded() string { + if x != nil { + return x.NewTargetHashHexEncoded + } + return "" +} + +func (x *EventRelayMiningDifficultyUpdated) GetPrevNumRelaysEma() uint64 { + if x != nil { + return x.PrevNumRelaysEma + } + return 0 +} + +func (x *EventRelayMiningDifficultyUpdated) GetNewNumRelaysEma() uint64 { + if x != nil { + return x.NewNumRelaysEma + } + return 0 +} + +var File_poktroll_service_event_proto protoreflect.FileDescriptor + +var file_poktroll_service_event_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x02, 0x0a, 0x21, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x1c, 0x70, + 0x72, 0x65, 0x76, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, + 0x68, 0x65, 0x78, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x18, 0x70, 0x72, 0x65, 0x76, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x61, 0x73, + 0x68, 0x48, 0x65, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x1b, 0x6e, + 0x65, 0x77, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x68, + 0x65, 0x78, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x17, 0x6e, 0x65, 0x77, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x61, 0x73, 0x68, 0x48, + 0x65, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x2d, 0x0a, 0x13, 0x70, 0x72, 0x65, + 0x76, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x5f, 0x65, 0x6d, 0x61, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x70, 0x72, 0x65, 0x76, 0x4e, 0x75, 0x6d, 0x52, + 0x65, 0x6c, 0x61, 0x79, 0x73, 0x45, 0x6d, 0x61, 0x12, 0x2b, 0x0a, 0x12, 0x6e, 0x65, 0x77, 0x5f, + 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x5f, 0x65, 0x6d, 0x61, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6e, 0x65, 0x77, 0x4e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, + 0x79, 0x73, 0x45, 0x6d, 0x61, 0x42, 0xaa, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, + 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x21, 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, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, + 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_service_event_proto_rawDescOnce sync.Once + file_poktroll_service_event_proto_rawDescData = file_poktroll_service_event_proto_rawDesc +) + +func file_poktroll_service_event_proto_rawDescGZIP() []byte { + file_poktroll_service_event_proto_rawDescOnce.Do(func() { + file_poktroll_service_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_service_event_proto_rawDescData) + }) + return file_poktroll_service_event_proto_rawDescData +} + +var file_poktroll_service_event_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_service_event_proto_goTypes = []interface{}{ + (*EventRelayMiningDifficultyUpdated)(nil), // 0: poktroll.service.EventRelayMiningDifficultyUpdated +} +var file_poktroll_service_event_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_poktroll_service_event_proto_init() } +func file_poktroll_service_event_proto_init() { + if File_poktroll_service_event_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_service_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventRelayMiningDifficultyUpdated); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_poktroll_service_event_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_service_event_proto_goTypes, + DependencyIndexes: file_poktroll_service_event_proto_depIdxs, + MessageInfos: file_poktroll_service_event_proto_msgTypes, + }.Build() + File_poktroll_service_event_proto = out.File + file_poktroll_service_event_proto_rawDesc = nil + file_poktroll_service_event_proto_goTypes = nil + file_poktroll_service_event_proto_depIdxs = nil +} diff --git a/api/poktroll/service/genesis.pulsar.go b/api/poktroll/service/genesis.pulsar.go index b88f2e05e..eb48548c7 100644 --- a/api/poktroll/service/genesis.pulsar.go +++ b/api/poktroll/service/genesis.pulsar.go @@ -66,10 +66,62 @@ func (x *_GenesisState_2_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_GenesisState_3_list)(nil) + +type _GenesisState_3_list struct { + list *[]*RelayMiningDifficulty +} + +func (x *_GenesisState_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RelayMiningDifficulty) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RelayMiningDifficulty) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_3_list) AppendMutable() protoreflect.Value { + v := new(RelayMiningDifficulty) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_3_list) NewElement() protoreflect.Value { + v := new(RelayMiningDifficulty) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) IsValid() bool { + return x.list != nil +} + var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor - fd_GenesisState_service_list protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_service_list protoreflect.FieldDescriptor + fd_GenesisState_relayMiningDifficultyList protoreflect.FieldDescriptor ) func init() { @@ -77,6 +129,7 @@ func init() { md_GenesisState = File_poktroll_service_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") fd_GenesisState_service_list = md_GenesisState.Fields().ByName("service_list") + fd_GenesisState_relayMiningDifficultyList = md_GenesisState.Fields().ByName("relayMiningDifficultyList") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -156,6 +209,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.RelayMiningDifficultyList) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_3_list{list: &x.RelayMiningDifficultyList}) + if !f(fd_GenesisState_relayMiningDifficultyList, value) { + return + } + } } // Has reports whether a field is populated. @@ -175,6 +234,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool return x.Params != nil case "poktroll.service.GenesisState.service_list": return len(x.ServiceList) != 0 + case "poktroll.service.GenesisState.relayMiningDifficultyList": + return len(x.RelayMiningDifficultyList) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.GenesisState")) @@ -195,6 +256,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { x.Params = nil case "poktroll.service.GenesisState.service_list": x.ServiceList = nil + case "poktroll.service.GenesisState.relayMiningDifficultyList": + x.RelayMiningDifficultyList = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.GenesisState")) @@ -220,6 +283,12 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto } listValue := &_GenesisState_2_list{list: &x.ServiceList} return protoreflect.ValueOfList(listValue) + case "poktroll.service.GenesisState.relayMiningDifficultyList": + if len(x.RelayMiningDifficultyList) == 0 { + return protoreflect.ValueOfList(&_GenesisState_3_list{}) + } + listValue := &_GenesisState_3_list{list: &x.RelayMiningDifficultyList} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.GenesisState")) @@ -246,6 +315,10 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value lv := value.List() clv := lv.(*_GenesisState_2_list) x.ServiceList = *clv.list + case "poktroll.service.GenesisState.relayMiningDifficultyList": + lv := value.List() + clv := lv.(*_GenesisState_3_list) + x.RelayMiningDifficultyList = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.GenesisState")) @@ -277,6 +350,12 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p } value := &_GenesisState_2_list{list: &x.ServiceList} return protoreflect.ValueOfList(value) + case "poktroll.service.GenesisState.relayMiningDifficultyList": + if x.RelayMiningDifficultyList == nil { + x.RelayMiningDifficultyList = []*RelayMiningDifficulty{} + } + value := &_GenesisState_3_list{list: &x.RelayMiningDifficultyList} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.GenesisState")) @@ -296,6 +375,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "poktroll.service.GenesisState.service_list": list := []*shared.Service{} return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) + case "poktroll.service.GenesisState.relayMiningDifficultyList": + list := []*RelayMiningDifficulty{} + return protoreflect.ValueOfList(&_GenesisState_3_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.GenesisState")) @@ -375,6 +457,12 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } + if len(x.RelayMiningDifficultyList) > 0 { + for _, e := range x.RelayMiningDifficultyList { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -404,6 +492,22 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.RelayMiningDifficultyList) > 0 { + for iNdEx := len(x.RelayMiningDifficultyList) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.RelayMiningDifficultyList[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } if len(x.ServiceList) > 0 { for iNdEx := len(x.ServiceList) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.ServiceList[iNdEx]) @@ -553,6 +657,40 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficultyList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.RelayMiningDifficultyList = append(x.RelayMiningDifficultyList, &RelayMiningDifficulty{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RelayMiningDifficultyList[len(x.RelayMiningDifficultyList)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -608,8 +746,9 @@ type GenesisState struct { unknownFields protoimpl.UnknownFields // params defines all the parameters of the module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - ServiceList []*shared.Service `protobuf:"bytes,2,rep,name=service_list,json=serviceList,proto3" json:"service_list,omitempty"` + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + ServiceList []*shared.Service `protobuf:"bytes,2,rep,name=service_list,json=serviceList,proto3" json:"service_list,omitempty"` + RelayMiningDifficultyList []*RelayMiningDifficulty `protobuf:"bytes,3,rep,name=relayMiningDifficultyList,proto3" json:"relayMiningDifficultyList,omitempty"` } func (x *GenesisState) Reset() { @@ -646,6 +785,13 @@ func (x *GenesisState) GetServiceList() []*shared.Service { return nil } +func (x *GenesisState) GetRelayMiningDifficultyList() []*RelayMiningDifficulty { + if x != nil { + return x.RelayMiningDifficultyList + } + return nil +} + var File_poktroll_service_genesis_proto protoreflect.FileDescriptor var file_poktroll_service_genesis_proto_rawDesc = []byte{ @@ -658,7 +804,10 @@ var file_poktroll_service_genesis_proto_rawDesc = []byte{ 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x01, 0x0a, 0x0c, 0x47, 0x65, + 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x61, + 0x79, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfb, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x61, @@ -667,19 +816,25 @@ var file_poktroll_service_genesis_proto_rawDesc = []byte{ 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x42, 0xac, 0x01, 0xd8, 0xe2, 0x1e, - 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 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, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, - 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x6b, 0x0a, 0x19, 0x72, 0x65, + 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x19, 0x72, 0x65, + 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x42, 0xac, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, + 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 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, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x10, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -696,18 +851,20 @@ func file_poktroll_service_genesis_proto_rawDescGZIP() []byte { var file_poktroll_service_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_poktroll_service_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: poktroll.service.GenesisState - (*Params)(nil), // 1: poktroll.service.Params - (*shared.Service)(nil), // 2: poktroll.shared.Service + (*GenesisState)(nil), // 0: poktroll.service.GenesisState + (*Params)(nil), // 1: poktroll.service.Params + (*shared.Service)(nil), // 2: poktroll.shared.Service + (*RelayMiningDifficulty)(nil), // 3: poktroll.service.RelayMiningDifficulty } var file_poktroll_service_genesis_proto_depIdxs = []int32{ 1, // 0: poktroll.service.GenesisState.params:type_name -> poktroll.service.Params 2, // 1: poktroll.service.GenesisState.service_list:type_name -> poktroll.shared.Service - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 3, // 2: poktroll.service.GenesisState.relayMiningDifficultyList:type_name -> poktroll.service.RelayMiningDifficulty + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_poktroll_service_genesis_proto_init() } @@ -716,6 +873,7 @@ func file_poktroll_service_genesis_proto_init() { return } file_poktroll_service_params_proto_init() + file_poktroll_service_relay_mining_difficulty_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_service_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenesisState); i { diff --git a/api/poktroll/service/query.pulsar.go b/api/poktroll/service/query.pulsar.go index 702edbeca..a066a4116 100644 --- a/api/poktroll/service/query.pulsar.go +++ b/api/poktroll/service/query.pulsar.go @@ -2671,6 +2671,1869 @@ func (x *fastReflection_QueryAllServicesResponse) ProtoMethods() *protoiface.Met } } +var ( + md_QueryGetRelayMiningDifficultyRequest protoreflect.MessageDescriptor + fd_QueryGetRelayMiningDifficultyRequest_serviceId protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_service_query_proto_init() + md_QueryGetRelayMiningDifficultyRequest = File_poktroll_service_query_proto.Messages().ByName("QueryGetRelayMiningDifficultyRequest") + fd_QueryGetRelayMiningDifficultyRequest_serviceId = md_QueryGetRelayMiningDifficultyRequest.Fields().ByName("serviceId") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetRelayMiningDifficultyRequest)(nil) + +type fastReflection_QueryGetRelayMiningDifficultyRequest QueryGetRelayMiningDifficultyRequest + +func (x *QueryGetRelayMiningDifficultyRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetRelayMiningDifficultyRequest)(x) +} + +func (x *QueryGetRelayMiningDifficultyRequest) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_service_query_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetRelayMiningDifficultyRequest_messageType fastReflection_QueryGetRelayMiningDifficultyRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetRelayMiningDifficultyRequest_messageType{} + +type fastReflection_QueryGetRelayMiningDifficultyRequest_messageType struct{} + +func (x fastReflection_QueryGetRelayMiningDifficultyRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetRelayMiningDifficultyRequest)(nil) +} +func (x fastReflection_QueryGetRelayMiningDifficultyRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetRelayMiningDifficultyRequest) +} +func (x fastReflection_QueryGetRelayMiningDifficultyRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetRelayMiningDifficultyRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetRelayMiningDifficultyRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryGetRelayMiningDifficultyRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) New() protoreflect.Message { + return new(fastReflection_QueryGetRelayMiningDifficultyRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Interface() protoreflect.ProtoMessage { + return (*QueryGetRelayMiningDifficultyRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ServiceId != "" { + value := protoreflect.ValueOfString(x.ServiceId) + if !f(fd_QueryGetRelayMiningDifficultyRequest_serviceId, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyRequest.serviceId": + return x.ServiceId != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyRequest.serviceId": + x.ServiceId = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyRequest.serviceId": + value := x.ServiceId + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyRequest.serviceId": + x.ServiceId = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyRequest.serviceId": + panic(fmt.Errorf("field serviceId of message poktroll.service.QueryGetRelayMiningDifficultyRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyRequest.serviceId": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.service.QueryGetRelayMiningDifficultyRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetRelayMiningDifficultyRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ServiceId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetRelayMiningDifficultyRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ServiceId) > 0 { + i -= len(x.ServiceId) + copy(dAtA[i:], x.ServiceId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceId))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetRelayMiningDifficultyRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryGetRelayMiningDifficultyResponse protoreflect.MessageDescriptor + fd_QueryGetRelayMiningDifficultyResponse_relayMiningDifficulty protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_service_query_proto_init() + md_QueryGetRelayMiningDifficultyResponse = File_poktroll_service_query_proto.Messages().ByName("QueryGetRelayMiningDifficultyResponse") + fd_QueryGetRelayMiningDifficultyResponse_relayMiningDifficulty = md_QueryGetRelayMiningDifficultyResponse.Fields().ByName("relayMiningDifficulty") +} + +var _ protoreflect.Message = (*fastReflection_QueryGetRelayMiningDifficultyResponse)(nil) + +type fastReflection_QueryGetRelayMiningDifficultyResponse QueryGetRelayMiningDifficultyResponse + +func (x *QueryGetRelayMiningDifficultyResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryGetRelayMiningDifficultyResponse)(x) +} + +func (x *QueryGetRelayMiningDifficultyResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_service_query_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryGetRelayMiningDifficultyResponse_messageType fastReflection_QueryGetRelayMiningDifficultyResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryGetRelayMiningDifficultyResponse_messageType{} + +type fastReflection_QueryGetRelayMiningDifficultyResponse_messageType struct{} + +func (x fastReflection_QueryGetRelayMiningDifficultyResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryGetRelayMiningDifficultyResponse)(nil) +} +func (x fastReflection_QueryGetRelayMiningDifficultyResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryGetRelayMiningDifficultyResponse) +} +func (x fastReflection_QueryGetRelayMiningDifficultyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetRelayMiningDifficultyResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryGetRelayMiningDifficultyResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryGetRelayMiningDifficultyResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) New() protoreflect.Message { + return new(fastReflection_QueryGetRelayMiningDifficultyResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Interface() protoreflect.ProtoMessage { + return (*QueryGetRelayMiningDifficultyResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RelayMiningDifficulty != nil { + value := protoreflect.ValueOfMessage(x.RelayMiningDifficulty.ProtoReflect()) + if !f(fd_QueryGetRelayMiningDifficultyResponse_relayMiningDifficulty, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": + return x.RelayMiningDifficulty != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": + x.RelayMiningDifficulty = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": + value := x.RelayMiningDifficulty + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": + x.RelayMiningDifficulty = value.Message().Interface().(*RelayMiningDifficulty) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": + if x.RelayMiningDifficulty == nil { + x.RelayMiningDifficulty = new(RelayMiningDifficulty) + } + return protoreflect.ValueOfMessage(x.RelayMiningDifficulty.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": + m := new(RelayMiningDifficulty) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryGetRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.service.QueryGetRelayMiningDifficultyResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryGetRelayMiningDifficultyResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.RelayMiningDifficulty != nil { + l = options.Size(x.RelayMiningDifficulty) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryGetRelayMiningDifficultyResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.RelayMiningDifficulty != nil { + encoded, err := options.Marshal(x.RelayMiningDifficulty) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryGetRelayMiningDifficultyResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", 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.RelayMiningDifficulty == nil { + x.RelayMiningDifficulty = &RelayMiningDifficulty{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RelayMiningDifficulty); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryAllRelayMiningDifficultyRequest protoreflect.MessageDescriptor + fd_QueryAllRelayMiningDifficultyRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_service_query_proto_init() + md_QueryAllRelayMiningDifficultyRequest = File_poktroll_service_query_proto.Messages().ByName("QueryAllRelayMiningDifficultyRequest") + fd_QueryAllRelayMiningDifficultyRequest_pagination = md_QueryAllRelayMiningDifficultyRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllRelayMiningDifficultyRequest)(nil) + +type fastReflection_QueryAllRelayMiningDifficultyRequest QueryAllRelayMiningDifficultyRequest + +func (x *QueryAllRelayMiningDifficultyRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllRelayMiningDifficultyRequest)(x) +} + +func (x *QueryAllRelayMiningDifficultyRequest) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_service_query_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAllRelayMiningDifficultyRequest_messageType fastReflection_QueryAllRelayMiningDifficultyRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllRelayMiningDifficultyRequest_messageType{} + +type fastReflection_QueryAllRelayMiningDifficultyRequest_messageType struct{} + +func (x fastReflection_QueryAllRelayMiningDifficultyRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllRelayMiningDifficultyRequest)(nil) +} +func (x fastReflection_QueryAllRelayMiningDifficultyRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllRelayMiningDifficultyRequest) +} +func (x fastReflection_QueryAllRelayMiningDifficultyRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllRelayMiningDifficultyRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllRelayMiningDifficultyRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryAllRelayMiningDifficultyRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) New() protoreflect.Message { + return new(fastReflection_QueryAllRelayMiningDifficultyRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Interface() protoreflect.ProtoMessage { + return (*QueryAllRelayMiningDifficultyRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllRelayMiningDifficultyRequest_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyRequest")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.service.QueryAllRelayMiningDifficultyRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllRelayMiningDifficultyRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAllRelayMiningDifficultyRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAllRelayMiningDifficultyRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryAllRelayMiningDifficultyResponse_1_list)(nil) + +type _QueryAllRelayMiningDifficultyResponse_1_list struct { + list *[]*RelayMiningDifficulty +} + +func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RelayMiningDifficulty) + (*x.list)[i] = concreteValue +} + +func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*RelayMiningDifficulty) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryAllRelayMiningDifficultyResponse_1_list) AppendMutable() protoreflect.Value { + v := new(RelayMiningDifficulty) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryAllRelayMiningDifficultyResponse_1_list) NewElement() protoreflect.Value { + v := new(RelayMiningDifficulty) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryAllRelayMiningDifficultyResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryAllRelayMiningDifficultyResponse protoreflect.MessageDescriptor + fd_QueryAllRelayMiningDifficultyResponse_relayMiningDifficulty protoreflect.FieldDescriptor + fd_QueryAllRelayMiningDifficultyResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_service_query_proto_init() + md_QueryAllRelayMiningDifficultyResponse = File_poktroll_service_query_proto.Messages().ByName("QueryAllRelayMiningDifficultyResponse") + fd_QueryAllRelayMiningDifficultyResponse_relayMiningDifficulty = md_QueryAllRelayMiningDifficultyResponse.Fields().ByName("relayMiningDifficulty") + fd_QueryAllRelayMiningDifficultyResponse_pagination = md_QueryAllRelayMiningDifficultyResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryAllRelayMiningDifficultyResponse)(nil) + +type fastReflection_QueryAllRelayMiningDifficultyResponse QueryAllRelayMiningDifficultyResponse + +func (x *QueryAllRelayMiningDifficultyResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryAllRelayMiningDifficultyResponse)(x) +} + +func (x *QueryAllRelayMiningDifficultyResponse) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_service_query_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryAllRelayMiningDifficultyResponse_messageType fastReflection_QueryAllRelayMiningDifficultyResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryAllRelayMiningDifficultyResponse_messageType{} + +type fastReflection_QueryAllRelayMiningDifficultyResponse_messageType struct{} + +func (x fastReflection_QueryAllRelayMiningDifficultyResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryAllRelayMiningDifficultyResponse)(nil) +} +func (x fastReflection_QueryAllRelayMiningDifficultyResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryAllRelayMiningDifficultyResponse) +} +func (x fastReflection_QueryAllRelayMiningDifficultyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllRelayMiningDifficultyResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryAllRelayMiningDifficultyResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryAllRelayMiningDifficultyResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) New() protoreflect.Message { + return new(fastReflection_QueryAllRelayMiningDifficultyResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Interface() protoreflect.ProtoMessage { + return (*QueryAllRelayMiningDifficultyResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.RelayMiningDifficulty) != 0 { + value := protoreflect.ValueOfList(&_QueryAllRelayMiningDifficultyResponse_1_list{list: &x.RelayMiningDifficulty}) + if !f(fd_QueryAllRelayMiningDifficultyResponse_relayMiningDifficulty, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryAllRelayMiningDifficultyResponse_pagination, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": + return len(x.RelayMiningDifficulty) != 0 + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": + x.RelayMiningDifficulty = nil + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": + if len(x.RelayMiningDifficulty) == 0 { + return protoreflect.ValueOfList(&_QueryAllRelayMiningDifficultyResponse_1_list{}) + } + listValue := &_QueryAllRelayMiningDifficultyResponse_1_list{list: &x.RelayMiningDifficulty} + return protoreflect.ValueOfList(listValue) + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": + lv := value.List() + clv := lv.(*_QueryAllRelayMiningDifficultyResponse_1_list) + x.RelayMiningDifficulty = *clv.list + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": + if x.RelayMiningDifficulty == nil { + x.RelayMiningDifficulty = []*RelayMiningDifficulty{} + } + value := &_QueryAllRelayMiningDifficultyResponse_1_list{list: &x.RelayMiningDifficulty} + return protoreflect.ValueOfList(value) + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": + list := []*RelayMiningDifficulty{} + return protoreflect.ValueOfList(&_QueryAllRelayMiningDifficultyResponse_1_list{list: &list}) + case "poktroll.service.QueryAllRelayMiningDifficultyResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.QueryAllRelayMiningDifficultyResponse")) + } + panic(fmt.Errorf("message poktroll.service.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.service.QueryAllRelayMiningDifficultyResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryAllRelayMiningDifficultyResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.RelayMiningDifficulty) > 0 { + for _, e := range x.RelayMiningDifficulty { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryAllRelayMiningDifficultyResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.RelayMiningDifficulty) > 0 { + for iNdEx := len(x.RelayMiningDifficulty) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.RelayMiningDifficulty[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryAllRelayMiningDifficultyResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.RelayMiningDifficulty = append(x.RelayMiningDifficulty, &RelayMiningDifficulty{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RelayMiningDifficulty[len(x.RelayMiningDifficulty)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -2897,6 +4760,154 @@ func (x *QueryAllServicesResponse) GetPagination() *v1beta1.PageResponse { return nil } +type QueryGetRelayMiningDifficultyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` +} + +func (x *QueryGetRelayMiningDifficultyRequest) Reset() { + *x = QueryGetRelayMiningDifficultyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_service_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetRelayMiningDifficultyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetRelayMiningDifficultyRequest) ProtoMessage() {} + +// Deprecated: Use QueryGetRelayMiningDifficultyRequest.ProtoReflect.Descriptor instead. +func (*QueryGetRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { + return file_poktroll_service_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryGetRelayMiningDifficultyRequest) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +type QueryGetRelayMiningDifficultyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RelayMiningDifficulty *RelayMiningDifficulty `protobuf:"bytes,1,opt,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty,omitempty"` +} + +func (x *QueryGetRelayMiningDifficultyResponse) Reset() { + *x = QueryGetRelayMiningDifficultyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_service_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryGetRelayMiningDifficultyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryGetRelayMiningDifficultyResponse) ProtoMessage() {} + +// Deprecated: Use QueryGetRelayMiningDifficultyResponse.ProtoReflect.Descriptor instead. +func (*QueryGetRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { + return file_poktroll_service_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryGetRelayMiningDifficultyResponse) GetRelayMiningDifficulty() *RelayMiningDifficulty { + if x != nil { + return x.RelayMiningDifficulty + } + return nil +} + +type QueryAllRelayMiningDifficultyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllRelayMiningDifficultyRequest) Reset() { + *x = QueryAllRelayMiningDifficultyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_service_query_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllRelayMiningDifficultyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllRelayMiningDifficultyRequest) ProtoMessage() {} + +// Deprecated: Use QueryAllRelayMiningDifficultyRequest.ProtoReflect.Descriptor instead. +func (*QueryAllRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { + return file_poktroll_service_query_proto_rawDescGZIP(), []int{8} +} + +func (x *QueryAllRelayMiningDifficultyRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryAllRelayMiningDifficultyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RelayMiningDifficulty []*RelayMiningDifficulty `protobuf:"bytes,1,rep,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty,omitempty"` + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryAllRelayMiningDifficultyResponse) Reset() { + *x = QueryAllRelayMiningDifficultyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_service_query_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryAllRelayMiningDifficultyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryAllRelayMiningDifficultyResponse) ProtoMessage() {} + +// Deprecated: Use QueryAllRelayMiningDifficultyResponse.ProtoReflect.Descriptor instead. +func (*QueryAllRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { + return file_poktroll_service_query_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryAllRelayMiningDifficultyResponse) GetRelayMiningDifficulty() []*RelayMiningDifficulty { + if x != nil { + return x.RelayMiningDifficulty + } + return nil +} + +func (x *QueryAllRelayMiningDifficultyResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + var File_poktroll_service_query_proto protoreflect.FileDescriptor var file_poktroll_service_query_proto_rawDesc = []byte{ @@ -2914,6 +4925,9 @@ var file_poktroll_service_query_proto_rawDesc = []byte{ 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x67, + 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x52, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, @@ -2944,46 +4958,107 @@ var file_poktroll_service_query_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xbb, 0x03, - 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x84, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x93, - 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, + 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x44, 0x0a, + 0x24, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, + 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, + 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, + 0x15, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x15, 0x72, 0x65, 0x6c, + 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, + 0x74, 0x79, 0x22, 0x6e, 0x0a, 0x24, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x52, 0x65, + 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0xd5, 0x01, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x52, + 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, + 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x15, + 0x72, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, + 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, + 0x75, 0x6c, 0x74, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x15, 0x72, 0x65, 0x6c, 0x61, + 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, + 0x79, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xe0, 0x06, 0x0a, 0x05, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x84, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x93, 0x01, 0x0a, 0x07, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x7b, 0x69, 0x64, + 0x7d, 0x12, 0x94, 0x01, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x12, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, + 0x12, 0x26, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xd4, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x6c, + 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, + 0x74, 0x79, 0x12, 0x36, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x33, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x94, 0x01, 0x0a, 0x0b, 0x41, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x12, 0x29, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, + 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x61, + 0x79, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x7d, 0x12, + 0xcb, 0x01, 0x0a, 0x18, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, + 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x41, 0x6c, 0x6c, 0x12, 0x36, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, + 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0xaa, 0x01, 0xd8, 0xe2, - 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 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, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, - 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, - 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, + 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x36, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x69, 0x6e, 0x69, + 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x42, 0xaa, 0x01, + 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 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, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, + 0x58, 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -2998,36 +5073,49 @@ func file_poktroll_service_query_proto_rawDescGZIP() []byte { return file_poktroll_service_query_proto_rawDescData } -var file_poktroll_service_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_poktroll_service_query_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_poktroll_service_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: poktroll.service.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: poktroll.service.QueryParamsResponse - (*QueryGetServiceRequest)(nil), // 2: poktroll.service.QueryGetServiceRequest - (*QueryGetServiceResponse)(nil), // 3: poktroll.service.QueryGetServiceResponse - (*QueryAllServicesRequest)(nil), // 4: poktroll.service.QueryAllServicesRequest - (*QueryAllServicesResponse)(nil), // 5: poktroll.service.QueryAllServicesResponse - (*Params)(nil), // 6: poktroll.service.Params - (*shared.Service)(nil), // 7: poktroll.shared.Service - (*v1beta1.PageRequest)(nil), // 8: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 9: cosmos.base.query.v1beta1.PageResponse + (*QueryParamsRequest)(nil), // 0: poktroll.service.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: poktroll.service.QueryParamsResponse + (*QueryGetServiceRequest)(nil), // 2: poktroll.service.QueryGetServiceRequest + (*QueryGetServiceResponse)(nil), // 3: poktroll.service.QueryGetServiceResponse + (*QueryAllServicesRequest)(nil), // 4: poktroll.service.QueryAllServicesRequest + (*QueryAllServicesResponse)(nil), // 5: poktroll.service.QueryAllServicesResponse + (*QueryGetRelayMiningDifficultyRequest)(nil), // 6: poktroll.service.QueryGetRelayMiningDifficultyRequest + (*QueryGetRelayMiningDifficultyResponse)(nil), // 7: poktroll.service.QueryGetRelayMiningDifficultyResponse + (*QueryAllRelayMiningDifficultyRequest)(nil), // 8: poktroll.service.QueryAllRelayMiningDifficultyRequest + (*QueryAllRelayMiningDifficultyResponse)(nil), // 9: poktroll.service.QueryAllRelayMiningDifficultyResponse + (*Params)(nil), // 10: poktroll.service.Params + (*shared.Service)(nil), // 11: poktroll.shared.Service + (*v1beta1.PageRequest)(nil), // 12: cosmos.base.query.v1beta1.PageRequest + (*v1beta1.PageResponse)(nil), // 13: cosmos.base.query.v1beta1.PageResponse + (*RelayMiningDifficulty)(nil), // 14: poktroll.service.RelayMiningDifficulty } var file_poktroll_service_query_proto_depIdxs = []int32{ - 6, // 0: poktroll.service.QueryParamsResponse.params:type_name -> poktroll.service.Params - 7, // 1: poktroll.service.QueryGetServiceResponse.service:type_name -> poktroll.shared.Service - 8, // 2: poktroll.service.QueryAllServicesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 7, // 3: poktroll.service.QueryAllServicesResponse.service:type_name -> poktroll.shared.Service - 9, // 4: poktroll.service.QueryAllServicesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 0, // 5: poktroll.service.Query.Params:input_type -> poktroll.service.QueryParamsRequest - 2, // 6: poktroll.service.Query.Service:input_type -> poktroll.service.QueryGetServiceRequest - 4, // 7: poktroll.service.Query.AllServices:input_type -> poktroll.service.QueryAllServicesRequest - 1, // 8: poktroll.service.Query.Params:output_type -> poktroll.service.QueryParamsResponse - 3, // 9: poktroll.service.Query.Service:output_type -> poktroll.service.QueryGetServiceResponse - 5, // 10: poktroll.service.Query.AllServices:output_type -> poktroll.service.QueryAllServicesResponse - 8, // [8:11] is the sub-list for method output_type - 5, // [5:8] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 10, // 0: poktroll.service.QueryParamsResponse.params:type_name -> poktroll.service.Params + 11, // 1: poktroll.service.QueryGetServiceResponse.service:type_name -> poktroll.shared.Service + 12, // 2: poktroll.service.QueryAllServicesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 11, // 3: poktroll.service.QueryAllServicesResponse.service:type_name -> poktroll.shared.Service + 13, // 4: poktroll.service.QueryAllServicesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 14, // 5: poktroll.service.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty:type_name -> poktroll.service.RelayMiningDifficulty + 12, // 6: poktroll.service.QueryAllRelayMiningDifficultyRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 14, // 7: poktroll.service.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty:type_name -> poktroll.service.RelayMiningDifficulty + 13, // 8: poktroll.service.QueryAllRelayMiningDifficultyResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 0, // 9: poktroll.service.Query.Params:input_type -> poktroll.service.QueryParamsRequest + 2, // 10: poktroll.service.Query.Service:input_type -> poktroll.service.QueryGetServiceRequest + 4, // 11: poktroll.service.Query.AllServices:input_type -> poktroll.service.QueryAllServicesRequest + 6, // 12: poktroll.service.Query.RelayMiningDifficulty:input_type -> poktroll.service.QueryGetRelayMiningDifficultyRequest + 8, // 13: poktroll.service.Query.RelayMiningDifficultyAll:input_type -> poktroll.service.QueryAllRelayMiningDifficultyRequest + 1, // 14: poktroll.service.Query.Params:output_type -> poktroll.service.QueryParamsResponse + 3, // 15: poktroll.service.Query.Service:output_type -> poktroll.service.QueryGetServiceResponse + 5, // 16: poktroll.service.Query.AllServices:output_type -> poktroll.service.QueryAllServicesResponse + 7, // 17: poktroll.service.Query.RelayMiningDifficulty:output_type -> poktroll.service.QueryGetRelayMiningDifficultyResponse + 9, // 18: poktroll.service.Query.RelayMiningDifficultyAll:output_type -> poktroll.service.QueryAllRelayMiningDifficultyResponse + 14, // [14:19] is the sub-list for method output_type + 9, // [9:14] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_poktroll_service_query_proto_init() } @@ -3036,6 +5124,7 @@ func file_poktroll_service_query_proto_init() { return } file_poktroll_service_params_proto_init() + file_poktroll_service_relay_mining_difficulty_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_service_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { @@ -3109,6 +5198,54 @@ func file_poktroll_service_query_proto_init() { return nil } } + file_poktroll_service_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetRelayMiningDifficultyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_service_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryGetRelayMiningDifficultyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_service_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllRelayMiningDifficultyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poktroll_service_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryAllRelayMiningDifficultyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3116,7 +5253,7 @@ func file_poktroll_service_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_service_query_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/api/poktroll/service/query_grpc.pb.go b/api/poktroll/service/query_grpc.pb.go index 98d68bf29..99ea067f5 100644 --- a/api/poktroll/service/query_grpc.pb.go +++ b/api/poktroll/service/query_grpc.pb.go @@ -19,9 +19,11 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - Query_Params_FullMethodName = "/poktroll.service.Query/Params" - Query_Service_FullMethodName = "/poktroll.service.Query/Service" - Query_AllServices_FullMethodName = "/poktroll.service.Query/AllServices" + Query_Params_FullMethodName = "/poktroll.service.Query/Params" + Query_Service_FullMethodName = "/poktroll.service.Query/Service" + Query_AllServices_FullMethodName = "/poktroll.service.Query/AllServices" + Query_RelayMiningDifficulty_FullMethodName = "/poktroll.service.Query/RelayMiningDifficulty" + Query_RelayMiningDifficultyAll_FullMethodName = "/poktroll.service.Query/RelayMiningDifficultyAll" ) // QueryClient is the client API for Query service. @@ -35,6 +37,9 @@ type QueryClient interface { // Queries a list of Service items. Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) + // Queries a list of RelayMiningDifficulty items. + RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) + RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) } type queryClient struct { @@ -75,6 +80,26 @@ func (c *queryClient) AllServices(ctx context.Context, in *QueryAllServicesReque return out, nil } +func (c *queryClient) RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryGetRelayMiningDifficultyResponse) + err := c.cc.Invoke(ctx, Query_RelayMiningDifficulty_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryAllRelayMiningDifficultyResponse) + err := c.cc.Invoke(ctx, Query_RelayMiningDifficultyAll_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility @@ -86,6 +111,9 @@ type QueryServer interface { // Queries a list of Service items. Service(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error) AllServices(context.Context, *QueryAllServicesRequest) (*QueryAllServicesResponse, error) + // Queries a list of RelayMiningDifficulty items. + RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) + RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) mustEmbedUnimplementedQueryServer() } @@ -102,6 +130,12 @@ func (UnimplementedQueryServer) Service(context.Context, *QueryGetServiceRequest func (UnimplementedQueryServer) AllServices(context.Context, *QueryAllServicesRequest) (*QueryAllServicesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllServices not implemented") } +func (UnimplementedQueryServer) RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficulty not implemented") +} +func (UnimplementedQueryServer) RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficultyAll not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -169,6 +203,42 @@ func _Query_AllServices_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_RelayMiningDifficulty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRelayMiningDifficultyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RelayMiningDifficulty(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_RelayMiningDifficulty_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RelayMiningDifficulty(ctx, req.(*QueryGetRelayMiningDifficultyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RelayMiningDifficultyAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRelayMiningDifficultyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RelayMiningDifficultyAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_RelayMiningDifficultyAll_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RelayMiningDifficultyAll(ctx, req.(*QueryAllRelayMiningDifficultyRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -188,6 +258,14 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "AllServices", Handler: _Query_AllServices_Handler, }, + { + MethodName: "RelayMiningDifficulty", + Handler: _Query_RelayMiningDifficulty_Handler, + }, + { + MethodName: "RelayMiningDifficultyAll", + Handler: _Query_RelayMiningDifficultyAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/service/query.proto", diff --git a/api/poktroll/service/relay_mining_difficulty.pulsar.go b/api/poktroll/service/relay_mining_difficulty.pulsar.go new file mode 100644 index 000000000..10e3920a7 --- /dev/null +++ b/api/poktroll/service/relay_mining_difficulty.pulsar.go @@ -0,0 +1,776 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package service + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_RelayMiningDifficulty protoreflect.MessageDescriptor + fd_RelayMiningDifficulty_service_id protoreflect.FieldDescriptor + fd_RelayMiningDifficulty_block_height protoreflect.FieldDescriptor + fd_RelayMiningDifficulty_num_relays_ema protoreflect.FieldDescriptor + fd_RelayMiningDifficulty_target_hash protoreflect.FieldDescriptor +) + +func init() { + file_poktroll_service_relay_mining_difficulty_proto_init() + md_RelayMiningDifficulty = File_poktroll_service_relay_mining_difficulty_proto.Messages().ByName("RelayMiningDifficulty") + fd_RelayMiningDifficulty_service_id = md_RelayMiningDifficulty.Fields().ByName("service_id") + fd_RelayMiningDifficulty_block_height = md_RelayMiningDifficulty.Fields().ByName("block_height") + fd_RelayMiningDifficulty_num_relays_ema = md_RelayMiningDifficulty.Fields().ByName("num_relays_ema") + fd_RelayMiningDifficulty_target_hash = md_RelayMiningDifficulty.Fields().ByName("target_hash") +} + +var _ protoreflect.Message = (*fastReflection_RelayMiningDifficulty)(nil) + +type fastReflection_RelayMiningDifficulty RelayMiningDifficulty + +func (x *RelayMiningDifficulty) ProtoReflect() protoreflect.Message { + return (*fastReflection_RelayMiningDifficulty)(x) +} + +func (x *RelayMiningDifficulty) slowProtoReflect() protoreflect.Message { + mi := &file_poktroll_service_relay_mining_difficulty_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_RelayMiningDifficulty_messageType fastReflection_RelayMiningDifficulty_messageType +var _ protoreflect.MessageType = fastReflection_RelayMiningDifficulty_messageType{} + +type fastReflection_RelayMiningDifficulty_messageType struct{} + +func (x fastReflection_RelayMiningDifficulty_messageType) Zero() protoreflect.Message { + return (*fastReflection_RelayMiningDifficulty)(nil) +} +func (x fastReflection_RelayMiningDifficulty_messageType) New() protoreflect.Message { + return new(fastReflection_RelayMiningDifficulty) +} +func (x fastReflection_RelayMiningDifficulty_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_RelayMiningDifficulty +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_RelayMiningDifficulty) Descriptor() protoreflect.MessageDescriptor { + return md_RelayMiningDifficulty +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_RelayMiningDifficulty) Type() protoreflect.MessageType { + return _fastReflection_RelayMiningDifficulty_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_RelayMiningDifficulty) New() protoreflect.Message { + return new(fastReflection_RelayMiningDifficulty) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_RelayMiningDifficulty) Interface() protoreflect.ProtoMessage { + return (*RelayMiningDifficulty)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_RelayMiningDifficulty) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ServiceId != "" { + value := protoreflect.ValueOfString(x.ServiceId) + if !f(fd_RelayMiningDifficulty_service_id, value) { + return + } + } + if x.BlockHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.BlockHeight) + if !f(fd_RelayMiningDifficulty_block_height, value) { + return + } + } + if x.NumRelaysEma != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumRelaysEma) + if !f(fd_RelayMiningDifficulty_num_relays_ema, value) { + return + } + } + if len(x.TargetHash) != 0 { + value := protoreflect.ValueOfBytes(x.TargetHash) + if !f(fd_RelayMiningDifficulty_target_hash, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_RelayMiningDifficulty) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "poktroll.service.RelayMiningDifficulty.service_id": + return x.ServiceId != "" + case "poktroll.service.RelayMiningDifficulty.block_height": + return x.BlockHeight != int64(0) + case "poktroll.service.RelayMiningDifficulty.num_relays_ema": + return x.NumRelaysEma != uint64(0) + case "poktroll.service.RelayMiningDifficulty.target_hash": + return len(x.TargetHash) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayMiningDifficulty")) + } + panic(fmt.Errorf("message poktroll.service.RelayMiningDifficulty does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RelayMiningDifficulty) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "poktroll.service.RelayMiningDifficulty.service_id": + x.ServiceId = "" + case "poktroll.service.RelayMiningDifficulty.block_height": + x.BlockHeight = int64(0) + case "poktroll.service.RelayMiningDifficulty.num_relays_ema": + x.NumRelaysEma = uint64(0) + case "poktroll.service.RelayMiningDifficulty.target_hash": + x.TargetHash = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayMiningDifficulty")) + } + panic(fmt.Errorf("message poktroll.service.RelayMiningDifficulty does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_RelayMiningDifficulty) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "poktroll.service.RelayMiningDifficulty.service_id": + value := x.ServiceId + return protoreflect.ValueOfString(value) + case "poktroll.service.RelayMiningDifficulty.block_height": + value := x.BlockHeight + return protoreflect.ValueOfInt64(value) + case "poktroll.service.RelayMiningDifficulty.num_relays_ema": + value := x.NumRelaysEma + return protoreflect.ValueOfUint64(value) + case "poktroll.service.RelayMiningDifficulty.target_hash": + value := x.TargetHash + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayMiningDifficulty")) + } + panic(fmt.Errorf("message poktroll.service.RelayMiningDifficulty does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RelayMiningDifficulty) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "poktroll.service.RelayMiningDifficulty.service_id": + x.ServiceId = value.Interface().(string) + case "poktroll.service.RelayMiningDifficulty.block_height": + x.BlockHeight = value.Int() + case "poktroll.service.RelayMiningDifficulty.num_relays_ema": + x.NumRelaysEma = value.Uint() + case "poktroll.service.RelayMiningDifficulty.target_hash": + x.TargetHash = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayMiningDifficulty")) + } + panic(fmt.Errorf("message poktroll.service.RelayMiningDifficulty does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RelayMiningDifficulty) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.RelayMiningDifficulty.service_id": + panic(fmt.Errorf("field service_id of message poktroll.service.RelayMiningDifficulty is not mutable")) + case "poktroll.service.RelayMiningDifficulty.block_height": + panic(fmt.Errorf("field block_height of message poktroll.service.RelayMiningDifficulty is not mutable")) + case "poktroll.service.RelayMiningDifficulty.num_relays_ema": + panic(fmt.Errorf("field num_relays_ema of message poktroll.service.RelayMiningDifficulty is not mutable")) + case "poktroll.service.RelayMiningDifficulty.target_hash": + panic(fmt.Errorf("field target_hash of message poktroll.service.RelayMiningDifficulty is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayMiningDifficulty")) + } + panic(fmt.Errorf("message poktroll.service.RelayMiningDifficulty does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_RelayMiningDifficulty) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "poktroll.service.RelayMiningDifficulty.service_id": + return protoreflect.ValueOfString("") + case "poktroll.service.RelayMiningDifficulty.block_height": + return protoreflect.ValueOfInt64(int64(0)) + case "poktroll.service.RelayMiningDifficulty.num_relays_ema": + return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.service.RelayMiningDifficulty.target_hash": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayMiningDifficulty")) + } + panic(fmt.Errorf("message poktroll.service.RelayMiningDifficulty does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_RelayMiningDifficulty) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in poktroll.service.RelayMiningDifficulty", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_RelayMiningDifficulty) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_RelayMiningDifficulty) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_RelayMiningDifficulty) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_RelayMiningDifficulty) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*RelayMiningDifficulty) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ServiceId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.BlockHeight != 0 { + n += 1 + runtime.Sov(uint64(x.BlockHeight)) + } + if x.NumRelaysEma != 0 { + n += 1 + runtime.Sov(uint64(x.NumRelaysEma)) + } + l = len(x.TargetHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*RelayMiningDifficulty) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.TargetHash) > 0 { + i -= len(x.TargetHash) + copy(dAtA[i:], x.TargetHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.TargetHash))) + i-- + dAtA[i] = 0x22 + } + if x.NumRelaysEma != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumRelaysEma)) + i-- + dAtA[i] = 0x18 + } + if x.BlockHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockHeight)) + i-- + dAtA[i] = 0x10 + } + if len(x.ServiceId) > 0 { + i -= len(x.ServiceId) + copy(dAtA[i:], x.ServiceId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceId))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*RelayMiningDifficulty) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RelayMiningDifficulty: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RelayMiningDifficulty: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + x.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.BlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumRelaysEma", wireType) + } + x.NumRelaysEma = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumRelaysEma |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TargetHash", wireType) + } + var byteLen 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++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + 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.TargetHash = append(x.TargetHash[:0], dAtA[iNdEx:postIndex]...) + if x.TargetHash == nil { + x.TargetHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: poktroll/service/relay_mining_difficulty.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// RelayMiningDifficulty is a message used to store the on-chain Relay Mining +// difficulty associated with a specific service ID. +// TODO_TECHDEBT: Embed this message in the Service message. +type RelayMiningDifficulty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The service ID the relay mining difficulty is associated with. + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + // The block height at which this relay mining difficulty was computed. + // This is needed to determine how much time has passed since the last time + // the exponential moving average was computed. + BlockHeight int64 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + // The exponential moving average of the number of relays for this service. + NumRelaysEma uint64 `protobuf:"varint,3,opt,name=num_relays_ema,json=numRelaysEma,proto3" json:"num_relays_ema,omitempty"` + // The target hash determining the difficulty to mine relays for this service. + // For example, if we use sha256 to hash the (RelayRequest,ReqlayResponse) tuple, + // and the difficulty has 4 leading zero bits, then the target hash would be: + // 0b0000111... (until 32 bytes are filled up). + TargetHash []byte `protobuf:"bytes,4,opt,name=target_hash,json=targetHash,proto3" json:"target_hash,omitempty"` +} + +func (x *RelayMiningDifficulty) Reset() { + *x = RelayMiningDifficulty{} + if protoimpl.UnsafeEnabled { + mi := &file_poktroll_service_relay_mining_difficulty_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RelayMiningDifficulty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RelayMiningDifficulty) ProtoMessage() {} + +// Deprecated: Use RelayMiningDifficulty.ProtoReflect.Descriptor instead. +func (*RelayMiningDifficulty) Descriptor() ([]byte, []int) { + return file_poktroll_service_relay_mining_difficulty_proto_rawDescGZIP(), []int{0} +} + +func (x *RelayMiningDifficulty) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *RelayMiningDifficulty) GetBlockHeight() int64 { + if x != nil { + return x.BlockHeight + } + return 0 +} + +func (x *RelayMiningDifficulty) GetNumRelaysEma() uint64 { + if x != nil { + return x.NumRelaysEma + } + return 0 +} + +func (x *RelayMiningDifficulty) GetTargetHash() []byte { + if x != nil { + return x.TargetHash + } + return nil +} + +var File_poktroll_service_relay_mining_difficulty_proto protoreflect.FileDescriptor + +var file_poktroll_service_relay_mining_difficulty_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, + 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x10, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x6c, + 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, + 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, + 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, + 0x79, 0x73, 0x5f, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6e, 0x75, + 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x45, 0x6d, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x61, 0x73, 0x68, 0x42, 0xba, 0x01, 0xd8, 0xe2, + 0x1e, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x1a, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, + 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 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, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, + 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, + 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_poktroll_service_relay_mining_difficulty_proto_rawDescOnce sync.Once + file_poktroll_service_relay_mining_difficulty_proto_rawDescData = file_poktroll_service_relay_mining_difficulty_proto_rawDesc +) + +func file_poktroll_service_relay_mining_difficulty_proto_rawDescGZIP() []byte { + file_poktroll_service_relay_mining_difficulty_proto_rawDescOnce.Do(func() { + file_poktroll_service_relay_mining_difficulty_proto_rawDescData = protoimpl.X.CompressGZIP(file_poktroll_service_relay_mining_difficulty_proto_rawDescData) + }) + return file_poktroll_service_relay_mining_difficulty_proto_rawDescData +} + +var file_poktroll_service_relay_mining_difficulty_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_poktroll_service_relay_mining_difficulty_proto_goTypes = []interface{}{ + (*RelayMiningDifficulty)(nil), // 0: poktroll.service.RelayMiningDifficulty +} +var file_poktroll_service_relay_mining_difficulty_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_poktroll_service_relay_mining_difficulty_proto_init() } +func file_poktroll_service_relay_mining_difficulty_proto_init() { + if File_poktroll_service_relay_mining_difficulty_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_poktroll_service_relay_mining_difficulty_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RelayMiningDifficulty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_poktroll_service_relay_mining_difficulty_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_poktroll_service_relay_mining_difficulty_proto_goTypes, + DependencyIndexes: file_poktroll_service_relay_mining_difficulty_proto_depIdxs, + MessageInfos: file_poktroll_service_relay_mining_difficulty_proto_msgTypes, + }.Build() + File_poktroll_service_relay_mining_difficulty_proto = out.File + file_poktroll_service_relay_mining_difficulty_proto_rawDesc = nil + file_poktroll_service_relay_mining_difficulty_proto_goTypes = nil + file_poktroll_service_relay_mining_difficulty_proto_depIdxs = nil +} diff --git a/api/poktroll/shared/tx.pulsar.go b/api/poktroll/shared/tx.pulsar.go index 7dba823cd..fe3e70a04 100644 --- a/api/poktroll/shared/tx.pulsar.go +++ b/api/poktroll/shared/tx.pulsar.go @@ -876,7 +876,7 @@ var ( fd_MsgUpdateParam_authority protoreflect.FieldDescriptor fd_MsgUpdateParam_name protoreflect.FieldDescriptor fd_MsgUpdateParam_as_string protoreflect.FieldDescriptor - fd_MsgUpdateParam_as_int64 protoreflect.FieldDescriptor + fd_MsgUpdateParam_as_uint64 protoreflect.FieldDescriptor fd_MsgUpdateParam_as_bytes protoreflect.FieldDescriptor ) @@ -886,7 +886,7 @@ func init() { fd_MsgUpdateParam_authority = md_MsgUpdateParam.Fields().ByName("authority") fd_MsgUpdateParam_name = md_MsgUpdateParam.Fields().ByName("name") fd_MsgUpdateParam_as_string = md_MsgUpdateParam.Fields().ByName("as_string") - fd_MsgUpdateParam_as_int64 = md_MsgUpdateParam.Fields().ByName("as_int64") + fd_MsgUpdateParam_as_uint64 = md_MsgUpdateParam.Fields().ByName("as_uint64") fd_MsgUpdateParam_as_bytes = md_MsgUpdateParam.Fields().ByName("as_bytes") } @@ -975,10 +975,10 @@ func (x *fastReflection_MsgUpdateParam) Range(f func(protoreflect.FieldDescripto if !f(fd_MsgUpdateParam_as_string, value) { return } - case *MsgUpdateParam_AsInt64: - v := o.AsInt64 - value := protoreflect.ValueOfInt64(v) - if !f(fd_MsgUpdateParam_as_int64, value) { + case *MsgUpdateParam_AsUint64: + v := o.AsUint64 + value := protoreflect.ValueOfUint64(v) + if !f(fd_MsgUpdateParam_as_uint64, value) { return } case *MsgUpdateParam_AsBytes: @@ -1016,10 +1016,10 @@ func (x *fastReflection_MsgUpdateParam) Has(fd protoreflect.FieldDescriptor) boo } else { return false } - case "poktroll.shared.MsgUpdateParam.as_int64": + case "poktroll.shared.MsgUpdateParam.as_uint64": if x.AsType == nil { return false - } else if _, ok := x.AsType.(*MsgUpdateParam_AsInt64); ok { + } else if _, ok := x.AsType.(*MsgUpdateParam_AsUint64); ok { return true } else { return false @@ -1054,7 +1054,7 @@ func (x *fastReflection_MsgUpdateParam) Clear(fd protoreflect.FieldDescriptor) { x.Name = "" case "poktroll.shared.MsgUpdateParam.as_string": x.AsType = nil - case "poktroll.shared.MsgUpdateParam.as_int64": + case "poktroll.shared.MsgUpdateParam.as_uint64": x.AsType = nil case "poktroll.shared.MsgUpdateParam.as_bytes": x.AsType = nil @@ -1088,13 +1088,13 @@ func (x *fastReflection_MsgUpdateParam) Get(descriptor protoreflect.FieldDescrip } else { return protoreflect.ValueOfString("") } - case "poktroll.shared.MsgUpdateParam.as_int64": + case "poktroll.shared.MsgUpdateParam.as_uint64": if x.AsType == nil { - return protoreflect.ValueOfInt64(int64(0)) - } else if v, ok := x.AsType.(*MsgUpdateParam_AsInt64); ok { - return protoreflect.ValueOfInt64(v.AsInt64) + return protoreflect.ValueOfUint64(uint64(0)) + } else if v, ok := x.AsType.(*MsgUpdateParam_AsUint64); ok { + return protoreflect.ValueOfUint64(v.AsUint64) } else { - return protoreflect.ValueOfInt64(int64(0)) + return protoreflect.ValueOfUint64(uint64(0)) } case "poktroll.shared.MsgUpdateParam.as_bytes": if x.AsType == nil { @@ -1131,9 +1131,9 @@ func (x *fastReflection_MsgUpdateParam) Set(fd protoreflect.FieldDescriptor, val case "poktroll.shared.MsgUpdateParam.as_string": cv := value.Interface().(string) x.AsType = &MsgUpdateParam_AsString{AsString: cv} - case "poktroll.shared.MsgUpdateParam.as_int64": - cv := value.Int() - x.AsType = &MsgUpdateParam_AsInt64{AsInt64: cv} + case "poktroll.shared.MsgUpdateParam.as_uint64": + cv := value.Uint() + x.AsType = &MsgUpdateParam_AsUint64{AsUint64: cv} case "poktroll.shared.MsgUpdateParam.as_bytes": cv := value.Bytes() x.AsType = &MsgUpdateParam_AsBytes{AsBytes: cv} @@ -1163,8 +1163,8 @@ func (x *fastReflection_MsgUpdateParam) Mutable(fd protoreflect.FieldDescriptor) panic(fmt.Errorf("field name of message poktroll.shared.MsgUpdateParam is not mutable")) case "poktroll.shared.MsgUpdateParam.as_string": panic(fmt.Errorf("field as_string of message poktroll.shared.MsgUpdateParam is not mutable")) - case "poktroll.shared.MsgUpdateParam.as_int64": - panic(fmt.Errorf("field as_int64 of message poktroll.shared.MsgUpdateParam is not mutable")) + case "poktroll.shared.MsgUpdateParam.as_uint64": + panic(fmt.Errorf("field as_uint64 of message poktroll.shared.MsgUpdateParam is not mutable")) case "poktroll.shared.MsgUpdateParam.as_bytes": panic(fmt.Errorf("field as_bytes of message poktroll.shared.MsgUpdateParam is not mutable")) default: @@ -1186,8 +1186,8 @@ func (x *fastReflection_MsgUpdateParam) NewField(fd protoreflect.FieldDescriptor return protoreflect.ValueOfString("") case "poktroll.shared.MsgUpdateParam.as_string": return protoreflect.ValueOfString("") - case "poktroll.shared.MsgUpdateParam.as_int64": - return protoreflect.ValueOfInt64(int64(0)) + case "poktroll.shared.MsgUpdateParam.as_uint64": + return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.shared.MsgUpdateParam.as_bytes": return protoreflect.ValueOfBytes(nil) default: @@ -1210,8 +1210,8 @@ func (x *fastReflection_MsgUpdateParam) WhichOneof(d protoreflect.OneofDescripto switch x.AsType.(type) { case *MsgUpdateParam_AsString: return x.Descriptor().Fields().ByName("as_string") - case *MsgUpdateParam_AsInt64: - return x.Descriptor().Fields().ByName("as_int64") + case *MsgUpdateParam_AsUint64: + return x.Descriptor().Fields().ByName("as_uint64") case *MsgUpdateParam_AsBytes: return x.Descriptor().Fields().ByName("as_bytes") } @@ -1286,11 +1286,11 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { } l = len(x.AsString) n += 1 + l + runtime.Sov(uint64(l)) - case *MsgUpdateParam_AsInt64: + case *MsgUpdateParam_AsUint64: if x == nil { break } - n += 1 + runtime.Sov(uint64(x.AsInt64)) + n += 1 + runtime.Sov(uint64(x.AsUint64)) case *MsgUpdateParam_AsBytes: if x == nil { break @@ -1334,8 +1334,8 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AsString))) i-- dAtA[i] = 0x1a - case *MsgUpdateParam_AsInt64: - i = runtime.EncodeVarint(dAtA, i, uint64(x.AsInt64)) + case *MsgUpdateParam_AsUint64: + i = runtime.EncodeVarint(dAtA, i, uint64(x.AsUint64)) i-- dAtA[i] = 0x30 case *MsgUpdateParam_AsBytes: @@ -1506,9 +1506,9 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 6: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsUint64", wireType) } - var v int64 + var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1518,12 +1518,12 @@ func (x *fastReflection_MsgUpdateParam) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + v |= uint64(b&0x7F) << shift if b < 0x80 { break } } - x.AsType = &MsgUpdateParam_AsInt64{v} + x.AsType = &MsgUpdateParam_AsUint64{v} case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) @@ -2126,7 +2126,7 @@ type MsgUpdateParam struct { // Types that are assignable to AsType: // // *MsgUpdateParam_AsString - // *MsgUpdateParam_AsInt64 + // *MsgUpdateParam_AsUint64 // *MsgUpdateParam_AsBytes AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` } @@ -2179,9 +2179,9 @@ func (x *MsgUpdateParam) GetAsString() string { return "" } -func (x *MsgUpdateParam) GetAsInt64() int64 { - if x, ok := x.GetAsType().(*MsgUpdateParam_AsInt64); ok { - return x.AsInt64 +func (x *MsgUpdateParam) GetAsUint64() uint64 { + if x, ok := x.GetAsType().(*MsgUpdateParam_AsUint64); ok { + return x.AsUint64 } return 0 } @@ -2201,8 +2201,8 @@ type MsgUpdateParam_AsString struct { AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof"` } -type MsgUpdateParam_AsInt64 struct { - AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof"` +type MsgUpdateParam_AsUint64 struct { + AsUint64 uint64 `protobuf:"varint,6,opt,name=as_uint64,json=asUint64,proto3,oneof"` } type MsgUpdateParam_AsBytes struct { @@ -2211,7 +2211,7 @@ type MsgUpdateParam_AsBytes struct { func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsUint64) isMsgUpdateParam_AsType() {} func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} @@ -2279,7 +2279,7 @@ var file_poktroll_shared_tx_proto_rawDesc = []byte{ 0x61, 0x72, 0x65, 0x64, 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, - 0xfb, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0xfe, 0x01, 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, 0x69, 0x6e, 0x67, 0x52, @@ -2287,42 +2287,42 @@ var file_poktroll_shared_tx_proto_rawDesc = []byte{ 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x09, 0x61, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 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, 0x12, 0x29, 0x0a, 0x08, - 0x61, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x0c, - 0xea, 0xde, 0x1f, 0x08, 0x61, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x48, 0x00, 0x52, 0x07, - 0x61, 0x73, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x29, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0c, 0xea, 0xde, 0x1f, 0x08, 0x61, - 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, 0x42, 0x79, 0x74, - 0x65, 0x73, 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, 0x49, 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, 0x2f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xc1, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, - 0x12, 0x5a, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, - 0x65, 0x64, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, - 0x61, 0x72, 0x65, 0x64, 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, 0x57, 0x0a, 0x0b, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1f, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x27, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 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, 0xa1, 0x01, 0xd8, - 0xe2, 0x1e, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x20, 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, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, - 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, - 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, - 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, - 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x48, 0x00, 0x52, 0x08, 0x61, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x09, + 0x61, 0x73, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x61, 0x73, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x48, 0x00, + 0x52, 0x08, 0x61, 0x73, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x29, 0x0a, 0x08, 0x61, 0x73, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0c, 0xea, 0xde, + 0x1f, 0x08, 0x61, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, + 0x42, 0x79, 0x74, 0x65, 0x73, 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, 0x49, 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, 0x2f, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0xc1, 0x01, 0x0a, 0x03, + 0x4d, 0x73, 0x67, 0x12, 0x5a, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 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, + 0x57, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1f, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, + 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x64, 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, + 0xa1, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x07, 0x54, 0x78, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 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, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, + 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, + 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, + 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, + 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2417,7 +2417,7 @@ func file_poktroll_shared_tx_proto_init() { } file_poktroll_shared_tx_proto_msgTypes[2].OneofWrappers = []interface{}{ (*MsgUpdateParam_AsString)(nil), - (*MsgUpdateParam_AsInt64)(nil), + (*MsgUpdateParam_AsUint64)(nil), (*MsgUpdateParam_AsBytes)(nil), } type x struct{} diff --git a/api/poktroll/tokenomics/event.pulsar.go b/api/poktroll/tokenomics/event.pulsar.go index f5d74bcf5..507b21ed9 100644 --- a/api/poktroll/tokenomics/event.pulsar.go +++ b/api/poktroll/tokenomics/event.pulsar.go @@ -16,11 +16,13 @@ import ( ) var ( - md_EventClaimExpired protoreflect.MessageDescriptor - fd_EventClaimExpired_claim protoreflect.FieldDescriptor - fd_EventClaimExpired_expiration_reason protoreflect.FieldDescriptor - fd_EventClaimExpired_num_relays protoreflect.FieldDescriptor - fd_EventClaimExpired_num_compute_units protoreflect.FieldDescriptor + md_EventClaimExpired protoreflect.MessageDescriptor + fd_EventClaimExpired_claim protoreflect.FieldDescriptor + fd_EventClaimExpired_expiration_reason protoreflect.FieldDescriptor + fd_EventClaimExpired_num_relays protoreflect.FieldDescriptor + fd_EventClaimExpired_num_claimed_compute_units protoreflect.FieldDescriptor + fd_EventClaimExpired_num_estimated_compute_units protoreflect.FieldDescriptor + fd_EventClaimExpired_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -29,7 +31,9 @@ func init() { fd_EventClaimExpired_claim = md_EventClaimExpired.Fields().ByName("claim") fd_EventClaimExpired_expiration_reason = md_EventClaimExpired.Fields().ByName("expiration_reason") fd_EventClaimExpired_num_relays = md_EventClaimExpired.Fields().ByName("num_relays") - fd_EventClaimExpired_num_compute_units = md_EventClaimExpired.Fields().ByName("num_compute_units") + fd_EventClaimExpired_num_claimed_compute_units = md_EventClaimExpired.Fields().ByName("num_claimed_compute_units") + fd_EventClaimExpired_num_estimated_compute_units = md_EventClaimExpired.Fields().ByName("num_estimated_compute_units") + fd_EventClaimExpired_claimed_upokt = md_EventClaimExpired.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventClaimExpired)(nil) @@ -115,9 +119,21 @@ func (x *fastReflection_EventClaimExpired) Range(f func(protoreflect.FieldDescri return } } - if x.NumComputeUnits != uint64(0) { - value := protoreflect.ValueOfUint64(x.NumComputeUnits) - if !f(fd_EventClaimExpired_num_compute_units, value) { + if x.NumClaimedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumClaimedComputeUnits) + if !f(fd_EventClaimExpired_num_claimed_compute_units, value) { + return + } + } + if x.NumEstimatedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumEstimatedComputeUnits) + if !f(fd_EventClaimExpired_num_estimated_compute_units, value) { + return + } + } + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventClaimExpired_claimed_upokt, value) { return } } @@ -142,8 +158,12 @@ func (x *fastReflection_EventClaimExpired) Has(fd protoreflect.FieldDescriptor) return x.ExpirationReason != 0 case "poktroll.tokenomics.EventClaimExpired.num_relays": return x.NumRelays != uint64(0) - case "poktroll.tokenomics.EventClaimExpired.num_compute_units": - return x.NumComputeUnits != uint64(0) + case "poktroll.tokenomics.EventClaimExpired.num_claimed_compute_units": + return x.NumClaimedComputeUnits != uint64(0) + case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": + return x.NumEstimatedComputeUnits != uint64(0) + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimExpired")) @@ -166,8 +186,12 @@ func (x *fastReflection_EventClaimExpired) Clear(fd protoreflect.FieldDescriptor x.ExpirationReason = 0 case "poktroll.tokenomics.EventClaimExpired.num_relays": x.NumRelays = uint64(0) - case "poktroll.tokenomics.EventClaimExpired.num_compute_units": - x.NumComputeUnits = uint64(0) + case "poktroll.tokenomics.EventClaimExpired.num_claimed_compute_units": + x.NumClaimedComputeUnits = uint64(0) + case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": + x.NumEstimatedComputeUnits = uint64(0) + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimExpired")) @@ -193,9 +217,15 @@ func (x *fastReflection_EventClaimExpired) Get(descriptor protoreflect.FieldDesc case "poktroll.tokenomics.EventClaimExpired.num_relays": value := x.NumRelays return protoreflect.ValueOfUint64(value) - case "poktroll.tokenomics.EventClaimExpired.num_compute_units": - value := x.NumComputeUnits + case "poktroll.tokenomics.EventClaimExpired.num_claimed_compute_units": + value := x.NumClaimedComputeUnits return protoreflect.ValueOfUint64(value) + case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": + value := x.NumEstimatedComputeUnits + return protoreflect.ValueOfUint64(value) + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + value := x.ClaimedUpokt + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimExpired")) @@ -222,8 +252,12 @@ func (x *fastReflection_EventClaimExpired) Set(fd protoreflect.FieldDescriptor, x.ExpirationReason = (ClaimExpirationReason)(value.Enum()) case "poktroll.tokenomics.EventClaimExpired.num_relays": x.NumRelays = value.Uint() - case "poktroll.tokenomics.EventClaimExpired.num_compute_units": - x.NumComputeUnits = value.Uint() + case "poktroll.tokenomics.EventClaimExpired.num_claimed_compute_units": + x.NumClaimedComputeUnits = value.Uint() + case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": + x.NumEstimatedComputeUnits = value.Uint() + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimExpired")) @@ -249,12 +283,19 @@ func (x *fastReflection_EventClaimExpired) Mutable(fd protoreflect.FieldDescript x.Claim = new(proof.Claim) } return protoreflect.ValueOfMessage(x.Claim.ProtoReflect()) + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.tokenomics.EventClaimExpired.expiration_reason": panic(fmt.Errorf("field expiration_reason of message poktroll.tokenomics.EventClaimExpired is not mutable")) case "poktroll.tokenomics.EventClaimExpired.num_relays": panic(fmt.Errorf("field num_relays of message poktroll.tokenomics.EventClaimExpired is not mutable")) - case "poktroll.tokenomics.EventClaimExpired.num_compute_units": - panic(fmt.Errorf("field num_compute_units of message poktroll.tokenomics.EventClaimExpired is not mutable")) + case "poktroll.tokenomics.EventClaimExpired.num_claimed_compute_units": + panic(fmt.Errorf("field num_claimed_compute_units of message poktroll.tokenomics.EventClaimExpired is not mutable")) + case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": + panic(fmt.Errorf("field num_estimated_compute_units of message poktroll.tokenomics.EventClaimExpired is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimExpired")) @@ -275,8 +316,13 @@ func (x *fastReflection_EventClaimExpired) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfEnum(0) case "poktroll.tokenomics.EventClaimExpired.num_relays": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.tokenomics.EventClaimExpired.num_compute_units": + case "poktroll.tokenomics.EventClaimExpired.num_claimed_compute_units": + return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimExpired")) @@ -356,8 +402,15 @@ func (x *fastReflection_EventClaimExpired) ProtoMethods() *protoiface.Methods { if x.NumRelays != 0 { n += 1 + runtime.Sov(uint64(x.NumRelays)) } - if x.NumComputeUnits != 0 { - n += 1 + runtime.Sov(uint64(x.NumComputeUnits)) + if x.NumClaimedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumClaimedComputeUnits)) + } + if x.NumEstimatedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) + } + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -388,8 +441,27 @@ func (x *fastReflection_EventClaimExpired) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.NumComputeUnits != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.NumComputeUnits)) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) + 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] = 0x32 + } + if x.NumEstimatedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumEstimatedComputeUnits)) + i-- + dAtA[i] = 0x28 + } + if x.NumClaimedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumClaimedComputeUnits)) i-- dAtA[i] = 0x20 } @@ -542,9 +614,47 @@ func (x *fastReflection_EventClaimExpired) ProtoMethods() *protoiface.Methods { } case 4: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) + } + x.NumClaimedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumClaimedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + x.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } - x.NumComputeUnits = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -554,11 +664,28 @@ func (x *fastReflection_EventClaimExpired) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - x.NumComputeUnits |= uint64(b&0x7F) << shift + 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.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -595,11 +722,13 @@ func (x *fastReflection_EventClaimExpired) ProtoMethods() *protoiface.Methods { } var ( - md_EventClaimSettled protoreflect.MessageDescriptor - fd_EventClaimSettled_claim protoreflect.FieldDescriptor - fd_EventClaimSettled_proof_requirement protoreflect.FieldDescriptor - fd_EventClaimSettled_num_relays protoreflect.FieldDescriptor - fd_EventClaimSettled_num_compute_units protoreflect.FieldDescriptor + md_EventClaimSettled protoreflect.MessageDescriptor + fd_EventClaimSettled_claim protoreflect.FieldDescriptor + fd_EventClaimSettled_proof_requirement protoreflect.FieldDescriptor + fd_EventClaimSettled_num_relays protoreflect.FieldDescriptor + fd_EventClaimSettled_num_claimed_compute_units protoreflect.FieldDescriptor + fd_EventClaimSettled_num_estimated_compute_units protoreflect.FieldDescriptor + fd_EventClaimSettled_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -608,7 +737,9 @@ func init() { fd_EventClaimSettled_claim = md_EventClaimSettled.Fields().ByName("claim") fd_EventClaimSettled_proof_requirement = md_EventClaimSettled.Fields().ByName("proof_requirement") fd_EventClaimSettled_num_relays = md_EventClaimSettled.Fields().ByName("num_relays") - fd_EventClaimSettled_num_compute_units = md_EventClaimSettled.Fields().ByName("num_compute_units") + fd_EventClaimSettled_num_claimed_compute_units = md_EventClaimSettled.Fields().ByName("num_claimed_compute_units") + fd_EventClaimSettled_num_estimated_compute_units = md_EventClaimSettled.Fields().ByName("num_estimated_compute_units") + fd_EventClaimSettled_claimed_upokt = md_EventClaimSettled.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventClaimSettled)(nil) @@ -694,9 +825,21 @@ func (x *fastReflection_EventClaimSettled) Range(f func(protoreflect.FieldDescri return } } - if x.NumComputeUnits != uint64(0) { - value := protoreflect.ValueOfUint64(x.NumComputeUnits) - if !f(fd_EventClaimSettled_num_compute_units, value) { + if x.NumClaimedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumClaimedComputeUnits) + if !f(fd_EventClaimSettled_num_claimed_compute_units, value) { + return + } + } + if x.NumEstimatedComputeUnits != uint64(0) { + value := protoreflect.ValueOfUint64(x.NumEstimatedComputeUnits) + if !f(fd_EventClaimSettled_num_estimated_compute_units, value) { + return + } + } + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventClaimSettled_claimed_upokt, value) { return } } @@ -721,8 +864,12 @@ func (x *fastReflection_EventClaimSettled) Has(fd protoreflect.FieldDescriptor) return x.ProofRequirement != 0 case "poktroll.tokenomics.EventClaimSettled.num_relays": return x.NumRelays != uint64(0) - case "poktroll.tokenomics.EventClaimSettled.num_compute_units": - return x.NumComputeUnits != uint64(0) + case "poktroll.tokenomics.EventClaimSettled.num_claimed_compute_units": + return x.NumClaimedComputeUnits != uint64(0) + case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": + return x.NumEstimatedComputeUnits != uint64(0) + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) @@ -745,8 +892,12 @@ func (x *fastReflection_EventClaimSettled) Clear(fd protoreflect.FieldDescriptor x.ProofRequirement = 0 case "poktroll.tokenomics.EventClaimSettled.num_relays": x.NumRelays = uint64(0) - case "poktroll.tokenomics.EventClaimSettled.num_compute_units": - x.NumComputeUnits = uint64(0) + case "poktroll.tokenomics.EventClaimSettled.num_claimed_compute_units": + x.NumClaimedComputeUnits = uint64(0) + case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": + x.NumEstimatedComputeUnits = uint64(0) + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) @@ -766,614 +917,26 @@ func (x *fastReflection_EventClaimSettled) Get(descriptor protoreflect.FieldDesc case "poktroll.tokenomics.EventClaimSettled.claim": value := x.Claim return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.tokenomics.EventClaimSettled.proof_requirement": - value := x.ProofRequirement - return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) - case "poktroll.tokenomics.EventClaimSettled.num_relays": - value := x.NumRelays - return protoreflect.ValueOfUint64(value) - case "poktroll.tokenomics.EventClaimSettled.num_compute_units": - value := x.NumComputeUnits - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) - } - panic(fmt.Errorf("message poktroll.tokenomics.EventClaimSettled does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventClaimSettled) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "poktroll.tokenomics.EventClaimSettled.claim": - x.Claim = value.Message().Interface().(*proof.Claim) - case "poktroll.tokenomics.EventClaimSettled.proof_requirement": - x.ProofRequirement = (proof.ProofRequirementReason)(value.Enum()) - case "poktroll.tokenomics.EventClaimSettled.num_relays": - x.NumRelays = value.Uint() - case "poktroll.tokenomics.EventClaimSettled.num_compute_units": - x.NumComputeUnits = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) - } - panic(fmt.Errorf("message poktroll.tokenomics.EventClaimSettled does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventClaimSettled) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.EventClaimSettled.claim": - if x.Claim == nil { - x.Claim = new(proof.Claim) - } - return protoreflect.ValueOfMessage(x.Claim.ProtoReflect()) - case "poktroll.tokenomics.EventClaimSettled.proof_requirement": - panic(fmt.Errorf("field proof_requirement of message poktroll.tokenomics.EventClaimSettled is not mutable")) - case "poktroll.tokenomics.EventClaimSettled.num_relays": - panic(fmt.Errorf("field num_relays of message poktroll.tokenomics.EventClaimSettled is not mutable")) - case "poktroll.tokenomics.EventClaimSettled.num_compute_units": - panic(fmt.Errorf("field num_compute_units of message poktroll.tokenomics.EventClaimSettled is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) - } - panic(fmt.Errorf("message poktroll.tokenomics.EventClaimSettled does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_EventClaimSettled) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.EventClaimSettled.claim": - m := new(proof.Claim) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.tokenomics.EventClaimSettled.proof_requirement": - return protoreflect.ValueOfEnum(0) - case "poktroll.tokenomics.EventClaimSettled.num_relays": - return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.tokenomics.EventClaimSettled.num_compute_units": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) - } - panic(fmt.Errorf("message poktroll.tokenomics.EventClaimSettled does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_EventClaimSettled) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.tokenomics.EventClaimSettled", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_EventClaimSettled) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventClaimSettled) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_EventClaimSettled) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_EventClaimSettled) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EventClaimSettled) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Claim != nil { - l = options.Size(x.Claim) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.ProofRequirement != 0 { - n += 1 + runtime.Sov(uint64(x.ProofRequirement)) - } - if x.NumRelays != 0 { - n += 1 + runtime.Sov(uint64(x.NumRelays)) - } - if x.NumComputeUnits != 0 { - n += 1 + runtime.Sov(uint64(x.NumComputeUnits)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*EventClaimSettled) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.NumComputeUnits != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.NumComputeUnits)) - i-- - dAtA[i] = 0x20 - } - if x.NumRelays != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.NumRelays)) - i-- - dAtA[i] = 0x18 - } - if x.ProofRequirement != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.ProofRequirement)) - i-- - dAtA[i] = 0x10 - } - if x.Claim != nil { - encoded, err := options.Marshal(x.Claim) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*EventClaimSettled) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventClaimSettled: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventClaimSettled: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Claim", 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.Claim == nil { - x.Claim = &proof.Claim{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Claim); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProofRequirement", wireType) - } - x.ProofRequirement = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.ProofRequirement |= proof.ProofRequirementReason(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) - } - x.NumRelays = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.NumRelays |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) - } - x.NumComputeUnits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.NumComputeUnits |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_EventRelayMiningDifficultyUpdated protoreflect.MessageDescriptor - fd_EventRelayMiningDifficultyUpdated_service_id protoreflect.FieldDescriptor - fd_EventRelayMiningDifficultyUpdated_prev_target_hash_hex_encoded protoreflect.FieldDescriptor - fd_EventRelayMiningDifficultyUpdated_new_target_hash_hex_encoded protoreflect.FieldDescriptor - fd_EventRelayMiningDifficultyUpdated_prev_num_relays_ema protoreflect.FieldDescriptor - fd_EventRelayMiningDifficultyUpdated_new_num_relays_ema protoreflect.FieldDescriptor -) - -func init() { - file_poktroll_tokenomics_event_proto_init() - md_EventRelayMiningDifficultyUpdated = File_poktroll_tokenomics_event_proto.Messages().ByName("EventRelayMiningDifficultyUpdated") - fd_EventRelayMiningDifficultyUpdated_service_id = md_EventRelayMiningDifficultyUpdated.Fields().ByName("service_id") - fd_EventRelayMiningDifficultyUpdated_prev_target_hash_hex_encoded = md_EventRelayMiningDifficultyUpdated.Fields().ByName("prev_target_hash_hex_encoded") - fd_EventRelayMiningDifficultyUpdated_new_target_hash_hex_encoded = md_EventRelayMiningDifficultyUpdated.Fields().ByName("new_target_hash_hex_encoded") - fd_EventRelayMiningDifficultyUpdated_prev_num_relays_ema = md_EventRelayMiningDifficultyUpdated.Fields().ByName("prev_num_relays_ema") - fd_EventRelayMiningDifficultyUpdated_new_num_relays_ema = md_EventRelayMiningDifficultyUpdated.Fields().ByName("new_num_relays_ema") -} - -var _ protoreflect.Message = (*fastReflection_EventRelayMiningDifficultyUpdated)(nil) - -type fastReflection_EventRelayMiningDifficultyUpdated EventRelayMiningDifficultyUpdated - -func (x *EventRelayMiningDifficultyUpdated) ProtoReflect() protoreflect.Message { - return (*fastReflection_EventRelayMiningDifficultyUpdated)(x) -} - -func (x *EventRelayMiningDifficultyUpdated) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_tokenomics_event_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_EventRelayMiningDifficultyUpdated_messageType fastReflection_EventRelayMiningDifficultyUpdated_messageType -var _ protoreflect.MessageType = fastReflection_EventRelayMiningDifficultyUpdated_messageType{} - -type fastReflection_EventRelayMiningDifficultyUpdated_messageType struct{} - -func (x fastReflection_EventRelayMiningDifficultyUpdated_messageType) Zero() protoreflect.Message { - return (*fastReflection_EventRelayMiningDifficultyUpdated)(nil) -} -func (x fastReflection_EventRelayMiningDifficultyUpdated_messageType) New() protoreflect.Message { - return new(fastReflection_EventRelayMiningDifficultyUpdated) -} -func (x fastReflection_EventRelayMiningDifficultyUpdated_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_EventRelayMiningDifficultyUpdated -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) Descriptor() protoreflect.MessageDescriptor { - return md_EventRelayMiningDifficultyUpdated -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) Type() protoreflect.MessageType { - return _fastReflection_EventRelayMiningDifficultyUpdated_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) New() protoreflect.Message { - return new(fastReflection_EventRelayMiningDifficultyUpdated) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) Interface() protoreflect.ProtoMessage { - return (*EventRelayMiningDifficultyUpdated)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.ServiceId != "" { - value := protoreflect.ValueOfString(x.ServiceId) - if !f(fd_EventRelayMiningDifficultyUpdated_service_id, value) { - return - } - } - if x.PrevTargetHashHexEncoded != "" { - value := protoreflect.ValueOfString(x.PrevTargetHashHexEncoded) - if !f(fd_EventRelayMiningDifficultyUpdated_prev_target_hash_hex_encoded, value) { - return - } - } - if x.NewTargetHashHexEncoded != "" { - value := protoreflect.ValueOfString(x.NewTargetHashHexEncoded) - if !f(fd_EventRelayMiningDifficultyUpdated_new_target_hash_hex_encoded, value) { - return - } - } - if x.PrevNumRelaysEma != uint64(0) { - value := protoreflect.ValueOfUint64(x.PrevNumRelaysEma) - if !f(fd_EventRelayMiningDifficultyUpdated_prev_num_relays_ema, value) { - return - } - } - if x.NewNumRelaysEma != uint64(0) { - value := protoreflect.ValueOfUint64(x.NewNumRelaysEma) - if !f(fd_EventRelayMiningDifficultyUpdated_new_num_relays_ema, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.service_id": - return x.ServiceId != "" - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": - return x.PrevTargetHashHexEncoded != "" - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": - return x.NewTargetHashHexEncoded != "" - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": - return x.PrevNumRelaysEma != uint64(0) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_num_relays_ema": - return x.NewNumRelaysEma != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventRelayMiningDifficultyUpdated")) - } - panic(fmt.Errorf("message poktroll.tokenomics.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.service_id": - x.ServiceId = "" - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": - x.PrevTargetHashHexEncoded = "" - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": - x.NewTargetHashHexEncoded = "" - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": - x.PrevNumRelaysEma = uint64(0) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_num_relays_ema": - x.NewNumRelaysEma = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventRelayMiningDifficultyUpdated")) - } - panic(fmt.Errorf("message poktroll.tokenomics.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.service_id": - value := x.ServiceId - return protoreflect.ValueOfString(value) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": - value := x.PrevTargetHashHexEncoded - return protoreflect.ValueOfString(value) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": - value := x.NewTargetHashHexEncoded - return protoreflect.ValueOfString(value) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": - value := x.PrevNumRelaysEma + case "poktroll.tokenomics.EventClaimSettled.proof_requirement": + value := x.ProofRequirement + return protoreflect.ValueOfEnum((protoreflect.EnumNumber)(value)) + case "poktroll.tokenomics.EventClaimSettled.num_relays": + value := x.NumRelays + return protoreflect.ValueOfUint64(value) + case "poktroll.tokenomics.EventClaimSettled.num_claimed_compute_units": + value := x.NumClaimedComputeUnits return protoreflect.ValueOfUint64(value) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_num_relays_ema": - value := x.NewNumRelaysEma + case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": + value := x.NumEstimatedComputeUnits return protoreflect.ValueOfUint64(value) + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + value := x.ClaimedUpokt + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventRelayMiningDifficultyUpdated")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) } - panic(fmt.Errorf("message poktroll.tokenomics.EventRelayMiningDifficultyUpdated does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message poktroll.tokenomics.EventClaimSettled does not contain field %s", descriptor.FullName())) } } @@ -1387,23 +950,25 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) Get(descriptor protor // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_EventClaimSettled) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.service_id": - x.ServiceId = value.Interface().(string) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": - x.PrevTargetHashHexEncoded = value.Interface().(string) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": - x.NewTargetHashHexEncoded = value.Interface().(string) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": - x.PrevNumRelaysEma = value.Uint() - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_num_relays_ema": - x.NewNumRelaysEma = value.Uint() + case "poktroll.tokenomics.EventClaimSettled.claim": + x.Claim = value.Message().Interface().(*proof.Claim) + case "poktroll.tokenomics.EventClaimSettled.proof_requirement": + x.ProofRequirement = (proof.ProofRequirementReason)(value.Enum()) + case "poktroll.tokenomics.EventClaimSettled.num_relays": + x.NumRelays = value.Uint() + case "poktroll.tokenomics.EventClaimSettled.num_claimed_compute_units": + x.NumClaimedComputeUnits = value.Uint() + case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": + x.NumEstimatedComputeUnits = value.Uint() + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventRelayMiningDifficultyUpdated")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) } - panic(fmt.Errorf("message poktroll.tokenomics.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.tokenomics.EventClaimSettled does not contain field %s", fd.FullName())) } } @@ -1417,56 +982,68 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) Set(fd protoreflect.F // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventClaimSettled) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.service_id": - panic(fmt.Errorf("field service_id of message poktroll.tokenomics.EventRelayMiningDifficultyUpdated is not mutable")) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": - panic(fmt.Errorf("field prev_target_hash_hex_encoded of message poktroll.tokenomics.EventRelayMiningDifficultyUpdated is not mutable")) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": - panic(fmt.Errorf("field new_target_hash_hex_encoded of message poktroll.tokenomics.EventRelayMiningDifficultyUpdated is not mutable")) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": - panic(fmt.Errorf("field prev_num_relays_ema of message poktroll.tokenomics.EventRelayMiningDifficultyUpdated is not mutable")) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_num_relays_ema": - panic(fmt.Errorf("field new_num_relays_ema of message poktroll.tokenomics.EventRelayMiningDifficultyUpdated is not mutable")) + case "poktroll.tokenomics.EventClaimSettled.claim": + if x.Claim == nil { + x.Claim = new(proof.Claim) + } + return protoreflect.ValueOfMessage(x.Claim.ProtoReflect()) + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + case "poktroll.tokenomics.EventClaimSettled.proof_requirement": + panic(fmt.Errorf("field proof_requirement of message poktroll.tokenomics.EventClaimSettled is not mutable")) + case "poktroll.tokenomics.EventClaimSettled.num_relays": + panic(fmt.Errorf("field num_relays of message poktroll.tokenomics.EventClaimSettled is not mutable")) + case "poktroll.tokenomics.EventClaimSettled.num_claimed_compute_units": + panic(fmt.Errorf("field num_claimed_compute_units of message poktroll.tokenomics.EventClaimSettled is not mutable")) + case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": + panic(fmt.Errorf("field num_estimated_compute_units of message poktroll.tokenomics.EventClaimSettled is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventRelayMiningDifficultyUpdated")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) } - panic(fmt.Errorf("message poktroll.tokenomics.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.tokenomics.EventClaimSettled does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_EventClaimSettled) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.service_id": - return protoreflect.ValueOfString("") - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_target_hash_hex_encoded": - return protoreflect.ValueOfString("") - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_target_hash_hex_encoded": - return protoreflect.ValueOfString("") - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.prev_num_relays_ema": + case "poktroll.tokenomics.EventClaimSettled.claim": + m := new(proof.Claim) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "poktroll.tokenomics.EventClaimSettled.proof_requirement": + return protoreflect.ValueOfEnum(0) + case "poktroll.tokenomics.EventClaimSettled.num_relays": + return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.tokenomics.EventClaimSettled.num_claimed_compute_units": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.tokenomics.EventRelayMiningDifficultyUpdated.new_num_relays_ema": + case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventRelayMiningDifficultyUpdated")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) } - panic(fmt.Errorf("message poktroll.tokenomics.EventRelayMiningDifficultyUpdated does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message poktroll.tokenomics.EventClaimSettled does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_EventClaimSettled) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.tokenomics.EventRelayMiningDifficultyUpdated", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in poktroll.tokenomics.EventClaimSettled", d.FullName())) } panic("unreachable") } @@ -1474,7 +1051,7 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) WhichOneof(d protoref // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_EventClaimSettled) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1485,7 +1062,7 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) GetUnknown() protoref // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_EventClaimSettled) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1497,7 +1074,7 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) SetUnknown(fields pro // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) IsValid() bool { +func (x *fastReflection_EventClaimSettled) IsValid() bool { return x != nil } @@ -1507,9 +1084,9 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_EventClaimSettled) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*EventRelayMiningDifficultyUpdated) + x := input.Message.Interface().(*EventClaimSettled) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1521,23 +1098,25 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto var n int var l int _ = l - l = len(x.ServiceId) - if l > 0 { + if x.Claim != nil { + l = options.Size(x.Claim) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.PrevTargetHashHexEncoded) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if x.ProofRequirement != 0 { + n += 1 + runtime.Sov(uint64(x.ProofRequirement)) } - l = len(x.NewTargetHashHexEncoded) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if x.NumRelays != 0 { + n += 1 + runtime.Sov(uint64(x.NumRelays)) } - if x.PrevNumRelaysEma != 0 { - n += 1 + runtime.Sov(uint64(x.PrevNumRelaysEma)) + if x.NumClaimedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumClaimedComputeUnits)) } - if x.NewNumRelaysEma != 0 { - n += 1 + runtime.Sov(uint64(x.NewNumRelaysEma)) + if x.NumEstimatedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) + } + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) + n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -1549,7 +1128,7 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*EventRelayMiningDifficultyUpdated) + x := input.Message.Interface().(*EventClaimSettled) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1568,34 +1147,51 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.NewNumRelaysEma != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.NewNumRelaysEma)) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) + 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] = 0x32 + } + if x.NumEstimatedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumEstimatedComputeUnits)) i-- dAtA[i] = 0x28 } - if x.PrevNumRelaysEma != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.PrevNumRelaysEma)) + if x.NumClaimedComputeUnits != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumClaimedComputeUnits)) i-- dAtA[i] = 0x20 } - if len(x.NewTargetHashHexEncoded) > 0 { - i -= len(x.NewTargetHashHexEncoded) - copy(dAtA[i:], x.NewTargetHashHexEncoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NewTargetHashHexEncoded))) + if x.NumRelays != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumRelays)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x18 } - if len(x.PrevTargetHashHexEncoded) > 0 { - i -= len(x.PrevTargetHashHexEncoded) - copy(dAtA[i:], x.PrevTargetHashHexEncoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PrevTargetHashHexEncoded))) + if x.ProofRequirement != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProofRequirement)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(x.ServiceId) > 0 { - i -= len(x.ServiceId) - copy(dAtA[i:], x.ServiceId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceId))) + if x.Claim != nil { + encoded, err := options.Marshal(x.Claim) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } @@ -1610,7 +1206,7 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*EventRelayMiningDifficultyUpdated) + x := input.Message.Interface().(*EventClaimSettled) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1642,17 +1238,17 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRelayMiningDifficultyUpdated: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventClaimSettled: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRelayMiningDifficultyUpdated: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventClaimSettled: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Claim", 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 @@ -1662,29 +1258,33 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto } 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.ServiceId = string(dAtA[iNdEx:postIndex]) + if x.Claim == nil { + x.Claim = &proof.Claim{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Claim); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } iNdEx = postIndex case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PrevTargetHashHexEncoded", wireType) + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProofRequirement", wireType) } - var stringLen uint64 + x.ProofRequirement = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1694,29 +1294,16 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + x.ProofRequirement |= proof.ProofRequirementReason(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.PrevTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NewTargetHashHexEncoded", wireType) + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumRelays", wireType) } - var stringLen uint64 + x.NumRelays = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1726,29 +1313,16 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + x.NumRelays |= 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.NewTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 4: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PrevNumRelaysEma", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) } - x.PrevNumRelaysEma = 0 + x.NumClaimedComputeUnits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1758,16 +1332,35 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto } b := dAtA[iNdEx] iNdEx++ - x.PrevNumRelaysEma |= uint64(b&0x7F) << shift + x.NumClaimedComputeUnits |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NewNumRelaysEma", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + x.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } - x.NewNumRelaysEma = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1777,11 +1370,28 @@ func (x *fastReflection_EventRelayMiningDifficultyUpdated) ProtoMethods() *proto } b := dAtA[iNdEx] iNdEx++ - x.NewNumRelaysEma |= uint64(b&0x7F) << shift + 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.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1843,7 +1453,7 @@ func (x *EventApplicationOverserviced) ProtoReflect() protoreflect.Message { } func (x *EventApplicationOverserviced) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_tokenomics_event_proto_msgTypes[3] + mi := &file_poktroll_tokenomics_event_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2483,7 +2093,7 @@ func (x *EventSupplierSlashed) ProtoReflect() protoreflect.Message { } func (x *EventSupplierSlashed) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_tokenomics_event_proto_msgTypes[4] + mi := &file_poktroll_tokenomics_event_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3083,7 +2693,13 @@ type EventClaimExpired struct { NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` // Number of compute units claimed as a function of the number of relays // and the compute units per relay for the particular service. - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units,omitempty"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` + // Number of estimated compute units claimed as a function of the number of claimed + // compute units and the relay difficulty multiplier for the particular service. + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` + // The uPOKT coin claimed to be rewarded for the work done as a function of + // the number of estimated compute units and the compute uints to token multiplier. + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventClaimExpired) Reset() { @@ -3127,13 +2743,27 @@ func (x *EventClaimExpired) GetNumRelays() uint64 { return 0 } -func (x *EventClaimExpired) GetNumComputeUnits() uint64 { +func (x *EventClaimExpired) GetNumClaimedComputeUnits() uint64 { + if x != nil { + return x.NumClaimedComputeUnits + } + return 0 +} + +func (x *EventClaimExpired) GetNumEstimatedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumEstimatedComputeUnits } return 0 } +func (x *EventClaimExpired) GetClaimedUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedUpokt + } + return nil +} + // EventClaimSettled is an event emitted whenever a claim is settled. // The proof_required determines whether the claim requires a proof that has been submitted or not type EventClaimSettled struct { @@ -3148,7 +2778,13 @@ type EventClaimSettled struct { NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` // Number of compute units claimed as a function of the number of relays // and the compute units per relay for the particular service. - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units,omitempty"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` + // Number of estimated compute units claimed as a function of the number of claimed + // compute units and the relay difficulty multiplier for the particular service. + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` + // The uPOKT coin claimed to be rewarded for the work done as a function of + // the number of estimated compute units and the compute uints to token multiplier. + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventClaimSettled) Reset() { @@ -3192,80 +2828,25 @@ func (x *EventClaimSettled) GetNumRelays() uint64 { return 0 } -func (x *EventClaimSettled) GetNumComputeUnits() uint64 { +func (x *EventClaimSettled) GetNumClaimedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumClaimedComputeUnits } return 0 } -// EventRelayMiningDifficultyUpdated is an event emitted whenever the relay mining difficulty is updated -// for a given service. -type EventRelayMiningDifficultyUpdated struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - PrevTargetHashHexEncoded string `protobuf:"bytes,2,opt,name=prev_target_hash_hex_encoded,json=prevTargetHashHexEncoded,proto3" json:"prev_target_hash_hex_encoded,omitempty"` - NewTargetHashHexEncoded string `protobuf:"bytes,3,opt,name=new_target_hash_hex_encoded,json=newTargetHashHexEncoded,proto3" json:"new_target_hash_hex_encoded,omitempty"` - PrevNumRelaysEma uint64 `protobuf:"varint,4,opt,name=prev_num_relays_ema,json=prevNumRelaysEma,proto3" json:"prev_num_relays_ema,omitempty"` - NewNumRelaysEma uint64 `protobuf:"varint,5,opt,name=new_num_relays_ema,json=newNumRelaysEma,proto3" json:"new_num_relays_ema,omitempty"` -} - -func (x *EventRelayMiningDifficultyUpdated) Reset() { - *x = EventRelayMiningDifficultyUpdated{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_tokenomics_event_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EventRelayMiningDifficultyUpdated) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EventRelayMiningDifficultyUpdated) ProtoMessage() {} - -// Deprecated: Use EventRelayMiningDifficultyUpdated.ProtoReflect.Descriptor instead. -func (*EventRelayMiningDifficultyUpdated) Descriptor() ([]byte, []int) { - return file_poktroll_tokenomics_event_proto_rawDescGZIP(), []int{2} -} - -func (x *EventRelayMiningDifficultyUpdated) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *EventRelayMiningDifficultyUpdated) GetPrevTargetHashHexEncoded() string { - if x != nil { - return x.PrevTargetHashHexEncoded - } - return "" -} - -func (x *EventRelayMiningDifficultyUpdated) GetNewTargetHashHexEncoded() string { - if x != nil { - return x.NewTargetHashHexEncoded - } - return "" -} - -func (x *EventRelayMiningDifficultyUpdated) GetPrevNumRelaysEma() uint64 { +func (x *EventClaimSettled) GetNumEstimatedComputeUnits() uint64 { if x != nil { - return x.PrevNumRelaysEma + return x.NumEstimatedComputeUnits } return 0 } -func (x *EventRelayMiningDifficultyUpdated) GetNewNumRelaysEma() uint64 { +func (x *EventClaimSettled) GetClaimedUpokt() *v1beta1.Coin { if x != nil { - return x.NewNumRelaysEma + return x.ClaimedUpokt } - return 0 + return nil } // EventApplicationOverserviced is emitted when an application has less stake than @@ -3292,7 +2873,7 @@ type EventApplicationOverserviced struct { func (x *EventApplicationOverserviced) Reset() { *x = EventApplicationOverserviced{} if protoimpl.UnsafeEnabled { - mi := &file_poktroll_tokenomics_event_proto_msgTypes[3] + mi := &file_poktroll_tokenomics_event_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3306,7 +2887,7 @@ func (*EventApplicationOverserviced) ProtoMessage() {} // Deprecated: Use EventApplicationOverserviced.ProtoReflect.Descriptor instead. func (*EventApplicationOverserviced) Descriptor() ([]byte, []int) { - return file_poktroll_tokenomics_event_proto_rawDescGZIP(), []int{3} + return file_poktroll_tokenomics_event_proto_rawDescGZIP(), []int{2} } func (x *EventApplicationOverserviced) GetApplicationAddr() string { @@ -3355,7 +2936,7 @@ type EventSupplierSlashed struct { func (x *EventSupplierSlashed) Reset() { *x = EventSupplierSlashed{} if protoimpl.UnsafeEnabled { - mi := &file_poktroll_tokenomics_event_proto_msgTypes[4] + mi := &file_poktroll_tokenomics_event_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3369,7 +2950,7 @@ func (*EventSupplierSlashed) ProtoMessage() {} // Deprecated: Use EventSupplierSlashed.ProtoReflect.Descriptor instead. func (*EventSupplierSlashed) Descriptor() ([]byte, []int) { - return file_poktroll_tokenomics_event_proto_rawDescGZIP(), []int{4} + return file_poktroll_tokenomics_event_proto_rawDescGZIP(), []int{3} } func (x *EventSupplierSlashed) GetSupplierOperatorAddr() string { @@ -3404,7 +2985,7 @@ var file_poktroll_tokenomics_event_proto_rawDesc = []byte{ 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, 0x1a, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x65, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, @@ -3419,95 +3000,102 @@ var file_poktroll_tokenomics_event_proto_rawDesc = []byte{ 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, - 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, - 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x0f, 0x6e, 0x75, 0x6d, 0x43, 0x6f, 0x6d, 0x70, - 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x22, 0xa9, 0x02, 0x0a, 0x11, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x12, 0x36, - 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, - 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, - 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x6a, 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x10, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, - 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, - 0x73, 0x12, 0x41, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, - 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x15, 0xea, 0xde, - 0x1f, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, - 0x69, 0x74, 0x73, 0x52, 0x0f, 0x6e, 0x75, 0x6d, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, - 0x6e, 0x69, 0x74, 0x73, 0x22, 0x9c, 0x02, 0x0a, 0x21, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, - 0x6c, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x1c, 0x70, 0x72, 0x65, - 0x76, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x68, 0x65, - 0x78, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x18, 0x70, 0x72, 0x65, 0x76, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x61, 0x73, 0x68, 0x48, - 0x65, 0x78, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x1b, 0x6e, 0x65, 0x77, - 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x68, 0x65, 0x78, - 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, - 0x6e, 0x65, 0x77, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x61, 0x73, 0x68, 0x48, 0x65, 0x78, - 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x2d, 0x0a, 0x13, 0x70, 0x72, 0x65, 0x76, 0x5f, - 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x5f, 0x65, 0x6d, 0x61, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x70, 0x72, 0x65, 0x76, 0x4e, 0x75, 0x6d, 0x52, 0x65, 0x6c, - 0x61, 0x79, 0x73, 0x45, 0x6d, 0x61, 0x12, 0x2b, 0x0a, 0x12, 0x6e, 0x65, 0x77, 0x5f, 0x6e, 0x75, - 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x5f, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0f, 0x6e, 0x65, 0x77, 0x4e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, - 0x45, 0x6d, 0x61, 0x22, 0x81, 0x02, 0x0a, 0x1c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x12, - 0x34, 0x0a, 0x16, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x14, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x3e, 0x0a, 0x0d, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, - 0x64, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, + 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, + 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, + 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, + 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, + 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, + 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, + 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, + 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, + 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, + 0x6b, 0x74, 0x22, 0xf3, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, + 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x12, 0x6a, 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x0a, + 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, + 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, + 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, + 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, + 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, + 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, + 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, + 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, - 0x64, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x40, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x42, 0x75, 0x72, 0x6e, 0x22, 0xbe, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, - 0x12, 0x34, 0x0a, 0x16, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78, - 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x43, 0x6c, - 0x61, 0x69, 0x6d, 0x73, 0x12, 0x42, 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, - 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, - 0x6e, 0x67, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x60, 0x0a, 0x15, 0x43, 0x6c, 0x61, 0x69, - 0x6d, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x58, 0x50, 0x49, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x52, 0x4f, 0x4f, 0x46, 0x5f, 0x4d, 0x49, - 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x52, 0x4f, 0x4f, 0x46, - 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x42, 0xbc, 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, 0x0a, 0x45, 0x76, 0x65, 0x6e, - 0x74, 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, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0x81, 0x02, 0x0a, 0x1c, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, + 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x64, 0x64, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x3e, 0x0a, 0x0d, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0c, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x40, 0x0a, 0x0e, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0d, 0x65, + 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x75, 0x72, 0x6e, 0x22, 0xbe, 0x01, 0x0a, + 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x6e, + 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x45, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x42, 0x0a, 0x0f, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x60, 0x0a, + 0x15, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x58, 0x50, 0x49, 0x52, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x52, 0x4f, + 0x4f, 0x46, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, + 0x50, 0x52, 0x4f, 0x4f, 0x46, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x42, + 0xbc, 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, + 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 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 ( @@ -3523,31 +3111,32 @@ func file_poktroll_tokenomics_event_proto_rawDescGZIP() []byte { } var file_poktroll_tokenomics_event_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_poktroll_tokenomics_event_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_poktroll_tokenomics_event_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_poktroll_tokenomics_event_proto_goTypes = []interface{}{ - (ClaimExpirationReason)(0), // 0: poktroll.tokenomics.ClaimExpirationReason - (*EventClaimExpired)(nil), // 1: poktroll.tokenomics.EventClaimExpired - (*EventClaimSettled)(nil), // 2: poktroll.tokenomics.EventClaimSettled - (*EventRelayMiningDifficultyUpdated)(nil), // 3: poktroll.tokenomics.EventRelayMiningDifficultyUpdated - (*EventApplicationOverserviced)(nil), // 4: poktroll.tokenomics.EventApplicationOverserviced - (*EventSupplierSlashed)(nil), // 5: poktroll.tokenomics.EventSupplierSlashed - (*proof.Claim)(nil), // 6: poktroll.proof.Claim - (proof.ProofRequirementReason)(0), // 7: poktroll.proof.ProofRequirementReason - (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin + (ClaimExpirationReason)(0), // 0: poktroll.tokenomics.ClaimExpirationReason + (*EventClaimExpired)(nil), // 1: poktroll.tokenomics.EventClaimExpired + (*EventClaimSettled)(nil), // 2: poktroll.tokenomics.EventClaimSettled + (*EventApplicationOverserviced)(nil), // 3: poktroll.tokenomics.EventApplicationOverserviced + (*EventSupplierSlashed)(nil), // 4: poktroll.tokenomics.EventSupplierSlashed + (*proof.Claim)(nil), // 5: poktroll.proof.Claim + (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin + (proof.ProofRequirementReason)(0), // 7: poktroll.proof.ProofRequirementReason } var file_poktroll_tokenomics_event_proto_depIdxs = []int32{ - 6, // 0: poktroll.tokenomics.EventClaimExpired.claim:type_name -> poktroll.proof.Claim + 5, // 0: poktroll.tokenomics.EventClaimExpired.claim:type_name -> poktroll.proof.Claim 0, // 1: poktroll.tokenomics.EventClaimExpired.expiration_reason:type_name -> poktroll.tokenomics.ClaimExpirationReason - 6, // 2: poktroll.tokenomics.EventClaimSettled.claim:type_name -> poktroll.proof.Claim - 7, // 3: poktroll.tokenomics.EventClaimSettled.proof_requirement:type_name -> poktroll.proof.ProofRequirementReason - 8, // 4: poktroll.tokenomics.EventApplicationOverserviced.expected_burn:type_name -> cosmos.base.v1beta1.Coin - 8, // 5: poktroll.tokenomics.EventApplicationOverserviced.effective_burn:type_name -> cosmos.base.v1beta1.Coin - 8, // 6: poktroll.tokenomics.EventSupplierSlashed.slashing_amount:type_name -> cosmos.base.v1beta1.Coin - 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 + 6, // 2: poktroll.tokenomics.EventClaimExpired.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin + 5, // 3: poktroll.tokenomics.EventClaimSettled.claim:type_name -> poktroll.proof.Claim + 7, // 4: poktroll.tokenomics.EventClaimSettled.proof_requirement:type_name -> poktroll.proof.ProofRequirementReason + 6, // 5: poktroll.tokenomics.EventClaimSettled.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin + 6, // 6: poktroll.tokenomics.EventApplicationOverserviced.expected_burn:type_name -> cosmos.base.v1beta1.Coin + 6, // 7: poktroll.tokenomics.EventApplicationOverserviced.effective_burn:type_name -> cosmos.base.v1beta1.Coin + 6, // 8: poktroll.tokenomics.EventSupplierSlashed.slashing_amount:type_name -> cosmos.base.v1beta1.Coin + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_poktroll_tokenomics_event_proto_init() } @@ -3581,18 +3170,6 @@ func file_poktroll_tokenomics_event_proto_init() { } } file_poktroll_tokenomics_event_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EventRelayMiningDifficultyUpdated); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_poktroll_tokenomics_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EventApplicationOverserviced); i { case 0: return &v.state @@ -3604,7 +3181,7 @@ func file_poktroll_tokenomics_event_proto_init() { return nil } } - file_poktroll_tokenomics_event_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_poktroll_tokenomics_event_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EventSupplierSlashed); i { case 0: return &v.state @@ -3623,7 +3200,7 @@ func file_poktroll_tokenomics_event_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_tokenomics_event_proto_rawDesc, NumEnums: 1, - NumMessages: 5, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/api/poktroll/tokenomics/genesis.pulsar.go b/api/poktroll/tokenomics/genesis.pulsar.go index 4548720da..812075f01 100644 --- a/api/poktroll/tokenomics/genesis.pulsar.go +++ b/api/poktroll/tokenomics/genesis.pulsar.go @@ -14,68 +14,15 @@ import ( sync "sync" ) -var _ protoreflect.List = (*_GenesisState_2_list)(nil) - -type _GenesisState_2_list struct { - list *[]*RelayMiningDifficulty -} - -func (x *_GenesisState_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*RelayMiningDifficulty) - (*x.list)[i] = concreteValue -} - -func (x *_GenesisState_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*RelayMiningDifficulty) - *x.list = append(*x.list, concreteValue) -} - -func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { - v := new(RelayMiningDifficulty) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_GenesisState_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_GenesisState_2_list) NewElement() protoreflect.Value { - v := new(RelayMiningDifficulty) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_GenesisState_2_list) IsValid() bool { - return x.list != nil -} - var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_params protoreflect.FieldDescriptor - fd_GenesisState_relayMiningDifficultyList protoreflect.FieldDescriptor + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor ) func init() { file_poktroll_tokenomics_genesis_proto_init() md_GenesisState = File_poktroll_tokenomics_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") - fd_GenesisState_relayMiningDifficultyList = md_GenesisState.Fields().ByName("relayMiningDifficultyList") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -149,12 +96,6 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } - if len(x.RelayMiningDifficultyList) != 0 { - value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.RelayMiningDifficultyList}) - if !f(fd_GenesisState_relayMiningDifficultyList, value) { - return - } - } } // Has reports whether a field is populated. @@ -172,8 +113,6 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool switch fd.FullName() { case "poktroll.tokenomics.GenesisState.params": return x.Params != nil - case "poktroll.tokenomics.GenesisState.relayMiningDifficultyList": - return len(x.RelayMiningDifficultyList) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.GenesisState")) @@ -192,8 +131,6 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "poktroll.tokenomics.GenesisState.params": x.Params = nil - case "poktroll.tokenomics.GenesisState.relayMiningDifficultyList": - x.RelayMiningDifficultyList = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.GenesisState")) @@ -213,12 +150,6 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto case "poktroll.tokenomics.GenesisState.params": value := x.Params return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.tokenomics.GenesisState.relayMiningDifficultyList": - if len(x.RelayMiningDifficultyList) == 0 { - return protoreflect.ValueOfList(&_GenesisState_2_list{}) - } - listValue := &_GenesisState_2_list{list: &x.RelayMiningDifficultyList} - return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.GenesisState")) @@ -241,10 +172,6 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value switch fd.FullName() { case "poktroll.tokenomics.GenesisState.params": x.Params = value.Message().Interface().(*Params) - case "poktroll.tokenomics.GenesisState.relayMiningDifficultyList": - lv := value.List() - clv := lv.(*_GenesisState_2_list) - x.RelayMiningDifficultyList = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.GenesisState")) @@ -270,12 +197,6 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p x.Params = new(Params) } return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) - case "poktroll.tokenomics.GenesisState.relayMiningDifficultyList": - if x.RelayMiningDifficultyList == nil { - x.RelayMiningDifficultyList = []*RelayMiningDifficulty{} - } - value := &_GenesisState_2_list{list: &x.RelayMiningDifficultyList} - return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.GenesisState")) @@ -292,9 +213,6 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "poktroll.tokenomics.GenesisState.params": m := new(Params) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.tokenomics.GenesisState.relayMiningDifficultyList": - list := []*RelayMiningDifficulty{} - return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.GenesisState")) @@ -368,12 +286,6 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { l = options.Size(x.Params) n += 1 + l + runtime.Sov(uint64(l)) } - if len(x.RelayMiningDifficultyList) > 0 { - for _, e := range x.RelayMiningDifficultyList { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -403,22 +315,6 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.RelayMiningDifficultyList) > 0 { - for iNdEx := len(x.RelayMiningDifficultyList) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.RelayMiningDifficultyList[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - } if x.Params != nil { encoded, err := options.Marshal(x.Params) if err != nil { @@ -518,40 +414,6 @@ func (x *fastReflection_GenesisState) 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 RelayMiningDifficultyList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.RelayMiningDifficultyList = append(x.RelayMiningDifficultyList, &RelayMiningDifficulty{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RelayMiningDifficultyList[len(x.RelayMiningDifficultyList)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -607,8 +469,7 @@ type GenesisState struct { unknownFields protoimpl.UnknownFields // params defines all the parameters of the module. - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - RelayMiningDifficultyList []*RelayMiningDifficulty `protobuf:"bytes,2,rep,name=relayMiningDifficultyList,proto3" json:"relayMiningDifficultyList,omitempty"` + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` } func (x *GenesisState) Reset() { @@ -638,13 +499,6 @@ func (x *GenesisState) GetParams() *Params { return nil } -func (x *GenesisState) GetRelayMiningDifficultyList() []*RelayMiningDifficulty { - if x != nil { - return x.RelayMiningDifficultyList - } - return nil -} - var File_poktroll_tokenomics_genesis_proto protoreflect.FileDescriptor var file_poktroll_tokenomics_genesis_proto_rawDesc = []byte{ @@ -656,34 +510,24 @@ var file_poktroll_tokenomics_genesis_proto_rawDesc = []byte{ 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x31, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, - 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbe, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3e, 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, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x6e, 0x0a, 0x19, 0x72, 0x65, 0x6c, 0x61, 0x79, - 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, - 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, - 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, - 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x19, 0x72, 0x65, - 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, - 0x6c, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x42, 0xbe, 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, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 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, + 0x6f, 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x3e, 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, + 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x42, 0xbe, 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, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 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 ( @@ -700,18 +544,16 @@ func file_poktroll_tokenomics_genesis_proto_rawDescGZIP() []byte { var file_poktroll_tokenomics_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_poktroll_tokenomics_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: poktroll.tokenomics.GenesisState - (*Params)(nil), // 1: poktroll.tokenomics.Params - (*RelayMiningDifficulty)(nil), // 2: poktroll.tokenomics.RelayMiningDifficulty + (*GenesisState)(nil), // 0: poktroll.tokenomics.GenesisState + (*Params)(nil), // 1: poktroll.tokenomics.Params } var file_poktroll_tokenomics_genesis_proto_depIdxs = []int32{ 1, // 0: poktroll.tokenomics.GenesisState.params:type_name -> poktroll.tokenomics.Params - 2, // 1: poktroll.tokenomics.GenesisState.relayMiningDifficultyList:type_name -> poktroll.tokenomics.RelayMiningDifficulty - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_poktroll_tokenomics_genesis_proto_init() } @@ -720,7 +562,6 @@ func file_poktroll_tokenomics_genesis_proto_init() { return } file_poktroll_tokenomics_params_proto_init() - file_poktroll_tokenomics_relay_mining_difficulty_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_tokenomics_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenesisState); i { diff --git a/api/poktroll/tokenomics/query.pulsar.go b/api/poktroll/tokenomics/query.pulsar.go index b3e903f40..505ea2dac 100644 --- a/api/poktroll/tokenomics/query.pulsar.go +++ b/api/poktroll/tokenomics/query.pulsar.go @@ -3,8 +3,6 @@ package tokenomics import ( _ "cosmossdk.io/api/amino" - v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" - _ "cosmossdk.io/api/cosmos/base/v1beta1" fmt "fmt" _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" @@ -809,1869 +807,6 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } } -var ( - md_QueryGetRelayMiningDifficultyRequest protoreflect.MessageDescriptor - fd_QueryGetRelayMiningDifficultyRequest_serviceId protoreflect.FieldDescriptor -) - -func init() { - file_poktroll_tokenomics_query_proto_init() - md_QueryGetRelayMiningDifficultyRequest = File_poktroll_tokenomics_query_proto.Messages().ByName("QueryGetRelayMiningDifficultyRequest") - fd_QueryGetRelayMiningDifficultyRequest_serviceId = md_QueryGetRelayMiningDifficultyRequest.Fields().ByName("serviceId") -} - -var _ protoreflect.Message = (*fastReflection_QueryGetRelayMiningDifficultyRequest)(nil) - -type fastReflection_QueryGetRelayMiningDifficultyRequest QueryGetRelayMiningDifficultyRequest - -func (x *QueryGetRelayMiningDifficultyRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryGetRelayMiningDifficultyRequest)(x) -} - -func (x *QueryGetRelayMiningDifficultyRequest) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_tokenomics_query_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryGetRelayMiningDifficultyRequest_messageType fastReflection_QueryGetRelayMiningDifficultyRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryGetRelayMiningDifficultyRequest_messageType{} - -type fastReflection_QueryGetRelayMiningDifficultyRequest_messageType struct{} - -func (x fastReflection_QueryGetRelayMiningDifficultyRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryGetRelayMiningDifficultyRequest)(nil) -} -func (x fastReflection_QueryGetRelayMiningDifficultyRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryGetRelayMiningDifficultyRequest) -} -func (x fastReflection_QueryGetRelayMiningDifficultyRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryGetRelayMiningDifficultyRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryGetRelayMiningDifficultyRequest -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryGetRelayMiningDifficultyRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) New() protoreflect.Message { - return new(fastReflection_QueryGetRelayMiningDifficultyRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Interface() protoreflect.ProtoMessage { - return (*QueryGetRelayMiningDifficultyRequest)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.ServiceId != "" { - value := protoreflect.ValueOfString(x.ServiceId) - if !f(fd_QueryGetRelayMiningDifficultyRequest_serviceId, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest.serviceId": - return x.ServiceId != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest.serviceId": - x.ServiceId = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest.serviceId": - value := x.ServiceId - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest.serviceId": - x.ServiceId = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest.serviceId": - panic(fmt.Errorf("field serviceId of message poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest.serviceId": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryGetRelayMiningDifficultyRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryGetRelayMiningDifficultyRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.ServiceId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryGetRelayMiningDifficultyRequest) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.ServiceId) > 0 { - i -= len(x.ServiceId) - copy(dAtA[i:], x.ServiceId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ServiceId))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryGetRelayMiningDifficultyRequest) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ServiceId", 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.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_QueryGetRelayMiningDifficultyResponse protoreflect.MessageDescriptor - fd_QueryGetRelayMiningDifficultyResponse_relayMiningDifficulty protoreflect.FieldDescriptor -) - -func init() { - file_poktroll_tokenomics_query_proto_init() - md_QueryGetRelayMiningDifficultyResponse = File_poktroll_tokenomics_query_proto.Messages().ByName("QueryGetRelayMiningDifficultyResponse") - fd_QueryGetRelayMiningDifficultyResponse_relayMiningDifficulty = md_QueryGetRelayMiningDifficultyResponse.Fields().ByName("relayMiningDifficulty") -} - -var _ protoreflect.Message = (*fastReflection_QueryGetRelayMiningDifficultyResponse)(nil) - -type fastReflection_QueryGetRelayMiningDifficultyResponse QueryGetRelayMiningDifficultyResponse - -func (x *QueryGetRelayMiningDifficultyResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryGetRelayMiningDifficultyResponse)(x) -} - -func (x *QueryGetRelayMiningDifficultyResponse) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_tokenomics_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryGetRelayMiningDifficultyResponse_messageType fastReflection_QueryGetRelayMiningDifficultyResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryGetRelayMiningDifficultyResponse_messageType{} - -type fastReflection_QueryGetRelayMiningDifficultyResponse_messageType struct{} - -func (x fastReflection_QueryGetRelayMiningDifficultyResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryGetRelayMiningDifficultyResponse)(nil) -} -func (x fastReflection_QueryGetRelayMiningDifficultyResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryGetRelayMiningDifficultyResponse) -} -func (x fastReflection_QueryGetRelayMiningDifficultyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryGetRelayMiningDifficultyResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryGetRelayMiningDifficultyResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryGetRelayMiningDifficultyResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) New() protoreflect.Message { - return new(fastReflection_QueryGetRelayMiningDifficultyResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Interface() protoreflect.ProtoMessage { - return (*QueryGetRelayMiningDifficultyResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.RelayMiningDifficulty != nil { - value := protoreflect.ValueOfMessage(x.RelayMiningDifficulty.ProtoReflect()) - if !f(fd_QueryGetRelayMiningDifficultyResponse_relayMiningDifficulty, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": - return x.RelayMiningDifficulty != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": - x.RelayMiningDifficulty = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": - value := x.RelayMiningDifficulty - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": - x.RelayMiningDifficulty = value.Message().Interface().(*RelayMiningDifficulty) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": - if x.RelayMiningDifficulty == nil { - x.RelayMiningDifficulty = new(RelayMiningDifficulty) - } - return protoreflect.ValueOfMessage(x.RelayMiningDifficulty.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty": - m := new(RelayMiningDifficulty) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryGetRelayMiningDifficultyResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryGetRelayMiningDifficultyResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.RelayMiningDifficulty != nil { - l = options.Size(x.RelayMiningDifficulty) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryGetRelayMiningDifficultyResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.RelayMiningDifficulty != nil { - encoded, err := options.Marshal(x.RelayMiningDifficulty) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryGetRelayMiningDifficultyResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", 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.RelayMiningDifficulty == nil { - x.RelayMiningDifficulty = &RelayMiningDifficulty{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RelayMiningDifficulty); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_QueryAllRelayMiningDifficultyRequest protoreflect.MessageDescriptor - fd_QueryAllRelayMiningDifficultyRequest_pagination protoreflect.FieldDescriptor -) - -func init() { - file_poktroll_tokenomics_query_proto_init() - md_QueryAllRelayMiningDifficultyRequest = File_poktroll_tokenomics_query_proto.Messages().ByName("QueryAllRelayMiningDifficultyRequest") - fd_QueryAllRelayMiningDifficultyRequest_pagination = md_QueryAllRelayMiningDifficultyRequest.Fields().ByName("pagination") -} - -var _ protoreflect.Message = (*fastReflection_QueryAllRelayMiningDifficultyRequest)(nil) - -type fastReflection_QueryAllRelayMiningDifficultyRequest QueryAllRelayMiningDifficultyRequest - -func (x *QueryAllRelayMiningDifficultyRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAllRelayMiningDifficultyRequest)(x) -} - -func (x *QueryAllRelayMiningDifficultyRequest) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_tokenomics_query_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryAllRelayMiningDifficultyRequest_messageType fastReflection_QueryAllRelayMiningDifficultyRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryAllRelayMiningDifficultyRequest_messageType{} - -type fastReflection_QueryAllRelayMiningDifficultyRequest_messageType struct{} - -func (x fastReflection_QueryAllRelayMiningDifficultyRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAllRelayMiningDifficultyRequest)(nil) -} -func (x fastReflection_QueryAllRelayMiningDifficultyRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAllRelayMiningDifficultyRequest) -} -func (x fastReflection_QueryAllRelayMiningDifficultyRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllRelayMiningDifficultyRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllRelayMiningDifficultyRequest -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryAllRelayMiningDifficultyRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) New() protoreflect.Message { - return new(fastReflection_QueryAllRelayMiningDifficultyRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Interface() protoreflect.ProtoMessage { - return (*QueryAllRelayMiningDifficultyRequest)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Pagination != nil { - value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryAllRelayMiningDifficultyRequest_pagination, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest.pagination": - return x.Pagination != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest.pagination": - x.Pagination = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest.pagination": - value := x.Pagination - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest.pagination": - x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest.pagination": - if x.Pagination == nil { - x.Pagination = new(v1beta1.PageRequest) - } - return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest.pagination": - m := new(v1beta1.PageRequest) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAllRelayMiningDifficultyRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAllRelayMiningDifficultyRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Pagination != nil { - l = options.Size(x.Pagination) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAllRelayMiningDifficultyRequest) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Pagination != nil { - encoded, err := options.Marshal(x.Pagination) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAllRelayMiningDifficultyRequest) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { - x.Pagination = &v1beta1.PageRequest{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_QueryAllRelayMiningDifficultyResponse_1_list)(nil) - -type _QueryAllRelayMiningDifficultyResponse_1_list struct { - list *[]*RelayMiningDifficulty -} - -func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*RelayMiningDifficulty) - (*x.list)[i] = concreteValue -} - -func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*RelayMiningDifficulty) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryAllRelayMiningDifficultyResponse_1_list) AppendMutable() protoreflect.Value { - v := new(RelayMiningDifficulty) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryAllRelayMiningDifficultyResponse_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryAllRelayMiningDifficultyResponse_1_list) NewElement() protoreflect.Value { - v := new(RelayMiningDifficulty) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryAllRelayMiningDifficultyResponse_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_QueryAllRelayMiningDifficultyResponse protoreflect.MessageDescriptor - fd_QueryAllRelayMiningDifficultyResponse_relayMiningDifficulty protoreflect.FieldDescriptor - fd_QueryAllRelayMiningDifficultyResponse_pagination protoreflect.FieldDescriptor -) - -func init() { - file_poktroll_tokenomics_query_proto_init() - md_QueryAllRelayMiningDifficultyResponse = File_poktroll_tokenomics_query_proto.Messages().ByName("QueryAllRelayMiningDifficultyResponse") - fd_QueryAllRelayMiningDifficultyResponse_relayMiningDifficulty = md_QueryAllRelayMiningDifficultyResponse.Fields().ByName("relayMiningDifficulty") - fd_QueryAllRelayMiningDifficultyResponse_pagination = md_QueryAllRelayMiningDifficultyResponse.Fields().ByName("pagination") -} - -var _ protoreflect.Message = (*fastReflection_QueryAllRelayMiningDifficultyResponse)(nil) - -type fastReflection_QueryAllRelayMiningDifficultyResponse QueryAllRelayMiningDifficultyResponse - -func (x *QueryAllRelayMiningDifficultyResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryAllRelayMiningDifficultyResponse)(x) -} - -func (x *QueryAllRelayMiningDifficultyResponse) slowProtoReflect() protoreflect.Message { - mi := &file_poktroll_tokenomics_query_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryAllRelayMiningDifficultyResponse_messageType fastReflection_QueryAllRelayMiningDifficultyResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryAllRelayMiningDifficultyResponse_messageType{} - -type fastReflection_QueryAllRelayMiningDifficultyResponse_messageType struct{} - -func (x fastReflection_QueryAllRelayMiningDifficultyResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryAllRelayMiningDifficultyResponse)(nil) -} -func (x fastReflection_QueryAllRelayMiningDifficultyResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryAllRelayMiningDifficultyResponse) -} -func (x fastReflection_QueryAllRelayMiningDifficultyResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllRelayMiningDifficultyResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryAllRelayMiningDifficultyResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryAllRelayMiningDifficultyResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) New() protoreflect.Message { - return new(fastReflection_QueryAllRelayMiningDifficultyResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Interface() protoreflect.ProtoMessage { - return (*QueryAllRelayMiningDifficultyResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.RelayMiningDifficulty) != 0 { - value := protoreflect.ValueOfList(&_QueryAllRelayMiningDifficultyResponse_1_list{list: &x.RelayMiningDifficulty}) - if !f(fd_QueryAllRelayMiningDifficultyResponse_relayMiningDifficulty, value) { - return - } - } - if x.Pagination != nil { - value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryAllRelayMiningDifficultyResponse_pagination, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": - return len(x.RelayMiningDifficulty) != 0 - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.pagination": - return x.Pagination != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": - x.RelayMiningDifficulty = nil - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.pagination": - x.Pagination = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": - if len(x.RelayMiningDifficulty) == 0 { - return protoreflect.ValueOfList(&_QueryAllRelayMiningDifficultyResponse_1_list{}) - } - listValue := &_QueryAllRelayMiningDifficultyResponse_1_list{list: &x.RelayMiningDifficulty} - return protoreflect.ValueOfList(listValue) - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.pagination": - value := x.Pagination - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": - lv := value.List() - clv := lv.(*_QueryAllRelayMiningDifficultyResponse_1_list) - x.RelayMiningDifficulty = *clv.list - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.pagination": - x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": - if x.RelayMiningDifficulty == nil { - x.RelayMiningDifficulty = []*RelayMiningDifficulty{} - } - value := &_QueryAllRelayMiningDifficultyResponse_1_list{list: &x.RelayMiningDifficulty} - return protoreflect.ValueOfList(value) - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.pagination": - if x.Pagination == nil { - x.Pagination = new(v1beta1.PageResponse) - } - return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty": - list := []*RelayMiningDifficulty{} - return protoreflect.ValueOfList(&_QueryAllRelayMiningDifficultyResponse_1_list{list: &list}) - case "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.pagination": - m := new(v1beta1.PageResponse) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse")) - } - panic(fmt.Errorf("message poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryAllRelayMiningDifficultyResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryAllRelayMiningDifficultyResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if len(x.RelayMiningDifficulty) > 0 { - for _, e := range x.RelayMiningDifficulty { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.Pagination != nil { - l = options.Size(x.Pagination) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryAllRelayMiningDifficultyResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Pagination != nil { - encoded, err := options.Marshal(x.Pagination) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if len(x.RelayMiningDifficulty) > 0 { - for iNdEx := len(x.RelayMiningDifficulty) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.RelayMiningDifficulty[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryAllRelayMiningDifficultyResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.RelayMiningDifficulty = append(x.RelayMiningDifficulty, &RelayMiningDifficulty{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RelayMiningDifficulty[len(x.RelayMiningDifficulty)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { - x.Pagination = &v1beta1.PageResponse{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -2749,154 +884,6 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } -type QueryGetRelayMiningDifficultyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` -} - -func (x *QueryGetRelayMiningDifficultyRequest) Reset() { - *x = QueryGetRelayMiningDifficultyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_tokenomics_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryGetRelayMiningDifficultyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryGetRelayMiningDifficultyRequest) ProtoMessage() {} - -// Deprecated: Use QueryGetRelayMiningDifficultyRequest.ProtoReflect.Descriptor instead. -func (*QueryGetRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { - return file_poktroll_tokenomics_query_proto_rawDescGZIP(), []int{2} -} - -func (x *QueryGetRelayMiningDifficultyRequest) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -type QueryGetRelayMiningDifficultyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RelayMiningDifficulty *RelayMiningDifficulty `protobuf:"bytes,1,opt,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty,omitempty"` -} - -func (x *QueryGetRelayMiningDifficultyResponse) Reset() { - *x = QueryGetRelayMiningDifficultyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_tokenomics_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryGetRelayMiningDifficultyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryGetRelayMiningDifficultyResponse) ProtoMessage() {} - -// Deprecated: Use QueryGetRelayMiningDifficultyResponse.ProtoReflect.Descriptor instead. -func (*QueryGetRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { - return file_poktroll_tokenomics_query_proto_rawDescGZIP(), []int{3} -} - -func (x *QueryGetRelayMiningDifficultyResponse) GetRelayMiningDifficulty() *RelayMiningDifficulty { - if x != nil { - return x.RelayMiningDifficulty - } - return nil -} - -type QueryAllRelayMiningDifficultyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *QueryAllRelayMiningDifficultyRequest) Reset() { - *x = QueryAllRelayMiningDifficultyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_tokenomics_query_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryAllRelayMiningDifficultyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryAllRelayMiningDifficultyRequest) ProtoMessage() {} - -// Deprecated: Use QueryAllRelayMiningDifficultyRequest.ProtoReflect.Descriptor instead. -func (*QueryAllRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { - return file_poktroll_tokenomics_query_proto_rawDescGZIP(), []int{4} -} - -func (x *QueryAllRelayMiningDifficultyRequest) GetPagination() *v1beta1.PageRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type QueryAllRelayMiningDifficultyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RelayMiningDifficulty []*RelayMiningDifficulty `protobuf:"bytes,1,rep,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty,omitempty"` - Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *QueryAllRelayMiningDifficultyResponse) Reset() { - *x = QueryAllRelayMiningDifficultyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_poktroll_tokenomics_query_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryAllRelayMiningDifficultyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryAllRelayMiningDifficultyResponse) ProtoMessage() {} - -// Deprecated: Use QueryAllRelayMiningDifficultyResponse.ProtoReflect.Descriptor instead. -func (*QueryAllRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { - return file_poktroll_tokenomics_query_proto_rawDescGZIP(), []int{5} -} - -func (x *QueryAllRelayMiningDifficultyResponse) GetRelayMiningDifficulty() []*RelayMiningDifficulty { - if x != nil { - return x.RelayMiningDifficulty - } - return nil -} - -func (x *QueryAllRelayMiningDifficultyResponse) GetPagination() *v1beta1.PageResponse { - if x != nil { - return x.Pagination - } - return nil -} - var File_poktroll_tokenomics_query_proto protoreflect.FileDescriptor var file_poktroll_tokenomics_query_proto_rawDesc = []byte{ @@ -2909,108 +896,38 @@ var file_poktroll_tokenomics_query_proto_rawDesc = []byte{ 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, - 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x31, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x72, 0x65, 0x6c, 0x61, - 0x79, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, - 0x6c, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x55, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 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, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x44, 0x0a, 0x24, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, - 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x8f, 0x01, 0x0a, - 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, - 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x15, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x4d, - 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x52, 0x65, 0x6c, 0x61, - 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, - 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x15, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, - 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x6e, - 0x0a, 0x24, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, - 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd8, - 0x01, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x79, - 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x15, 0x72, 0x65, 0x6c, 0x61, - 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, - 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x52, 0x65, - 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, - 0x6c, 0x74, 0x79, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x15, 0x72, 0x65, 0x6c, 0x61, 0x79, - 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, - 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xce, 0x04, 0x0a, 0x05, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x12, 0x8d, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, - 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x70, 0x6f, 0x6b, 0x74, - 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0xdd, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, - 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x39, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, - 0x69, 0x63, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, - 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, - 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x12, 0x45, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, - 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x66, - 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x2f, 0x7b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x49, 0x64, 0x7d, 0x12, 0xd4, 0x01, 0x0a, 0x18, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, - 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x41, 0x6c, 0x6c, - 0x12, 0x39, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x52, - 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, - 0x75, 0x6c, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x70, 0x6f, + 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x55, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 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, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x32, 0x97, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x8d, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x27, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, + 0x63, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0xbc, 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, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x4d, - 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x12, - 0x39, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, - 0x63, 0x73, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, - 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x42, 0xbc, 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, 0x0a, 0x51, 0x75, 0x65, 0x72, - 0x79, 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, + 0x73, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 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 ( @@ -3025,36 +942,21 @@ func file_poktroll_tokenomics_query_proto_rawDescGZIP() []byte { return file_poktroll_tokenomics_query_proto_rawDescData } -var file_poktroll_tokenomics_query_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_poktroll_tokenomics_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_poktroll_tokenomics_query_proto_goTypes = []interface{}{ - (*QueryParamsRequest)(nil), // 0: poktroll.tokenomics.QueryParamsRequest - (*QueryParamsResponse)(nil), // 1: poktroll.tokenomics.QueryParamsResponse - (*QueryGetRelayMiningDifficultyRequest)(nil), // 2: poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest - (*QueryGetRelayMiningDifficultyResponse)(nil), // 3: poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse - (*QueryAllRelayMiningDifficultyRequest)(nil), // 4: poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest - (*QueryAllRelayMiningDifficultyResponse)(nil), // 5: poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse - (*Params)(nil), // 6: poktroll.tokenomics.Params - (*RelayMiningDifficulty)(nil), // 7: poktroll.tokenomics.RelayMiningDifficulty - (*v1beta1.PageRequest)(nil), // 8: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 9: cosmos.base.query.v1beta1.PageResponse + (*QueryParamsRequest)(nil), // 0: poktroll.tokenomics.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: poktroll.tokenomics.QueryParamsResponse + (*Params)(nil), // 2: poktroll.tokenomics.Params } var file_poktroll_tokenomics_query_proto_depIdxs = []int32{ - 6, // 0: poktroll.tokenomics.QueryParamsResponse.params:type_name -> poktroll.tokenomics.Params - 7, // 1: poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse.relayMiningDifficulty:type_name -> poktroll.tokenomics.RelayMiningDifficulty - 8, // 2: poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 7, // 3: poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.relayMiningDifficulty:type_name -> poktroll.tokenomics.RelayMiningDifficulty - 9, // 4: poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 0, // 5: poktroll.tokenomics.Query.Params:input_type -> poktroll.tokenomics.QueryParamsRequest - 2, // 6: poktroll.tokenomics.Query.RelayMiningDifficulty:input_type -> poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest - 4, // 7: poktroll.tokenomics.Query.RelayMiningDifficultyAll:input_type -> poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest - 1, // 8: poktroll.tokenomics.Query.Params:output_type -> poktroll.tokenomics.QueryParamsResponse - 3, // 9: poktroll.tokenomics.Query.RelayMiningDifficulty:output_type -> poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse - 5, // 10: poktroll.tokenomics.Query.RelayMiningDifficultyAll:output_type -> poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse - 8, // [8:11] is the sub-list for method output_type - 5, // [5:8] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 2, // 0: poktroll.tokenomics.QueryParamsResponse.params:type_name -> poktroll.tokenomics.Params + 0, // 1: poktroll.tokenomics.Query.Params:input_type -> poktroll.tokenomics.QueryParamsRequest + 1, // 2: poktroll.tokenomics.Query.Params:output_type -> poktroll.tokenomics.QueryParamsResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_poktroll_tokenomics_query_proto_init() } @@ -3063,7 +965,6 @@ func file_poktroll_tokenomics_query_proto_init() { return } file_poktroll_tokenomics_params_proto_init() - file_poktroll_tokenomics_relay_mining_difficulty_proto_init() if !protoimpl.UnsafeEnabled { file_poktroll_tokenomics_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryParamsRequest); i { @@ -3089,54 +990,6 @@ func file_poktroll_tokenomics_query_proto_init() { return nil } } - file_poktroll_tokenomics_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryGetRelayMiningDifficultyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_poktroll_tokenomics_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryGetRelayMiningDifficultyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_poktroll_tokenomics_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAllRelayMiningDifficultyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_poktroll_tokenomics_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryAllRelayMiningDifficultyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3144,7 +997,7 @@ func file_poktroll_tokenomics_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poktroll_tokenomics_query_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 2, NumExtensions: 0, NumServices: 1, }, diff --git a/api/poktroll/tokenomics/query_grpc.pb.go b/api/poktroll/tokenomics/query_grpc.pb.go index e45017866..f12dade48 100644 --- a/api/poktroll/tokenomics/query_grpc.pb.go +++ b/api/poktroll/tokenomics/query_grpc.pb.go @@ -19,9 +19,7 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - Query_Params_FullMethodName = "/poktroll.tokenomics.Query/Params" - Query_RelayMiningDifficulty_FullMethodName = "/poktroll.tokenomics.Query/RelayMiningDifficulty" - Query_RelayMiningDifficultyAll_FullMethodName = "/poktroll.tokenomics.Query/RelayMiningDifficultyAll" + Query_Params_FullMethodName = "/poktroll.tokenomics.Query/Params" ) // QueryClient is the client API for Query service. @@ -32,9 +30,6 @@ const ( type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries a list of RelayMiningDifficulty items. - RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) - RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) } type queryClient struct { @@ -55,26 +50,6 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryGetRelayMiningDifficultyResponse) - err := c.cc.Invoke(ctx, Query_RelayMiningDifficulty_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(QueryAllRelayMiningDifficultyResponse) - err := c.cc.Invoke(ctx, Query_RelayMiningDifficultyAll_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility @@ -83,9 +58,6 @@ func (c *queryClient) RelayMiningDifficultyAll(ctx context.Context, in *QueryAll type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of RelayMiningDifficulty items. - RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) - RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) mustEmbedUnimplementedQueryServer() } @@ -96,12 +68,6 @@ type UnimplementedQueryServer struct { func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (UnimplementedQueryServer) RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficulty not implemented") -} -func (UnimplementedQueryServer) RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficultyAll not implemented") -} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -133,42 +99,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_RelayMiningDifficulty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetRelayMiningDifficultyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RelayMiningDifficulty(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_RelayMiningDifficulty_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RelayMiningDifficulty(ctx, req.(*QueryGetRelayMiningDifficultyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RelayMiningDifficultyAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllRelayMiningDifficultyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RelayMiningDifficultyAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_RelayMiningDifficultyAll_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RelayMiningDifficultyAll(ctx, req.(*QueryAllRelayMiningDifficultyRequest)) - } - return interceptor(ctx, in, info, handler) -} - // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -180,14 +110,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "RelayMiningDifficulty", - Handler: _Query_RelayMiningDifficulty_Handler, - }, - { - MethodName: "RelayMiningDifficultyAll", - Handler: _Query_RelayMiningDifficultyAll_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/tokenomics/query.proto", diff --git a/docusaurus/docs/develop/developer_guide/adding_params.md b/docusaurus/docs/develop/developer_guide/adding_params.md index 37ff71d1f..0843a6d81 100644 --- a/docusaurus/docs/develop/developer_guide/adding_params.md +++ b/docusaurus/docs/develop/developer_guide/adding_params.md @@ -148,9 +148,19 @@ with the default value for the new parameter. "@type": "/poktroll.proof.MsgUpdateParams", "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", "params": { - "min_relay_difficulty_bits": "0", "proof_request_probability": "0.25", - "proof_requirement_threshold": "20", + "proof_requirement_threshold": { + "denom": "upokt", + "amount": "20000000" + }, + "proof_missing_penalty": { + "amount": "320000000", + "denom": "upokt" + }, + "proof_submission_fee": { + "amount": "1000000", + "denom": "upokt" + }, "new_parameter_name": "100" // Add this line } } diff --git a/docusaurus/docs/operate/configs/supplier_staking_config.md b/docusaurus/docs/operate/configs/supplier_staking_config.md index 534aa9324..7e2283f3e 100644 --- a/docusaurus/docs/operate/configs/supplier_staking_config.md +++ b/docusaurus/docs/operate/configs/supplier_staking_config.md @@ -232,7 +232,8 @@ _`Optional`_, _`Non-empty`_ ```yaml default_rev_share_percent: - : + : + : ``` `default_rev_share_percent` is an optional map that defines the default the revenue diff --git a/docusaurus/docs/protocol/governance/params.md b/docusaurus/docs/protocol/governance/params.md index f0f9d598c..496b4fb9c 100644 --- a/docusaurus/docs/protocol/governance/params.md +++ b/docusaurus/docs/protocol/governance/params.md @@ -9,6 +9,8 @@ sidebar_position: 1 DO NOT EDIT: this file was generated by make docs_update_gov_params_page ::: +- [Access Control](#access-control) +- [Updating governance parameter values](#updating-governance-parameter-values) - [Updating this page](#updating-this-page) - [Adding a new parameter](#adding-a-new-parameter) - [Parameters](#parameters) diff --git a/e2e/tests/0_settlement.feature b/e2e/tests/0_settlement.feature index a4f84e62c..94c4de9cc 100644 --- a/e2e/tests/0_settlement.feature +++ b/e2e/tests/0_settlement.feature @@ -20,7 +20,6 @@ Feature: Tokenomics Namespace # to make sure a proof is required. And the "proof" module parameters are set as follows | name | value | type | - | relay_difficulty_target_hash | ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff | bytes | | proof_request_probability | 0.25 | float | | proof_requirement_threshold | 839 | coin | | proof_missing_penalty | 320 | coin | @@ -55,7 +54,6 @@ Feature: Tokenomics Namespace # to make sure a proof is not required. And the "proof" module parameters are set as follows | name | value | type | - | relay_difficulty_target_hash | ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff | bytes | | proof_request_probability | 0 | float | | proof_requirement_threshold | 421 | coin | | proof_missing_penalty | 320 | coin | diff --git a/e2e/tests/parse_params_test.go b/e2e/tests/parse_params_test.go index 98ba813d6..f8a213eaa 100644 --- a/e2e/tests/parse_params_test.go +++ b/e2e/tests/parse_params_test.go @@ -3,7 +3,6 @@ package e2e import ( - "encoding/hex" "fmt" "strconv" @@ -132,8 +131,6 @@ func (s *suite) newProofMsgUpdateParams(params paramsAnyMap) cosmostypes.Msg { for paramName, paramValue := range params { switch paramName { - case prooftypes.ParamRelayDifficultyTargetHash: - msgUpdateParams.Params.RelayDifficultyTargetHash, _ = hex.DecodeString(string(paramValue.value.([]byte))) case prooftypes.ParamProofRequestProbability: msgUpdateParams.Params.ProofRequestProbability = paramValue.value.(float32) case prooftypes.ParamProofRequirementThreshold: @@ -293,22 +290,6 @@ func (s *suite) newTokenomicsMsgUpdateParam(authority string, param paramAny) (m func (s *suite) newProofMsgUpdateParam(authority string, param paramAny) (msg proto.Message) { switch param.typeStr { - case "string": - msg = proto.Message(&prooftypes.MsgUpdateParam{ - Authority: authority, - Name: param.name, - AsType: &prooftypes.MsgUpdateParam_AsString{ - AsString: param.value.(string), - }, - }) - case "int64": - msg = proto.Message(&prooftypes.MsgUpdateParam{ - Authority: authority, - Name: param.name, - AsType: &prooftypes.MsgUpdateParam_AsInt64{ - AsInt64: param.value.(int64), - }, - }) case "bytes": msg = proto.Message(&prooftypes.MsgUpdateParam{ Authority: authority, @@ -350,12 +331,12 @@ func (s *suite) newSharedMsgUpdateParam(authority string, param paramAny) (msg p AsString: param.value.(string), }, }) - case "int64": + case "uint64": msg = proto.Message(&sharedtypes.MsgUpdateParam{ Authority: authority, Name: param.name, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{ - AsInt64: param.value.(int64), + AsType: &sharedtypes.MsgUpdateParam_AsUint64{ + AsUint64: param.value.(uint64), }, }) case "bytes": diff --git a/e2e/tests/session.feature b/e2e/tests/session.feature index 715e7319a..d1c3ca1d4 100644 --- a/e2e/tests/session.feature +++ b/e2e/tests/session.feature @@ -6,7 +6,6 @@ Feature: Session Namespace # to make sure a proof is required. And the "proof" module parameters are set as follows | name | value | type | - | relay_difficulty_target_hash | ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff | bytes | | proof_request_probability | 0.25 | float | | proof_requirement_threshold | 209 | coin | | proof_missing_penalty | 320 | coin | diff --git a/e2e/tests/session_steps_test.go b/e2e/tests/session_steps_test.go index 54b732958..2404d7e06 100644 --- a/e2e/tests/session_steps_test.go +++ b/e2e/tests/session_steps_test.go @@ -191,7 +191,8 @@ func (s *suite) TheClaimCreatedBySupplierForServiceForApplicationShouldBeSuccess require.Equal(s, app.Address, claim.SessionHeader.ApplicationAddress) require.Equal(s, supplier.OperatorAddress, claim.SupplierOperatorAddress) require.Equal(s, serviceId, claim.SessionHeader.ServiceId) - require.Greater(s, claimSettledEvent.NumComputeUnits, uint64(0), "compute units should be greater than 0") + require.Greater(s, claimSettledEvent.NumClaimedComputeUnits, uint64(0), "claimed compute units should be greater than 0") + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt return true } diff --git a/e2e/tests/update_params_test.go b/e2e/tests/update_params_test.go index 63f3b4c01..8dbaee5dc 100644 --- a/e2e/tests/update_params_test.go +++ b/e2e/tests/update_params_test.go @@ -3,7 +3,6 @@ package e2e import ( - "encoding/hex" "encoding/json" "fmt" "reflect" @@ -363,11 +362,6 @@ func (s *suite) assertExpectedModuleParamsUpdated(moduleName string) { params := prooftypes.DefaultParams() paramsMap := s.expectedModuleParams[moduleName] - relayDifficultyTargetHash, ok := paramsMap[prooftypes.ParamRelayDifficultyTargetHash] - if ok { - params.RelayDifficultyTargetHash, _ = hex.DecodeString(string(relayDifficultyTargetHash.value.([]byte))) - } - proofRequestProbability, ok := paramsMap[prooftypes.ParamProofRequestProbability] if ok { params.ProofRequestProbability = proofRequestProbability.value.(float32) diff --git a/localnet/poktrolld/config/supplier1_stake_config.yaml b/localnet/poktrolld/config/supplier1_stake_config.yaml index 228e6ade2..e3d475939 100644 --- a/localnet/poktrolld/config/supplier1_stake_config.yaml +++ b/localnet/poktrolld/config/supplier1_stake_config.yaml @@ -2,8 +2,8 @@ owner_address: pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4 operator_address: pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4 stake_amount: 1000069upokt default_rev_share_percent: - - pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4: 80.5 - - pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw: 19.5 + pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4: 80.5 + pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw: 19.5 services: - service_id: anvil endpoints: @@ -11,8 +11,8 @@ services: rpc_type: JSON_RPC - service_id: ollama rev_share_percent: - - pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4: 50 - - pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw: 50 + pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4: 50 + pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw: 50 endpoints: - publicly_exposed_url: http://relayminer1:8545 rpc_type: REST diff --git a/localnet/poktrolld/config/supplier_stake_config_example.yaml b/localnet/poktrolld/config/supplier_stake_config_example.yaml index 51eb04fdc..ce14f4a08 100644 --- a/localnet/poktrolld/config/supplier_stake_config_example.yaml +++ b/localnet/poktrolld/config/supplier_stake_config_example.yaml @@ -30,8 +30,8 @@ stake_amount: 1000069upokt # or include at least one item. default_rev_share_percent: # The sum of all shares MUST equal 100%. Staking will fail otherwise. - - pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4: 80.5 - - pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw: 19.5 + pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4: 80.5 + pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw: 19.5 services: # The endpoint URL for the Anvil service is provided via the RelayMiner. # The RelayMiner acts as a proxy, forwarding requests to the actual Anvil data node behind it. @@ -45,8 +45,8 @@ services: # service, default_rev_share_percent is used. # The sum of all shares MUST equal 100%. Staking will fail otherwise. rev_share_percent: - - pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4: 50 - - pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw: 50 + pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4: 50 + pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw: 50 endpoints: - publicly_exposed_url: http://relayminer1:8545 rpc_type: REST diff --git a/makefiles/params.mk b/makefiles/params.mk index e2f736f10..3e577ab52 100644 --- a/makefiles/params.mk +++ b/makefiles/params.mk @@ -40,10 +40,6 @@ params_get_proof: ## Get the proof module params params_update_proof_all: ## Update the proof module params poktrolld tx authz exec ./tools/scripts/params/proof_all.json $(PARAM_FLAGS) -.PHONY: params_update_proof_min_relay_difficulty_bits -params_update_proof_min_relay_difficulty_bits: ## Update the proof module min_relay_difficulty_bits param - poktrolld tx authz exec ./tools/scripts/params/proof_min_relay_difficulty_bits.json $(PARAM_FLAGS) - .PHONY: params_update_proof_proof_request_probability params_update_proof_proof_request_probability: ## Update the proof module proof_request_probability param poktrolld tx authz exec ./tools/scripts/params/proof_proof_request_probability.json $(PARAM_FLAGS) diff --git a/pkg/client/interface.go b/pkg/client/interface.go index 502773709..ad963cbbe 100644 --- a/pkg/client/interface.go +++ b/pkg/client/interface.go @@ -9,7 +9,6 @@ //go:generate mockgen -destination=../../testutil/mockclient/session_query_client_mock.go -package=mockclient . SessionQueryClient //go:generate mockgen -destination=../../testutil/mockclient/shared_query_client_mock.go -package=mockclient . SharedQueryClient //go:generate mockgen -destination=../../testutil/mockclient/proof_query_client_mock.go -package=mockclient . ProofQueryClient -//go:generate mockgen -destination=../../testutil/mockclient/tokenomics_query_client_mock.go -package=mockclient . TokenomicsQueryClient //go:generate mockgen -destination=../../testutil/mockclient/service_query_client_mock.go -package=mockclient . ServiceQueryClient //go:generate mockgen -destination=../../testutil/mockclient/bank_query_client_mock.go -package=mockclient . BankQueryClient //go:generate mockgen -destination=../../testutil/mockclient/cosmos_tx_builder_mock.go -package=mockclient github.com/cosmos/cosmos-sdk/client TxBuilder @@ -32,6 +31,7 @@ import ( "github.com/pokt-network/poktroll/pkg/either" "github.com/pokt-network/poktroll/pkg/observable" apptypes "github.com/pokt-network/poktroll/x/application/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -351,24 +351,12 @@ type ProofQueryClient interface { GetParams(ctx context.Context) (ProofParams, error) } -// TokenomicsRelayMiningDifficulty is a go interface type which corresponding to the poktroll.tokenomics.RelayMiningDifficulty -// protobuf message. This is necessary to prevent dependency cycles. -type TokenomicsRelayMiningDifficulty interface { - GetTargetHash() []byte -} - -// TokenomicsQueryClient defines an interface that enables the querying of the -// on-chain tokenomics information -type TokenomicsQueryClient interface { - GetServiceRelayDifficultyTargetHash(ctx context.Context, serviceId string) (TokenomicsRelayMiningDifficulty, error) - // GetParams queries the chain for the current tokenomics module parameters. -} - // ServiceQueryClient defines an interface that enables the querying of the // on-chain service information type ServiceQueryClient interface { // GetService queries the chain for the details of the service provided GetService(ctx context.Context, serviceId string) (sharedtypes.Service, error) + GetServiceRelayDifficulty(ctx context.Context, serviceId string) (servicetypes.RelayMiningDifficulty, error) } // BankQueryClient defines an interface that enables the querying of the diff --git a/pkg/client/query/servicequerier.go b/pkg/client/query/servicequerier.go index 9b5cdfc76..6b0dba20b 100644 --- a/pkg/client/query/servicequerier.go +++ b/pkg/client/query/servicequerier.go @@ -5,8 +5,11 @@ import ( "cosmossdk.io/depinject" "github.com/cosmos/gogoproto/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/pokt-network/poktroll/pkg/client" + "github.com/pokt-network/poktroll/pkg/crypto/protocol" servicetypes "github.com/pokt-network/poktroll/x/service/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -60,3 +63,31 @@ func (servq *serviceQuerier) GetService( } return res.Service, nil } + +// GetServiceRelayDifficulty queries the onchain data for +// the relay mining difficulty associated with the given service. +func (servq *serviceQuerier) GetServiceRelayDifficulty( + ctx context.Context, + serviceId string, +) (servicetypes.RelayMiningDifficulty, error) { + req := &servicetypes.QueryGetRelayMiningDifficultyRequest{ + ServiceId: serviceId, + } + + res, err := servq.serviceQuerier.RelayMiningDifficulty(ctx, req) + if status.Code(err) == codes.NotFound { + newServiceDifficulty := servicetypes.RelayMiningDifficulty{ + ServiceId: serviceId, + BlockHeight: 0, + NumRelaysEma: 0, + TargetHash: protocol.BaseRelayDifficultyHashBz, + } + + return newServiceDifficulty, nil + } + if err != nil { + return servicetypes.RelayMiningDifficulty{}, err + } + + return res.RelayMiningDifficulty, nil +} diff --git a/pkg/client/query/tokenomicsquerier.go b/pkg/client/query/tokenomicsquerier.go deleted file mode 100644 index 52b4da453..000000000 --- a/pkg/client/query/tokenomicsquerier.go +++ /dev/null @@ -1,55 +0,0 @@ -package query - -import ( - "context" - - "cosmossdk.io/depinject" - "github.com/cosmos/gogoproto/grpc" - - "github.com/pokt-network/poktroll/pkg/client" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" -) - -// tokenomicsQuerier is a wrapper around the tokenomicstypes.QueryClient that enables the -// querying of on-chain tokenomics module data. -type tokenomicsQuerier struct { - clientConn grpc.ClientConn - tokenomicsQuerier tokenomicstypes.QueryClient -} - -// NewTokenomicsQuerier returns a new instance of a client.TokenomicsQueryClient by -// injecting the dependecies provided by the depinject.Config. -// -// Required dependencies: -// - grpc.ClientConn -func NewTokenomicsQuerier(deps depinject.Config) (client.TokenomicsQueryClient, error) { - querier := &tokenomicsQuerier{} - - if err := depinject.Inject( - deps, - &querier.clientConn, - ); err != nil { - return nil, err - } - - querier.tokenomicsQuerier = tokenomicstypes.NewQueryClient(querier.clientConn) - - return querier, nil -} - -// GetServiceRelayDifficultyTargetHash queries the onchain data for -// the relay mining difficulty associated with the given service. -func (tq *tokenomicsQuerier) GetServiceRelayDifficultyTargetHash( - ctx context.Context, - serviceId string, -) (client.TokenomicsRelayMiningDifficulty, error) { - req := &tokenomicstypes.QueryGetRelayMiningDifficultyRequest{ - ServiceId: serviceId, - } - - res, err := tq.tokenomicsQuerier.RelayMiningDifficulty(ctx, req) - if err != nil { - return nil, err - } - return &res.RelayMiningDifficulty, nil -} diff --git a/pkg/deps/config/suppliers.go b/pkg/deps/config/suppliers.go index aceb81410..c7548f1cb 100644 --- a/pkg/deps/config/suppliers.go +++ b/pkg/deps/config/suppliers.go @@ -466,24 +466,6 @@ func NewSupplyProofQueryClientFn() SupplierFn { } } -// NewSupplyTokenomicsQueryClientFn returns a function which constructs a -// TokenomicsQueryClient instance and returns a new depinject.Config which -// is supplied with the given deps and the new TokenomicsQueryClient. -func NewSupplyTokenomicsQueryClientFn() SupplierFn { - return func( - _ context.Context, - deps depinject.Config, - _ *cobra.Command, - ) (depinject.Config, error) { - tokenomicsQuerier, err := query.NewTokenomicsQuerier(deps) - if err != nil { - return nil, err - } - - return depinject.Configs(deps, depinject.Supply(tokenomicsQuerier)), nil - } -} - // NewSupplyServiceQueryClientFn returns a function which constructs a // NewSupplyServiceQueryClient instance and returns a new depinject.Config which // is supplied with the given deps and the new ServiceQueryClient. diff --git a/pkg/relayer/cmd/cmd.go b/pkg/relayer/cmd/cmd.go index 66681b881..c8f0df94e 100644 --- a/pkg/relayer/cmd/cmd.go +++ b/pkg/relayer/cmd/cmd.go @@ -194,14 +194,13 @@ func setupRelayerDependencies( config.NewSupplyTxClientContextFn(queryNodeGRPCUrl, txNodeRPCUrl), // leaf config.NewSupplyDelegationClientFn(), // leaf config.NewSupplySharedQueryClientFn(), // leaf - config.NewSupplyTokenomicsQueryClientFn(), + config.NewSupplyServiceQueryClientFn(), supplyMiner, config.NewSupplyAccountQuerierFn(), config.NewSupplyBankQuerierFn(), config.NewSupplyApplicationQuerierFn(), config.NewSupplySupplierQuerierFn(), config.NewSupplySessionQuerierFn(), - config.NewSupplyServiceQueryClientFn(), config.NewSupplyProofQueryClientFn(), config.NewSupplyRingCacheFn(), supplyTxFactory, diff --git a/pkg/relayer/miner/gen/gen_fixtures.go b/pkg/relayer/miner/gen/gen_fixtures.go index 01c91392b..857049f5a 100644 --- a/pkg/relayer/miner/gen/gen_fixtures.go +++ b/pkg/relayer/miner/gen/gen_fixtures.go @@ -40,7 +40,6 @@ const ( defaultSvcID = "svc1" ) -// TODO_FOLLOWUP(@olshansk, #690): Do a global anycase grep for "DifficultyBits" and update/remove things appropriately. var ( // flagDifficultyThresholdHashStr is the difficulty threshold hash, as a hex string, that a // randomized, serialized relay must be greater than to be included in the diff --git a/pkg/relayer/miner/miner.go b/pkg/relayer/miner/miner.go index f22a85760..b6ed55e0e 100644 --- a/pkg/relayer/miner/miner.go +++ b/pkg/relayer/miner/miner.go @@ -15,7 +15,6 @@ import ( "github.com/pokt-network/poktroll/pkg/observable/filter" "github.com/pokt-network/poktroll/pkg/observable/logging" "github.com/pokt-network/poktroll/pkg/relayer" - prooftypes "github.com/pokt-network/poktroll/x/proof/types" servicetypes "github.com/pokt-network/poktroll/x/service/types" ) @@ -25,16 +24,16 @@ var _ relayer.Miner = (*miner)(nil) // difficulty of each, finally publishing those with sufficient difficulty to // minedRelayObs as they are applicable for relay volume. type miner struct { - // tokenomicsQueryClient is used to query for the relay difficulty target hash of a service. + // serviceQueryClient is used to query for the relay difficulty target hash of a service. // relay_difficulty is the target hash which a relay hash must be less than to be volume/reward applicable. - tokenomicsQueryClient client.TokenomicsQueryClient + serviceQueryClient client.ServiceQueryClient } // NewMiner creates a new miner from the given dependencies and options. It // returns an error if it has not been sufficiently configured or supplied. // // Required Dependencies: -// - ProofQueryClient +// - ServiceQueryClient // // Available options: // - WithRelayDifficultyTargetHash @@ -44,7 +43,7 @@ func NewMiner( ) (*miner, error) { mnr := &miner{} - if err := depinject.Inject(deps, &mnr.tokenomicsQueryClient); err != nil { + if err := depinject.Inject(deps, &mnr.serviceQueryClient); err != nil { return nil, err } @@ -129,11 +128,9 @@ func (mnr *miner) getServiceRelayDifficultyTargetHash(ctx context.Context, req * return nil, fmt.Errorf("invalid session header: %w", err) } - serviceRelayDifficulty, err := mnr.tokenomicsQueryClient.GetServiceRelayDifficultyTargetHash(ctx, sessionHeader.ServiceId) + serviceRelayDifficulty, err := mnr.serviceQueryClient.GetServiceRelayDifficulty(ctx, sessionHeader.ServiceId) if err != nil { - // TODO_IMPROVE: log the error and a message saying the default relay difficulty target hash - // is being used. - return prooftypes.DefaultRelayDifficultyTargetHash, nil + return nil, err } return serviceRelayDifficulty.GetTargetHash(), nil diff --git a/pkg/relayer/miner/miner_test.go b/pkg/relayer/miner/miner_test.go index 01a67c37c..7afbf69d2 100644 --- a/pkg/relayer/miner/miner_test.go +++ b/pkg/relayer/miner/miner_test.go @@ -46,12 +46,10 @@ func TestMiner_MinedRelays(t *testing.T) { expectedMinedRelays = unmarshalHexMinedRelays(t, marshaledMinableRelaysHex) ) - proofQueryClientMock := testqueryclients.NewTestProofQueryClient(t) - testqueryclients.SetServiceRelayDifficultyTargetHash(t, testSvcId, testRelayMiningTargetHash) - tokenomicsQueryClientMock := testqueryclients.NewTestTokenomicsQueryClient(t) + serviceQueryClientMock := testqueryclients.NewTestServiceQueryClient(t) - deps := depinject.Supply(proofQueryClientMock, tokenomicsQueryClientMock) + deps := depinject.Supply(serviceQueryClientMock) mnr, err := miner.NewMiner(deps) require.NoError(t, err) diff --git a/pkg/relayer/session/claim.go b/pkg/relayer/session/claim.go index ef758c28d..7bf05924b 100644 --- a/pkg/relayer/session/claim.go +++ b/pkg/relayer/session/claim.go @@ -315,10 +315,12 @@ func (rs *relayerSessionsManager) payableProofsSessionTrees( ).Warn().Msg("supplier operator cannot afford to submit proof for claim, skipping") } - logger.Warn().Msgf( - "Supplier operator %q can only afford %d out of %d claims", - supplierOpeartorAddress, len(claimableSessionTrees), len(sessionTrees), - ) + if len(claimableSessionTrees) < len(sessionTrees) { + logger.Warn().Msgf( + "Supplier operator %q can only afford %d out of %d claims", + supplierOpeartorAddress, len(claimableSessionTrees), len(sessionTrees), + ) + } return claimableSessionTrees, nil } diff --git a/pkg/relayer/session/proof.go b/pkg/relayer/session/proof.go index 1b97e838e..05f6b4cbe 100644 --- a/pkg/relayer/session/proof.go +++ b/pkg/relayer/session/proof.go @@ -15,7 +15,6 @@ import ( "github.com/pokt-network/poktroll/x/proof/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" "github.com/pokt-network/poktroll/x/shared" - tokenomics "github.com/pokt-network/poktroll/x/tokenomics" ) // submitProofs maps over the given claimedSessions observable. @@ -277,24 +276,25 @@ func (rs *relayerSessionsManager) isProofRequired( // Create the claim object and use its methods to determine if a proof is required. claim := claimFromSessionTree(sessionTree) - // Get the number of compute units accumulated through the given session. - numClaimComputeUnits, err := claim.GetNumComputeUnits() + proofParams, err := rs.proofQueryClient.GetParams(ctx) if err != nil { return false, err } - proofParams, err := rs.proofQueryClient.GetParams(ctx) + sharedParams, err := rs.sharedQueryClient.GetParams(ctx) if err != nil { return false, err } - sharedParams, err := rs.sharedQueryClient.GetParams(ctx) + // Retrieving the relay mining difficulty for the service at hand + serviceId := claim.GetSessionHeader().GetServiceId() + relayMiningDifficulty, err := rs.serviceQueryClient.GetServiceRelayDifficulty(ctx, serviceId) if err != nil { return false, err } // The amount of uPOKT being claimed. - claimedAmount, err := tokenomics.NumComputeUnitsToCoin(*sharedParams, numClaimComputeUnits) + claimedAmount, err := claim.GetClaimeduPOKT(*sharedParams, relayMiningDifficulty) if err != nil { return false, err } diff --git a/pkg/relayer/session/session.go b/pkg/relayer/session/session.go index 15fce0220..2578d1b15 100644 --- a/pkg/relayer/session/session.go +++ b/pkg/relayer/session/session.go @@ -65,9 +65,6 @@ type relayerSessionsManager struct { // claim requires a proof. proofQueryClient client.ProofQueryClient - // tokenomicsQueryClient is used to query for the tokenomics module parameters. - tokenomicsQueryClient client.TokenomicsQueryClient - // bankQueryClient is used to query for the bank module parameters. bankQueryClient client.BankQueryClient } @@ -100,7 +97,6 @@ func NewRelayerSessions( &rs.sharedQueryClient, &rs.serviceQueryClient, &rs.proofQueryClient, - &rs.tokenomicsQueryClient, &rs.bankQueryClient, ); err != nil { return nil, err diff --git a/pkg/relayer/session/session_test.go b/pkg/relayer/session/session_test.go index 5b3c24f2f..31e094a42 100644 --- a/pkg/relayer/session/session_test.go +++ b/pkg/relayer/session/session_test.go @@ -60,6 +60,8 @@ func requireProofCountEqualsExpectedValueFromProofParams(t *testing.T, proofPara Id: "svc", ComputeUnitsPerRelay: 2, } + + testqueryclients.SetServiceRelayDifficultyTargetHash(t, service.Id, protocol.BaseRelayDifficultyHashBz) // Add the service to the existing services. testqueryclients.AddToExistingServices(t, service) @@ -157,12 +159,14 @@ func TestRelayerSessionsManager_InsufficientBalanceForProofSubmission(t *testing ComputeUnitsPerRelay: 1, } testqueryclients.AddToExistingServices(t, lowCUPRService) + testqueryclients.SetServiceRelayDifficultyTargetHash(t, lowCUPRService.Id, protocol.BaseRelayDifficultyHashBz) highCUPRService := sharedtypes.Service{ Id: "highCUPRService", ComputeUnitsPerRelay: 2, } testqueryclients.AddToExistingServices(t, highCUPRService) + testqueryclients.SetServiceRelayDifficultyTargetHash(t, highCUPRService.Id, protocol.BaseRelayDifficultyHashBz) lowCUPRServiceActiveSession := &sessiontypes.Session{ Header: &sessiontypes.SessionHeader{ @@ -313,7 +317,6 @@ func setupDependencies( sharedQueryClientMock := testqueryclients.NewTestSharedQueryClient(t) serviceQueryClientMock := testqueryclients.NewTestServiceQueryClient(t) proofQueryClientMock := testqueryclients.NewTestProofQueryClientWithParams(t, &proofParams) - tokenomicsQueryClient := testqueryclients.NewTestTokenomicsQueryClient(t) bankQueryClient := testqueryclients.NewTestBankQueryClientWithBalance(t, supplierOperatorBalance) deps := depinject.Supply( @@ -323,7 +326,6 @@ func setupDependencies( sharedQueryClientMock, serviceQueryClientMock, proofQueryClientMock, - tokenomicsQueryClient, bankQueryClient, ) storesDirectoryOpt := testrelayer.WithTempStoresDirectory(t) diff --git a/proto/poktroll/application/tx.proto b/proto/poktroll/application/tx.proto index 229f03808..9fc236bf8 100644 --- a/proto/poktroll/application/tx.proto +++ b/proto/poktroll/application/tx.proto @@ -107,8 +107,8 @@ message MsgUpdateParam { string name = 2; oneof asType { - int64 as_int64 = 3; - cosmos.base.v1beta1.Coin as_coin = 4; + uint64 as_uint64 = 3 [(gogoproto.jsontag) = "as_uint64"]; + cosmos.base.v1beta1.Coin as_coin = 4 [(gogoproto.jsontag) = "as_coin"]; }; } diff --git a/proto/poktroll/proof/event.proto b/proto/poktroll/proof/event.proto index c1a53ceb8..b4e99aad9 100644 --- a/proto/poktroll/proof/event.proto +++ b/proto/poktroll/proof/event.proto @@ -4,27 +4,34 @@ package poktroll.proof; option go_package = "github.com/pokt-network/poktroll/x/proof/types"; option (gogoproto.stable_marshaler_all) = true; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "poktroll/proof/types.proto"; message EventClaimCreated { poktroll.proof.Claim claim = 1 [(gogoproto.jsontag) = "claim"]; uint64 num_relays = 2 [(gogoproto.jsontag) = "num_relays"]; - uint64 num_compute_units = 3 [(gogoproto.jsontag) = "num_compute_units"]; + uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; + uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } // TODO_TEST: Add coverage for claim updates. message EventClaimUpdated { poktroll.proof.Claim claim = 1 [(gogoproto.jsontag) = "claim"]; uint64 num_relays = 2 [(gogoproto.jsontag) = "num_relays"]; - uint64 num_compute_units = 3 [(gogoproto.jsontag) = "num_compute_units"]; + uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; + uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } message EventProofSubmitted { poktroll.proof.Claim claim = 1 [(gogoproto.jsontag) = "claim"]; poktroll.proof.Proof proof = 2 [(gogoproto.jsontag) = "proof"]; uint64 num_relays = 3 [(gogoproto.jsontag) = "num_relays"]; - uint64 num_compute_units = 4 [(gogoproto.jsontag) = "num_compute_units"]; + uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; + uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } // TODO_TEST: Add coverage for proof updates. @@ -32,5 +39,7 @@ message EventProofUpdated { poktroll.proof.Claim claim = 1 [(gogoproto.jsontag) = "claim"]; poktroll.proof.Proof proof = 2 [(gogoproto.jsontag) = "proof"]; uint64 num_relays = 3 [(gogoproto.jsontag) = "num_relays"]; - uint64 num_compute_units = 4 [(gogoproto.jsontag) = "num_compute_units"]; + uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; + uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } diff --git a/proto/poktroll/proof/params.proto b/proto/poktroll/proof/params.proto index 2b8a97a22..0af62cebf 100644 --- a/proto/poktroll/proof/params.proto +++ b/proto/poktroll/proof/params.proto @@ -13,10 +13,6 @@ message Params { option (amino.name) = "poktroll/x/proof/Params"; option (gogoproto.equal) = true; - // TODO_FOLLOWUP(@olshansk, #690): Either delete this or change it to be named "minimum" - // relay_difficulty_target_hash is the maximum value a relay hash must be less than to be volume/reward applicable. - bytes relay_difficulty_target_hash = 1 [(gogoproto.jsontag) = "relay_difficulty_target_hash"]; - // proof_request_probability is the probability of a session requiring a proof // if it's cost (i.e. compute unit consumption) is below the ProofRequirementThreshold. float proof_request_probability = 2 [(gogoproto.jsontag) = "proof_request_probability"]; diff --git a/proto/poktroll/proof/tx.proto b/proto/poktroll/proof/tx.proto index 4264f0daa..139e87042 100644 --- a/proto/poktroll/proof/tx.proto +++ b/proto/poktroll/proof/tx.proto @@ -59,8 +59,6 @@ message MsgUpdateParam { // specified in the `Params`` message in `proof/params.proto.` string name = 2; oneof as_type { - string as_string = 3 [(gogoproto.jsontag) = "as_string"]; - int64 as_int64 = 6 [(gogoproto.jsontag) = "as_int64"]; bytes as_bytes = 7 [(gogoproto.jsontag) = "as_bytes"]; float as_float = 8 [(gogoproto.jsontag) = "as_float"]; cosmos.base.v1beta1.Coin as_coin = 9 [(gogoproto.jsontag) = "as_coin"]; diff --git a/proto/poktroll/service/event.proto b/proto/poktroll/service/event.proto new file mode 100644 index 000000000..c9507e2ce --- /dev/null +++ b/proto/poktroll/service/event.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package poktroll.service; + +option go_package = "github.com/pokt-network/poktroll/x/service/types"; +option (gogoproto.stable_marshaler_all) = true; + +import "gogoproto/gogo.proto"; + +// EventRelayMiningDifficultyUpdated is an event emitted whenever the relay mining difficulty is updated +// for a given service. +message EventRelayMiningDifficultyUpdated { + string service_id = 1; + string prev_target_hash_hex_encoded = 2; + string new_target_hash_hex_encoded = 3; + uint64 prev_num_relays_ema = 4; + uint64 new_num_relays_ema = 5; +} \ No newline at end of file diff --git a/proto/poktroll/service/genesis.proto b/proto/poktroll/service/genesis.proto index e8f505348..be45ef550 100644 --- a/proto/poktroll/service/genesis.proto +++ b/proto/poktroll/service/genesis.proto @@ -9,6 +9,7 @@ import "gogoproto/gogo.proto"; import "poktroll/service/params.proto"; import "poktroll/shared/service.proto"; +import "poktroll/service/relay_mining_difficulty.proto"; // GenesisState defines the service module's genesis state. @@ -17,5 +18,6 @@ message GenesisState { // params defines all the parameters of the module. Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; repeated poktroll.shared.Service service_list = 2 [(gogoproto.nullable) = false] ; + repeated RelayMiningDifficulty relayMiningDifficultyList = 3 [(gogoproto.nullable) = false] ; } diff --git a/proto/poktroll/service/query.proto b/proto/poktroll/service/query.proto index 4b49a3e82..0f027ab98 100644 --- a/proto/poktroll/service/query.proto +++ b/proto/poktroll/service/query.proto @@ -11,6 +11,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "poktroll/service/params.proto"; import "poktroll/shared/service.proto"; +import "poktroll/service/relay_mining_difficulty.proto"; // Query defines the gRPC querier service. service Query { @@ -30,6 +31,15 @@ service Query { option (google.api.http).get = "/pokt-network/poktroll/service/service"; } + + // Queries a list of RelayMiningDifficulty items. + rpc RelayMiningDifficulty (QueryGetRelayMiningDifficultyRequest) returns (QueryGetRelayMiningDifficultyResponse) { + option (google.api.http).get = "/pokt-network/poktroll/service/relay_mining_difficulty/{serviceId}"; + + } + rpc RelayMiningDifficultyAll (QueryAllRelayMiningDifficultyRequest) returns (QueryAllRelayMiningDifficultyResponse) { + option (google.api.http).get = "/pokt-network/poktroll/service/relay_mining_difficulty"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -59,3 +69,19 @@ message QueryAllServicesResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryGetRelayMiningDifficultyRequest { + string serviceId = 1; +} + +message QueryGetRelayMiningDifficultyResponse { + RelayMiningDifficulty relayMiningDifficulty = 1 [(gogoproto.nullable) = false]; +} + +message QueryAllRelayMiningDifficultyRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllRelayMiningDifficultyResponse { + repeated RelayMiningDifficulty relayMiningDifficulty = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/poktroll/tokenomics/relay_mining_difficulty.proto b/proto/poktroll/service/relay_mining_difficulty.proto similarity index 89% rename from proto/poktroll/tokenomics/relay_mining_difficulty.proto rename to proto/poktroll/service/relay_mining_difficulty.proto index 36a671d0a..aaade441a 100644 --- a/proto/poktroll/tokenomics/relay_mining_difficulty.proto +++ b/proto/poktroll/service/relay_mining_difficulty.proto @@ -1,13 +1,14 @@ syntax = "proto3"; -package poktroll.tokenomics; +package poktroll.service; -option go_package = "github.com/pokt-network/poktroll/x/tokenomics/types"; +option go_package = "github.com/pokt-network/poktroll/x/service/types"; option (gogoproto.stable_marshaler_all) = true; import "gogoproto/gogo.proto"; // RelayMiningDifficulty is a message used to store the on-chain Relay Mining // difficulty associated with a specific service ID. +// TODO_TECHDEBT: Embed this message in the Service message. message RelayMiningDifficulty { // The service ID the relay mining difficulty is associated with. string service_id = 1; diff --git a/proto/poktroll/shared/tx.proto b/proto/poktroll/shared/tx.proto index c4097c461..86f52a7f5 100644 --- a/proto/poktroll/shared/tx.proto +++ b/proto/poktroll/shared/tx.proto @@ -48,7 +48,7 @@ message MsgUpdateParam { string name = 2; oneof as_type { string as_string = 3 [(gogoproto.jsontag) = "as_string"]; - int64 as_int64 = 6 [(gogoproto.jsontag) = "as_int64"]; + uint64 as_uint64 = 6 [(gogoproto.jsontag) = "as_uint64"]; bytes as_bytes = 7 [(gogoproto.jsontag) = "as_bytes"]; } } diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto index b1f862081..cf521df99 100644 --- a/proto/poktroll/supplier/tx.proto +++ b/proto/poktroll/supplier/tx.proto @@ -16,7 +16,7 @@ import "poktroll/shared/service.proto"; // Msg defines the Msg service. service Msg { option (cosmos.msg.v1.service) = true; - + // UpdateParams defines a (governance) operation for updating the module // parameters. The authority defaults to the x/gov module account. rpc UpdateParams (MsgUpdateParams ) returns (MsgUpdateParamsResponse ); @@ -28,14 +28,10 @@ service Msg { message MsgUpdateParams { option (cosmos.msg.v1.signer) = "authority"; option (amino.name) = "poktroll/x/supplier/MsgUpdateParams"; - + // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // TODO_IMPROVE(#322): The requirement to provide all params is adopted from the - // latest Cosmos SDK version. We should look into either improving this ourselves - // or seeing if it is on their roadmap. - // params defines the x/supplier parameters to update. // NOTE: All parameters must be supplied. Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; diff --git a/proto/poktroll/tokenomics/event.proto b/proto/poktroll/tokenomics/event.proto index b16f7f001..fb807d121 100644 --- a/proto/poktroll/tokenomics/event.proto +++ b/proto/poktroll/tokenomics/event.proto @@ -25,9 +25,13 @@ message EventClaimExpired { uint64 num_relays = 3 [(gogoproto.jsontag) = "num_relays"]; // Number of compute units claimed as a function of the number of relays // and the compute units per relay for the particular service. - uint64 num_compute_units = 4 [(gogoproto.jsontag) = "num_compute_units"]; - // TODO_BETA(@red-0ne): Rename 'num_compute_units' to 'num_claimed_compute_units' - // and introduce a 'num_estimated_compute_units' field. + uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; + // Number of estimated compute units claimed as a function of the number of claimed + // compute units and the relay difficulty multiplier for the particular service. + uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; + // The uPOKT coin claimed to be rewarded for the work done as a function of + // the number of estimated compute units and the compute uints to token multiplier. + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } // EventClaimSettled is an event emitted whenever a claim is settled. @@ -40,19 +44,13 @@ message EventClaimSettled { uint64 num_relays = 3 [(gogoproto.jsontag) = "num_relays"]; // Number of compute units claimed as a function of the number of relays // and the compute units per relay for the particular service. - uint64 num_compute_units = 4 [(gogoproto.jsontag) = "num_compute_units"]; - // TODO_BETA(@red-0ne): Rename 'num_compute_units' to 'num_claimed_compute_units' - // and introduce a 'num_estimated_compute_units' field. -} - -// EventRelayMiningDifficultyUpdated is an event emitted whenever the relay mining difficulty is updated -// for a given service. -message EventRelayMiningDifficultyUpdated { - string service_id = 1; - string prev_target_hash_hex_encoded = 2; - string new_target_hash_hex_encoded = 3; - uint64 prev_num_relays_ema = 4; - uint64 new_num_relays_ema = 5; + uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; + // Number of estimated compute units claimed as a function of the number of claimed + // compute units and the relay difficulty multiplier for the particular service. + uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; + // The uPOKT coin claimed to be rewarded for the work done as a function of + // the number of estimated compute units and the compute uints to token multiplier. + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } // EventApplicationOverserviced is emitted when an application has less stake than diff --git a/proto/poktroll/tokenomics/genesis.proto b/proto/poktroll/tokenomics/genesis.proto index a6fe91264..9b904f849 100644 --- a/proto/poktroll/tokenomics/genesis.proto +++ b/proto/poktroll/tokenomics/genesis.proto @@ -8,13 +8,11 @@ option (gogoproto.stable_marshaler_all) = true; import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "poktroll/tokenomics/params.proto"; -import "poktroll/tokenomics/relay_mining_difficulty.proto"; // GenesisState defines the tokenomics module's genesis state. message GenesisState { - + // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - repeated RelayMiningDifficulty relayMiningDifficultyList = 2 [(gogoproto.nullable) = false] ; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/poktroll/tokenomics/query.proto b/proto/poktroll/tokenomics/query.proto index 23888d8a2..325d3ade8 100644 --- a/proto/poktroll/tokenomics/query.proto +++ b/proto/poktroll/tokenomics/query.proto @@ -9,11 +9,8 @@ import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos_proto/cosmos.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos/base/v1beta1/coin.proto"; import "poktroll/tokenomics/params.proto"; -import "poktroll/tokenomics/relay_mining_difficulty.proto"; // Query defines the gRPC querier service. service Query { @@ -23,16 +20,6 @@ service Query { option (google.api.http).get = "/pokt-network/poktroll/tokenomics/params"; } - - // Queries a list of RelayMiningDifficulty items. - rpc RelayMiningDifficulty (QueryGetRelayMiningDifficultyRequest) returns (QueryGetRelayMiningDifficultyResponse) { - option (google.api.http).get = "/pokt-network/poktroll/tokenomics/relay_mining_difficulty/{serviceId}"; - - } - rpc RelayMiningDifficultyAll (QueryAllRelayMiningDifficultyRequest) returns (QueryAllRelayMiningDifficultyResponse) { - option (google.api.http).get = "/pokt-network/poktroll/tokenomics/relay_mining_difficulty"; - - } } // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} @@ -43,21 +30,3 @@ message QueryParamsResponse { // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } - -message QueryGetRelayMiningDifficultyRequest { - string serviceId = 1; -} - -message QueryGetRelayMiningDifficultyResponse { - RelayMiningDifficulty relayMiningDifficulty = 1 [(gogoproto.nullable) = false]; -} - -message QueryAllRelayMiningDifficultyRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QueryAllRelayMiningDifficultyResponse { - repeated RelayMiningDifficulty relayMiningDifficulty = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - diff --git a/tests/integration/application/min_stake_test.go b/tests/integration/application/min_stake_test.go index 5e552ea8b..0815dba96 100644 --- a/tests/integration/application/min_stake_test.go +++ b/tests/integration/application/min_stake_test.go @@ -20,6 +20,7 @@ import ( apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" + "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -48,6 +49,11 @@ func TestApplicationMinStakeTestSuite(t *testing.T) { func (s *applicationMinStakeTestSuite) SetupTest() { s.keepers, s.ctx = keeper.NewTokenomicsModuleKeepers(s.T(), cosmoslog.NewNopLogger()) + proofParams := prooftypes.DefaultParams() + proofParams.ProofRequestProbability = 0 + err := s.keepers.ProofKeeper.SetParams(s.ctx, proofParams) + require.NoError(s.T(), err) + s.serviceId = "svc1" s.appBech32 = sample.AccAddress() s.supplierBech32 = sample.AccAddress() @@ -82,9 +88,19 @@ func (s *applicationMinStakeTestSuite) TestAppIsUnbondedIfBelowMinStakeWhenSettl // Create a claim whose settlement amount drops the application below min stake claim := s.getClaim(sessionHeader) + s.keepers.ProofKeeper.UpsertClaim(s.ctx, *claim) - // Process TLMs for the claim. - err := s.keepers.Keeper.ProcessTokenLogicModules(s.ctx, claim) + // Set the current height to the claim settlement height. + sdkCtx := cosmostypes.UnwrapSDKContext(s.ctx) + currentHeight := sdkCtx.BlockHeight() + sharedParams := s.keepers.SharedKeeper.GetParams(s.ctx) + currentSessionEndHeight := shared.GetSessionEndHeight(&sharedParams, currentHeight) + claimSettlementHeight := currentSessionEndHeight + int64(sharedtypes.GetSessionEndToProofWindowCloseBlocks(&sharedParams)) + 1 + sdkCtx = sdkCtx.WithBlockHeight(claimSettlementHeight) + s.ctx = sdkCtx + + // Settle pending claims; this should cause the application to be unbonded. + _, _, err := s.keepers.Keeper.SettlePendingClaims(sdkCtx) require.NoError(s.T(), err) // Assert that the application was unbonded. @@ -131,7 +147,7 @@ func (s *applicationMinStakeTestSuite) stakeSupplier() { RevShare: []*sharedtypes.ServiceRevenueShare{ { Address: s.supplierBech32, - RevSharePercentage: 1, + RevSharePercentage: 100, }, }, }, diff --git a/tests/integration/tokenomics/relay_mining_difficulty_test.go b/tests/integration/service/relay_mining_difficulty_test.go similarity index 85% rename from tests/integration/tokenomics/relay_mining_difficulty_test.go rename to tests/integration/service/relay_mining_difficulty_test.go index eb6ad935c..7b34bd71e 100644 --- a/tests/integration/tokenomics/relay_mining_difficulty_test.go +++ b/tests/integration/service/relay_mining_difficulty_test.go @@ -2,13 +2,15 @@ package integration_test import ( "context" + "math" "testing" - "time" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pokt-network/smt" "github.com/pokt-network/smt/kvstore/pebble" "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/cmd/poktrolld/cmd" "github.com/pokt-network/poktroll/pkg/crypto/protocol" testutilevents "github.com/pokt-network/poktroll/testutil/events" @@ -16,10 +18,10 @@ import ( testutil "github.com/pokt-network/poktroll/testutil/integration" "github.com/pokt-network/poktroll/testutil/testrelayer" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) func init() { @@ -39,6 +41,20 @@ func TestUpdateRelayMiningDifficulty_NewServiceSeenForTheFirstTime(t *testing.T) // Get the current session and shared params session := getSession(t, integrationApp) sharedParams := getSharedParams(t, integrationApp) + proofParams := getProofParams(t, integrationApp) + + // Update the proof parameters to never require a proof, since this test is not + // submitting any proofs. + maxProofRequirementThreshold := sdk.NewInt64Coin(volatile.DenomuPOKT, math.MaxInt64) + proofParams.ProofRequirementThreshold = &maxProofRequirementThreshold + proofParams.ProofRequestProbability = 0 + + msgProofParams := prooftypes.MsgUpdateParams{ + Authority: integrationApp.GetAuthority(), + Params: proofParams, + } + _, err := integrationApp.RunMsg(t, &msgProofParams) + require.NoError(t, err) // Prepare the trie with several mined relays expectedNumRelays := uint64(100) @@ -91,14 +107,10 @@ func TestUpdateRelayMiningDifficulty_NewServiceSeenForTheFirstTime(t *testing.T) // TODO_TECHDEBT(@bryanchriswhite): Olshansky is unsure why the +1 is necessary here but it was required to pass the test. integrationApp.NextBlocks(t, int(numBlocksUntilProofWindowCloseHeight)+1) - // TODO_TECHDEBT: Aiming to get PR #771 over the finish line and this is a hacky - // workaround: https://github.com/pokt-network/poktroll/pull/771#issuecomment-2364071636 - time.Sleep(3 * time.Second) - // Check that the expected events are emitted events := sdkCtx.EventManager().Events() - relayMiningEvents := testutilevents.FilterEvents[*tokenomicstypes.EventRelayMiningDifficultyUpdated](t, - events, "poktroll.tokenomics.EventRelayMiningDifficultyUpdated") + relayMiningEvents := testutilevents.FilterEvents[*servicetypes.EventRelayMiningDifficultyUpdated](t, + events, "poktroll.service.EventRelayMiningDifficultyUpdated") require.Len(t, relayMiningEvents, 1, "unexpected number of relay mining difficulty updated events") relayMiningEvent := relayMiningEvents[0] require.Equal(t, "svc1", relayMiningEvent.ServiceId) @@ -143,6 +155,21 @@ func getSharedParams(t *testing.T, integrationApp *testutil.App) sharedtypes.Par return sharedQueryRes.Params } +// getProofParams returns the proof parameters for the current block height. +func getProofParams(t *testing.T, integrationApp *testutil.App) prooftypes.Params { + t.Helper() + + sdkCtx := integrationApp.GetSdkCtx() + + proofQueryClient := prooftypes.NewQueryClient(integrationApp.QueryHelper()) + proofParamsReq := prooftypes.QueryParamsRequest{} + + proofQueryRes, err := proofQueryClient.Params(sdkCtx, &proofParamsReq) + require.NoError(t, err) + + return proofQueryRes.Params +} + // getSession returns the current session for the default application and service. func getSession(t *testing.T, integrationApp *testutil.App) *sessiontypes.Session { t.Helper() diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index 9cf1d21a6..2beeb2196 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -1,146 +1,218 @@ package integration_test import ( - "context" + "math" + "math/big" "testing" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pokt-network/smt" "github.com/pokt-network/smt/kvstore/pebble" "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" + "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/pkg/crypto/protocol" - "github.com/pokt-network/poktroll/testutil/integration" - "github.com/pokt-network/poktroll/testutil/integration/suites" + testutils "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/sample" "github.com/pokt-network/poktroll/testutil/testrelayer" apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" + servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) -var ( -// TODO_BETA(#826): Uncomment these -// Test params. -// computeUnitsToTokensMultiplier = uint64(1) // keeping the math simple -// proofRequirementThreshold = sdk.NewInt64Coin(volatile.DenomuPOKT, 1e18) +const ( + initialNumRelays = uint64(1e3) + // DEV_NOTE: Max numRelays is set so that the test doesn't timeout. + maxNumRelays = uint64(1024e3) ) -type RelayMiningIntegrationTestSuite struct { - suites.ParamsSuite -} +func TestComputeNewDifficultyHash_RewardsReflectWorkCompleted(t *testing.T) { + // Update the target number of relays to a value that suits the test. + // A too high number would make the difficulty stay at BaseRelayDifficultyHash + initialTargetRelays := servicekeeper.TargetNumRelays + servicekeeper.TargetNumRelays = 1000 + t.Cleanup(func() { + // Reset the target number of relays to its initial value. + servicekeeper.TargetNumRelays = initialTargetRelays + }) + + // Prepare the test service. + service := sharedtypes.Service{ + Id: "svc1", + Name: "svcName1", + ComputeUnitsPerRelay: 1, + OwnerAddress: sample.AccAddress(), + } -func (s *RelayMiningIntegrationTestSuite) SetupTest() { - // Construct a fresh integration app for each test. - s.NewApp(s.T()) - s.SetupTestAuthzAccounts(s.T()) - s.SetupTestAuthzGrants(s.T()) -} + // Prepare the test application. + appAddress := sample.AccAddress() + appStake := apptypes.DefaultMinStake.Add(apptypes.DefaultMinStake) + application := apptypes.Application{ + Address: appAddress, + Stake: &appStake, + ServiceConfigs: []*sharedtypes.ApplicationServiceConfig{ + {ServiceId: service.Id}, + }, + } + + // Prepare the test supplier. + supplierAddress := sample.AccAddress() + // TODO(#850): Update supplier stake to be min stake + supplierStake := sdk.NewInt64Coin(volatile.DenomuPOKT, 1000) + supplier := sharedtypes.Supplier{ + OperatorAddress: supplierAddress, + OwnerAddress: supplierAddress, + Stake: &supplierStake, + Services: []*sharedtypes.SupplierServiceConfig{ + { + ServiceId: service.Id, + RevShare: []*sharedtypes.ServiceRevenueShare{ + { + Address: supplierAddress, + RevSharePercentage: 100, + }, + }, + }, + }, + } + + keepers, ctx := testutils.NewTokenomicsModuleKeepers(t, nil, + testutils.WithService(service), + testutils.WithApplication(application), + testutils.WithSupplier(supplier), + ) + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx = sdkCtx.WithBlockHeight(1) + + // Set the CUTTM to 1 to simplify the math + sharedParams := keepers.SharedKeeper.GetParams(sdkCtx) + sharedParams.ComputeUnitsToTokensMultiplier = uint64(1) + err := keepers.SharedKeeper.SetParams(sdkCtx, sharedParams) + require.NoError(t, err) + + // Set the global proof params so we never need a proof (for simplicity of this test) + err = keepers.ProofKeeper.SetParams(sdkCtx, prooftypes.Params{ + ProofRequestProbability: 0, // we never need a proof randomly + ProofRequirementThreshold: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: sdkmath.NewInt(math.MaxInt64)}, // a VERY high threshold + }) + require.NoError(t, err) + + // Update the relay mining difficulty so there's always a difficulty to retrieve + // for the test service. + _, err = keepers.ServiceKeeper.UpdateRelayMiningDifficulty(sdkCtx, map[string]uint64{service.Id: 1}) + require.NoError(t, err) + + // Set the previous relays and rewards to be used to calculate the increase ratio. + previousNumRelays := uint64(0) + previousRewardsAmount := sdkmath.NewInt(0) + + // Set the initial difficulty multiplier to later check that it has increased. + difficultyMultiplier := big.NewRat(1, 1) + + // Monotonically increase the number of relays from a very small number + // to a very large number. + for numRelays := initialNumRelays; numRelays <= maxNumRelays; numRelays *= 2 { + getSessionReq := sessiontypes.QueryGetSessionRequest{ + ApplicationAddress: appAddress, + ServiceId: service.Id, + BlockHeight: sdkCtx.BlockHeight(), + } + sessionRes, err := keepers.SessionKeeper.GetSession(sdkCtx, &getSessionReq) + require.NoError(t, err) + + session := sessionRes.Session -func (s *RelayMiningIntegrationTestSuite) TestComputeNewDifficultyHash_RewardsReflectWorkCompleted() { - // Set the shared module param compute_units_to_tokens_multiplier. - // TODO_BETA(#826): wait for integration app & suites refactor to be merged. - // _, err := s.RunUpdateParam(s.T(), - // sharedtypes.ModuleName, - // sharedtypes.ParamComputeUnitsToTokensMultiplier, - // computeUnitsToTokensMultiplier, - // ) - // require.NoError(s.T(), err) - - // Set the proof params so we never need a proof (for simplicity of this test) - // TODO_BETA(#826): wait for integration app & suites refactor to be merged. - // _, err = s.RunUpdateParam(s.T(), - // prooftypes.ModuleName, - // prooftypes.ParamProofRequestProbability, - // float32(0), - // ) - // require.NoError(s.T(), err) - - // Set the proof requirement threshold to be VERY high. - // TODO_BETA(#826): wait for integration app & suites refactor to be merged. - // _, err = s.RunUpdateParam(s.T(), - // prooftypes.ModuleName, - // prooftypes.ParamProofRequirementThreshold, - // &proofRequirementThreshold, - // ) - // require.NoError(s.T(), err) - - // TODO(@red-0ne, #781): Implement this test after the business logic is done. - - /* // Determine the height at which the claim will expire. - sharedParams := sharedtypes.DefaultParams() - claimWindowSizeBlocks := int64(sharedParams.GetClaimWindowOpenOffsetBlocks() + sharedParams.GetClaimWindowCloseOffsetBlocks()) - proofWindowSizeBlocks := int64(sharedParams.GetProofWindowOpenOffsetBlocks() + sharedParams.GetProofWindowCloseOffsetBlocks()) + sessionEndToProofWindowCloseBlocks := sharedtypes.GetSessionEndToProofWindowCloseBlocks(&sharedParams) + sessionEndHeight := session.GetHeader().GetSessionEndBlockHeight() + claimExpirationHeight := sessionEndHeight + int64(sessionEndToProofWindowCloseBlocks) + 1 - app := integrationApp.DefaultApplication - supplier := integrationApp.DefaultSupplier - service := integrationApp.DefaultService + sdkCtx = sdkCtx.WithBlockHeight(claimExpirationHeight) - // Monotonically increase the number of relays from a very small number - // to a very large number - for numRelays := uint64(1e3); numRelays <= 1e16; numRelays *= 10 { - session := getSession(t, integrationApp) + // Get the relay mining difficulty that will be used when settling the pending claims. + relayMiningDifficulty, ok := keepers.ServiceKeeper.GetRelayMiningDifficulty(sdkCtx, service.Id) + require.True(t, ok) - sessionEndHeight := session.GetHeader().GetSessionEndBlockHeight() - claimExpirationHeight := int64(sessionEndHeight + claimWindowSizeBlocks + proofWindowSizeBlocks + 1) + // Prepare a claim with the given number of relays. + claim := prepareRealClaim(t, numRelays, supplierAddress, session, &service, &relayMiningDifficulty) - ctxAtHeight := sdkCtx.WithBlockHeight(claimExpirationHeight) + // Get the claim's expected reward. + claimedRewards, err := claim.GetClaimeduPOKT(sharedParams, relayMiningDifficulty) + require.NoError(t, err) - relayMiningDifficulty, ok := keepers.TokenomicsKeeper.GetRelayMiningDifficulty(ctxAtHeight, service.Id) - require.True(t, ok) + // Get the number of claimed mined relays. + claimNumRelays, err := claim.GetNumRelays() + require.NoError(t, err) - // Prepare a claim with the given number of relays and store it - claim := prepareRealClaim(t, ctxAtHeight, integrationApp, numRelays, app, supplier, session, service, &relayMiningDifficulty) - keepers.ProofKeeper.UpsertClaim(ctxAtHeight, *claim) + // Store the claim before settling it. + keepers.ProofKeeper.UpsertClaim(sdkCtx, *claim) - // Calling SettlePendingClaims calls ProcessTokenLogicModules behind the scenes - settledResult, expiredResult, err := keepers.TokenomicsKeeper.SettlePendingClaims(ctxAtHeight) - require.NoError(t, err) - require.Equal(t, 1, int(settledResult.NumClaims)) - require.Equal(t, 0, int(expiredResult.NumClaims)) + // Calling SettlePendingClaims calls ProcessTokenLogicModules behind the scenes + settledResult, expiredResult, err := keepers.Keeper.SettlePendingClaims(sdkCtx) + require.NoError(t, err) + require.Equal(t, 1, int(settledResult.NumClaims)) + require.Equal(t, 0, int(expiredResult.NumClaims)) - // Update the relay mining difficulty - _, err = keepers.TokenomicsKeeper.UpdateRelayMiningDifficulty(ctxAtHeight, map[string]uint64{service.Id: numRelays}) - require.NoError(t, err) + // Update the relay mining difficulty + _, err = keepers.Keeper.UpdateRelayMiningDifficulty(sdkCtx, map[string]uint64{service.Id: claimNumRelays}) + require.NoError(t, err) - // Compute the expected reward - expectedReward := numRelays * serviceComputeUnitsPerRelay * computeUnitsToTokensMultiplier - fmt.Println("Expected reward:", expectedReward) + // Get the updated relay mining difficulty + updatedRelayMiningDifficulty, ok := keepers.ServiceKeeper.GetRelayMiningDifficulty(sdkCtx, service.Id) + require.True(t, ok) - // Compute the new difficulty hash - newDifficultyHash := protocol.ComputeNewDifficultyHash(ctx, numRelays) + // Compute the new difficulty hash based on the updated relay mining difficulty. + newDifficultyHash := protocol.ComputeNewDifficultyTargetHash( + protocol.BaseRelayDifficultyHashBz, + servicekeeper.TargetNumRelays, + updatedRelayMiningDifficulty.NumRelaysEma, + ) + + // Check that the updated difficulty hash is correct. + require.Equal(t, newDifficultyHash, updatedRelayMiningDifficulty.TargetHash) - // // Check that the new difficulty hash is correct - require.Equal(t, expectedReward, newDifficultyHash.Reward) + // Check that the new relays EMA has increased. + require.Greater(t, + updatedRelayMiningDifficulty.NumRelaysEma, + relayMiningDifficulty.NumRelaysEma, + ) - // Update the relay mining difficulty and - // - Check that EMA is changing - // - Check that the difficulty is changing + prevDifficultyMultiplier := protocol.GetRelayDifficultyMultiplier(relayMiningDifficulty.TargetHash) + newDifficultyMultiplier := protocol.GetRelayDifficultyMultiplier(updatedRelayMiningDifficulty.TargetHash) + // Check that the new difficulty has increased when it's no longer the base difficulty. + if newDifficultyMultiplier.Cmp(big.NewRat(1, 1)) == 1 { + require.True(t, newDifficultyMultiplier.Cmp(prevDifficultyMultiplier) == 1) + } - // Maintain a map of {num_relays -> num_rewards} - // Then compute, for everything we have in the map (double list) - // - Ratio of curr_relays to prev_relays - // - Ratio of curr_rewards to prev_rewards - // - Ensure the above are the same + // Make sure that the rewards reflect the work completed and that it increases + // proportionally to the number of relays mined. + if previousNumRelays > 0 { + numRelaysRatio := float64(numRelays) / float64(previousNumRelays) + rewardsRatio, _ := new(big.Rat).SetFrac(claimedRewards.Amount.BigInt(), previousRewardsAmount.BigInt()).Float64() + require.InDelta(t, numRelaysRatio, rewardsRatio, 0.1) } - */ + + previousNumRelays = numRelays + previousRewardsAmount = claimedRewards.Amount + difficultyMultiplier = newDifficultyMultiplier + } + + require.Equal(t, difficultyMultiplier.Cmp(big.NewRat(1, 1)), 1) } // prepareRealClaim prepares a claim by creating a real SMST with the given number // of mined relays that adhere to the actual on-chain difficulty of the test service. -// -//nolint:unused // Will be used once the test above is implemented. func prepareRealClaim( - t *testing.T, ctx context.Context, - integrationApp *integration.App, + t *testing.T, numRelays uint64, - app *apptypes.Application, - supplier *sharedtypes.Supplier, + supplierAddress string, session *sessiontypes.Session, service *sharedtypes.Service, - relayMiningDifficulty *tokenomicstypes.RelayMiningDifficulty, + relayMiningDifficulty *servicetypes.RelayMiningDifficulty, ) *prooftypes.Claim { t.Helper() @@ -153,30 +225,20 @@ func prepareRealClaim( // Insert the mined relays into the SMST for i := uint64(0); i < numRelays; i++ { - // Mine a real relay - minedRelay := testrelayer.NewSignedMinedRelay(t, ctx, - session, - app.Address, - supplier.OperatorAddress, - integrationApp.DefaultSupplierKeyringKeyringUid, - integrationApp.GetKeyRing(), - integrationApp.GetRingClient(), - ) + // DEV_NOTE: Unsigned relays are mined instead of signed relays to avoid calling + // the application querier and signature logic which make the test very slow + // given the large number of iterations involved. + minedRelay := testrelayer.NewUnsignedMinedRelay(t, session, supplierAddress) // Ensure that the relay is applicable to the relay mining difficulty if protocol.IsRelayVolumeApplicable(minedRelay.Hash, relayMiningDifficulty.TargetHash) { err = trie.Update(minedRelay.Hash, minedRelay.Bytes, service.ComputeUnitsPerRelay) require.NoError(t, err) } } - // Return the applicable claim return &prooftypes.Claim{ - SupplierOperatorAddress: integrationApp.DefaultSupplier.GetOperatorAddress(), + SupplierOperatorAddress: supplierAddress, SessionHeader: session.GetHeader(), RootHash: trie.Root(), } } - -func TestRelayMiningIntegrationSuite(t *testing.T) { - suite.Run(t, new(RelayMiningIntegrationTestSuite)) -} diff --git a/testutil/integration/suites/param_configs.go b/testutil/integration/suites/param_configs.go index e81a3f2d5..3f11ac943 100644 --- a/testutil/integration/suites/param_configs.go +++ b/testutil/integration/suites/param_configs.go @@ -81,9 +81,7 @@ var ( QueryParamsResponse: sharedtypes.QueryParamsResponse{}, }, ParamTypes: map[ParamType]any{ - // TODO_IMPROVE: Add a Uint64 asType instead of using int64 for uint64 params. - ParamTypeUint64: sharedtypes.MsgUpdateParam_AsInt64{}, - ParamTypeInt64: sharedtypes.MsgUpdateParam_AsInt64{}, + ParamTypeUint64: sharedtypes.MsgUpdateParam_AsUint64{}, ParamTypeString: sharedtypes.MsgUpdateParam_AsString{}, ParamTypeBytes: sharedtypes.MsgUpdateParam_AsBytes{}, }, @@ -147,8 +145,7 @@ var ( MinStake: &ValidActorMinStake, }, ParamTypes: map[ParamType]any{ - // TODO_IMPROVE: Add a Uint64 asType instead of using int64 for uint64 params. - ParamTypeUint64: apptypes.MsgUpdateParam_AsInt64{}, + ParamTypeUint64: apptypes.MsgUpdateParam_AsUint64{}, ParamTypeCoin: apptypes.MsgUpdateParam_AsCoin{}, }, DefaultParams: apptypes.DefaultParams(), @@ -203,16 +200,12 @@ var ( QueryParamsResponse: prooftypes.QueryParamsResponse{}, }, ValidParams: prooftypes.Params{ - RelayDifficultyTargetHash: ValidRelayDifficultyTargetHash, ProofRequestProbability: 0.1, ProofRequirementThreshold: &ValidProofRequirementThresholdCoin, ProofMissingPenalty: &ValidProofMissingPenaltyCoin, ProofSubmissionFee: &ValidProofSubmissionFeeCoin, }, ParamTypes: map[ParamType]any{ - ParamTypeUint64: prooftypes.MsgUpdateParam_AsInt64{}, - ParamTypeInt64: prooftypes.MsgUpdateParam_AsInt64{}, - ParamTypeString: prooftypes.MsgUpdateParam_AsString{}, ParamTypeBytes: prooftypes.MsgUpdateParam_AsBytes{}, ParamTypeFloat32: prooftypes.MsgUpdateParam_AsFloat{}, ParamTypeCoin: prooftypes.MsgUpdateParam_AsCoin{}, diff --git a/testutil/integration/suites/update_params.go b/testutil/integration/suites/update_params.go index f7db56aeb..7da33f997 100644 --- a/testutil/integration/suites/update_params.go +++ b/testutil/integration/suites/update_params.go @@ -245,7 +245,7 @@ func (s *ParamsSuite) RunUpdateParamAsSigner( switch paramType { case ParamTypeUint64: // NB: MsgUpdateParam doesn't currently support uint64 param type. - msgAsTypeValue.Elem().FieldByName("AsInt64").SetInt(int64(paramReflectValue.Interface().(uint64))) + msgAsTypeValue.Elem().FieldByName("AsUint64").Set(paramReflectValue) case ParamTypeInt64: msgAsTypeValue.Elem().FieldByName("AsInt64").Set(paramReflectValue) case ParamTypeFloat32: diff --git a/testutil/keeper/tokenomics.go b/testutil/keeper/tokenomics.go index 4659654cf..f9df12788 100644 --- a/testutil/keeper/tokenomics.go +++ b/testutil/keeper/tokenomics.go @@ -140,6 +140,8 @@ func TokenomicsKeeperWithActorAddrs(t testing.TB) ( }, } + sdkCtx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + ctrl := gomock.NewController(t) // Mock the application keeper. @@ -225,6 +227,12 @@ func TokenomicsKeeperWithActorAddrs(t testing.TB) ( Return(sharedtypes.Service{}, false). AnyTimes() + relayMiningDifficulty := servicekeeper.NewDefaultRelayMiningDifficulty(sdkCtx, log.NewNopLogger(), service.Id, servicekeeper.TargetNumRelays) + mockServiceKeeper.EXPECT(). + GetRelayMiningDifficulty(gomock.Any(), gomock.Any()). + Return(relayMiningDifficulty, true). + AnyTimes() + k := tokenomicskeeper.NewKeeper( cdc, runtime.NewKVStoreService(storeKey), @@ -240,8 +248,6 @@ func TokenomicsKeeperWithActorAddrs(t testing.TB) ( mockServiceKeeper, ) - sdkCtx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) - // Add a block proposer address to the context valAddr, err := cosmostypes.ValAddressFromBech32(sample.ValAddress()) require.NoError(t, err) @@ -464,6 +470,7 @@ func NewTokenomicsModuleKeepers( return keepers, ctx } +// WithService is an option to set the service in the tokenomics module keepers. func WithService(service sharedtypes.Service) TokenomicsModuleKeepersOpt { return func(ctx context.Context, keepers *TokenomicsModuleKeepers) context.Context { keepers.SetService(ctx, service) @@ -471,6 +478,24 @@ func WithService(service sharedtypes.Service) TokenomicsModuleKeepersOpt { } } +// WithApplication is an option to set the application in the tokenomics module keepers. +func WithApplication(applicaion apptypes.Application) TokenomicsModuleKeepersOpt { + return func(ctx context.Context, keepers *TokenomicsModuleKeepers) context.Context { + keepers.SetApplication(ctx, applicaion) + return ctx + } +} + +// WithSupplier is an option to set the supplier in the tokenomics module keepers. +func WithSupplier(supplier sharedtypes.Supplier) TokenomicsModuleKeepersOpt { + return func(ctx context.Context, keepers *TokenomicsModuleKeepers) context.Context { + keepers.SetSupplier(ctx, supplier) + return ctx + } +} + +// WithProposerAddr is an option to set the proposer address in the context used +// by the tokenomics module keepers. func WithProposerAddr(addr string) TokenomicsModuleKeepersOpt { return func(ctx context.Context, keepers *TokenomicsModuleKeepers) context.Context { valAddr, err := cosmostypes.ValAddressFromBech32(addr) diff --git a/testutil/testclient/testqueryclients/servicequerier.go b/testutil/testclient/testqueryclients/servicequerier.go index 0557078c0..58f88c2f8 100644 --- a/testutil/testclient/testqueryclients/servicequerier.go +++ b/testutil/testclient/testqueryclients/servicequerier.go @@ -8,9 +8,19 @@ import ( "github.com/pokt-network/poktroll/testutil/mockclient" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) +// TODO_TECHDEBT: refactor the methods using this variable to avoid having a global scope +// for the map across unit tests run under the same testing.T instance. +// Ditto for other similar package-level variables in this package. +// relayDifficultyTargets is a map of: serviceId -> RelayMiningDifficulty +// It is updated by the SetServiceRelayDifficultyTargetHash, and read by +// the mock tokenomics query client to get a specific service's relay difficulty +// target hash. +var relayDifficultyTargets = make(map[string]*servicetypes.RelayMiningDifficulty) + // TODO_TECHDEBT: refactor the methods using this variable to avoid having a global scope // for the map across unit tests run under the same testing.T instance. // services is a map of: serviceId -> Service @@ -40,6 +50,20 @@ func NewTestServiceQueryClient( }). AnyTimes() + serviceQuerier.EXPECT().GetServiceRelayDifficulty(gomock.Any(), gomock.Any()). + DoAndReturn(func( + _ context.Context, + serviceId string, + ) (servicetypes.RelayMiningDifficulty, error) { + relayDifficulty, ok := relayDifficultyTargets[serviceId] + if !ok { + return servicetypes.RelayMiningDifficulty{}, servicetypes.ErrServiceMissingRelayMiningDifficulty.Wrapf("retrieving the relay mining difficulty for service %s", serviceId) + } + + return *relayDifficulty, nil + }). + AnyTimes() + return serviceQuerier } @@ -57,3 +81,22 @@ func AddToExistingServices( delete(services, service.Id) }) } + +// AddServiceRelayDifficultyTargetHash sets the relay difficulty target hash +// for the given service to mock it "existing" on chain. +// It will also remove the service relay difficulty target hashes from the map when the test is cleaned up. +func SetServiceRelayDifficultyTargetHash(t *testing.T, + serviceId string, + relayDifficultyTargetHash []byte, +) { + t.Helper() + + relayDifficultyTargets[serviceId] = &servicetypes.RelayMiningDifficulty{ + ServiceId: serviceId, + TargetHash: relayDifficultyTargetHash, + } + + t.Cleanup(func() { + delete(relayDifficultyTargets, serviceId) + }) +} diff --git a/testutil/testclient/testqueryclients/tokenomicsquerier.go b/testutil/testclient/testqueryclients/tokenomicsquerier.go deleted file mode 100644 index dc8c2e72e..000000000 --- a/testutil/testclient/testqueryclients/tokenomicsquerier.go +++ /dev/null @@ -1,66 +0,0 @@ -package testqueryclients - -import ( - "context" - "testing" - - "github.com/golang/mock/gomock" - - "github.com/pokt-network/poktroll/testutil/mockclient" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" -) - -// TODO_TECHDEBT: refactor the methods using this variable to avoid having a global scope -// for the map across unit tests run under the same testing.T instance. -// Ditto for other similar package-level variables in this package. -// relayDifficultyTargets is a map of: serviceId -> RelayMiningDifficulty -// It is updated by the SetServiceRelayDifficultyTargetHash, and read by -// the mock tokenomics query client to get a specific service's relay difficulty -// target hash. -var relayDifficultyTargets = make(map[string]*tokenomicstypes.RelayMiningDifficulty) - -// NewTestTokenomicsQueryClient creates a mock of the TokenomicsQueryClient -// which allows the caller to call GetSession any times and will return -// the session matching the app address, serviceID and the blockHeight passed. -func NewTestTokenomicsQueryClient( - t *testing.T, -) *mockclient.MockTokenomicsQueryClient { - t.Helper() - ctrl := gomock.NewController(t) - - tokenomicsQuerier := mockclient.NewMockTokenomicsQueryClient(ctrl) - tokenomicsQuerier.EXPECT().GetServiceRelayDifficultyTargetHash(gomock.Any(), gomock.Any()). - DoAndReturn(func( - _ context.Context, - serviceId string, - ) (*tokenomicstypes.RelayMiningDifficulty, error) { - relayDifficulty, ok := relayDifficultyTargets[serviceId] - if !ok { - return nil, tokenomicstypes.ErrTokenomicsMissingRelayMiningDifficulty.Wrapf("retrieving the relay mining difficulty for service %s", serviceId) - } - - return relayDifficulty, nil - }). - AnyTimes() - - return tokenomicsQuerier -} - -// AddServiceRelayDifficultyTargetHash sets the relay difficulty target hash -// for the given service to mock it "existing" on chain. -// It will also remove the service relay difficulty target hashes from the map when the test is cleaned up. -func SetServiceRelayDifficultyTargetHash(t *testing.T, - serviceId string, - relayDifficultyTargetHash []byte, -) { - t.Helper() - - relayDifficultyTargets[serviceId] = &tokenomicstypes.RelayMiningDifficulty{ - ServiceId: serviceId, - TargetHash: relayDifficultyTargetHash, - } - - t.Cleanup(func() { - delete(relayDifficultyTargets, serviceId) - }) -} diff --git a/testutil/testrelayer/relays.go b/testutil/testrelayer/relays.go index 01223f7a5..3b1ac2f91 100644 --- a/testutil/testrelayer/relays.go +++ b/testutil/testrelayer/relays.go @@ -45,13 +45,13 @@ func NewUnsignedMinedRelay( SessionHeader: session.Header, SupplierOperatorAddress: supplierOperatorAddress, }, - Payload: []byte("request_payload"), + Payload: randomPayload(), }, Res: &servicetypes.RelayResponse{ Meta: servicetypes.RelayResponseMetadata{ SessionHeader: session.Header, }, - Payload: []byte("response_payload"), + Payload: randomPayload(), }, } diff --git a/tools/scripts/params/proof_all.json b/tools/scripts/params/proof_all.json index 182ce6316..73e080cd9 100644 --- a/tools/scripts/params/proof_all.json +++ b/tools/scripts/params/proof_all.json @@ -5,7 +5,6 @@ "@type": "/poktroll.proof.MsgUpdateParams", "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", "params": { - "min_relay_difficulty_bits": "0", "proof_request_probability": "0.25", "proof_requirement_threshold": { "denom": "upokt", diff --git a/tools/scripts/params/proof_min_relay_difficulty_bits.json b/tools/scripts/params/proof_min_relay_difficulty_bits.json deleted file mode 100644 index 72c14a1d5..000000000 --- a/tools/scripts/params/proof_min_relay_difficulty_bits.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "body": { - "messages": [ - { - "@type": "/poktroll.proof.MsgUpdateParam", - "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", - "name": "min_relay_difficulty_bits", - "as_int64": "0" - } - ] - } -} diff --git a/x/application/keeper/msg_server_stake_application.go b/x/application/keeper/msg_server_stake_application.go index f056d3592..3bbd22f0d 100644 --- a/x/application/keeper/msg_server_stake_application.go +++ b/x/application/keeper/msg_server_stake_application.go @@ -71,11 +71,11 @@ func (k msgServer) StakeApplication(ctx context.Context, msg *types.MsgStakeAppl // TODO_CONSIDERATION: If we support multiple native tokens, we will need to // start checking the denom here. if msg.Stake.Amount.LT(minStake.Amount) { - errFmt := "application %q must stake at least %s" - logger.Info(fmt.Sprintf(errFmt, msg.Address, minStake)) + err = fmt.Errorf("application %q must stake at least %s", msg.GetAddress(), minStake) + logger.Info(err.Error()) return nil, status.Error( codes.InvalidArgument, - types.ErrAppInvalidStake.Wrapf(errFmt, msg.Address, minStake).Error(), + types.ErrAppInvalidStake.Wrapf("%s", err).Error(), ) } diff --git a/x/application/keeper/msg_server_update_param.go b/x/application/keeper/msg_server_update_param.go index 1968b774f..a06925e75 100644 --- a/x/application/keeper/msg_server_update_param.go +++ b/x/application/keeper/msg_server_update_param.go @@ -33,10 +33,19 @@ func (k msgServer) UpdateParam(ctx context.Context, msg *apptypes.MsgUpdateParam params := k.GetParams(ctx) switch msg.Name { - // TODO_IMPROVE: Add a Uint64 asType instead of using int64 for uint64 params. case apptypes.ParamMaxDelegatedGateways: - logger = logger.With("param_value", msg.GetAsInt64()) - params.MaxDelegatedGateways = uint64(msg.GetAsInt64()) + logger = logger.With("param_value", msg.GetAsUint64()) + + params.MaxDelegatedGateways = msg.GetAsUint64() + if _, ok := msg.AsType.(*apptypes.MsgUpdateParam_AsUint64); !ok { + return nil, apptypes.ErrAppParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) + } + maxDelegatedGateways := msg.GetAsUint64() + + if err := apptypes.ValidateMaxDelegatedGateways(maxDelegatedGateways); err != nil { + return nil, apptypes.ErrAppParamInvalid.Wrapf("maxdelegegated_gateways (%d): %v", maxDelegatedGateways, err) + } + params.MaxDelegatedGateways = maxDelegatedGateways case apptypes.ParamMinStake: logger = logger.With("param_value", msg.GetAsCoin()) params.MinStake = msg.GetAsCoin() diff --git a/x/application/keeper/msg_server_update_param_test.go b/x/application/keeper/msg_server_update_param_test.go index 8f8b5ab03..9076569f3 100644 --- a/x/application/keeper/msg_server_update_param_test.go +++ b/x/application/keeper/msg_server_update_param_test.go @@ -28,7 +28,7 @@ func TestMsgUpdateParam_UpdateMaxDelegatedGatewaysOnly(t *testing.T) { updateParamMsg := &apptypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: apptypes.ParamMaxDelegatedGateways, - AsType: &apptypes.MsgUpdateParam_AsInt64{AsInt64: int64(expectedMaxDelegatedGateways)}, + AsType: &apptypes.MsgUpdateParam_AsUint64{AsUint64: expectedMaxDelegatedGateways}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) diff --git a/x/application/types/application.go b/x/application/types/application.go index b4a33cd5b..c584d75a1 100644 --- a/x/application/types/application.go +++ b/x/application/types/application.go @@ -4,7 +4,10 @@ import sharedtypes "github.com/pokt-network/poktroll/x/shared/types" // ApplicationNotUnstaking is the value of `unstake_session_end_height` if the // application is not actively in the unbonding period. -const ApplicationNotUnstaking uint64 = 0 +const ( + ApplicationNotUnstaking uint64 = iota + ApplicationBelowMinStake +) // IsUnbonding returns true if the application is actively unbonding. // It determines if the application has submitted an unstake message, in which case diff --git a/x/application/types/message_update_param.go b/x/application/types/message_update_param.go index 2f71cdac0..ed66a4ee4 100644 --- a/x/application/types/message_update_param.go +++ b/x/application/types/message_update_param.go @@ -15,7 +15,7 @@ func NewMsgUpdateParam(authority string, name string, asType any) *MsgUpdatePara switch t := asType.(type) { case uint64: - asTypeIface = &MsgUpdateParam_AsInt64{AsInt64: int64(t)} + asTypeIface = &MsgUpdateParam_AsUint64{AsUint64: t} case *cosmostypes.Coin: asTypeIface = &MsgUpdateParam_AsCoin{AsCoin: t} default: @@ -46,7 +46,7 @@ func (msg *MsgUpdateParam) ValidateBasic() error { if err := msg.paramTypeIsUint64(); err != nil { return err } - return ValidateMaxDelegatedGateways(uint64(msg.GetAsInt64())) + return ValidateMaxDelegatedGateways(msg.GetAsUint64()) case ParamMinStake: if err := msg.paramTypeIsCoin(); err != nil { return err @@ -58,10 +58,10 @@ func (msg *MsgUpdateParam) ValidateBasic() error { } func (msg *MsgUpdateParam) paramTypeIsUint64() error { - if _, ok := msg.AsType.(*MsgUpdateParam_AsInt64); !ok { + if _, ok := msg.AsType.(*MsgUpdateParam_AsUint64); !ok { return ErrAppParamInvalid.Wrapf(""+ "invalid type for param %q; expected %T, got %T", - msg.Name, &MsgUpdateParam_AsInt64{}, msg.AsType, + msg.Name, &MsgUpdateParam_AsUint64{}, msg.AsType, ) } return nil diff --git a/x/application/types/tx.pb.go b/x/application/types/tx.pb.go index 557ef57a4..99df3c002 100644 --- a/x/application/types/tx.pb.go +++ b/x/application/types/tx.pb.go @@ -549,7 +549,7 @@ type MsgUpdateParam struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Types that are valid to be assigned to AsType: // - // *MsgUpdateParam_AsInt64 + // *MsgUpdateParam_AsUint64 // *MsgUpdateParam_AsCoin AsType isMsgUpdateParam_AsType `protobuf_oneof:"asType"` } @@ -589,15 +589,15 @@ type isMsgUpdateParam_AsType interface { Size() int } -type MsgUpdateParam_AsInt64 struct { - AsInt64 int64 `protobuf:"varint,3,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64,omitempty"` +type MsgUpdateParam_AsUint64 struct { + AsUint64 uint64 `protobuf:"varint,3,opt,name=as_uint64,json=asUint64,proto3,oneof" json:"as_uint64"` } type MsgUpdateParam_AsCoin struct { - AsCoin *types.Coin `protobuf:"bytes,4,opt,name=as_coin,json=asCoin,proto3,oneof" json:"as_coin,omitempty"` + AsCoin *types.Coin `protobuf:"bytes,4,opt,name=as_coin,json=asCoin,proto3,oneof" json:"as_coin"` } -func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsUint64) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { if m != nil { @@ -620,9 +620,9 @@ func (m *MsgUpdateParam) GetName() string { return "" } -func (m *MsgUpdateParam) GetAsInt64() int64 { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsInt64); ok { - return x.AsInt64 +func (m *MsgUpdateParam) GetAsUint64() uint64 { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsUint64); ok { + return x.AsUint64 } return 0 } @@ -637,7 +637,7 @@ func (m *MsgUpdateParam) GetAsCoin() *types.Coin { // XXX_OneofWrappers is for the internal use of the proto package. func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*MsgUpdateParam_AsInt64)(nil), + (*MsgUpdateParam_AsUint64)(nil), (*MsgUpdateParam_AsCoin)(nil), } } @@ -702,63 +702,64 @@ func init() { func init() { proto.RegisterFile("poktroll/application/tx.proto", fileDescriptor_bed224e38ab1cc6d) } var fileDescriptor_bed224e38ab1cc6d = []byte{ - // 888 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xbf, 0x6f, 0xdb, 0x46, - 0x14, 0xd6, 0x45, 0x89, 0x6c, 0x3f, 0xa5, 0x4e, 0x42, 0x29, 0x0d, 0xcd, 0x24, 0x8c, 0x42, 0xb4, - 0x85, 0xa2, 0xc6, 0x24, 0xa4, 0x08, 0x06, 0xa2, 0xc5, 0xb0, 0xdc, 0x1f, 0xc9, 0xa0, 0xa2, 0xa0, - 0xdd, 0xa5, 0x8b, 0x70, 0x92, 0x2e, 0x34, 0x61, 0x89, 0x47, 0xf0, 0xce, 0x4a, 0x34, 0xb5, 0xe8, - 0xd8, 0xa9, 0x7f, 0x45, 0x51, 0x74, 0xd2, 0xd0, 0xa5, 0x7f, 0x40, 0x81, 0x74, 0x6a, 0xd0, 0x29, - 0x53, 0x51, 0xc8, 0x83, 0xff, 0x8d, 0x82, 0x3f, 0x45, 0x51, 0x54, 0x45, 0x17, 0x19, 0xba, 0xd8, - 0xe4, 0xdd, 0xf7, 0xde, 0xfb, 0xbe, 0xef, 0x51, 0xef, 0x0e, 0xee, 0xdb, 0xf4, 0x94, 0x3b, 0x74, - 0x38, 0xd4, 0xb0, 0x6d, 0x0f, 0xcd, 0x3e, 0xe6, 0x26, 0xb5, 0x34, 0xfe, 0x4a, 0xb5, 0x1d, 0xca, - 0xa9, 0x50, 0x0e, 0xb7, 0xd5, 0xd8, 0xb6, 0x74, 0x0b, 0x8f, 0x4c, 0x8b, 0x6a, 0xde, 0x5f, 0x1f, - 0x28, 0xed, 0xf4, 0x29, 0x1b, 0x51, 0xd6, 0xf5, 0xde, 0x34, 0xff, 0x25, 0xd8, 0x92, 0xfd, 0x37, - 0xad, 0x87, 0x19, 0xd1, 0xc6, 0xf5, 0x1e, 0xe1, 0xb8, 0xae, 0xf5, 0xa9, 0x69, 0x05, 0xfb, 0x77, - 0x82, 0xfd, 0x11, 0x33, 0xb4, 0x71, 0xdd, 0xfd, 0x17, 0x6c, 0x94, 0x0d, 0x6a, 0x50, 0x3f, 0xa1, - 0xfb, 0x14, 0xac, 0x56, 0xd2, 0x19, 0x4f, 0x6c, 0x12, 0x16, 0x7c, 0x98, 0x8a, 0xb0, 0xb1, 0x83, - 0x47, 0x21, 0x64, 0x2e, 0x9b, 0x9d, 0x60, 0x87, 0x0c, 0x34, 0x46, 0x9c, 0xb1, 0xd9, 0x27, 0xfe, - 0xb6, 0xf2, 0x1b, 0x82, 0x1b, 0x1d, 0x66, 0x7c, 0x65, 0x0f, 0x30, 0x27, 0x5f, 0x7a, 0x81, 0xc2, - 0x1e, 0x6c, 0xe1, 0x33, 0x7e, 0x42, 0x1d, 0x93, 0x4f, 0x44, 0x54, 0x41, 0xd5, 0xad, 0xb6, 0xf8, - 0xe7, 0x2f, 0xbb, 0xe5, 0x40, 0xeb, 0xc1, 0x60, 0xe0, 0x10, 0xc6, 0x8e, 0xb8, 0x63, 0x5a, 0x86, - 0x3e, 0x87, 0x0a, 0xfb, 0x50, 0xf0, 0x4b, 0x8b, 0x57, 0x2a, 0xa8, 0x5a, 0x6c, 0xdc, 0x53, 0xd3, - 0x3c, 0x55, 0xfd, 0x2a, 0xed, 0xad, 0xd7, 0x7f, 0x3d, 0xc8, 0xfd, 0x74, 0x31, 0xad, 0x21, 0x3d, - 0x08, 0x6b, 0x3d, 0xfd, 0xee, 0x62, 0x5a, 0x9b, 0x27, 0xfc, 0xfe, 0x62, 0x5a, 0xfb, 0x28, 0xa2, - 0xff, 0x6a, 0x41, 0x63, 0x82, 0xb3, 0xb2, 0x03, 0x77, 0x12, 0x4b, 0x3a, 0x61, 0x36, 0xb5, 0x18, - 0x51, 0xfe, 0x40, 0x50, 0xea, 0x30, 0xe3, 0x88, 0xe3, 0x53, 0x72, 0x30, 0x4f, 0x21, 0x34, 0x60, - 0x03, 0xfb, 0x52, 0xd6, 0x8a, 0x0c, 0x81, 0x82, 0x06, 0xd7, 0x98, 0x9b, 0x27, 0x50, 0xb8, 0xa3, - 0x06, 0x70, 0xb7, 0xe3, 0x6a, 0xd0, 0x71, 0xf5, 0x90, 0x9a, 0x96, 0xee, 0xe3, 0x84, 0x4f, 0x61, - 0x33, 0x30, 0x9c, 0x89, 0xf9, 0x4a, 0xbe, 0x5a, 0x6c, 0x3c, 0x9a, 0xbb, 0xe2, 0x77, 0x44, 0x8d, - 0x91, 0x3a, 0xf2, 0xb1, 0x87, 0xd4, 0x7a, 0x61, 0x1a, 0x7a, 0x14, 0xda, 0xba, 0xee, 0x3a, 0x13, - 0xb2, 0x50, 0x7a, 0x70, 0x37, 0x45, 0x50, 0x28, 0x58, 0x38, 0x84, 0x62, 0xcc, 0x2a, 0x4f, 0x5c, - 0xb1, 0xf1, 0x30, 0xbd, 0x19, 0xf1, 0xf8, 0x78, 0x94, 0xb2, 0x0f, 0xb7, 0x5d, 0x43, 0x2d, 0x96, - 0xb4, 0x4d, 0x4c, 0xd8, 0x16, 0x99, 0x93, 0x20, 0xf9, 0x00, 0xee, 0xa7, 0x26, 0x88, 0xfa, 0xf2, - 0x23, 0x82, 0x72, 0x87, 0x19, 0x9f, 0x90, 0x21, 0x31, 0x30, 0x27, 0xc7, 0xf4, 0x73, 0xcc, 0xc9, - 0x4b, 0x3c, 0x11, 0x9e, 0x7a, 0xfc, 0xbb, 0x59, 0x9b, 0x03, 0xd8, 0xb6, 0x83, 0x15, 0xe1, 0x00, - 0x6e, 0x18, 0x7e, 0x96, 0x28, 0xfc, 0xca, 0x9a, 0xf0, 0xed, 0x20, 0x20, 0x58, 0x6d, 0xdd, 0x74, - 0x55, 0xc4, 0x09, 0x28, 0x7d, 0xb8, 0x97, 0xc6, 0xf3, 0xdd, 0xfa, 0xfd, 0x33, 0x02, 0xd1, 0xf3, - 0x6b, 0x10, 0xd4, 0xf9, 0xcc, 0xa1, 0xa3, 0xff, 0xab, 0x23, 0x0a, 0x54, 0x56, 0x71, 0x8d, 0xda, - 0xfb, 0x2b, 0x82, 0xf7, 0x3b, 0xcc, 0x38, 0x76, 0xb0, 0xc5, 0x5e, 0x10, 0x27, 0xfe, 0x09, 0xed, - 0xc3, 0x36, 0xa3, 0x67, 0x4e, 0x9f, 0x64, 0x56, 0xf4, 0x9e, 0x8f, 0x0f, 0x45, 0x3d, 0x87, 0xd2, - 0x80, 0x30, 0x6e, 0x5a, 0x5e, 0xbe, 0xcc, 0xc2, 0x84, 0x58, 0x50, 0x28, 0xae, 0xe4, 0x8a, 0x4b, - 0xd0, 0x51, 0x08, 0xc8, 0xe9, 0xd4, 0xdf, 0x6d, 0xcf, 0x7f, 0x47, 0xb0, 0xbd, 0x38, 0xb5, 0xfe, - 0xf3, 0xec, 0x15, 0xe0, 0xaa, 0x85, 0x47, 0xfe, 0x5c, 0xda, 0xd2, 0xbd, 0x67, 0xe1, 0x2e, 0x6c, - 0x62, 0xd6, 0x35, 0x2d, 0xbe, 0xd7, 0x14, 0xf3, 0x15, 0x54, 0xcd, 0x3f, 0xcb, 0xe9, 0x1b, 0x98, - 0x3d, 0x77, 0x17, 0x84, 0x26, 0x6c, 0x60, 0xd6, 0x75, 0x0f, 0x27, 0xf1, 0xea, 0x9a, 0x59, 0xf6, - 0x2c, 0xa7, 0x17, 0x30, 0x73, 0x9f, 0x5a, 0xdb, 0x8b, 0x13, 0xba, 0xbd, 0x09, 0x05, 0xcc, 0x8e, - 0x27, 0x36, 0x51, 0xbe, 0xf0, 0xba, 0x1d, 0x93, 0x12, 0x59, 0xd5, 0x8c, 0x8e, 0x05, 0xb4, 0xfe, - 0x58, 0x08, 0xcf, 0x82, 0xc6, 0xb4, 0x00, 0xf9, 0x0e, 0x33, 0x84, 0x01, 0x5c, 0x5f, 0x38, 0x9c, - 0x3e, 0x4c, 0x8f, 0x4e, 0x0c, 0x7f, 0x69, 0x37, 0x13, 0x2c, 0xe2, 0x68, 0xc3, 0xcd, 0xa5, 0xf3, - 0xe1, 0xd1, 0xca, 0x14, 0x49, 0xa8, 0x54, 0xcf, 0x0c, 0x8d, 0x2a, 0x8e, 0x41, 0x48, 0x19, 0xae, - 0x1f, 0xaf, 0xa6, 0xbd, 0x04, 0x96, 0x9e, 0x5c, 0x02, 0x1c, 0xd5, 0x65, 0x70, 0x6b, 0x79, 0xe2, - 0xd6, 0x56, 0x66, 0x5a, 0xc2, 0x4a, 0x8d, 0xec, 0xd8, 0xa8, 0xe8, 0x37, 0x70, 0x3b, 0x7d, 0xb0, - 0xa9, 0xff, 0x22, 0x21, 0x05, 0x2f, 0xed, 0x5d, 0x0e, 0x1f, 0x11, 0x98, 0x40, 0x29, 0x6d, 0x10, - 0x3d, 0x5e, 0x99, 0x2e, 0x05, 0x2d, 0x35, 0x2f, 0x83, 0x8e, 0x4a, 0x63, 0x28, 0xc6, 0x7f, 0xe0, - 0x1f, 0x64, 0xf9, 0x30, 0xa5, 0xc7, 0x59, 0x50, 0x61, 0x09, 0xe9, 0xda, 0xb7, 0xee, 0x35, 0xaa, - 0xad, 0xbf, 0x9e, 0xc9, 0xe8, 0xcd, 0x4c, 0x46, 0x6f, 0x67, 0x32, 0xfa, 0x7b, 0x26, 0xa3, 0x1f, - 0xce, 0xe5, 0xdc, 0x9b, 0x73, 0x39, 0xf7, 0xf6, 0x5c, 0xce, 0x7d, 0xdd, 0x34, 0x4c, 0x7e, 0x72, - 0xd6, 0x53, 0xfb, 0x74, 0xa4, 0xb9, 0xc9, 0x77, 0x2d, 0xc2, 0x5f, 0x52, 0xe7, 0x54, 0x5b, 0x71, - 0xc3, 0xf2, 0xee, 0x99, 0xbd, 0x82, 0x77, 0x4d, 0x7c, 0xf2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x3f, 0xdc, 0xac, 0x04, 0x3e, 0x0b, 0x00, 0x00, + // 903 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x3f, 0x6f, 0xdb, 0x56, + 0x10, 0xd7, 0x8b, 0x1d, 0xc5, 0x3a, 0x25, 0x4e, 0x42, 0x3b, 0x0d, 0xcd, 0x26, 0xb4, 0x42, 0xb4, + 0x85, 0xe3, 0xda, 0x24, 0xac, 0x08, 0x06, 0xa2, 0xc5, 0x90, 0xdc, 0x3f, 0xe9, 0xa0, 0xa2, 0xa0, + 0x9d, 0xa5, 0x8b, 0xf0, 0x24, 0xbd, 0xd0, 0x84, 0x25, 0x3e, 0x82, 0xef, 0x49, 0x89, 0xa6, 0x16, + 0x1d, 0x3b, 0xf5, 0x53, 0x14, 0x45, 0x27, 0x0d, 0x5d, 0xfa, 0x01, 0x0a, 0x64, 0x6b, 0xd0, 0x29, + 0x93, 0x51, 0xc8, 0x83, 0x80, 0x7c, 0x8a, 0x82, 0x7f, 0x45, 0x51, 0x54, 0x45, 0x17, 0x19, 0xba, + 0xd8, 0xe4, 0xbb, 0xdf, 0xdd, 0xfd, 0x7e, 0x77, 0xd4, 0xdd, 0x83, 0x87, 0x36, 0x3d, 0xe7, 0x0e, + 0xed, 0x76, 0x35, 0x6c, 0xdb, 0x5d, 0xb3, 0x8d, 0xb9, 0x49, 0x2d, 0x8d, 0xbf, 0x52, 0x6d, 0x87, + 0x72, 0x2a, 0x6c, 0x86, 0x66, 0x35, 0x66, 0x96, 0xee, 0xe2, 0x9e, 0x69, 0x51, 0xcd, 0xfb, 0xeb, + 0x03, 0xa5, 0xad, 0x36, 0x65, 0x3d, 0xca, 0x9a, 0xde, 0x9b, 0xe6, 0xbf, 0x04, 0x26, 0xd9, 0x7f, + 0xd3, 0x5a, 0x98, 0x11, 0x6d, 0x70, 0xd0, 0x22, 0x1c, 0x1f, 0x68, 0x6d, 0x6a, 0x5a, 0x81, 0xfd, + 0x7e, 0x60, 0xef, 0x31, 0x43, 0x1b, 0x1c, 0xb8, 0xff, 0x02, 0xc3, 0xa6, 0x41, 0x0d, 0xea, 0x07, + 0x74, 0x9f, 0x82, 0xd3, 0x52, 0x3a, 0xe3, 0xa1, 0x4d, 0xc2, 0x84, 0x8f, 0x52, 0x11, 0x36, 0x76, + 0x70, 0x2f, 0x84, 0x4c, 0x65, 0xb3, 0x33, 0xec, 0x90, 0x8e, 0xc6, 0x88, 0x33, 0x30, 0xdb, 0xc4, + 0x37, 0x2b, 0x7f, 0x20, 0xb8, 0xdd, 0x60, 0xc6, 0x73, 0xbb, 0x83, 0x39, 0xf9, 0xc6, 0x73, 0x14, + 0x0e, 0xa1, 0x80, 0xfb, 0xfc, 0x8c, 0x3a, 0x26, 0x1f, 0x8a, 0xa8, 0x84, 0x76, 0x0a, 0x75, 0xf1, + 0xaf, 0xdf, 0xf6, 0x37, 0x03, 0xad, 0xb5, 0x4e, 0xc7, 0x21, 0x8c, 0x9d, 0x70, 0xc7, 0xb4, 0x0c, + 0x7d, 0x0a, 0x15, 0x8e, 0x20, 0xef, 0xa7, 0x16, 0xaf, 0x95, 0xd0, 0x4e, 0xb1, 0xfc, 0x40, 0x4d, + 0xab, 0xa9, 0xea, 0x67, 0xa9, 0x17, 0x5e, 0x5f, 0x6c, 0xe7, 0x7e, 0x99, 0x8c, 0x76, 0x91, 0x1e, + 0xb8, 0x55, 0x9f, 0xfe, 0x30, 0x19, 0xed, 0x4e, 0x03, 0xfe, 0x38, 0x19, 0xed, 0x7e, 0x12, 0xd1, + 0x7f, 0x35, 0xa3, 0x31, 0xc1, 0x59, 0xd9, 0x82, 0xfb, 0x89, 0x23, 0x9d, 0x30, 0x9b, 0x5a, 0x8c, + 0x28, 0x7f, 0x22, 0xd8, 0x68, 0x30, 0xe3, 0x84, 0xe3, 0x73, 0x52, 0x9b, 0x86, 0x10, 0xca, 0x70, + 0x03, 0xfb, 0x52, 0x96, 0x8a, 0x0c, 0x81, 0x82, 0x06, 0xd7, 0x99, 0x1b, 0x27, 0x50, 0xb8, 0xa5, + 0x06, 0x70, 0xb7, 0xe3, 0x6a, 0xd0, 0x71, 0xf5, 0x98, 0x9a, 0x96, 0xee, 0xe3, 0x84, 0xcf, 0x61, + 0x2d, 0x28, 0x38, 0x13, 0x57, 0x4a, 0x2b, 0x3b, 0xc5, 0xf2, 0xe3, 0x69, 0x55, 0xfc, 0x8e, 0xa8, + 0x31, 0x52, 0x27, 0x3e, 0xf6, 0x98, 0x5a, 0x2f, 0x4c, 0x43, 0x8f, 0x5c, 0xab, 0x37, 0xdd, 0xca, + 0x84, 0x2c, 0x94, 0x16, 0x7c, 0x98, 0x22, 0x28, 0x14, 0x2c, 0x1c, 0x43, 0x31, 0x56, 0x2a, 0x4f, + 0x5c, 0xb1, 0xfc, 0x28, 0xbd, 0x19, 0x71, 0xff, 0xb8, 0x97, 0x72, 0x04, 0xf7, 0xdc, 0x82, 0x5a, + 0x2c, 0x59, 0x36, 0x31, 0x51, 0xb6, 0xa8, 0x38, 0x09, 0x92, 0xdb, 0xf0, 0x30, 0x35, 0x40, 0xd4, + 0x97, 0x9f, 0x11, 0x6c, 0x36, 0x98, 0xf1, 0x19, 0xe9, 0x12, 0x03, 0x73, 0x72, 0x4a, 0xbf, 0xc4, + 0x9c, 0xbc, 0xc4, 0x43, 0xe1, 0xa9, 0xc7, 0xbf, 0x99, 0xb5, 0x39, 0x80, 0x6d, 0x3b, 0x38, 0x11, + 0x6a, 0x70, 0xdb, 0xf0, 0xa3, 0x44, 0xee, 0xd7, 0x96, 0xb8, 0xaf, 0x07, 0x0e, 0xc1, 0x69, 0xf5, + 0x8e, 0xab, 0x22, 0x4e, 0x40, 0x69, 0xc3, 0x83, 0x34, 0x9e, 0xef, 0xb7, 0xde, 0xbf, 0x22, 0x10, + 0xbd, 0x7a, 0x75, 0x82, 0x3c, 0x5f, 0x38, 0xb4, 0xf7, 0x7f, 0xad, 0x88, 0x02, 0xa5, 0x45, 0x5c, + 0xa3, 0xf6, 0xfe, 0x8e, 0xe0, 0x83, 0x06, 0x33, 0x4e, 0x1d, 0x6c, 0xb1, 0x17, 0xc4, 0x89, 0x7f, + 0x42, 0x47, 0xb0, 0xce, 0x68, 0xdf, 0x69, 0x93, 0xcc, 0x8a, 0x6e, 0xf9, 0xf8, 0x50, 0xd4, 0x57, + 0xb0, 0xd1, 0x21, 0x8c, 0x9b, 0x96, 0x17, 0x2f, 0xb3, 0x30, 0x21, 0xe6, 0x14, 0x8a, 0xdb, 0x70, + 0xc5, 0x25, 0xe8, 0x28, 0x04, 0xe4, 0x74, 0xea, 0xef, 0xb7, 0xe7, 0x13, 0x04, 0xeb, 0xb3, 0x53, + 0xeb, 0x3f, 0xcf, 0x5e, 0x01, 0x56, 0x2d, 0xdc, 0xf3, 0xe7, 0x52, 0x41, 0xf7, 0x9e, 0x85, 0x3d, + 0x28, 0x60, 0xd6, 0xec, 0x9b, 0x16, 0x3f, 0xac, 0x88, 0x2b, 0x25, 0xb4, 0xb3, 0x5a, 0xbf, 0xf5, + 0xee, 0x62, 0x7b, 0x7a, 0xf8, 0x2c, 0xa7, 0xaf, 0x61, 0xf6, 0xdc, 0x7b, 0x16, 0x6a, 0x70, 0x03, + 0xb3, 0xa6, 0xbb, 0xad, 0xc4, 0xd5, 0x25, 0xc3, 0xad, 0x5e, 0x7c, 0x77, 0xb1, 0x1d, 0xa2, 0x9f, + 0xe5, 0xf4, 0x3c, 0x66, 0xee, 0x71, 0x75, 0x7d, 0x76, 0x7e, 0xd7, 0xd7, 0x20, 0x8f, 0xd9, 0xe9, + 0xd0, 0x26, 0xca, 0xd7, 0xde, 0xb7, 0x10, 0x13, 0x1a, 0x15, 0xb2, 0x12, 0x2d, 0x0d, 0xb4, 0x7c, + 0x69, 0x84, 0x9b, 0xa2, 0x3c, 0xca, 0xc3, 0x4a, 0x83, 0x19, 0x42, 0x07, 0x6e, 0xce, 0xac, 0xae, + 0x8f, 0xd3, 0xbd, 0x13, 0xab, 0x41, 0xda, 0xcf, 0x04, 0x8b, 0x38, 0xda, 0x70, 0x67, 0x6e, 0x7b, + 0x3c, 0x5e, 0x18, 0x22, 0x09, 0x95, 0x0e, 0x32, 0x43, 0xa3, 0x8c, 0x03, 0x10, 0x52, 0x46, 0xef, + 0xa7, 0x8b, 0x69, 0xcf, 0x81, 0xa5, 0x27, 0x57, 0x00, 0x47, 0x79, 0x19, 0xdc, 0x9d, 0x9f, 0xc7, + 0xbb, 0x0b, 0x23, 0xcd, 0x61, 0xa5, 0x72, 0x76, 0x6c, 0x94, 0xf4, 0x3b, 0xb8, 0x97, 0x3e, 0xf6, + 0xd4, 0x7f, 0x91, 0x90, 0x82, 0x97, 0x0e, 0xaf, 0x86, 0x8f, 0x08, 0x0c, 0x61, 0x23, 0x6d, 0x4c, + 0xed, 0x2d, 0x0c, 0x97, 0x82, 0x96, 0x2a, 0x57, 0x41, 0x47, 0xa9, 0x31, 0x14, 0xe3, 0x3f, 0xff, + 0x8f, 0xb2, 0x7c, 0x98, 0xd2, 0x5e, 0x16, 0x54, 0x98, 0x42, 0xba, 0xfe, 0xbd, 0x7b, 0xc9, 0xaa, + 0xeb, 0xaf, 0xc7, 0x32, 0x7a, 0x33, 0x96, 0xd1, 0xdb, 0xb1, 0x8c, 0xfe, 0x1e, 0xcb, 0xe8, 0xa7, + 0x4b, 0x39, 0xf7, 0xe6, 0x52, 0xce, 0xbd, 0xbd, 0x94, 0x73, 0xdf, 0x56, 0x0c, 0x93, 0x9f, 0xf5, + 0x5b, 0x6a, 0x9b, 0xf6, 0x34, 0x37, 0xf8, 0xbe, 0x45, 0xf8, 0x4b, 0xea, 0x9c, 0x6b, 0x0b, 0xee, + 0x5f, 0xde, 0x2d, 0xb4, 0x95, 0xf7, 0x2e, 0x91, 0x4f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x1d, + 0x19, 0xb2, 0x0c, 0x5c, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1518,14 +1519,14 @@ func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateParam_AsInt64) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParam_AsUint64) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParam_AsInt64) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParam_AsUint64) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarintTx(dAtA, i, uint64(m.AsInt64)) + i = encodeVarintTx(dAtA, i, uint64(m.AsUint64)) i-- dAtA[i] = 0x18 return len(dAtA) - i, nil @@ -1785,13 +1786,13 @@ func (m *MsgUpdateParam) Size() (n int) { return n } -func (m *MsgUpdateParam_AsInt64) Size() (n int) { +func (m *MsgUpdateParam_AsUint64) Size() (n int) { if m == nil { return 0 } var l int _ = l - n += 1 + sovTx(uint64(m.AsInt64)) + n += 1 + sovTx(uint64(m.AsUint64)) return n } func (m *MsgUpdateParam_AsCoin) Size() (n int) { @@ -3019,9 +3020,9 @@ func (m *MsgUpdateParam) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AsUint64", wireType) } - var v int64 + var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3031,12 +3032,12 @@ func (m *MsgUpdateParam) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + v |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.AsType = &MsgUpdateParam_AsInt64{v} + m.AsType = &MsgUpdateParam_AsUint64{v} case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AsCoin", wireType) diff --git a/x/proof/keeper/msg_server_create_claim.go b/x/proof/keeper/msg_server_create_claim.go index dd53f3d78..6bfa498d5 100644 --- a/x/proof/keeper/msg_server_create_claim.go +++ b/x/proof/keeper/msg_server_create_claim.go @@ -80,7 +80,7 @@ func (k msgServer) CreateClaim( } // Get the number of claimed compute units in the claim - numClaimComputeUnits, err = claim.GetNumComputeUnits() + numClaimComputeUnits, err = claim.GetNumClaimedComputeUnits() if err != nil { return nil, status.Error(codes.Internal, types.ErrProofInvalidClaimRootHash.Wrapf("%v", err).Error()) } @@ -123,17 +123,19 @@ func (k msgServer) CreateClaim( case true: claimUpsertEvent = proto.Message( &types.EventClaimUpdated{ - Claim: &claim, - NumRelays: numRelays, - NumComputeUnits: numClaimComputeUnits, + Claim: &claim, + NumRelays: numRelays, + NumClaimedComputeUnits: numClaimComputeUnits, + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt }, ) case false: claimUpsertEvent = proto.Message( &types.EventClaimCreated{ - Claim: &claim, - NumRelays: numRelays, - NumComputeUnits: numClaimComputeUnits, + Claim: &claim, + NumRelays: numRelays, + NumClaimedComputeUnits: numClaimComputeUnits, + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt }, ) } diff --git a/x/proof/keeper/msg_server_create_claim_test.go b/x/proof/keeper/msg_server_create_claim_test.go index 8a34f4fb7..87a8a81fd 100644 --- a/x/proof/keeper/msg_server_create_claim_test.go +++ b/x/proof/keeper/msg_server_create_claim_test.go @@ -51,8 +51,8 @@ func TestMsgServer_CreateClaim_Success(t *testing.T) { ) int64 merkleRoot smt.MerkleSumRoot // The Compute Units Per Relay for the service used in the test. - serviceComputeUnitsPerRelay uint64 - expectedNumComputeUnits uint64 + serviceComputeUnitsPerRelay uint64 + expectedNumClaimedComputeUnits uint64 }{ { desc: "claim message height equals supplier's earliest claim commit height", @@ -64,23 +64,23 @@ func TestMsgServer_CreateClaim_Success(t *testing.T) { supplierOperatorAddr, ) }, - merkleRoot: defaultMerkleRoot, - serviceComputeUnitsPerRelay: computeUnitsPerRelay, - expectedNumComputeUnits: expectedNumComputeUnits, + merkleRoot: defaultMerkleRoot, + serviceComputeUnitsPerRelay: computeUnitsPerRelay, + expectedNumClaimedComputeUnits: expectedNumComputeUnits, }, { - desc: "claim message height equals claim window close height", - getClaimMsgHeight: shared.GetClaimWindowCloseHeight, - merkleRoot: defaultMerkleRoot, - serviceComputeUnitsPerRelay: computeUnitsPerRelay, - expectedNumComputeUnits: expectedNumComputeUnits, + desc: "claim message height equals claim window close height", + getClaimMsgHeight: shared.GetClaimWindowCloseHeight, + merkleRoot: defaultMerkleRoot, + serviceComputeUnitsPerRelay: computeUnitsPerRelay, + expectedNumClaimedComputeUnits: expectedNumComputeUnits, }, { - desc: "claim message for service with >1 compute units per relay", - getClaimMsgHeight: shared.GetClaimWindowCloseHeight, - merkleRoot: customComputeUnitsPerRelayMerkleRoot, - serviceComputeUnitsPerRelay: nonDefaultComputeUnitsPerRelay, - expectedNumComputeUnits: expectedNonDefaultNumComputeUnits, + desc: "claim message for service with >1 compute units per relay", + getClaimMsgHeight: shared.GetClaimWindowCloseHeight, + merkleRoot: customComputeUnitsPerRelayMerkleRoot, + serviceComputeUnitsPerRelay: nonDefaultComputeUnitsPerRelay, + expectedNumClaimedComputeUnits: expectedNonDefaultNumComputeUnits, }, } @@ -175,7 +175,7 @@ func TestMsgServer_CreateClaim_Success(t *testing.T) { require.Len(t, claimCreatedEvents, 1) require.EqualValues(t, &claim, claimCreatedEvents[0].GetClaim()) - require.Equal(t, uint64(test.expectedNumComputeUnits), claimCreatedEvents[0].GetNumComputeUnits()) + require.Equal(t, uint64(test.expectedNumClaimedComputeUnits), claimCreatedEvents[0].GetNumClaimedComputeUnits()) require.Equal(t, uint64(expectedNumRelays), claimCreatedEvents[0].GetNumRelays()) }) } @@ -599,7 +599,7 @@ func TestMsgServer_CreateClaim_Error_ComputeUnitsMismatch(t *testing.T) { // use the test claim message to create a claim object to get the number of relays and compute units in the claim. testClaim := types.Claim{RootHash: testClaimMsg.GetRootHash()} - testClaimNumComputeUnits, err := testClaim.GetNumComputeUnits() + testClaimNumComputeUnits, err := testClaim.GetNumClaimedComputeUnits() require.NoError(t, err) testClaimNumRelays, err := testClaim.GetNumRelays() require.NoError(t, err) diff --git a/x/proof/keeper/msg_server_submit_proof.go b/x/proof/keeper/msg_server_submit_proof.go index ed819784a..4101cbfed 100644 --- a/x/proof/keeper/msg_server_submit_proof.go +++ b/x/proof/keeper/msg_server_submit_proof.go @@ -15,9 +15,9 @@ import ( "github.com/pokt-network/poktroll/telemetry" "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - "github.com/pokt-network/poktroll/x/tokenomics" ) // SubmitProof is the server handler to submit and store a proof on-chain. @@ -42,10 +42,10 @@ func (k msgServer) SubmitProof( ) (_ *types.MsgSubmitProofResponse, err error) { // Declare claim to reference in telemetry. var ( - claim = new(types.Claim) - isExistingProof bool - numRelays uint64 - numComputeUnits uint64 + claim = new(types.Claim) + isExistingProof bool + numRelays uint64 + numClaimComputeUnits uint64 ) // Defer telemetry calls so that they reference the final values the relevant variables. @@ -54,7 +54,7 @@ func (k msgServer) SubmitProof( if !isExistingProof { telemetry.ClaimCounter(types.ClaimProofStage_PROVEN, 1, err) telemetry.ClaimRelaysCounter(types.ClaimProofStage_PROVEN, numRelays, err) - telemetry.ClaimComputeUnitsCounter(types.ClaimProofStage_PROVEN, numComputeUnits, err) + telemetry.ClaimComputeUnitsCounter(types.ClaimProofStage_PROVEN, numClaimComputeUnits, err) } }() @@ -120,11 +120,12 @@ func (k msgServer) SubmitProof( if err != nil { return nil, status.Error(codes.Internal, types.ErrProofInvalidClaimRootHash.Wrap(err.Error()).Error()) } - numComputeUnits, err = claim.GetNumComputeUnits() + // DEV_NOTE: It is assumed that numClaimComputeUnits = numRelays * serviceComputeUnitsPerRelay + // has been checked during the claim creation process. + numClaimComputeUnits, err = claim.GetNumClaimedComputeUnits() if err != nil { return nil, status.Error(codes.Internal, types.ErrProofInvalidClaimRootHash.Wrap(err.Error()).Error()) } - // DEV_NOTE: It is assumed that numComputeUnits = numRelays * serviceComputeUnitsPerRelay // Check if a prior proof already exists. _, isExistingProof = k.GetProof(ctx, proof.SessionHeader.SessionId, proof.SupplierOperatorAddress) @@ -139,19 +140,21 @@ func (k msgServer) SubmitProof( case true: proofUpsertEvent = proto.Message( &types.EventProofUpdated{ - Claim: claim, - Proof: &proof, - NumRelays: numRelays, - NumComputeUnits: numComputeUnits, + Claim: claim, + Proof: &proof, + NumRelays: numRelays, + NumClaimedComputeUnits: numClaimComputeUnits, + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt }, ) case false: proofUpsertEvent = proto.Message( &types.EventProofSubmitted{ - Claim: claim, - Proof: &proof, - NumRelays: numRelays, - NumComputeUnits: numComputeUnits, + Claim: claim, + Proof: &proof, + NumRelays: numRelays, + NumClaimedComputeUnits: numClaimComputeUnits, + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt }, ) } @@ -221,22 +224,19 @@ func (k Keeper) ProofRequirementForClaim(ctx context.Context, claim *types.Claim telemetry.ProofRequirementCounter(requirementReason, err) }() - // NB: Assumption that claim is non-nil and has a valid root sum because it - // is retrieved from the store and validated, on-chain, at time of creation. - // TODO(@red-0ne, #781): Ensure we're using the scaled/estimated compute units here. - var numClaimComputeUnits uint64 - numClaimComputeUnits, err = claim.GetNumComputeUnits() - if err != nil { - return requirementReason, err - } - proofParams := k.GetParams(ctx) sharedParams := k.sharedKeeper.GetParams(ctx) + serviceId := claim.GetSessionHeader().GetServiceId() + relayMiningDifficulty, found := k.serviceKeeper.GetRelayMiningDifficulty(ctx, serviceId) + if !found { + relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(ctx, logger, serviceId, servicekeeper.TargetNumRelays) + } + // Retrieve the number of tokens claimed to compare against the threshold. // Different services have varying compute_unit -> token multipliers, so the // threshold value is done in a common unit denomination. - claimeduPOKT, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits) + claimeduPOKT, err := claim.GetClaimeduPOKT(sharedParams, relayMiningDifficulty) if err != nil { return requirementReason, err } diff --git a/x/proof/keeper/msg_server_submit_proof_test.go b/x/proof/keeper/msg_server_submit_proof_test.go index aca0937e1..d05e0a7d1 100644 --- a/x/proof/keeper/msg_server_submit_proof_test.go +++ b/x/proof/keeper/msg_server_submit_proof_test.go @@ -46,8 +46,7 @@ var ( // - the relay difficulty target hash to the easiest difficulty so that these tests don't need to mine for valid relays. // - the proof request probability to 1 so that all test sessions require a proof. testProofParams = prooftypes.Params{ - RelayDifficultyTargetHash: protocol.BaseRelayDifficultyHashBz, - ProofRequestProbability: 1, + ProofRequestProbability: 1, } ) @@ -99,7 +98,6 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { // Set proof keeper params to disable relay mining and always require a proof. proofParams := keepers.Keeper.GetParams(ctx) proofParams.ProofRequestProbability = testProofParams.ProofRequestProbability - proofParams.RelayDifficultyTargetHash = testProofParams.RelayDifficultyTargetHash err := keepers.Keeper.SetParams(ctx, proofParams) require.NoError(t, err) @@ -157,7 +155,7 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { // Submit the corresponding proof. numRelays := uint64(5) - numComputeUnits := numRelays * service.ComputeUnitsPerRelay + numClaimComputeUnits := numRelays * service.ComputeUnitsPerRelay sessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, @@ -240,7 +238,8 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { require.EqualValues(t, claim, proofSubmittedEvent.GetClaim()) require.EqualValues(t, &proofs[0], proofSubmittedEvent.GetProof()) require.Equal(t, uint64(numRelays), proofSubmittedEvent.GetNumRelays()) - require.Equal(t, uint64(numComputeUnits), proofSubmittedEvent.GetNumComputeUnits()) + require.Equal(t, uint64(numClaimComputeUnits), proofSubmittedEvent.GetNumClaimedComputeUnits()) + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt assertions }) } } @@ -259,7 +258,6 @@ func TestMsgServer_SubmitProof_Error_OutsideOfWindow(t *testing.T) { // Set proof keeper params to disable relaymining and always require a proof. proofParams := keepers.Keeper.GetParams(ctx) proofParams.ProofRequestProbability = testProofParams.ProofRequestProbability - proofParams.RelayDifficultyTargetHash = testProofParams.RelayDifficultyTargetHash err := keepers.Keeper.SetParams(ctx, proofParams) require.NoError(t, err) @@ -705,7 +703,6 @@ func TestMsgServer_SubmitProof_FailSubmittingNonRequiredProof(t *testing.T) { // Set proof keeper params to disable relay mining but never require a proof. proofParams := keepers.Keeper.GetParams(ctx) proofParams.ProofRequestProbability = 0 - proofParams.RelayDifficultyTargetHash = testProofParams.RelayDifficultyTargetHash err := keepers.Keeper.SetParams(ctx, proofParams) require.NoError(t, err) diff --git a/x/proof/keeper/msg_server_update_param.go b/x/proof/keeper/msg_server_update_param.go index df698a38b..6e6b3603c 100644 --- a/x/proof/keeper/msg_server_update_param.go +++ b/x/proof/keeper/msg_server_update_param.go @@ -2,6 +2,10 @@ package keeper import ( "context" + "fmt" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/pokt-network/poktroll/x/proof/types" ) @@ -12,65 +16,59 @@ func (k msgServer) UpdateParam( ctx context.Context, msg *types.MsgUpdateParam, ) (*types.MsgUpdateParamResponse, error) { + logger := k.logger.With( + "method", "UpdateParam", + "param_name", msg.Name, + ) + if err := msg.ValidateBasic(); err != nil { - return nil, err + return nil, status.Error(codes.InvalidArgument, err.Error()) } if k.GetAuthority() != msg.Authority { - return nil, types.ErrProofInvalidSigner.Wrapf("invalid authority; expected %s, got %s", k.GetAuthority(), msg.Authority) + return nil, status.Error( + codes.InvalidArgument, + types.ErrProofInvalidSigner.Wrapf( + "invalid authority; expected %s, got %s", + k.GetAuthority(), msg.Authority, + ).Error(), + ) } params := k.GetParams(ctx) switch msg.Name { - case types.ParamRelayDifficultyTargetHash: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsBytes) - if !ok { - return nil, types.ErrProofParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.RelayDifficultyTargetHash = value.AsBytes case types.ParamProofRequestProbability: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsFloat) - if !ok { - return nil, types.ErrProofParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.ProofRequestProbability = value.AsFloat + logger = logger.With("param_value", msg.GetAsFloat()) + params.ProofRequestProbability = msg.GetAsFloat() case types.ParamProofRequirementThreshold: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsCoin) - if !ok { - return nil, types.ErrProofParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.ProofRequirementThreshold = value.AsCoin + logger = logger.With("param_value", msg.GetAsCoin()) + params.ProofRequirementThreshold = msg.GetAsCoin() case types.ParamProofMissingPenalty: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsCoin) - if !ok { - return nil, types.ErrProofParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.ProofMissingPenalty = value.AsCoin + logger = logger.With("param_value", msg.GetAsCoin()) + params.ProofMissingPenalty = msg.GetAsCoin() case types.ParamProofSubmissionFee: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsCoin) - if !ok { - return nil, types.ErrProofParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.ProofSubmissionFee = value.AsCoin + logger = logger.With("param_value", msg.GetAsCoin()) + params.ProofSubmissionFee = msg.GetAsCoin() default: - return nil, types.ErrProofParamInvalid.Wrapf("unsupported param %q", msg.Name) + return nil, status.Error( + codes.InvalidArgument, + types.ErrProofParamInvalid.Wrapf("unsupported param %q", msg.Name).Error(), + ) } if err := params.ValidateBasic(); err != nil { - return nil, err + return nil, status.Error(codes.InvalidArgument, err.Error()) } if err := k.SetParams(ctx, params); err != nil { - return nil, err + err = fmt.Errorf("unable to set params: %w", err) + logger.Error(fmt.Sprintf("ERROR: %s", err)) + return nil, status.Error(codes.Internal, err.Error()) } updatedParams := k.GetParams(ctx) + return &types.MsgUpdateParamResponse{ Params: &updatedParams, }, nil diff --git a/x/proof/keeper/msg_server_update_param_test.go b/x/proof/keeper/msg_server_update_param_test.go index 52078f52a..a53d688ec 100644 --- a/x/proof/keeper/msg_server_update_param_test.go +++ b/x/proof/keeper/msg_server_update_param_test.go @@ -1,7 +1,6 @@ package keeper_test import ( - "encoding/hex" "testing" "cosmossdk.io/math" @@ -16,33 +15,6 @@ import ( prooftypes "github.com/pokt-network/poktroll/x/proof/types" ) -func TestMsgUpdateParam_UpdateMinRelayDifficultyBitsOnly(t *testing.T) { - expectedRelayDifficultyTargetHash, _ := hex.DecodeString("0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff") - - // Set the parameters to their default values - k, msgSrv, ctx := setupMsgServer(t) - defaultParams := prooftypes.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, expectedRelayDifficultyTargetHash, defaultParams.RelayDifficultyTargetHash) - - // Update the min stake. - updateParamMsg := &prooftypes.MsgUpdateParam{ - Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), - Name: prooftypes.ParamRelayDifficultyTargetHash, - AsType: &prooftypes.MsgUpdateParam_AsBytes{AsBytes: expectedRelayDifficultyTargetHash}, - } - res, err := msgSrv.UpdateParam(ctx, updateParamMsg) - require.NoError(t, err) - - require.NotEqual(t, defaultParams.RelayDifficultyTargetHash, res.Params.RelayDifficultyTargetHash) - require.Equal(t, expectedRelayDifficultyTargetHash, res.Params.RelayDifficultyTargetHash) - - // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "RelayDifficultyTargetHash") -} - func TestMsgUpdateParam_UpdateProofRequestProbabilityOnly(t *testing.T) { var expectedProofRequestProbability float32 = 0.1 @@ -67,7 +39,7 @@ func TestMsgUpdateParam_UpdateProofRequestProbabilityOnly(t *testing.T) { require.Equal(t, expectedProofRequestProbability, res.Params.ProofRequestProbability) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ProofRequestProbability") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, string(prooftypes.KeyProofRequestProbability)) } func TestMsgUpdateParam_UpdateProofRequirementThresholdOnly(t *testing.T) { @@ -94,7 +66,7 @@ func TestMsgUpdateParam_UpdateProofRequirementThresholdOnly(t *testing.T) { require.Equal(t, &expectedProofRequirementThreshold, res.Params.ProofRequirementThreshold) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ProofRequirementThreshold") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, string(prooftypes.KeyProofRequirementThreshold)) } func TestMsgUpdateParam_UpdateProofMissingPenaltyOnly(t *testing.T) { @@ -121,7 +93,7 @@ func TestMsgUpdateParam_UpdateProofMissingPenaltyOnly(t *testing.T) { require.Equal(t, &expectedProofMissingPenalty, res.Params.ProofMissingPenalty) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ProofMissingPenalty") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, string(prooftypes.KeyProofMissingPenalty)) } func TestMsgUpdateParam_UpdateProofSubmissionFeeOnly(t *testing.T) { @@ -148,5 +120,5 @@ func TestMsgUpdateParam_UpdateProofSubmissionFeeOnly(t *testing.T) { require.Equal(t, &expectedProofSubmissionFee, res.Params.ProofSubmissionFee) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, "ProofSubmissionFee") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &defaultParams, res.Params, string(prooftypes.KeyProofSubmissionFee)) } diff --git a/x/proof/keeper/msg_update_params_test.go b/x/proof/keeper/msg_update_params_test.go index f50570c46..d7509dc93 100644 --- a/x/proof/keeper/msg_update_params_test.go +++ b/x/proof/keeper/msg_update_params_test.go @@ -42,9 +42,9 @@ func TestMsgUpdateParams(t *testing.T) { params: &types.MsgUpdateParams{ Authority: k.GetAuthority(), Params: types.Params{ + ProofRequirementThreshold: &types.DefaultProofRequirementThreshold, ProofMissingPenalty: &types.DefaultProofMissingPenalty, ProofSubmissionFee: &types.MinProofSubmissionFee, - RelayDifficultyTargetHash: types.DefaultRelayDifficultyTargetHash, }, }, shouldError: false, diff --git a/x/proof/keeper/params_test.go b/x/proof/keeper/params_test.go index 50370a3d2..43e197d02 100644 --- a/x/proof/keeper/params_test.go +++ b/x/proof/keeper/params_test.go @@ -19,35 +19,6 @@ func TestGetParams(t *testing.T) { require.NoError(t, k.SetParams(ctx, params)) require.EqualValues(t, params, k.GetParams(ctx)) } -func TestParams_ValidateMinRelayDifficulty(t *testing.T) { - tests := []struct { - desc string - relayDifficultyTargetHash any - expectedErr error - }{ - { - desc: "invalid type", - relayDifficultyTargetHash: int64(-1), - expectedErr: prooftypes.ErrProofParamInvalid.Wrapf("invalid parameter type: int64"), - }, - { - desc: "valid RelayDifficultyTargetHash", - relayDifficultyTargetHash: prooftypes.DefaultRelayDifficultyTargetHash, - }, - } - - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - err := prooftypes.ValidateRelayDifficultyTargetHash(tt.relayDifficultyTargetHash) - if tt.expectedErr != nil { - require.Error(t, err) - require.Contains(t, err.Error(), tt.expectedErr.Error()) - } else { - require.NoError(t, err) - } - }) - } -} func TestParams_ValidateProofRequestProbability(t *testing.T) { tests := []struct { @@ -135,7 +106,7 @@ func TestParams_ValidateProofMissingPenalty(t *testing.T) { { desc: "invalid denomination", proofMissingPenalty: &invalidDenomCoin, - expectedErr: prooftypes.ErrProofParamInvalid.Wrap("invalid coin denom: invalid_denom"), + expectedErr: prooftypes.ErrProofParamInvalid.Wrap("invalid proof_missing_penalty denom: invalid_denom"), }, { desc: "missing", @@ -153,12 +124,12 @@ func TestParams_ValidateProofMissingPenalty(t *testing.T) { }, } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - err := prooftypes.ValidateProofMissingPenalty(tt.proofMissingPenalty) - if tt.expectedErr != nil { + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := prooftypes.ValidateProofMissingPenalty(test.proofMissingPenalty) + if test.expectedErr != nil { require.Error(t, err) - require.Contains(t, err.Error(), tt.expectedErr.Error()) + require.EqualError(t, err, test.expectedErr.Error()) } else { require.NoError(t, err) } @@ -184,7 +155,7 @@ func TestParams_ValidateProofSubmissionFee(t *testing.T) { { desc: "invalid denomination", proofSubmissionFee: &invalidDenomCoin, - expectedErr: prooftypes.ErrProofParamInvalid.Wrap("invalid coin denom: invalid_denom"), + expectedErr: prooftypes.ErrProofParamInvalid.Wrap("invalid proof_submission_fee denom: invalid_denom"), }, { desc: "missing", @@ -200,7 +171,7 @@ func TestParams_ValidateProofSubmissionFee(t *testing.T) { desc: "below minimum", proofSubmissionFee: &belowMinProofSubmissionFee, expectedErr: prooftypes.ErrProofParamInvalid.Wrapf( - "ProofSubmissionFee param is below minimum value %s: got %s", + "proof_submission_fee is below minimum value %s: got %s", prooftypes.MinProofSubmissionFee, belowMinProofSubmissionFee, ), @@ -211,12 +182,12 @@ func TestParams_ValidateProofSubmissionFee(t *testing.T) { }, } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - err := prooftypes.ValidateProofSubmissionFee(tt.proofSubmissionFee) - if tt.expectedErr != nil { + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := prooftypes.ValidateProofSubmissionFee(test.proofSubmissionFee) + if test.expectedErr != nil { require.Error(t, err) - require.Contains(t, err.Error(), tt.expectedErr.Error()) + require.EqualError(t, err, test.expectedErr.Error()) } else { require.NoError(t, err) } diff --git a/x/proof/keeper/proof_validation.go b/x/proof/keeper/proof_validation.go index f771ca626..46a0af656 100644 --- a/x/proof/keeper/proof_validation.go +++ b/x/proof/keeper/proof_validation.go @@ -36,6 +36,7 @@ import ( "github.com/pokt-network/poktroll/pkg/crypto/protocol" "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" ) @@ -162,19 +163,17 @@ func (k Keeper) EnsureValidProof( } logger.Debug("successfully verified relay response signature") - // Get the proof module's governance parameters. - // TODO_BETA(@red-0ne): Ensure we use the difficulty from the service and add - // a test for a proof with an invalid difficulty. - params := k.GetParams(ctx) - serviceRelayDifficultyTargetHash := params.RelayDifficultyTargetHash - if len(serviceRelayDifficultyTargetHash) == 0 { - serviceRelayDifficultyTargetHash = types.DefaultRelayDifficultyTargetHash + // Get the service's relay mining difficulty. + serviceRelayDifficulty, found := k.serviceKeeper.GetRelayMiningDifficulty(ctx, sessionHeader.GetServiceId()) + if !found { + // If the relay mining difficulty is not found, use the default relay mining difficulty. + serviceRelayDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(ctx, k.Logger(), sessionHeader.GetServiceId(), servicekeeper.TargetNumRelays) } // Verify the relay difficulty is above the minimum required to earn rewards. if err = validateRelayDifficulty( relayBz, - serviceRelayDifficultyTargetHash, + serviceRelayDifficulty.GetTargetHash(), ); err != nil { return types.ErrProofInvalidRelayDifficulty.Wrapf("failed to validate relay difficulty for service %s due to: %v", sessionHeader.ServiceId, err) } diff --git a/x/proof/keeper/proof_validation_test.go b/x/proof/keeper/proof_validation_test.go index 13222338d..8d118eade 100644 --- a/x/proof/keeper/proof_validation_test.go +++ b/x/proof/keeper/proof_validation_test.go @@ -1,10 +1,12 @@ package keeper_test import ( + "context" "encoding/hex" "testing" "cosmossdk.io/depinject" + "cosmossdk.io/log" ring_secp256k1 "github.com/athanorlabs/go-dleq/secp256k1" "github.com/cosmos/cosmos-sdk/crypto/keyring" cosmostypes "github.com/cosmos/cosmos-sdk/types" @@ -22,6 +24,7 @@ import ( "github.com/pokt-network/poktroll/testutil/testtree" "github.com/pokt-network/poktroll/x/proof/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" servicetypes "github.com/pokt-network/poktroll/x/service/types" "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" @@ -588,17 +591,12 @@ func TestEnsureValidProof_Error(t *testing.T) { { desc: "relay difficulty must be greater than or equal to a high difficulty (low target hash)", newProof: func(t *testing.T) *prooftypes.Proof { - // Set the minimum relay difficulty to a non-zero value such that the relays - // constructed by the test helpers have a negligible chance of being valid. - err = keepers.Keeper.SetParams(ctx, prooftypes.Params{ - RelayDifficultyTargetHash: lowTargetHash, - }) - require.NoError(t, err) - + serviceId := validSessionHeader.GetServiceId() + logger := log.NewNopLogger() + setRelayMiningDifficultyHash(ctx, keepers.ServiceKeeper, serviceId, lowTargetHash, logger) // Reset the minimum relay difficulty to zero after this test case. t.Cleanup(func() { - err = keepers.Keeper.SetParams(ctx, prooftypes.DefaultParams()) - require.NoError(t, err) + setRelayMiningDifficultyHash(ctx, keepers.ServiceKeeper, serviceId, protocol.BaseRelayDifficultyHashBz, logger) }) // Construct a proof message with a session tree containing @@ -777,3 +775,15 @@ func TestEnsureValidProof_Error(t *testing.T) { }) } } + +func setRelayMiningDifficultyHash( + ctx context.Context, + serviceKeeper prooftypes.ServiceKeeper, + serviceId string, + targetHash []byte, + logger log.Logger, +) { + relayMiningDifficulty := servicekeeper.NewDefaultRelayMiningDifficulty(ctx, logger, serviceId, servicekeeper.TargetNumRelays) + relayMiningDifficulty.TargetHash = targetHash + serviceKeeper.SetRelayMiningDifficulty(ctx, relayMiningDifficulty) +} diff --git a/x/proof/types/claim.go b/x/proof/types/claim.go index a2f46fb1f..08b3dc406 100644 --- a/x/proof/types/claim.go +++ b/x/proof/types/claim.go @@ -1,15 +1,23 @@ package types import ( + "math/big" + + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pokt-network/smt" + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/pkg/crypto/protocol" poktrand "github.com/pokt-network/poktroll/pkg/crypto/rand" + servicetypes "github.com/pokt-network/poktroll/x/service/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) -// GetNumComputeUnits returns the number of compute units for a given claim +// GetNumClaimedComputeUnits returns the number of compute units for a given claim // as determined by the sum of the root hash. -func (claim *Claim) GetNumComputeUnits() (numComputeUnits uint64, err error) { +func (claim *Claim) GetNumClaimedComputeUnits() (numClaimedComputeUnits uint64, err error) { return smt.MerkleSumRoot(claim.GetRootHash()).Sum() } @@ -19,6 +27,79 @@ func (claim *Claim) GetNumRelays() (numRelays uint64, err error) { return smt.MerkleSumRoot(claim.GetRootHash()).Count() } +// GetNumEstimatedComputeUnits returns the claim's estimated number of compute units. +func (claim *Claim) GetNumEstimatedComputeUnits( + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) (numEstimatedComputeUnits uint64, err error) { + numEstimatedComputeUnitsRat, err := claim.getNumEstimatedComputeUnitsRat(relayMiningDifficulty) + if err != nil { + return 0, err + } + + numerator := numEstimatedComputeUnitsRat.Num() + denominator := numEstimatedComputeUnitsRat.Denom() + + return new(big.Int).Div(numerator, denominator).Uint64(), nil +} + +// GetClaimeduPOKT returns the claim's reward based on the relay mining difficulty +// and global network parameters. +func (claim *Claim) GetClaimeduPOKT( + sharedParams sharedtypes.Params, + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) (sdk.Coin, error) { + // Get the estimated number of compute units as a ratio to calculate the reward + // to avoid precision loss. + numEstimatedComputeUnitsRat, err := claim.getNumEstimatedComputeUnitsRat(relayMiningDifficulty) + if err != nil { + return sdk.Coin{}, err + } + + computeUnitsToTokenMultiplierRat := new(big.Rat).SetUint64(sharedParams.GetComputeUnitsToTokensMultiplier()) + + // CUTTM is a GLOBAL network wide parameter. + upoktAmountRat := new(big.Rat).Mul(numEstimatedComputeUnitsRat, computeUnitsToTokenMultiplierRat) + + // Perform the division as late as possible to minimize precision loss. + upoktAmount := new(big.Int).Div(upoktAmountRat.Num(), upoktAmountRat.Denom()) + if upoktAmount.Sign() < 0 { + return sdk.Coin{}, ErrProofInvalidClaimedAmount.Wrapf( + "num estimated compute units (%s) * CUTTM (%d) resulted in a negative amount: %s", + numEstimatedComputeUnitsRat.RatString(), + sharedParams.GetComputeUnitsToTokensMultiplier(), + upoktAmountRat, + ) + } + + return sdk.NewCoin(volatile.DenomuPOKT, math.NewIntFromBigInt(upoktAmount)), nil +} + +// getNumEstimatedComputeUnitsRat returns the estimated claim's number of compute units +// as a ratio. +func (claim *Claim) getNumEstimatedComputeUnitsRat( + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) (numEstimatedComputeUnits *big.Rat, err error) { + // Ensure the claim's service ID matches the relay mining difficulty service ID. + if claim.GetSessionHeader().GetServiceId() != relayMiningDifficulty.GetServiceId() { + return nil, ErrProofInvalidRelayDifficulty.Wrapf( + "claim service ID (%s) does not match the service relay mining difficulty service ID (%s)", + claim.GetSessionHeader().GetServiceId(), + relayMiningDifficulty.GetServiceId(), + ) + } + + numComputeUnits, err := claim.GetNumClaimedComputeUnits() + if err != nil { + return nil, err + } + + numComputeUnitsRat := new(big.Rat).SetUint64(numComputeUnits) + difficultyMultiplier := protocol.GetRelayDifficultyMultiplier(relayMiningDifficulty.GetTargetHash()) + numEstimatedComputeUnitsRat := new(big.Rat).Mul(difficultyMultiplier, numComputeUnitsRat) + + return numEstimatedComputeUnitsRat, nil +} + // GetHash returns the SHA-256 hash of the serialized claim. func (claim *Claim) GetHash() ([]byte, error) { claimBz, err := claim.Marshal() diff --git a/x/proof/types/errors.go b/x/proof/types/errors.go index d388b06c9..9a97711b7 100644 --- a/x/proof/types/errors.go +++ b/x/proof/types/errors.go @@ -39,4 +39,5 @@ var ( ErrProofFailedToDeductFee = sdkerrors.Register(ModuleName, 1128, "failed to deduct proof submission fee") ErrProofNotRequired = sdkerrors.Register(ModuleName, 1129, "proof not required") ErrProofInvalidRelayDifficulty = sdkerrors.Register(ModuleName, 1130, "invalid relay difficulty") + ErrProofInvalidClaimedAmount = sdkerrors.Register(ModuleName, 1131, "invalid claimed amount") ) diff --git a/x/proof/types/event.pb.go b/x/proof/types/event.pb.go index 2ef856138..8e467c0c5 100644 --- a/x/proof/types/event.pb.go +++ b/x/proof/types/event.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -24,9 +25,11 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type EventClaimCreated struct { - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` + ClaimedUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventClaimCreated) Reset() { *m = EventClaimCreated{} } @@ -72,18 +75,34 @@ func (m *EventClaimCreated) GetNumRelays() uint64 { return 0 } -func (m *EventClaimCreated) GetNumComputeUnits() uint64 { +func (m *EventClaimCreated) GetNumClaimedComputeUnits() uint64 { if m != nil { - return m.NumComputeUnits + return m.NumClaimedComputeUnits } return 0 } +func (m *EventClaimCreated) GetNumEstimatedComputeUnits() uint64 { + if m != nil { + return m.NumEstimatedComputeUnits + } + return 0 +} + +func (m *EventClaimCreated) GetClaimedUpokt() *types.Coin { + if m != nil { + return m.ClaimedUpokt + } + return nil +} + // TODO_TEST: Add coverage for claim updates. type EventClaimUpdated struct { - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,3,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` + ClaimedUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventClaimUpdated) Reset() { *m = EventClaimUpdated{} } @@ -129,18 +148,34 @@ func (m *EventClaimUpdated) GetNumRelays() uint64 { return 0 } -func (m *EventClaimUpdated) GetNumComputeUnits() uint64 { +func (m *EventClaimUpdated) GetNumClaimedComputeUnits() uint64 { if m != nil { - return m.NumComputeUnits + return m.NumClaimedComputeUnits } return 0 } +func (m *EventClaimUpdated) GetNumEstimatedComputeUnits() uint64 { + if m != nil { + return m.NumEstimatedComputeUnits + } + return 0 +} + +func (m *EventClaimUpdated) GetClaimedUpokt() *types.Coin { + if m != nil { + return m.ClaimedUpokt + } + return nil +} + type EventProofSubmitted struct { - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof"` - NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof"` + NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` + ClaimedUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventProofSubmitted) Reset() { *m = EventProofSubmitted{} } @@ -193,19 +228,35 @@ func (m *EventProofSubmitted) GetNumRelays() uint64 { return 0 } -func (m *EventProofSubmitted) GetNumComputeUnits() uint64 { +func (m *EventProofSubmitted) GetNumClaimedComputeUnits() uint64 { if m != nil { - return m.NumComputeUnits + return m.NumClaimedComputeUnits } return 0 } +func (m *EventProofSubmitted) GetNumEstimatedComputeUnits() uint64 { + if m != nil { + return m.NumEstimatedComputeUnits + } + return 0 +} + +func (m *EventProofSubmitted) GetClaimedUpokt() *types.Coin { + if m != nil { + return m.ClaimedUpokt + } + return nil +} + // TODO_TEST: Add coverage for proof updates. type EventProofUpdated struct { - Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof"` - NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` + Claim *Claim `protobuf:"bytes,1,opt,name=claim,proto3" json:"claim"` + Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof"` + NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` + ClaimedUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventProofUpdated) Reset() { *m = EventProofUpdated{} } @@ -258,13 +309,27 @@ func (m *EventProofUpdated) GetNumRelays() uint64 { return 0 } -func (m *EventProofUpdated) GetNumComputeUnits() uint64 { +func (m *EventProofUpdated) GetNumClaimedComputeUnits() uint64 { if m != nil { - return m.NumComputeUnits + return m.NumClaimedComputeUnits } return 0 } +func (m *EventProofUpdated) GetNumEstimatedComputeUnits() uint64 { + if m != nil { + return m.NumEstimatedComputeUnits + } + return 0 +} + +func (m *EventProofUpdated) GetClaimedUpokt() *types.Coin { + if m != nil { + return m.ClaimedUpokt + } + return nil +} + func init() { proto.RegisterType((*EventClaimCreated)(nil), "poktroll.proof.EventClaimCreated") proto.RegisterType((*EventClaimUpdated)(nil), "poktroll.proof.EventClaimUpdated") @@ -275,29 +340,36 @@ func init() { func init() { proto.RegisterFile("poktroll/proof/event.proto", fileDescriptor_dd4c19e04487fbec) } var fileDescriptor_dd4c19e04487fbec = []byte{ - // 341 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x28, 0xca, 0xcf, 0x4f, 0xd3, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, - 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x83, 0xc9, 0xe9, 0x81, 0xe5, 0xa4, 0x44, 0xd2, - 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x14, 0xba, 0x09, 0x25, 0x95, 0x05, - 0xa9, 0xc5, 0x10, 0x39, 0xa5, 0xbd, 0x8c, 0x5c, 0x82, 0xae, 0x20, 0x13, 0x9d, 0x73, 0x12, 0x33, - 0x73, 0x9d, 0x8b, 0x52, 0x13, 0x4b, 0x52, 0x53, 0x84, 0xcc, 0xb8, 0x58, 0x93, 0x41, 0x7c, 0x09, - 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x51, 0x3d, 0x54, 0x7b, 0xf4, 0xc0, 0x8a, 0x9d, 0x38, 0x5f, - 0xdd, 0x93, 0x87, 0xa8, 0x0b, 0x82, 0x50, 0x42, 0xba, 0x5c, 0x5c, 0x79, 0xa5, 0xb9, 0xf1, 0x45, - 0xa9, 0x39, 0x89, 0x95, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x2c, 0x4e, 0x7c, 0xaf, 0xee, 0xc9, - 0x23, 0x89, 0x06, 0x71, 0xe6, 0x95, 0xe6, 0x06, 0x81, 0x99, 0x42, 0x8e, 0x5c, 0x82, 0x20, 0x89, - 0xe4, 0xfc, 0xdc, 0x82, 0xd2, 0x92, 0xd4, 0xf8, 0xd2, 0xbc, 0xcc, 0x92, 0x62, 0x09, 0x66, 0xb0, - 0x2e, 0xd1, 0x57, 0xf7, 0xe4, 0x31, 0x25, 0x83, 0xf8, 0xf3, 0x4a, 0x73, 0x9d, 0x21, 0x22, 0xa1, - 0x20, 0x01, 0x34, 0xf7, 0x87, 0x16, 0xa4, 0x0c, 0x31, 0xf7, 0x7f, 0x67, 0xe4, 0x12, 0x06, 0xbb, - 0x3f, 0x00, 0xe4, 0xb0, 0xe0, 0xd2, 0xa4, 0xdc, 0xcc, 0x12, 0x4a, 0x7c, 0x60, 0xc6, 0xc5, 0x0a, - 0x56, 0x00, 0x76, 0x3c, 0x16, 0x7d, 0x60, 0x6b, 0x20, 0xfa, 0xc0, 0x02, 0x41, 0x10, 0x0a, 0xcd, - 0xe7, 0xcc, 0x64, 0xf9, 0x9c, 0x85, 0x24, 0x9f, 0x7f, 0x85, 0xc5, 0x1c, 0xd8, 0x49, 0x94, 0xc6, - 0xdc, 0x90, 0xf1, 0xb7, 0x93, 0xcf, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0xde, 0x78, - 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, - 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, - 0x0f, 0xf2, 0x82, 0x6e, 0x5e, 0x6a, 0x49, 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0x3c, 0x0f, 0x57, 0x20, - 0xe7, 0xe2, 0x24, 0x36, 0x70, 0x36, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x84, 0x01, - 0x75, 0x26, 0x04, 0x00, 0x00, + // 451 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x3f, 0x8f, 0xd3, 0x30, + 0x18, 0xc6, 0x1b, 0x7a, 0x3d, 0xe9, 0x0c, 0x9c, 0x74, 0xe1, 0x8f, 0x72, 0x45, 0x38, 0x27, 0xa6, + 0x5b, 0xce, 0x56, 0x41, 0xea, 0x07, 0x48, 0xd4, 0x8d, 0x01, 0x82, 0x2a, 0x21, 0x06, 0xaa, 0x24, + 0x35, 0x25, 0x6a, 0x6c, 0x47, 0x89, 0x5d, 0xe8, 0x27, 0x60, 0xe5, 0x1b, 0x21, 0x36, 0xc6, 0x8e, + 0x9d, 0x22, 0x94, 0x6e, 0xf9, 0x14, 0xc8, 0x76, 0x83, 0xda, 0x08, 0x90, 0x50, 0x25, 0x58, 0x3a, + 0xc5, 0x7e, 0x9f, 0xe7, 0xb1, 0x9d, 0xf7, 0x27, 0xcb, 0xa0, 0x9f, 0xf1, 0xb9, 0xc8, 0x79, 0x9a, + 0xe2, 0x2c, 0xe7, 0xfc, 0x1d, 0x26, 0x0b, 0xc2, 0x04, 0xca, 0x72, 0x2e, 0xb8, 0x7d, 0xde, 0x68, + 0x48, 0x6b, 0x7d, 0x18, 0xf3, 0x82, 0xf2, 0x02, 0x47, 0x61, 0x41, 0xf0, 0x62, 0x10, 0x11, 0x11, + 0x0e, 0x70, 0xcc, 0x13, 0x66, 0xfc, 0xfd, 0xfb, 0x33, 0x3e, 0xe3, 0x7a, 0x88, 0xd5, 0x68, 0x5b, + 0x6d, 0xef, 0x20, 0x96, 0x19, 0x29, 0x8c, 0xf6, 0xe4, 0x53, 0x17, 0x5c, 0x8c, 0xd4, 0x8e, 0x7e, + 0x1a, 0x26, 0xd4, 0xcf, 0x49, 0x28, 0xc8, 0xd4, 0x1e, 0x82, 0x5e, 0xac, 0xe6, 0x8e, 0x75, 0x65, + 0x5d, 0xdf, 0x7e, 0xfa, 0x00, 0xed, 0x9f, 0x03, 0x69, 0xb3, 0x77, 0x56, 0x97, 0xae, 0xf1, 0x05, + 0xe6, 0x63, 0xdf, 0x00, 0xc0, 0x24, 0x9d, 0xe4, 0x24, 0x0d, 0x97, 0x85, 0x73, 0xeb, 0xca, 0xba, + 0x3e, 0xf1, 0xce, 0xeb, 0xd2, 0xdd, 0xa9, 0x06, 0x67, 0x4c, 0xd2, 0x40, 0x0f, 0xed, 0xd7, 0xe0, + 0x52, 0x09, 0x3a, 0x4b, 0xa6, 0x93, 0x98, 0xd3, 0x4c, 0x0a, 0x32, 0x91, 0x2c, 0x11, 0x85, 0x73, + 0xa2, 0xd3, 0x8f, 0xeb, 0xd2, 0xfd, 0xbd, 0x29, 0x78, 0xc8, 0x24, 0xf5, 0x8d, 0xe2, 0x1b, 0x61, + 0xac, 0xea, 0xf6, 0x5b, 0xf0, 0x48, 0x85, 0x48, 0x21, 0x12, 0xaa, 0xfe, 0xa8, 0xb5, 0x76, 0x4f, + 0xaf, 0xed, 0xd6, 0xa5, 0xfb, 0x27, 0x5b, 0xe0, 0x30, 0x49, 0x47, 0x8d, 0xb6, 0xb7, 0xfe, 0x4b, + 0x70, 0xb7, 0x39, 0x90, 0x54, 0xbd, 0x71, 0x4e, 0x75, 0xa3, 0x2e, 0x91, 0x01, 0x84, 0x14, 0x20, + 0xb4, 0x05, 0x84, 0x7c, 0x9e, 0x30, 0xef, 0xa2, 0x2e, 0xdd, 0xfd, 0x4c, 0x70, 0x67, 0x3b, 0x1d, + 0xab, 0x59, 0x8b, 0xc4, 0x38, 0x9b, 0x1e, 0x49, 0xfc, 0x27, 0x12, 0x5f, 0xbb, 0xe0, 0x9e, 0x26, + 0xf1, 0x42, 0xb5, 0xf8, 0x95, 0x8c, 0x68, 0x22, 0x0e, 0x61, 0x31, 0x04, 0x3d, 0x6d, 0xd0, 0x18, + 0x7e, 0x91, 0xd3, 0xdb, 0x98, 0x9c, 0x2e, 0x04, 0xe6, 0xd3, 0x62, 0xd8, 0x3d, 0x32, 0xfc, 0x0b, + 0x86, 0x5f, 0x9a, 0xdb, 0xa4, 0x9b, 0x7b, 0xe8, 0x6d, 0x3a, 0x12, 0xfc, 0xe7, 0x04, 0xbd, 0xe7, + 0xdf, 0x2a, 0x68, 0xad, 0x2a, 0x68, 0xad, 0x2b, 0x68, 0x7d, 0xaf, 0xa0, 0xf5, 0x79, 0x03, 0x3b, + 0xab, 0x0d, 0xec, 0xac, 0x37, 0xb0, 0xf3, 0x06, 0xcd, 0x12, 0xf1, 0x5e, 0x46, 0x28, 0xe6, 0x14, + 0x2b, 0xfb, 0x0d, 0x23, 0xe2, 0x03, 0xcf, 0xe7, 0xf8, 0xe7, 0x5b, 0xf7, 0x71, 0xf7, 0xb5, 0x8b, + 0x4e, 0xf5, 0x73, 0xf7, 0xec, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x12, 0xa3, 0x30, 0x6e, + 0x07, 0x00, 0x00, } func (m *EventClaimCreated) Marshal() (dAtA []byte, err error) { @@ -320,10 +392,27 @@ func (m *EventClaimCreated) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + if m.ClaimedUpokt != nil { + { + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x32 + } + if m.NumEstimatedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumEstimatedComputeUnits)) + i-- + dAtA[i] = 0x28 + } + if m.NumClaimedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumClaimedComputeUnits)) + i-- + dAtA[i] = 0x20 } if m.NumRelays != 0 { i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) @@ -365,10 +454,27 @@ func (m *EventClaimUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + if m.ClaimedUpokt != nil { + { + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x32 + } + if m.NumEstimatedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumEstimatedComputeUnits)) + i-- + dAtA[i] = 0x28 + } + if m.NumClaimedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumClaimedComputeUnits)) + i-- + dAtA[i] = 0x20 } if m.NumRelays != 0 { i = encodeVarintEvent(dAtA, i, uint64(m.NumRelays)) @@ -410,8 +516,25 @@ func (m *EventProofSubmitted) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + if m.ClaimedUpokt != nil { + { + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.NumEstimatedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumEstimatedComputeUnits)) + i-- + dAtA[i] = 0x28 + } + if m.NumClaimedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumClaimedComputeUnits)) i-- dAtA[i] = 0x20 } @@ -467,8 +590,25 @@ func (m *EventProofUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + if m.ClaimedUpokt != nil { + { + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.NumEstimatedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumEstimatedComputeUnits)) + i-- + dAtA[i] = 0x28 + } + if m.NumClaimedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumClaimedComputeUnits)) i-- dAtA[i] = 0x20 } @@ -528,8 +668,15 @@ func (m *EventClaimCreated) Size() (n int) { if m.NumRelays != 0 { n += 1 + sovEvent(uint64(m.NumRelays)) } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) + if m.NumClaimedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumClaimedComputeUnits)) + } + if m.NumEstimatedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) + } + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() + n += 1 + l + sovEvent(uint64(l)) } return n } @@ -547,8 +694,15 @@ func (m *EventClaimUpdated) Size() (n int) { if m.NumRelays != 0 { n += 1 + sovEvent(uint64(m.NumRelays)) } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) + if m.NumClaimedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumClaimedComputeUnits)) + } + if m.NumEstimatedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) + } + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() + n += 1 + l + sovEvent(uint64(l)) } return n } @@ -570,8 +724,15 @@ func (m *EventProofSubmitted) Size() (n int) { if m.NumRelays != 0 { n += 1 + sovEvent(uint64(m.NumRelays)) } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) + if m.NumClaimedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumClaimedComputeUnits)) + } + if m.NumEstimatedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) + } + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() + n += 1 + l + sovEvent(uint64(l)) } return n } @@ -593,8 +754,15 @@ func (m *EventProofUpdated) Size() (n int) { if m.NumRelays != 0 { n += 1 + sovEvent(uint64(m.NumRelays)) } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) + if m.NumClaimedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumClaimedComputeUnits)) + } + if m.NumEstimatedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) + } + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() + n += 1 + l + sovEvent(uint64(l)) } return n } @@ -689,11 +857,11 @@ func (m *EventClaimCreated) Unmarshal(dAtA []byte) error { break } } - case 3: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) } - m.NumComputeUnits = 0 + m.NumClaimedComputeUnits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -703,11 +871,66 @@ func (m *EventClaimCreated) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift + m.NumClaimedComputeUnits |= uint64(b&0x7F) << shift if b < 0x80 { break } } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + m.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types.Coin{} + } + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvent(dAtA[iNdEx:]) @@ -813,11 +1036,11 @@ func (m *EventClaimUpdated) Unmarshal(dAtA []byte) error { break } } - case 3: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) } - m.NumComputeUnits = 0 + m.NumClaimedComputeUnits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -827,11 +1050,66 @@ func (m *EventClaimUpdated) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift + m.NumClaimedComputeUnits |= uint64(b&0x7F) << shift if b < 0x80 { break } } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + m.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types.Coin{} + } + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvent(dAtA[iNdEx:]) @@ -975,9 +1253,47 @@ func (m *EventProofSubmitted) Unmarshal(dAtA []byte) error { } case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) + } + m.NumClaimedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumClaimedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + m.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } - m.NumComputeUnits = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -987,11 +1303,28 @@ func (m *EventProofSubmitted) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types.Coin{} + } + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvent(dAtA[iNdEx:]) @@ -1135,9 +1468,9 @@ func (m *EventProofUpdated) Unmarshal(dAtA []byte) error { } case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) } - m.NumComputeUnits = 0 + m.NumClaimedComputeUnits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1147,11 +1480,66 @@ func (m *EventProofUpdated) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift + m.NumClaimedComputeUnits |= uint64(b&0x7F) << shift if b < 0x80 { break } } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + m.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types.Coin{} + } + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvent(dAtA[iNdEx:]) diff --git a/x/proof/types/expected_keepers.go b/x/proof/types/expected_keepers.go index 1f546b557..66103d2b8 100644 --- a/x/proof/types/expected_keepers.go +++ b/x/proof/types/expected_keepers.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" apptypes "github.com/pokt-network/poktroll/x/application/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -58,6 +59,8 @@ type SharedKeeper interface { // ServiceKeeper defines the expected interface for the Service module. type ServiceKeeper interface { GetService(ctx context.Context, serviceID string) (sharedtypes.Service, bool) + GetRelayMiningDifficulty(ctx context.Context, serviceID string) (servicetypes.RelayMiningDifficulty, bool) // Only used for testing & simulation SetService(ctx context.Context, service sharedtypes.Service) + SetRelayMiningDifficulty(ctx context.Context, relayMiningDifficulty servicetypes.RelayMiningDifficulty) } diff --git a/x/proof/types/message_update_param.go b/x/proof/types/message_update_param.go index 9f1a26539..67b897699 100644 --- a/x/proof/types/message_update_param.go +++ b/x/proof/types/message_update_param.go @@ -14,10 +14,6 @@ func NewMsgUpdateParam(authority string, name string, value any) (*MsgUpdatePara var valueAsType isMsgUpdateParam_AsType switch v := value.(type) { - case string: - valueAsType = &MsgUpdateParam_AsString{AsString: v} - case int64: - valueAsType = &MsgUpdateParam_AsInt64{AsInt64: v} case []byte: valueAsType = &MsgUpdateParam_AsBytes{AsBytes: v} case *sdk.Coin: @@ -33,9 +29,10 @@ func NewMsgUpdateParam(authority string, name string, value any) (*MsgUpdatePara }, nil } -// ValidateBasic performs a basic validation of the MsgUpdateParam fields. It ensures -// the parameter name is supported and the parameter type matches the expected type for -// a given parameter name. +// ValidateBasic performs a basic validation of the MsgUpdateParam fields. It ensures: +// 1. The parameter name is supported. +// 2. The parameter type matches the expected type for a given parameter name. +// 3. The parameter value is valid (according to its respective validation function). func (msg *MsgUpdateParam) ValidateBasic() error { // Validate the address if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { @@ -49,33 +46,31 @@ func (msg *MsgUpdateParam) ValidateBasic() error { // Parameter name must be supported by this module. switch msg.Name { - case ParamRelayDifficultyTargetHash: - return msg.paramTypeIsBytes() case ParamProofRequestProbability: - return msg.paramTypeIsFloat() + if err := msg.paramTypeIsFloat(); err != nil { + return err + } + return ValidateProofRequestProbability(msg.GetAsFloat()) case ParamProofRequirementThreshold: - return msg.paramTypeIsCoin() + if err := msg.paramTypeIsCoin(); err != nil { + return err + } + return ValidateProofRequirementThreshold(msg.GetAsCoin()) case ParamProofMissingPenalty: - return msg.paramTypeIsCoin() + if err := msg.paramTypeIsCoin(); err != nil { + return err + } + return ValidateProofMissingPenalty(msg.GetAsCoin()) case ParamProofSubmissionFee: - return msg.paramTypeIsCoin() + if err := msg.paramTypeIsCoin(); err != nil { + return err + } + return ValidateProofSubmissionFee(msg.GetAsCoin()) default: return ErrProofParamNameInvalid.Wrapf("unsupported param %q", msg.Name) } } -// paramTypeIsBytes checks if the parameter type is a byte slice, returning an error if not. -func (msg *MsgUpdateParam) paramTypeIsBytes() error { - if _, ok := msg.AsType.(*MsgUpdateParam_AsBytes); !ok { - return ErrProofParamInvalid.Wrapf( - "invalid type for param %q expected %T, got %T", - msg.Name, &MsgUpdateParam_AsBytes{}, - msg.AsType, - ) - } - return nil -} - // paramTypeIsFloat checks if the parameter type is Float, returning an error if not. func (msg *MsgUpdateParam) paramTypeIsFloat() error { if _, ok := msg.AsType.(*MsgUpdateParam_AsFloat); !ok { diff --git a/x/proof/types/message_update_param_test.go b/x/proof/types/message_update_param_test.go index d89a323ad..ac88a4ffb 100644 --- a/x/proof/types/message_update_param_test.go +++ b/x/proof/types/message_update_param_test.go @@ -20,7 +20,7 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { msg: MsgUpdateParam{ Authority: "invalid_address", Name: "", // Doesn't matter for this test - AsType: &MsgUpdateParam_AsInt64{AsInt64: 1}, + AsType: &MsgUpdateParam_AsFloat{AsFloat: 0}, }, expectedErr: ErrProofInvalidAddress, @@ -28,8 +28,8 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { name: "invalid: param name incorrect (non-existent)", msg: MsgUpdateParam{ Authority: sample.AccAddress(), - Name: "WRONG_relay_difficulty_target_hash", - AsType: &MsgUpdateParam_AsInt64{AsInt64: 1}, + Name: "non_existent", + AsType: &MsgUpdateParam_AsFloat{AsFloat: 0}, }, expectedErr: ErrProofParamNameInvalid, @@ -37,16 +37,16 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { name: "invalid: incorrect param type", msg: MsgUpdateParam{ Authority: sample.AccAddress(), - Name: ParamRelayDifficultyTargetHash, - AsType: &MsgUpdateParam_AsString{AsString: "invalid"}, + Name: ParamProofMissingPenalty, + AsType: &MsgUpdateParam_AsFloat{AsFloat: 0}, }, expectedErr: ErrProofParamInvalid, }, { name: "valid: correct authority, param name, and type", msg: MsgUpdateParam{ Authority: sample.AccAddress(), - Name: ParamRelayDifficultyTargetHash, - AsType: &MsgUpdateParam_AsBytes{AsBytes: DefaultRelayDifficultyTargetHash}, + Name: ParamProofMissingPenalty, + AsType: &MsgUpdateParam_AsCoin{AsCoin: &DefaultProofMissingPenalty}, }, expectedErr: nil, diff --git a/x/proof/types/params.go b/x/proof/types/params.go index 9b35c3871..16d77287f 100644 --- a/x/proof/types/params.go +++ b/x/proof/types/params.go @@ -7,20 +7,12 @@ import ( "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/pkg/client" - "github.com/pokt-network/poktroll/pkg/crypto/protocol" ) var ( _ client.ProofParams = (*Params)(nil) _ paramtypes.ParamSet = (*Params)(nil) - // TODO_TECHDEBT(#690): Delete this parameter and just use "protocol.BaseRelayDifficultyHashBz" - // as a hard-coded version. This param was originally intended to be a "minimum", - // but the minimum equivalent of "0" in this case is "BaseRelayDifficultyHashBz". - KeyRelayDifficultyTargetHash = []byte("RelayDifficultyTargetHash") - ParamRelayDifficultyTargetHash = "relay_difficulty_target_hash" - DefaultRelayDifficultyTargetHash = protocol.BaseRelayDifficultyHashBz - // TODO_BETA(@red-0ne): Iterate on the parameters below by adding unit suffixes and // consider having the proof_requirement_threshold to be a function of the supplier's stake amount. @@ -54,14 +46,12 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new Params instance func NewParams( - relayDifficultyTargetHash []byte, proofRequestProbability float32, proofRequirementThreshold *cosmostypes.Coin, proofMissingPenalty *cosmostypes.Coin, proofSubmissionFee *cosmostypes.Coin, ) Params { return Params{ - RelayDifficultyTargetHash: relayDifficultyTargetHash, ProofRequestProbability: proofRequestProbability, ProofRequirementThreshold: proofRequirementThreshold, ProofMissingPenalty: proofMissingPenalty, @@ -72,7 +62,6 @@ func NewParams( // DefaultParams returns a default set of parameters func DefaultParams() Params { return NewParams( - DefaultRelayDifficultyTargetHash, DefaultProofRequestProbability, &DefaultProofRequirementThreshold, &DefaultProofMissingPenalty, @@ -83,11 +72,6 @@ func DefaultParams() Params { // ParamSetPairs get the params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair( - KeyRelayDifficultyTargetHash, - &p.RelayDifficultyTargetHash, - ValidateRelayDifficultyTargetHash, - ), paramtypes.NewParamSetPair( KeyProofRequestProbability, &p.ProofRequestProbability, @@ -113,11 +97,6 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { // ValidateBasic does a sanity check on the provided params. func (params *Params) ValidateBasic() error { - // Validate the ComputeUnitsToTokensMultiplier - if err := ValidateRelayDifficultyTargetHash(params.RelayDifficultyTargetHash); err != nil { - return err - } - if err := ValidateProofRequestProbability(params.ProofRequestProbability); err != nil { return err } @@ -137,47 +116,39 @@ func (params *Params) ValidateBasic() error { return nil } -// ValidateRelayDifficultyTargetHash validates the MinRelayDifficultyBits param. +// ValidateProofRequestProbability validates the ProofRequestProbability param. // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateRelayDifficultyTargetHash(v interface{}) error { - relayDifficultyTargetHash, ok := v.([]byte) +func ValidateProofRequestProbability(proofRequestProbabilityAny any) error { + proofRequestProbability, ok := proofRequestProbabilityAny.(float32) if !ok { - return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", v) + return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", proofRequestProbabilityAny) } - if len(relayDifficultyTargetHash) != protocol.RelayHasherSize { - return ErrProofParamInvalid.Wrapf( - "invalid RelayDifficultyTargetHash: (%x); length wanted: %d; got: %d", - relayDifficultyTargetHash, - 32, - len(relayDifficultyTargetHash), - ) + if proofRequestProbability < 0 || proofRequestProbability > 1 { + return ErrProofParamInvalid.Wrapf("invalid ProofRequestProbability: (%v)", proofRequestProbability) } return nil } -// ValidateProofRequestProbability validates the ProofRequestProbability param. +// ValidateProofRequirementThreshold validates the ProofRequirementThreshold param. // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateProofRequestProbability(v interface{}) error { - proofRequestProbability, ok := v.(float32) +func ValidateProofRequirementThreshold(proofRequirementThresholdAny any) error { + proofRequirementThresholdCoin, ok := proofRequirementThresholdAny.(*cosmostypes.Coin) if !ok { - return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", v) + return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", proofRequirementThresholdAny) } - if proofRequestProbability < 0 || proofRequestProbability > 1 { - return ErrProofParamInvalid.Wrapf("invalid ProofRequestProbability: (%v)", proofRequestProbability) + if proofRequirementThresholdCoin == nil { + return ErrProofParamInvalid.Wrap("missing proof_requirement_threshold") } - return nil -} + if proofRequirementThresholdCoin.Denom != volatile.DenomuPOKT { + return ErrProofParamInvalid.Wrapf("invalid proof_requirement_threshold denom: %s", proofRequirementThresholdCoin.Denom) + } -// ValidateProofRequirementThreshold validates the ProofRequirementThreshold param. -// NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateProofRequirementThreshold(v interface{}) error { - _, ok := v.(*cosmostypes.Coin) - if !ok { - return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", v) + if proofRequirementThresholdCoin.IsZero() || proofRequirementThresholdCoin.IsNegative() { + return ErrProofParamInvalid.Wrapf("invalid proof_requirement_threshold amount: %s <= 0", proofRequirementThresholdCoin) } return nil @@ -185,29 +156,33 @@ func ValidateProofRequirementThreshold(v interface{}) error { // ValidateProofMissingPenalty validates the ProofMissingPenalty param. // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateProofMissingPenalty(v interface{}) error { - coin, ok := v.(*cosmostypes.Coin) +func ValidateProofMissingPenalty(proofMissingPenaltyAny any) error { + proofMissingPenaltyCoin, ok := proofMissingPenaltyAny.(*cosmostypes.Coin) if !ok { - return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", v) + return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", proofMissingPenaltyAny) } - if coin == nil { + if proofMissingPenaltyCoin == nil { return ErrProofParamInvalid.Wrap("missing proof_missing_penalty") } - if coin.Denom != volatile.DenomuPOKT { - return ErrProofParamInvalid.Wrapf("invalid coin denom: %s", coin.Denom) + if proofMissingPenaltyCoin.Denom != volatile.DenomuPOKT { + return ErrProofParamInvalid.Wrapf("invalid proof_missing_penalty denom: %s", proofMissingPenaltyCoin.Denom) + } + + if proofMissingPenaltyCoin.IsZero() || proofMissingPenaltyCoin.IsNegative() { + return ErrProofParamInvalid.Wrapf("invalid proof_missing_penalty amount: %s <= 0", proofMissingPenaltyCoin) } return nil } -// ValidateProofSubmission validates the ProofSubmissionFee param. +// ValidateProofSubmissionFee validates the ProofSubmissionFee param. // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateProofSubmissionFee(v interface{}) error { - submissionFeeCoin, ok := v.(*cosmostypes.Coin) +func ValidateProofSubmissionFee(proofSubmissionFeeAny any) error { + submissionFeeCoin, ok := proofSubmissionFeeAny.(*cosmostypes.Coin) if !ok { - return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", v) + return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", proofSubmissionFeeAny) } if submissionFeeCoin == nil { @@ -215,12 +190,12 @@ func ValidateProofSubmissionFee(v interface{}) error { } if submissionFeeCoin.Denom != volatile.DenomuPOKT { - return ErrProofParamInvalid.Wrapf("invalid coin denom: %s", submissionFeeCoin.Denom) + return ErrProofParamInvalid.Wrapf("invalid proof_submission_fee denom: %s", submissionFeeCoin.Denom) } if submissionFeeCoin.Amount.LT(MinProofSubmissionFee.Amount) { return ErrProofParamInvalid.Wrapf( - "ProofSubmissionFee param is below minimum value %s: got %s", + "proof_submission_fee is below minimum value %s: got %s", MinProofSubmissionFee, submissionFeeCoin, ) diff --git a/x/proof/types/params.pb.go b/x/proof/types/params.pb.go index 6302cfa71..b84b9ab41 100644 --- a/x/proof/types/params.pb.go +++ b/x/proof/types/params.pb.go @@ -4,7 +4,6 @@ package types import ( - bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" @@ -29,9 +28,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - // TODO_FOLLOWUP(@olshansk, #690): Either delete this or change it to be named "minimum" - // relay_difficulty_target_hash is the maximum value a relay hash must be less than to be volume/reward applicable. - RelayDifficultyTargetHash []byte `protobuf:"bytes,1,opt,name=relay_difficulty_target_hash,json=relayDifficultyTargetHash,proto3" json:"relay_difficulty_target_hash"` // proof_request_probability is the probability of a session requiring a proof // if it's cost (i.e. compute unit consumption) is below the ProofRequirementThreshold. ProofRequestProbability float32 `protobuf:"fixed32,2,opt,name=proof_request_probability,json=proofRequestProbability,proto3" json:"proof_request_probability"` @@ -84,13 +80,6 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetRelayDifficultyTargetHash() []byte { - if m != nil { - return m.RelayDifficultyTargetHash - } - return nil -} - func (m *Params) GetProofRequestProbability() float32 { if m != nil { return m.ProofRequestProbability @@ -126,35 +115,32 @@ func init() { func init() { proto.RegisterFile("poktroll/proof/params.proto", fileDescriptor_2ad689ad5bf3a2d7) } var fileDescriptor_2ad689ad5bf3a2d7 = []byte{ - // 439 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x31, 0x6e, 0xd4, 0x40, - 0x14, 0x86, 0x77, 0x42, 0x48, 0x61, 0x10, 0x12, 0x26, 0x28, 0x76, 0x02, 0xb6, 0x45, 0xb5, 0x42, - 0xc2, 0xa3, 0x40, 0x47, 0xb9, 0x20, 0x44, 0x01, 0xd2, 0xca, 0xa4, 0x81, 0x66, 0x34, 0xde, 0xbc, - 0xb5, 0x47, 0xb1, 0xe7, 0x99, 0x99, 0x59, 0xc0, 0x1c, 0x81, 0x8a, 0x23, 0x70, 0x04, 0x1a, 0xee, - 0x40, 0x99, 0x32, 0x95, 0x85, 0x76, 0x0b, 0x90, 0x4f, 0x81, 0x76, 0x66, 0xb3, 0x29, 0x08, 0xd9, - 0xc6, 0x1a, 0xfd, 0xdf, 0xfb, 0xdf, 0x6f, 0x3d, 0xfd, 0xde, 0x41, 0x83, 0x27, 0x46, 0x61, 0x55, - 0xd1, 0x46, 0x21, 0x4e, 0x69, 0xc3, 0x15, 0xaf, 0x75, 0xda, 0x28, 0x34, 0xe8, 0xdf, 0x3a, 0x87, - 0xa9, 0x85, 0xfb, 0xb7, 0x79, 0x2d, 0x24, 0x52, 0xfb, 0x75, 0x23, 0xfb, 0xbb, 0x05, 0x16, 0x68, - 0x9f, 0x74, 0xf9, 0x5a, 0xa9, 0xd1, 0x04, 0x75, 0x8d, 0x9a, 0xe6, 0x5c, 0x03, 0xfd, 0x70, 0x98, - 0x83, 0xe1, 0x87, 0x74, 0x82, 0x42, 0x3a, 0xfe, 0xe0, 0xc7, 0xb6, 0xb7, 0x33, 0xb6, 0x49, 0x3e, - 0xf7, 0xee, 0x29, 0xa8, 0x78, 0xcb, 0x8e, 0xc5, 0x74, 0x2a, 0x26, 0xb3, 0xca, 0xb4, 0xcc, 0x70, - 0x55, 0x80, 0x61, 0x25, 0xd7, 0x65, 0x40, 0x12, 0x32, 0xbc, 0x39, 0x4a, 0xfa, 0x2e, 0xbe, 0x72, - 0x2e, 0x0b, 0x2d, 0x7d, 0xbe, 0x86, 0x47, 0x96, 0xbd, 0xe4, 0xba, 0xf4, 0xdf, 0x7a, 0xa1, 0xfd, - 0x7f, 0xa6, 0xe0, 0xfd, 0x0c, 0xb4, 0x61, 0x8d, 0xc2, 0x9c, 0xe7, 0xa2, 0x12, 0xa6, 0x0d, 0xb6, - 0x12, 0x32, 0xdc, 0x1a, 0xdd, 0xef, 0xbb, 0xf8, 0xff, 0x43, 0xd9, 0x9e, 0x45, 0x99, 0x23, 0xe3, - 0x0b, 0xe0, 0x7f, 0xf6, 0x0e, 0x2e, 0x5c, 0x42, 0x41, 0x0d, 0xd2, 0x30, 0x53, 0x2a, 0xd0, 0x25, - 0x56, 0xc7, 0xc1, 0xb5, 0x84, 0x0c, 0x6f, 0x3c, 0x0e, 0x53, 0x77, 0x8e, 0x74, 0x79, 0x8e, 0x74, - 0x75, 0x8e, 0xf4, 0x19, 0x0a, 0x39, 0x8a, 0xfb, 0x2e, 0xbe, 0x6a, 0x43, 0x16, 0xae, 0x93, 0x57, - 0xec, 0xe8, 0x1c, 0xf9, 0xa5, 0x77, 0xd7, 0x39, 0x6b, 0xa1, 0xb5, 0x90, 0x05, 0x6b, 0x40, 0xf2, - 0xca, 0xb4, 0xc1, 0xf6, 0xa6, 0xd4, 0xb0, 0xef, 0xe2, 0xcb, 0xbd, 0xd9, 0x1d, 0x2b, 0xbf, 0x76, - 0xea, 0xd8, 0x89, 0x3e, 0x78, 0xbb, 0x6e, 0x5a, 0xcf, 0x72, 0x6b, 0x40, 0xc9, 0xa6, 0x00, 0xc1, - 0xf5, 0x4d, 0x41, 0x41, 0xdf, 0xc5, 0x97, 0x5a, 0x33, 0xdf, 0xaa, 0x6f, 0xd6, 0xe2, 0x0b, 0x80, - 0xa7, 0xc9, 0x9f, 0x6f, 0x31, 0xf9, 0xf2, 0xfb, 0xfb, 0xc3, 0xbd, 0x75, 0x29, 0x3f, 0xad, 0x6a, - 0xe9, 0xca, 0x32, 0x7a, 0xf5, 0x73, 0x1e, 0x91, 0xd3, 0x79, 0x44, 0xce, 0xe6, 0x11, 0xf9, 0x35, - 0x8f, 0xc8, 0xd7, 0x45, 0x34, 0x38, 0x5d, 0x44, 0x83, 0xb3, 0x45, 0x34, 0x78, 0x97, 0x16, 0xc2, - 0x94, 0xb3, 0x3c, 0x9d, 0x60, 0x4d, 0x97, 0x1b, 0x1e, 0x49, 0x30, 0x1f, 0x51, 0x9d, 0xd0, 0x7f, - 0xd6, 0x99, 0xb6, 0x01, 0x9d, 0xef, 0xd8, 0x32, 0x3e, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x63, - 0xa4, 0x76, 0xd5, 0x04, 0x03, 0x00, 0x00, + // 390 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0xce, 0xd2, 0x40, + 0x14, 0x85, 0x29, 0x28, 0x8b, 0x9a, 0x98, 0x58, 0x31, 0xb4, 0x10, 0xa7, 0xc4, 0x15, 0x31, 0x71, + 0x26, 0xe8, 0xce, 0x25, 0x26, 0xae, 0x34, 0x21, 0xd5, 0x8d, 0x6e, 0x9a, 0x16, 0x87, 0x76, 0x42, + 0x3b, 0xb7, 0xce, 0x0c, 0x2a, 0x3e, 0x82, 0x2b, 0x1f, 0xc1, 0x47, 0xf0, 0x31, 0x5c, 0x12, 0x57, + 0xac, 0x1a, 0x53, 0x16, 0x9a, 0x3e, 0x85, 0x61, 0xa6, 0xc0, 0xe2, 0xe7, 0xff, 0xd9, 0x34, 0x93, + 0xf3, 0xdd, 0x73, 0xce, 0x4d, 0x7a, 0xed, 0x61, 0x01, 0x4b, 0x25, 0x20, 0xcb, 0x48, 0x21, 0x00, + 0x16, 0xa4, 0x88, 0x44, 0x94, 0x4b, 0x5c, 0x08, 0x50, 0xe0, 0xdc, 0x3d, 0x40, 0xac, 0xe1, 0xe0, + 0x5e, 0x94, 0x33, 0x0e, 0x44, 0x7f, 0xcd, 0xc8, 0xa0, 0x97, 0x40, 0x02, 0xfa, 0x49, 0xf6, 0xaf, + 0x46, 0x45, 0x73, 0x90, 0x39, 0x48, 0x12, 0x47, 0x92, 0x92, 0x4f, 0x93, 0x98, 0xaa, 0x68, 0x42, + 0xe6, 0xc0, 0xb8, 0xe1, 0x8f, 0x7e, 0x77, 0xec, 0xee, 0x4c, 0x37, 0x39, 0xef, 0x6c, 0x4f, 0x87, + 0x87, 0x82, 0x7e, 0x5c, 0x51, 0xa9, 0xc2, 0x42, 0x40, 0x1c, 0xc5, 0x2c, 0x63, 0x6a, 0xed, 0xb6, + 0x47, 0xd6, 0xb8, 0x3d, 0x7d, 0x58, 0x97, 0xfe, 0xf5, 0x43, 0x41, 0x5f, 0xa3, 0xc0, 0x90, 0xd9, + 0x09, 0x38, 0x5f, 0xed, 0xe1, 0xc9, 0xc5, 0x04, 0xcd, 0x29, 0x57, 0xa1, 0x4a, 0x05, 0x95, 0x29, + 0x64, 0x1f, 0xdc, 0xce, 0xc8, 0x1a, 0xdf, 0x79, 0xea, 0x61, 0xb3, 0x2b, 0xde, 0xef, 0x8a, 0x9b, + 0x5d, 0xf1, 0x0b, 0x60, 0x7c, 0xea, 0xd7, 0xa5, 0x7f, 0x53, 0x42, 0xe0, 0x1d, 0x9b, 0x1b, 0xf6, + 0xf6, 0x80, 0x9c, 0xd4, 0x7e, 0x60, 0x9c, 0x39, 0x93, 0x92, 0xf1, 0x24, 0x2c, 0x28, 0x8f, 0x32, + 0xb5, 0x76, 0x6f, 0x5d, 0x6a, 0xf5, 0xea, 0xd2, 0x3f, 0xef, 0x0d, 0xee, 0x6b, 0xf9, 0xb5, 0x51, + 0x67, 0x46, 0x74, 0xa8, 0xdd, 0x33, 0xd3, 0x72, 0x15, 0x6b, 0x03, 0xf0, 0x70, 0x41, 0xa9, 0x7b, + 0xfb, 0x52, 0x91, 0x5b, 0x97, 0xfe, 0x59, 0x6b, 0xe0, 0x68, 0xf5, 0xcd, 0x51, 0x7c, 0x49, 0xe9, + 0xf3, 0xd1, 0xbf, 0x1f, 0xbe, 0xf5, 0xed, 0xef, 0xcf, 0xc7, 0xfd, 0xe3, 0xc5, 0x7c, 0x69, 0x6e, + 0xc6, 0xfc, 0xc9, 0xe9, 0xab, 0x5f, 0x15, 0xb2, 0x36, 0x15, 0xb2, 0xb6, 0x15, 0xb2, 0xfe, 0x54, + 0xc8, 0xfa, 0xbe, 0x43, 0xad, 0xcd, 0x0e, 0xb5, 0xb6, 0x3b, 0xd4, 0x7a, 0x8f, 0x13, 0xa6, 0xd2, + 0x55, 0x8c, 0xe7, 0x90, 0x93, 0x7d, 0xc2, 0x13, 0x4e, 0xd5, 0x67, 0x10, 0x4b, 0x72, 0x25, 0x4e, + 0xad, 0x0b, 0x2a, 0xe3, 0xae, 0xbe, 0x94, 0x67, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x68, 0xf0, + 0x63, 0xa9, 0xa1, 0x02, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -176,9 +162,6 @@ func (this *Params) Equal(that interface{}) bool { } else if this == nil { return false } - if !bytes.Equal(this.RelayDifficultyTargetHash, that1.RelayDifficultyTargetHash) { - return false - } if this.ProofRequestProbability != that1.ProofRequestProbability { return false } @@ -255,13 +238,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x15 } - if len(m.RelayDifficultyTargetHash) > 0 { - i -= len(m.RelayDifficultyTargetHash) - copy(dAtA[i:], m.RelayDifficultyTargetHash) - i = encodeVarintParams(dAtA, i, uint64(len(m.RelayDifficultyTargetHash))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } @@ -282,10 +258,6 @@ func (m *Params) Size() (n int) { } var l int _ = l - l = len(m.RelayDifficultyTargetHash) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } if m.ProofRequestProbability != 0 { n += 5 } @@ -339,40 +311,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { 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 RelayDifficultyTargetHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RelayDifficultyTargetHash = append(m.RelayDifficultyTargetHash[:0], dAtA[iNdEx:postIndex]...) - if m.RelayDifficultyTargetHash == nil { - m.RelayDifficultyTargetHash = []byte{} - } - iNdEx = postIndex case 2: if wireType != 5 { return fmt.Errorf("proto: wrong wireType = %d for field ProofRequestProbability", wireType) diff --git a/x/proof/types/tx.pb.go b/x/proof/types/tx.pb.go index 8d5376a58..61d576174 100644 --- a/x/proof/types/tx.pb.go +++ b/x/proof/types/tx.pb.go @@ -129,8 +129,6 @@ type MsgUpdateParam struct { // specified in the `Params`` message in `proof/params.proto.` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Types that are valid to be assigned to AsType: - // *MsgUpdateParam_AsString - // *MsgUpdateParam_AsInt64 // *MsgUpdateParam_AsBytes // *MsgUpdateParam_AsFloat // *MsgUpdateParam_AsCoin @@ -172,12 +170,6 @@ type isMsgUpdateParam_AsType interface { Size() int } -type MsgUpdateParam_AsString struct { - AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"` -} -type MsgUpdateParam_AsInt64 struct { - AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64"` -} type MsgUpdateParam_AsBytes struct { AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof" json:"as_bytes"` } @@ -188,11 +180,9 @@ type MsgUpdateParam_AsCoin struct { AsCoin *types.Coin `protobuf:"bytes,9,opt,name=as_coin,json=asCoin,proto3,oneof" json:"as_coin"` } -func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsFloat) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsFloat) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsCoin) isMsgUpdateParam_AsType() {} func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { if m != nil { @@ -215,20 +205,6 @@ func (m *MsgUpdateParam) GetName() string { return "" } -func (m *MsgUpdateParam) GetAsString() string { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsString); ok { - return x.AsString - } - return "" -} - -func (m *MsgUpdateParam) GetAsInt64() int64 { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsInt64); ok { - return x.AsInt64 - } - return 0 -} - func (m *MsgUpdateParam) GetAsBytes() []byte { if x, ok := m.GetAsType().(*MsgUpdateParam_AsBytes); ok { return x.AsBytes @@ -253,8 +229,6 @@ func (m *MsgUpdateParam) GetAsCoin() *types.Coin { // XXX_OneofWrappers is for the internal use of the proto package. func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*MsgUpdateParam_AsString)(nil), - (*MsgUpdateParam_AsInt64)(nil), (*MsgUpdateParam_AsBytes)(nil), (*MsgUpdateParam_AsFloat)(nil), (*MsgUpdateParam_AsCoin)(nil), @@ -511,57 +485,54 @@ func init() { func init() { proto.RegisterFile("poktroll/proof/tx.proto", fileDescriptor_345e95e87511f6a6) } var fileDescriptor_345e95e87511f6a6 = []byte{ - // 792 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x41, 0x4f, 0xdb, 0x48, - 0x14, 0x8e, 0xc3, 0x12, 0xe2, 0x49, 0xc8, 0x6a, 0x2d, 0x96, 0x38, 0x61, 0xd7, 0x89, 0x72, 0xd8, - 0xcd, 0xb2, 0x8b, 0x2d, 0x60, 0x85, 0xb4, 0xdc, 0x08, 0x5a, 0x94, 0x4a, 0x45, 0x45, 0xa6, 0x48, - 0x55, 0x2f, 0xd6, 0x24, 0x19, 0x12, 0x8b, 0xd8, 0x63, 0xcd, 0x4c, 0x28, 0xdc, 0xaa, 0x1e, 0x7b, - 0xea, 0xcf, 0xe8, 0x91, 0x43, 0x2f, 0xfd, 0x07, 0x1c, 0x51, 0x4f, 0x9c, 0xa2, 0x2a, 0x54, 0x42, - 0x85, 0x3f, 0x51, 0x79, 0x66, 0xe2, 0x38, 0x69, 0x80, 0xaa, 0xa7, 0x5e, 0xe2, 0x99, 0xf7, 0x7d, - 0xf3, 0xe5, 0xbd, 0xef, 0x3d, 0x8f, 0x41, 0x3e, 0xc0, 0x47, 0x8c, 0xe0, 0x6e, 0xd7, 0x0a, 0x08, - 0xc6, 0x87, 0x16, 0x3b, 0x31, 0x03, 0x82, 0x19, 0xd6, 0x72, 0x43, 0xc0, 0xe4, 0x40, 0xf1, 0x17, - 0xe8, 0xb9, 0x3e, 0xb6, 0xf8, 0xaf, 0xa0, 0x14, 0x8d, 0x26, 0xa6, 0x1e, 0xa6, 0x56, 0x03, 0x52, - 0x64, 0x1d, 0xaf, 0x36, 0x10, 0x83, 0xab, 0x56, 0x13, 0xbb, 0xbe, 0xc4, 0xf3, 0x12, 0xf7, 0x68, - 0xdb, 0x3a, 0x5e, 0x0d, 0x1f, 0x12, 0x28, 0x08, 0xc0, 0xe1, 0x3b, 0x4b, 0x6c, 0x24, 0xb4, 0xd0, - 0xc6, 0x6d, 0x2c, 0xe2, 0xe1, 0x4a, 0x46, 0x97, 0x26, 0xb2, 0x0c, 0x20, 0x81, 0xde, 0xf0, 0x48, - 0x71, 0xb2, 0x84, 0xd3, 0x00, 0x0d, 0xb1, 0xdf, 0x22, 0x8c, 0x22, 0x4a, 0x5d, 0xec, 0x8f, 0xa1, - 0xbf, 0x8f, 0xd0, 0x0e, 0x24, 0xa8, 0x65, 0x51, 0x44, 0x8e, 0xdd, 0x26, 0x12, 0x70, 0xe5, 0xbd, - 0x02, 0x7e, 0xde, 0xa5, 0xed, 0x83, 0xa0, 0x05, 0x19, 0xda, 0xe3, 0x7f, 0xa9, 0x6d, 0x00, 0x15, - 0xf6, 0x58, 0x07, 0x13, 0x97, 0x9d, 0xea, 0x4a, 0x59, 0xa9, 0xaa, 0x35, 0xfd, 0xc3, 0xbb, 0x95, - 0x05, 0x59, 0xc4, 0x56, 0xab, 0x45, 0x10, 0xa5, 0xfb, 0x8c, 0xb8, 0x7e, 0xdb, 0x1e, 0x51, 0xb5, - 0xff, 0x40, 0x4a, 0x24, 0xad, 0x27, 0xcb, 0x4a, 0x35, 0xb3, 0xb6, 0x68, 0x8e, 0xfb, 0x6b, 0x0a, - 0xfd, 0x9a, 0x7a, 0xde, 0x2f, 0x25, 0xde, 0x5e, 0x9f, 0x2d, 0x2b, 0xb6, 0x3c, 0xb0, 0xb9, 0xfe, - 0xea, 0xfa, 0x6c, 0x79, 0x24, 0xf5, 0xfa, 0xfa, 0x6c, 0xb9, 0x1c, 0x25, 0x7e, 0x22, 0x8b, 0x9e, - 0xc8, 0xb3, 0x52, 0x00, 0xf9, 0x89, 0x90, 0x8d, 0x68, 0x80, 0x7d, 0x8a, 0x2a, 0x9f, 0x93, 0x20, - 0x37, 0x8e, 0x7d, 0x77, 0x55, 0x1a, 0xf8, 0xc9, 0x87, 0x1e, 0xe2, 0x35, 0xa9, 0x36, 0x5f, 0x6b, - 0xff, 0x00, 0x15, 0x52, 0x87, 0x72, 0xae, 0x3e, 0xc3, 0xb5, 0xe6, 0x6f, 0xfa, 0xa5, 0x51, 0xb0, - 0x9e, 0xb0, 0xd3, 0x50, 0x8a, 0x69, 0x7f, 0x81, 0x34, 0xa4, 0x8e, 0xeb, 0xb3, 0x8d, 0x7f, 0xf5, - 0x54, 0x59, 0xa9, 0xce, 0xd4, 0xb2, 0x37, 0xfd, 0x52, 0x14, 0xab, 0x27, 0xec, 0x39, 0x48, 0x1f, - 0x85, 0x4b, 0x49, 0x6d, 0x9c, 0x32, 0x44, 0xf5, 0xb9, 0xb2, 0x52, 0xcd, 0x46, 0x54, 0x1e, 0x13, - 0xd4, 0x5a, 0xb8, 0x94, 0xd4, 0xc3, 0x2e, 0x86, 0x4c, 0x4f, 0x97, 0x95, 0x6a, 0x32, 0xa2, 0xf2, - 0x98, 0xa0, 0xee, 0x84, 0x4b, 0x6d, 0x0b, 0xcc, 0x41, 0xea, 0x84, 0x53, 0xab, 0xab, 0xbc, 0x33, - 0x05, 0x53, 0x56, 0x1d, 0x8e, 0xb5, 0x29, 0xc7, 0xda, 0xdc, 0xc6, 0xae, 0x5f, 0xcb, 0xdc, 0xf4, - 0x4b, 0x43, 0x76, 0x3d, 0x61, 0xa7, 0x20, 0x0d, 0xc3, 0x9b, 0xb9, 0xf1, 0x06, 0xd5, 0x54, 0x2e, - 0x19, 0x0e, 0x5a, 0xa5, 0x0e, 0x16, 0xc7, 0xad, 0x1e, 0x76, 0x41, 0x33, 0xa3, 0x81, 0x50, 0xee, - 0x1b, 0x88, 0xe1, 0x14, 0x54, 0x6e, 0x15, 0xde, 0xb5, 0x6d, 0x82, 0x20, 0x43, 0xdb, 0x5d, 0xe8, - 0x7a, 0xda, 0x53, 0x50, 0xa0, 0xbd, 0x20, 0xe8, 0xba, 0x88, 0x38, 0x38, 0x40, 0x04, 0x32, 0x4c, - 0x1c, 0x28, 0x7a, 0xf5, 0x60, 0x17, 0xf3, 0xc3, 0xa3, 0x4f, 0xe4, 0x49, 0x09, 0x6b, 0x3b, 0x20, - 0x27, 0xdf, 0x15, 0xa7, 0x83, 0x60, 0x0b, 0x11, 0x39, 0xb1, 0xa5, 0x51, 0x82, 0x12, 0x37, 0xf7, - 0xc5, 0xb3, 0xce, 0x69, 0xf6, 0x3c, 0x8d, 0x6f, 0xb5, 0x25, 0xa0, 0x12, 0x8c, 0x99, 0xd3, 0x81, - 0xb4, 0xc3, 0xe7, 0x20, 0x6b, 0xa7, 0xc3, 0x40, 0x1d, 0xd2, 0xce, 0xa6, 0x11, 0x5a, 0x76, 0x77, - 0xf6, 0x95, 0xff, 0xb9, 0x6f, 0xb1, 0x62, 0x23, 0xdf, 0xfe, 0x06, 0xb3, 0xcd, 0x30, 0x20, 0x6d, - 0xfb, 0x75, 0xd2, 0x36, 0xc1, 0x16, 0x9c, 0xca, 0x27, 0x61, 0xda, 0x7e, 0xaf, 0xe1, 0xb9, 0x6c, - 0x2f, 0xc4, 0x7f, 0x70, 0xd3, 0x16, 0xc0, 0x2c, 0x2f, 0x43, 0x1a, 0x26, 0x36, 0xdf, 0xe8, 0x56, - 0xac, 0xca, 0xb8, 0x5b, 0x42, 0xef, 0x0e, 0xb7, 0x04, 0x5b, 0x70, 0xd6, 0x6e, 0x93, 0x60, 0x66, - 0x97, 0xb6, 0xb5, 0x67, 0x20, 0x3b, 0x76, 0xe7, 0x95, 0x26, 0x4f, 0x4d, 0xdc, 0x2c, 0xc5, 0x3f, - 0x1f, 0x20, 0x44, 0xe9, 0x1c, 0x80, 0x4c, 0x7c, 0x80, 0x8d, 0x29, 0xe7, 0x62, 0x78, 0xf1, 0x8f, - 0xfb, 0xf1, 0xb8, 0x6c, 0xbc, 0xc5, 0xd3, 0x64, 0x63, 0xf8, 0x54, 0xd9, 0x69, 0xe6, 0x1d, 0x80, - 0x4c, 0xfc, 0x92, 0x34, 0xee, 0xaf, 0x72, 0xaa, 0xec, 0x94, 0x37, 0xbf, 0x38, 0xfb, 0x32, 0xbc, - 0xde, 0x6b, 0x8f, 0xcf, 0x07, 0x86, 0x72, 0x31, 0x30, 0x94, 0xcb, 0x81, 0xa1, 0x7c, 0x1c, 0x18, - 0xca, 0x9b, 0x2b, 0x23, 0x71, 0x71, 0x65, 0x24, 0x2e, 0xaf, 0x8c, 0xc4, 0x73, 0xb3, 0xed, 0xb2, - 0x4e, 0xaf, 0x61, 0x36, 0xb1, 0x67, 0x85, 0xb2, 0x2b, 0x3e, 0x62, 0x2f, 0x30, 0x39, 0xb2, 0xbe, - 0xba, 0xf9, 0xf9, 0x07, 0xad, 0x91, 0xe2, 0x9f, 0xac, 0xf5, 0x2f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xea, 0x29, 0x29, 0xa7, 0xd0, 0x07, 0x00, 0x00, + // 747 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x4d, 0x4f, 0xdb, 0x4c, + 0x10, 0x8e, 0xc3, 0xcb, 0x47, 0x36, 0xbc, 0x79, 0xf5, 0x5a, 0x94, 0x7c, 0xd0, 0x3a, 0x51, 0x0e, + 0x6d, 0x4a, 0x85, 0x2d, 0x40, 0xaa, 0x54, 0x6e, 0x04, 0x15, 0xe5, 0x50, 0x54, 0x64, 0x8a, 0x54, + 0xf5, 0x12, 0x6d, 0x92, 0x25, 0xb6, 0x88, 0xbd, 0xd6, 0xee, 0x86, 0xc2, 0xad, 0xea, 0xb1, 0x27, + 0x7e, 0x46, 0x8f, 0x1c, 0x7a, 0xe9, 0x3f, 0xe0, 0x88, 0x7a, 0xe2, 0x84, 0xaa, 0x50, 0x09, 0x09, + 0xfe, 0x44, 0xb5, 0x1f, 0x76, 0x1c, 0x37, 0x40, 0xd5, 0x53, 0x2f, 0xf1, 0xee, 0x3c, 0xcf, 0x4c, + 0x66, 0x9e, 0x19, 0x8f, 0x41, 0x3e, 0xc0, 0xfb, 0x8c, 0xe0, 0x5e, 0xcf, 0x0a, 0x08, 0xc6, 0x7b, + 0x16, 0x3b, 0x34, 0x03, 0x82, 0x19, 0xd6, 0x73, 0x21, 0x60, 0x0a, 0xa0, 0xf4, 0x3f, 0xf4, 0x5c, + 0x1f, 0x5b, 0xe2, 0x57, 0x52, 0x4a, 0x46, 0x1b, 0x53, 0x0f, 0x53, 0xab, 0x05, 0x29, 0xb2, 0x0e, + 0x96, 0x5b, 0x88, 0xc1, 0x65, 0xab, 0x8d, 0x5d, 0x5f, 0xe1, 0x79, 0x85, 0x7b, 0xb4, 0x6b, 0x1d, + 0x2c, 0xf3, 0x87, 0x02, 0x8a, 0x12, 0x68, 0x8a, 0x9b, 0x25, 0x2f, 0x0a, 0x9a, 0xeb, 0xe2, 0x2e, + 0x96, 0x76, 0x7e, 0x52, 0xd6, 0x85, 0x44, 0x96, 0x01, 0x24, 0xd0, 0x0b, 0x5d, 0x4a, 0xc9, 0x12, + 0x8e, 0x02, 0x14, 0x62, 0x0f, 0x23, 0x8c, 0x22, 0x4a, 0x5d, 0xec, 0x8f, 0xa0, 0x8f, 0x86, 0xa8, + 0x03, 0x09, 0xea, 0x58, 0x14, 0x91, 0x03, 0xb7, 0x8d, 0x24, 0x5c, 0xfd, 0xaa, 0x81, 0xff, 0xb6, + 0x68, 0x77, 0x37, 0xe8, 0x40, 0x86, 0xb6, 0xc5, 0x5f, 0xea, 0xcf, 0x41, 0x06, 0xf6, 0x99, 0x83, + 0x89, 0xcb, 0x8e, 0x0a, 0x5a, 0x45, 0xab, 0x65, 0xea, 0x85, 0x6f, 0x5f, 0x96, 0xe6, 0x54, 0x11, + 0xeb, 0x9d, 0x0e, 0x41, 0x94, 0xee, 0x30, 0xe2, 0xfa, 0x5d, 0x7b, 0x48, 0xd5, 0x5f, 0x80, 0x29, + 0x99, 0x74, 0x21, 0x5d, 0xd1, 0x6a, 0xd9, 0x95, 0x79, 0x73, 0x54, 0x5f, 0x53, 0xc6, 0xaf, 0x67, + 0x4e, 0x2f, 0xca, 0xa9, 0xcf, 0x57, 0x27, 0x8b, 0x9a, 0xad, 0x1c, 0xd6, 0x56, 0x3f, 0x5e, 0x9d, + 0x2c, 0x0e, 0x43, 0x7d, 0xba, 0x3a, 0x59, 0xac, 0x44, 0x89, 0x1f, 0xaa, 0xa2, 0x13, 0x79, 0x56, + 0x8b, 0x20, 0x9f, 0x30, 0xd9, 0x88, 0x06, 0xd8, 0xa7, 0xa8, 0x7a, 0x9c, 0x06, 0xb9, 0x51, 0xec, + 0x8f, 0xab, 0xd2, 0xc1, 0x3f, 0x3e, 0xf4, 0x90, 0xa8, 0x29, 0x63, 0x8b, 0xb3, 0xfe, 0x14, 0xcc, + 0x40, 0xda, 0x6c, 0x1d, 0x31, 0x44, 0x0b, 0xd3, 0x15, 0xad, 0x36, 0x5b, 0x9f, 0xbd, 0xbe, 0x28, + 0x47, 0xb6, 0x46, 0xca, 0x9e, 0x86, 0xb4, 0xce, 0x8f, 0x8a, 0xba, 0xd7, 0xc3, 0x90, 0x15, 0x66, + 0x2a, 0x5a, 0x2d, 0x1d, 0x51, 0x85, 0x4d, 0x52, 0x37, 0xf9, 0x51, 0x5f, 0x07, 0xd3, 0x90, 0x36, + 0xf9, 0x70, 0x15, 0x32, 0x42, 0xc0, 0xa2, 0xa9, 0x92, 0xe3, 0xd3, 0x67, 0xaa, 0xe9, 0x33, 0x37, + 0xb0, 0xeb, 0xd7, 0xb3, 0xd7, 0x17, 0xe5, 0x90, 0xdd, 0x48, 0xd9, 0x53, 0x90, 0x72, 0xf3, 0x5a, + 0x6e, 0x54, 0xc7, 0x7a, 0x46, 0x84, 0xe4, 0xf3, 0x50, 0x6d, 0x80, 0xf9, 0x51, 0x45, 0x42, 0xb1, + 0x74, 0x33, 0xea, 0x9b, 0x76, 0x57, 0xdf, 0xc2, 0x66, 0x55, 0x6f, 0x34, 0x21, 0xee, 0x06, 0x41, + 0x90, 0xa1, 0x8d, 0x1e, 0x74, 0x3d, 0xfd, 0x0d, 0x28, 0xd2, 0x7e, 0x10, 0xf4, 0x5c, 0x44, 0x9a, + 0x38, 0x40, 0x04, 0x32, 0x4c, 0x9a, 0x50, 0x4a, 0x7a, 0xaf, 0xd8, 0xf9, 0xd0, 0xf5, 0xb5, 0xf2, + 0x54, 0xb0, 0xbe, 0x09, 0x72, 0x6a, 0xa4, 0x9b, 0x0e, 0x82, 0x1d, 0x44, 0xd4, 0x60, 0x95, 0x87, + 0x09, 0x2a, 0xdc, 0xdc, 0x91, 0xcf, 0x86, 0xa0, 0xd9, 0xff, 0xd2, 0xf8, 0x55, 0x5f, 0x00, 0x19, + 0x82, 0x31, 0x6b, 0x3a, 0x90, 0x3a, 0x85, 0x09, 0xde, 0x2f, 0x7b, 0x86, 0x1b, 0x1a, 0x90, 0x3a, + 0x6b, 0x06, 0x97, 0xec, 0xf6, 0xec, 0xab, 0x2f, 0x85, 0x6e, 0xb1, 0x62, 0x23, 0xdd, 0x9e, 0x81, + 0xc9, 0x36, 0x37, 0x28, 0xd9, 0x1e, 0x24, 0x65, 0x93, 0x6c, 0xc9, 0xa9, 0xfe, 0x90, 0xa2, 0xed, + 0xf4, 0x5b, 0x9e, 0xcb, 0xb6, 0x39, 0xfe, 0x97, 0x8b, 0x36, 0x07, 0x26, 0x45, 0x19, 0x4a, 0x30, + 0x79, 0xf9, 0x4d, 0xb5, 0x62, 0x55, 0xc6, 0xd5, 0x92, 0xf1, 0x6e, 0x51, 0x4b, 0xb2, 0x25, 0x67, + 0xe5, 0x26, 0x0d, 0x26, 0xb6, 0x68, 0x57, 0x7f, 0x0b, 0x66, 0x47, 0x56, 0x53, 0x39, 0xe9, 0x95, + 0x58, 0x00, 0xa5, 0x27, 0xf7, 0x10, 0xa2, 0x74, 0x76, 0x41, 0x36, 0x3e, 0xc0, 0xc6, 0x18, 0xbf, + 0x18, 0x5e, 0x7a, 0x7c, 0x37, 0x1e, 0x0f, 0x1b, 0x6f, 0xf1, 0xb8, 0xb0, 0x31, 0x7c, 0x6c, 0xd8, + 0x71, 0xe2, 0xed, 0x82, 0x6c, 0x7c, 0x97, 0x19, 0x77, 0x57, 0x39, 0x36, 0xec, 0x98, 0x37, 0xbf, + 0x34, 0xf9, 0x81, 0x6f, 0xe1, 0xfa, 0xab, 0xd3, 0x81, 0xa1, 0x9d, 0x0d, 0x0c, 0xed, 0x7c, 0x60, + 0x68, 0xdf, 0x07, 0x86, 0x76, 0x7c, 0x69, 0xa4, 0xce, 0x2e, 0x8d, 0xd4, 0xf9, 0xa5, 0x91, 0x7a, + 0x67, 0x76, 0x5d, 0xe6, 0xf4, 0x5b, 0x66, 0x1b, 0x7b, 0x16, 0x0f, 0xbb, 0xe4, 0x23, 0xf6, 0x1e, + 0x93, 0x7d, 0xeb, 0x97, 0x05, 0x2d, 0xbe, 0x3b, 0xad, 0x29, 0xf1, 0x65, 0x59, 0xfd, 0x19, 0x00, + 0x00, 0xff, 0xff, 0x70, 0xd3, 0xcd, 0x4c, 0x77, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -865,32 +836,6 @@ func (m *MsgUpdateParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateParam_AsString) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsString) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i -= len(m.AsString) - copy(dAtA[i:], m.AsString) - i = encodeVarintTx(dAtA, i, uint64(len(m.AsString))) - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} -func (m *MsgUpdateParam_AsInt64) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParam_AsInt64) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintTx(dAtA, i, uint64(m.AsInt64)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} func (m *MsgUpdateParam_AsBytes) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) @@ -1199,25 +1144,6 @@ func (m *MsgUpdateParam) Size() (n int) { return n } -func (m *MsgUpdateParam_AsString) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AsString) - n += 1 + l + sovTx(uint64(l)) - return n -} -func (m *MsgUpdateParam_AsInt64) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovTx(uint64(m.AsInt64)) - return n -} func (m *MsgUpdateParam_AsBytes) Size() (n int) { if m == nil { return 0 @@ -1596,58 +1522,6 @@ func (m *MsgUpdateParam) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AsString", 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.AsType = &MsgUpdateParam_AsString{string(dAtA[iNdEx:postIndex])} - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AsType = &MsgUpdateParam_AsInt64{v} case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) diff --git a/x/service/keeper/msg_server_update_param.go b/x/service/keeper/msg_server_update_param.go index d2d224dba..ac1ea6a6c 100644 --- a/x/service/keeper/msg_server_update_param.go +++ b/x/service/keeper/msg_server_update_param.go @@ -3,6 +3,9 @@ package keeper import ( "context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/pokt-network/poktroll/x/service/types" ) @@ -12,38 +15,51 @@ func (k msgServer) UpdateParam( ctx context.Context, msg *types.MsgUpdateParam, ) (*types.MsgUpdateParamResponse, error) { + logger := k.logger.With( + "method", "UpdateParam", + "param_name", msg.Name, + ) + if err := msg.ValidateBasic(); err != nil { - return nil, err + return nil, status.Error(codes.InvalidArgument, err.Error()) } if k.GetAuthority() != msg.Authority { - return nil, types.ErrServiceInvalidSigner.Wrapf("invalid authority; expected %s, got %s", k.GetAuthority(), msg.Authority) + return nil, status.Error( + codes.InvalidArgument, + types.ErrServiceInvalidSigner.Wrapf( + "invalid authority; expected %s, got %s", + k.GetAuthority(), msg.Authority, + ).Error(), + ) } params := k.GetParams(ctx) switch msg.Name { case types.ParamAddServiceFee: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsCoin) - if !ok { - return nil, types.ErrServiceParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - addServiceFee := value.AsCoin - - if err := types.ValidateAddServiceFee(addServiceFee); err != nil { - return nil, err - } - - params.AddServiceFee = addServiceFee + logger = logger.With("param_value", msg.GetAsCoin()) + params.AddServiceFee = msg.GetAsCoin() default: - return nil, types.ErrServiceParamInvalid.Wrapf("unsupported param %q", msg.Name) + return nil, status.Error( + codes.InvalidArgument, + types.ErrServiceParamInvalid.Wrapf("unsupported param %q", msg.Name).Error(), + ) + } + + // Perform a global validation on all params, which includes the updated param. + // This is needed to ensure that the updated param is valid in the context of all other params. + if err := params.ValidateBasic(); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) } if err := k.SetParams(ctx, params); err != nil { - return nil, err + logger.Info("ERROR: %s", err) + return nil, status.Error(codes.Internal, err.Error()) } updatedParams := k.GetParams(ctx) + return &types.MsgUpdateParamResponse{ Params: &updatedParams, }, nil diff --git a/x/service/keeper/msg_server_update_param_test.go b/x/service/keeper/msg_server_update_param_test.go index 74c038d20..67c2eb979 100644 --- a/x/service/keeper/msg_server_update_param_test.go +++ b/x/service/keeper/msg_server_update_param_test.go @@ -14,7 +14,7 @@ import ( servicetypes "github.com/pokt-network/poktroll/x/service/types" ) -func TestMsgUpdateParam_UpdateAddServiceFee(t *testing.T) { +func TestMsgUpdateParam_UpdateAddServiceFeeOnly(t *testing.T) { expectedAddServiceFee := &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(1000000001)} // Set the parameters to their default values diff --git a/x/service/keeper/msg_update_params_test.go b/x/service/keeper/msg_update_params_test.go index e2340e064..e473aab7d 100644 --- a/x/service/keeper/msg_update_params_test.go +++ b/x/service/keeper/msg_update_params_test.go @@ -30,13 +30,13 @@ func TestMsgUpdateParams(t *testing.T) { expectedErrMsg: "invalid authority", }, { - desc: "send empty params", + desc: "invalid: send empty params", input: &types.MsgUpdateParams{ Authority: k.GetAuthority(), Params: types.Params{}, }, shouldError: true, - expectedErrMsg: "invalid ServiceFee", + expectedErrMsg: "missing add_service_fee", }, { desc: "valid: send default params", diff --git a/x/service/keeper/params_test.go b/x/service/keeper/params_test.go index 2c7100aef..556f1de0f 100644 --- a/x/service/keeper/params_test.go +++ b/x/service/keeper/params_test.go @@ -6,13 +6,43 @@ import ( "github.com/stretchr/testify/require" keepertest "github.com/pokt-network/poktroll/testutil/keeper" - "github.com/pokt-network/poktroll/x/service/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" ) func TestGetParams(t *testing.T) { k, ctx := keepertest.ServiceKeeper(t) - params := types.DefaultParams() + params := servicetypes.DefaultParams() require.NoError(t, k.SetParams(ctx, params)) require.EqualValues(t, params, k.GetParams(ctx)) } + +func TestParams_ValidateAddServiceFee(t *testing.T) { + tests := []struct { + desc string + addServiceFee any + expectedErr error + }{ + { + desc: "invalid type", + addServiceFee: "100upokt", + expectedErr: servicetypes.ErrServiceParamInvalid, + }, + { + desc: "valid AddServiceFee", + addServiceFee: &servicetypes.MinAddServiceFee, + }, + } + + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := servicetypes.ValidateAddServiceFee(test.addServiceFee) + if test.expectedErr != nil { + require.Error(t, err) + require.Contains(t, err.Error(), test.expectedErr.Error()) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/tokenomics/keeper/query_relay_mining_difficulty.go b/x/service/keeper/query_relay_mining_difficulty.go similarity index 97% rename from x/tokenomics/keeper/query_relay_mining_difficulty.go rename to x/service/keeper/query_relay_mining_difficulty.go index 6b7b2f36d..67fdc3077 100644 --- a/x/tokenomics/keeper/query_relay_mining_difficulty.go +++ b/x/service/keeper/query_relay_mining_difficulty.go @@ -9,7 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/pokt-network/poktroll/x/tokenomics/types" + "github.com/pokt-network/poktroll/x/service/types" ) func (k Keeper) RelayMiningDifficultyAll(ctx context.Context, req *types.QueryAllRelayMiningDifficultyRequest) (*types.QueryAllRelayMiningDifficultyResponse, error) { diff --git a/x/tokenomics/keeper/query_relay_mining_difficulty_test.go b/x/service/keeper/query_relay_mining_difficulty_test.go similarity index 95% rename from x/tokenomics/keeper/query_relay_mining_difficulty_test.go rename to x/service/keeper/query_relay_mining_difficulty_test.go index 7146cfdb3..3e42c4151 100644 --- a/x/tokenomics/keeper/query_relay_mining_difficulty_test.go +++ b/x/service/keeper/query_relay_mining_difficulty_test.go @@ -11,14 +11,14 @@ import ( keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/testutil/nullify" - "github.com/pokt-network/poktroll/x/tokenomics/types" + "github.com/pokt-network/poktroll/x/service/types" ) // Prevent strconv unused error var _ = strconv.IntSize func TestRelayMiningDifficultyQuerySingle(t *testing.T) { - keeper, ctx := keepertest.TokenomicsKeeper(t) + keeper, ctx := keepertest.ServiceKeeper(t) msgs := createNRelayMiningDifficulty(keeper, ctx, 2) tests := []struct { desc string @@ -69,7 +69,7 @@ func TestRelayMiningDifficultyQuerySingle(t *testing.T) { } func TestRelayMiningDifficultyQueryPaginated(t *testing.T) { - keeper, ctx := keepertest.TokenomicsKeeper(t) + keeper, ctx := keepertest.ServiceKeeper(t) msgs := createNRelayMiningDifficulty(keeper, ctx, 5) request := func(next []byte, offset, limit uint64, total bool) *types.QueryAllRelayMiningDifficultyRequest { diff --git a/x/tokenomics/keeper/relay_mining_difficulty.go b/x/service/keeper/relay_mining_difficulty.go similarity index 97% rename from x/tokenomics/keeper/relay_mining_difficulty.go rename to x/service/keeper/relay_mining_difficulty.go index 1b16e5fbe..191d97a5c 100644 --- a/x/tokenomics/keeper/relay_mining_difficulty.go +++ b/x/service/keeper/relay_mining_difficulty.go @@ -8,7 +8,7 @@ import ( storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/runtime" - "github.com/pokt-network/poktroll/x/tokenomics/types" + "github.com/pokt-network/poktroll/x/service/types" ) // SetRelayMiningDifficulty set a specific relayMiningDifficulty in the store from its index diff --git a/x/tokenomics/keeper/relay_mining_difficulty_test.go b/x/service/keeper/relay_mining_difficulty_test.go similarity index 85% rename from x/tokenomics/keeper/relay_mining_difficulty_test.go rename to x/service/keeper/relay_mining_difficulty_test.go index 3644fe4c8..37bf9ebee 100644 --- a/x/tokenomics/keeper/relay_mining_difficulty_test.go +++ b/x/service/keeper/relay_mining_difficulty_test.go @@ -9,8 +9,8 @@ import ( keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/testutil/nullify" - "github.com/pokt-network/poktroll/x/tokenomics/keeper" - "github.com/pokt-network/poktroll/x/tokenomics/types" + "github.com/pokt-network/poktroll/x/service/keeper" + "github.com/pokt-network/poktroll/x/service/types" ) // Prevent strconv unused error @@ -27,7 +27,7 @@ func createNRelayMiningDifficulty(keeper keeper.Keeper, ctx context.Context, n i } func TestRelayMiningDifficultyGet(t *testing.T) { - keeper, ctx := keepertest.TokenomicsKeeper(t) + keeper, ctx := keepertest.ServiceKeeper(t) difficulties := createNRelayMiningDifficulty(keeper, ctx, 10) for _, difficulty := range difficulties { rst, found := keeper.GetRelayMiningDifficulty(ctx, @@ -41,7 +41,7 @@ func TestRelayMiningDifficultyGet(t *testing.T) { } } func TestRelayMiningDifficultyRemove(t *testing.T) { - keeper, ctx := keepertest.TokenomicsKeeper(t) + keeper, ctx := keepertest.ServiceKeeper(t) difficulties := createNRelayMiningDifficulty(keeper, ctx, 10) for _, difficulty := range difficulties { keeper.RemoveRelayMiningDifficulty(ctx, @@ -55,7 +55,7 @@ func TestRelayMiningDifficultyRemove(t *testing.T) { } func TestRelayMiningDifficultyGetAll(t *testing.T) { - keeper, ctx := keepertest.TokenomicsKeeper(t) + keeper, ctx := keepertest.ServiceKeeper(t) difficulties := createNRelayMiningDifficulty(keeper, ctx, 10) require.ElementsMatch(t, nullify.Fill(difficulties), diff --git a/x/tokenomics/keeper/scale_difficulty_test.go b/x/service/keeper/scale_difficulty_test.go similarity index 100% rename from x/tokenomics/keeper/scale_difficulty_test.go rename to x/service/keeper/scale_difficulty_test.go diff --git a/x/service/keeper/update_relay_mining_difficulty.go b/x/service/keeper/update_relay_mining_difficulty.go new file mode 100644 index 000000000..0a3ac6fc8 --- /dev/null +++ b/x/service/keeper/update_relay_mining_difficulty.go @@ -0,0 +1,185 @@ +package keeper + +import ( + "bytes" + "context" + "encoding/hex" + "fmt" + "math/big" + "sort" + + "cosmossdk.io/log" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/pokt-network/poktroll/pkg/crypto/protocol" + "github.com/pokt-network/poktroll/x/service/types" +) + +var ( + // TargetNumRelays is the target number of relays we want the network to mine for + // a specific service across all applications & suppliers per session. + // This number determines the total number of leafs to be created across in + // the off-chain SMTs, across all suppliers, for each service. + // It indirectly drives the off-chain resource requirements of the network + // in additional to playing a critical role in Relay Mining. + // TODO_MAINNET(#542): Make this a governance parameter and figure out the correct value. + TargetNumRelays = uint64(10e4) + + // Exponential moving average (ema) smoothing factor, commonly known as alpha. + // Usually, alpha = 2 / (N+1), where N is the number of periods. + // Large alpha -> more weight on recent data; less smoothing and fast response. + // Small alpha -> more weight on past data; more smoothing and slow response. + // + // TODO_MAINNET: Use a language agnostic float implementation or arithmetic library + // to ensure deterministic results across different language implementations of the + // protocol. + // + // TODO_MAINNET(@olshansk, @rawthil): Play around with the value N for EMA to + // capture what the memory should be. + emaSmoothingFactor = new(big.Float).SetFloat64(0.1) +) + +// UpdateRelayMiningDifficulty updates the on-chain relay mining difficulty +// based on the amount of on-chain relays for each service, given a map of serviceId->numRelays. +func (k Keeper) UpdateRelayMiningDifficulty( + ctx context.Context, + relaysPerServiceMap map[string]uint64, +) (difficultyPerServiceMap map[string]types.RelayMiningDifficulty, err error) { + logger := k.Logger().With("method", "UpdateRelayMiningDifficulty") + sdkCtx := sdk.UnwrapSDKContext(ctx) + + difficultyPerServiceMap = make(map[string]types.RelayMiningDifficulty, len(relaysPerServiceMap)) + + // Iterate over the relaysPerServiceMap deterministically by sorting the keys. + // This ensures that the order of the keys is consistent across different nodes. + // See comment: https://github.com/pokt-network/poktroll/pull/840#discussion_r1796663285 + sortedRelayPerServiceMapKeys := getSortedMapKeys(relaysPerServiceMap) + for _, serviceId := range sortedRelayPerServiceMapKeys { + numRelays := relaysPerServiceMap[serviceId] + prevDifficulty, found := k.GetRelayMiningDifficulty(ctx, serviceId) + if !found { + prevDifficulty = NewDefaultRelayMiningDifficulty(ctx, logger, serviceId, numRelays) + } + + // TODO_MAINNET(@Olshansk): We could potentially compute the smoothing factor + // using a common formula, such as alpha = 2 / (N+1), where N is the number + // of periods. + // N := ctx.BlockHeight() - prevDifficulty.BlockHeight + // alpha := 2 / (1 + N) + alpha := emaSmoothingFactor + + // Compute the updated EMA of the number of relays. + prevRelaysEma := prevDifficulty.NumRelaysEma + newRelaysEma := computeEma(alpha, prevRelaysEma, numRelays) + + // CRITICAL_DEV_NOTE: We changed this code to pass in "BaseRelayDifficultyHashBz" instead of "prevDifficulty.TargetHash" + // to "ComputeNewDifficultyTargetHash" because we used to have 2 moving variables: + // 1. Input difficulty + // 2. Relays EMA + // However, since the "TargetNumRelays" remained constant, the following case would keep scaling down the difficulty: + // - newRelaysEma = 100 -> scaled by 10 / 100 -> scaled down by 0.1 + // - newRelaysEma = 50 -> scaled by 10 / 50 -> scaled down by 0.2 + // - newRelaysEma = 20 -> scaled by 10 / 20 -> scaled down by 0.5 + // We kept scaling down even though numRelaysEma was decreasing. + // To avoid continuing to increase the difficulty (i.e. scaling down), the + // relative starting difficulty has to be kept constant. + difficultyHash := protocol.ComputeNewDifficultyTargetHash(protocol.BaseRelayDifficultyHashBz, TargetNumRelays, newRelaysEma) + newDifficulty := types.RelayMiningDifficulty{ + ServiceId: serviceId, + BlockHeight: sdkCtx.BlockHeight(), + NumRelaysEma: newRelaysEma, + TargetHash: difficultyHash, + } + k.SetRelayMiningDifficulty(ctx, newDifficulty) + + // Emit an event for the updated relay mining difficulty regardless of + // whether the difficulty changed or not. + + relayMiningDifficultyUpdateEvent := types.EventRelayMiningDifficultyUpdated{ + ServiceId: serviceId, + PrevTargetHashHexEncoded: hex.EncodeToString(prevDifficulty.TargetHash), + NewTargetHashHexEncoded: hex.EncodeToString(newDifficulty.TargetHash), + PrevNumRelaysEma: prevDifficulty.NumRelaysEma, + NewNumRelaysEma: newDifficulty.NumRelaysEma, + } + if err := sdkCtx.EventManager().EmitTypedEvent(&relayMiningDifficultyUpdateEvent); err != nil { + return nil, err + } + + // Output the appropriate log message based on whether the difficulty was initialized, updated or unchanged. + var logMessage string + switch { + case !found: + logMessage = fmt.Sprintf("Initialized RelayMiningDifficulty for service %s at height %d with difficulty %x", serviceId, sdkCtx.BlockHeight(), newDifficulty.TargetHash) + case !bytes.Equal(prevDifficulty.TargetHash, newDifficulty.TargetHash): + logMessage = fmt.Sprintf("Updated RelayMiningDifficulty for service %s at height %d from %x to %x", serviceId, sdkCtx.BlockHeight(), prevDifficulty.TargetHash, newDifficulty.TargetHash) + default: + logMessage = fmt.Sprintf("No change in RelayMiningDifficulty for service %s at height %d. Current difficulty: %x", serviceId, sdkCtx.BlockHeight(), newDifficulty.TargetHash) + } + logger.Info(logMessage) + + // Store the updated difficulty in the map for telemetry. + // This is done to only emit the telemetry event if all the difficulties + // are updated successfully. + difficultyPerServiceMap[serviceId] = newDifficulty + } + + return difficultyPerServiceMap, nil +} + +// computeEma computes the EMA at time t, given the EMA at time t-1, the raw +// data revealed at time t, and the smoothing factor α. +// Src: https://en.wikipedia.org/wiki/Exponential_smoothing +// +// TODO_MAINNET: Use a language agnostic float implementation or arithmetic library +// to ensure deterministic results across different language implementations of the +// protocol. +func computeEma(alpha *big.Float, prevEma, currValue uint64) uint64 { + oneMinusAlpha := new(big.Float).Sub(new(big.Float).SetInt64(1), alpha) + prevEmaFloat := new(big.Float).SetUint64(prevEma) + + weightedCurrentContribution := new(big.Float).Mul(alpha, new(big.Float).SetUint64(currValue)) + weightedPreviousContribution := new(big.Float).Mul(oneMinusAlpha, prevEmaFloat) + newEma, _ := new(big.Float).Add(weightedCurrentContribution, weightedPreviousContribution).Uint64() + return newEma +} + +// NewDefaultRelayMiningDifficulty is a helper that creates a new RelayMiningDifficulty +// structure if one is not available. It is often used to set the default when a service's +// difficulty is being initialized for the first time. +func NewDefaultRelayMiningDifficulty( + ctx context.Context, + logger log.Logger, + serviceId string, + numRelays uint64, +) types.RelayMiningDifficulty { + logger = logger.With("helper", "NewDefaultRelayMiningDifficulty") + + // Compute the target hash based on the number of relays seen for the first time. + newDifficultyHash := protocol.ComputeNewDifficultyTargetHash(protocol.BaseRelayDifficultyHashBz, TargetNumRelays, numRelays) + + logger.Warn(types.ErrServiceMissingRelayMiningDifficulty.Wrapf( + "No previous relay mining difficulty found for service %s.\n"+ + "Creating a new relay mining difficulty with %d relays and an initial target hash %x", + serviceId, numRelays, newDifficultyHash).Error()) + + // Return a new RelayMiningDifficulty with the computed target hash. + return types.RelayMiningDifficulty{ + ServiceId: serviceId, + BlockHeight: sdk.UnwrapSDKContext(ctx).BlockHeight(), + NumRelaysEma: numRelays, + TargetHash: newDifficultyHash, + } + +} + +// getSortedMapKeys returns the keys of a map lexicographically sorted. +func getSortedMapKeys(m map[string]uint64) []string { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + + sort.Strings(keys) + return keys +} diff --git a/x/tokenomics/keeper/update_relay_mining_difficulty_test.go b/x/service/keeper/update_relay_mining_difficulty_test.go similarity index 87% rename from x/tokenomics/keeper/update_relay_mining_difficulty_test.go rename to x/service/keeper/update_relay_mining_difficulty_test.go index 70ce23846..f355d0977 100644 --- a/x/tokenomics/keeper/update_relay_mining_difficulty_test.go +++ b/x/service/keeper/update_relay_mining_difficulty_test.go @@ -10,16 +10,14 @@ import ( "github.com/pokt-network/poktroll/pkg/crypto/protocol" testutilevents "github.com/pokt-network/poktroll/testutil/events" keepertest "github.com/pokt-network/poktroll/testutil/keeper" - "github.com/pokt-network/poktroll/x/tokenomics/keeper" - tokenomicskeeper "github.com/pokt-network/poktroll/x/tokenomics/keeper" - "github.com/pokt-network/poktroll/x/tokenomics/types" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" + servicetypes "github.com/pokt-network/poktroll/x/service/types" ) func TestComputeNewDifficultyHash_MonotonicallyIncreasingRelays(t *testing.T) { svcId := "svc1" - keeper, ctx := keepertest.TokenomicsKeeper(t) + keeper, ctx := keepertest.ServiceKeeper(t) prevEMA := uint64(0) prevTargetHash := protocol.BaseRelayDifficultyHashBz @@ -53,7 +51,7 @@ func TestComputeNewDifficultyHash_MonotonicallyIncreasingRelays(t *testing.T) { func TestComputeNewDifficultyHash_MonotonicallyDecreasingRelays(t *testing.T) { svcId := "svc1" - keeper, ctx := keepertest.TokenomicsKeeper(t) + keeper, ctx := keepertest.ServiceKeeper(t) prevEMA := uint64(0) prevTargetHash := protocol.BaseRelayDifficultyHashBz @@ -91,7 +89,7 @@ func TestComputeNewDifficultyHash_MonotonicallyDecreasingRelays(t *testing.T) { // a flow testing a few different scenarios, but does not cover the full range // of edge or use cases. func TestUpdateRelayMiningDifficulty_Base(t *testing.T) { - keeper, ctx := keepertest.TokenomicsKeeper(t) + keeper, ctx := keepertest.ServiceKeeper(t) sdkCtx := cosmostypes.UnwrapSDKContext(ctx) // Introduce svc1 for the first time @@ -152,7 +150,7 @@ func TestUpdateRelayMiningDifficulty_Base(t *testing.T) { require.True(t, found) require.Less(t, difficultySvc22.NumRelaysEma, difficultySvc21.NumRelaysEma) // Since the relays EMA is lower than the target, the difficulty hash is all 1s - require.Less(t, difficultySvc22.NumRelaysEma, tokenomicskeeper.TargetNumRelays) + require.Less(t, difficultySvc22.NumRelaysEma, servicekeeper.TargetNumRelays) require.Equal(t, difficultySvc22.TargetHash, makeBytesFullOfOnes(32)) // svc3 is new so the relay ema is equal to the first value provided @@ -162,8 +160,8 @@ func TestUpdateRelayMiningDifficulty_Base(t *testing.T) { // Confirm a relay mining difficulty update event was emitted events := sdkCtx.EventManager().Events() - expectedEvents := testutilevents.FilterEvents[*tokenomicstypes.EventRelayMiningDifficultyUpdated](t, - events, "poktroll.tokenomics.EventRelayMiningDifficultyUpdated") + expectedEvents := testutilevents.FilterEvents[*servicetypes.EventRelayMiningDifficultyUpdated](t, + events, "poktroll.service.EventRelayMiningDifficultyUpdated") require.Len(t, expectedEvents, 6) // 3 for svc1, 2 for svc2, 1 for svc3 } @@ -171,33 +169,33 @@ func TestUpdateRelayMiningDifficulty_FirstDifficulty(t *testing.T) { tests := []struct { desc string numRelays uint64 - expectedRelayMiningDifficulty types.RelayMiningDifficulty + expectedRelayMiningDifficulty servicetypes.RelayMiningDifficulty }{ { desc: "First Difficulty way below target", - numRelays: keeper.TargetNumRelays / 1e3, - expectedRelayMiningDifficulty: types.RelayMiningDifficulty{ + numRelays: servicekeeper.TargetNumRelays / 1e3, + expectedRelayMiningDifficulty: servicetypes.RelayMiningDifficulty{ ServiceId: "svc1", BlockHeight: 1, - NumRelaysEma: keeper.TargetNumRelays / 1e3, + NumRelaysEma: servicekeeper.TargetNumRelays / 1e3, TargetHash: defaultDifficulty(), // default difficulty without any leading 0 bits }, }, { desc: "First Difficulty equal to target", - numRelays: keeper.TargetNumRelays, - expectedRelayMiningDifficulty: types.RelayMiningDifficulty{ + numRelays: servicekeeper.TargetNumRelays, + expectedRelayMiningDifficulty: servicetypes.RelayMiningDifficulty{ ServiceId: "svc1", BlockHeight: 1, - NumRelaysEma: keeper.TargetNumRelays, + NumRelaysEma: servicekeeper.TargetNumRelays, TargetHash: defaultDifficulty(), // default difficulty without any leading 0 bits }, }, { desc: "First Difficulty way above target", - numRelays: keeper.TargetNumRelays * 1e3, - expectedRelayMiningDifficulty: types.RelayMiningDifficulty{ + numRelays: servicekeeper.TargetNumRelays * 1e3, + expectedRelayMiningDifficulty: servicetypes.RelayMiningDifficulty{ ServiceId: "svc1", BlockHeight: 1, - NumRelaysEma: keeper.TargetNumRelays * 1e3, + NumRelaysEma: servicekeeper.TargetNumRelays * 1e3, TargetHash: append( []byte{0b00000000}, // at least 8 leading 0 bits makeBytesFullOfOnes(31)..., @@ -207,7 +205,7 @@ func TestUpdateRelayMiningDifficulty_FirstDifficulty(t *testing.T) { } for _, tt := range tests { t.Run(tt.desc, func(t *testing.T) { - keeper, ctx := keepertest.TokenomicsKeeper(t) + keeper, ctx := keepertest.ServiceKeeper(t) relaysPerServiceMap := map[string]uint64{ "svc1": tt.numRelays, } diff --git a/x/service/module/genesis.go b/x/service/module/genesis.go index 96a1f6275..91be88ed2 100644 --- a/x/service/module/genesis.go +++ b/x/service/module/genesis.go @@ -13,6 +13,10 @@ func InitGenesis(ctx context.Context, k keeper.Keeper, genState types.GenesisSta for _, service := range genState.ServiceList { k.SetService(ctx, service) } + // Set all the relayMiningDifficulty + for _, difficulty := range genState.RelayMiningDifficultyList { + k.SetRelayMiningDifficulty(ctx, difficulty) + } // this line is used by starport scaffolding # genesis/module/init if err := k.SetParams(ctx, genState.Params); err != nil { panic(err) @@ -25,6 +29,7 @@ func ExportGenesis(ctx context.Context, k keeper.Keeper) *types.GenesisState { genesis.Params = k.GetParams(ctx) genesis.ServiceList = k.GetAllServices(ctx) + genesis.RelayMiningDifficultyList = k.GetAllRelayMiningDifficulty(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/service/module/genesis_test.go b/x/service/module/genesis_test.go index c95032594..0b7eb295d 100644 --- a/x/service/module/genesis_test.go +++ b/x/service/module/genesis_test.go @@ -26,6 +26,15 @@ func TestGenesis(t *testing.T) { Name: "service two", }, }, + + RelayMiningDifficultyList: []types.RelayMiningDifficulty{ + { + ServiceId: "0", + }, + { + ServiceId: "1", + }, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -38,5 +47,6 @@ func TestGenesis(t *testing.T) { nullify.Fill(got) require.ElementsMatch(t, genesisState.ServiceList, got.ServiceList) + require.ElementsMatch(t, genesisState.RelayMiningDifficultyList, got.RelayMiningDifficultyList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/service/types/errors.go b/x/service/types/errors.go index d593be500..1cf4d363d 100644 --- a/x/service/types/errors.go +++ b/x/service/types/errors.go @@ -6,19 +6,17 @@ import sdkerrors "cosmossdk.io/errors" // x/service module sentinel errors var ( - ErrServiceInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") - ErrServiceDuplicateIndex = sdkerrors.Register(ModuleName, 1101, "duplicate index when adding a new service") - ErrServiceInvalidAddress = sdkerrors.Register(ModuleName, 1102, "invalid address when adding a new service") - ErrServiceMissingID = sdkerrors.Register(ModuleName, 1103, "missing service ID") - ErrServiceMissingName = sdkerrors.Register(ModuleName, 1104, "missing service name") - ErrServiceAlreadyExists = sdkerrors.Register(ModuleName, 1105, "service already exists") - ErrServiceInvalidServiceFee = sdkerrors.Register(ModuleName, 1106, "invalid ServiceFee") - ErrServiceAccountNotFound = sdkerrors.Register(ModuleName, 1107, "account not found") - ErrServiceNotEnoughFunds = sdkerrors.Register(ModuleName, 1108, "not enough funds to add service") - ErrServiceFailedToDeductFee = sdkerrors.Register(ModuleName, 1109, "failed to deduct fee") - ErrServiceInvalidRelayResponse = sdkerrors.Register(ModuleName, 1110, "invalid relay response") - ErrServiceInvalidRelayRequest = sdkerrors.Register(ModuleName, 1111, "invalid relay request") - ErrServiceInvalidOwnerAddress = sdkerrors.Register(ModuleName, 1113, "invalid owner address") - ErrServiceParamNameInvalid = sdkerrors.Register(ModuleName, 1114, "the provided param name is invalid") - ErrServiceParamInvalid = sdkerrors.Register(ModuleName, 1115, "the provided param is invalid") + ErrServiceInvalidSigner = sdkerrors.Register(ModuleName, 1100, "expected gov account as only signer for proposal message") + ErrServiceDuplicateIndex = sdkerrors.Register(ModuleName, 1101, "duplicate index when adding a new service") + ErrServiceInvalidAddress = sdkerrors.Register(ModuleName, 1102, "invalid address when adding a new service") + ErrServiceMissingID = sdkerrors.Register(ModuleName, 1103, "missing service ID") + ErrServiceMissingName = sdkerrors.Register(ModuleName, 1104, "missing service name") + ErrServiceAlreadyExists = sdkerrors.Register(ModuleName, 1105, "service already exists") + ErrServiceNotEnoughFunds = sdkerrors.Register(ModuleName, 1108, "not enough funds to add service") + ErrServiceFailedToDeductFee = sdkerrors.Register(ModuleName, 1109, "failed to deduct fee") + ErrServiceInvalidRelayResponse = sdkerrors.Register(ModuleName, 1110, "invalid relay response") + ErrServiceInvalidRelayRequest = sdkerrors.Register(ModuleName, 1111, "invalid relay request") + ErrServiceInvalidOwnerAddress = sdkerrors.Register(ModuleName, 1113, "invalid owner address") + ErrServiceParamInvalid = sdkerrors.Register(ModuleName, 1115, "the provided param is invalid") + ErrServiceMissingRelayMiningDifficulty = sdkerrors.Register(ModuleName, 1116, "missing relay mining difficulty") ) diff --git a/x/service/types/event.pb.go b/x/service/types/event.pb.go new file mode 100644 index 000000000..b85ba4263 --- /dev/null +++ b/x/service/types/event.pb.go @@ -0,0 +1,495 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: poktroll/service/event.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventRelayMiningDifficultyUpdated is an event emitted whenever the relay mining difficulty is updated +// for a given service. +type EventRelayMiningDifficultyUpdated struct { + ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + PrevTargetHashHexEncoded string `protobuf:"bytes,2,opt,name=prev_target_hash_hex_encoded,json=prevTargetHashHexEncoded,proto3" json:"prev_target_hash_hex_encoded,omitempty"` + NewTargetHashHexEncoded string `protobuf:"bytes,3,opt,name=new_target_hash_hex_encoded,json=newTargetHashHexEncoded,proto3" json:"new_target_hash_hex_encoded,omitempty"` + PrevNumRelaysEma uint64 `protobuf:"varint,4,opt,name=prev_num_relays_ema,json=prevNumRelaysEma,proto3" json:"prev_num_relays_ema,omitempty"` + NewNumRelaysEma uint64 `protobuf:"varint,5,opt,name=new_num_relays_ema,json=newNumRelaysEma,proto3" json:"new_num_relays_ema,omitempty"` +} + +func (m *EventRelayMiningDifficultyUpdated) Reset() { *m = EventRelayMiningDifficultyUpdated{} } +func (m *EventRelayMiningDifficultyUpdated) String() string { return proto.CompactTextString(m) } +func (*EventRelayMiningDifficultyUpdated) ProtoMessage() {} +func (*EventRelayMiningDifficultyUpdated) Descriptor() ([]byte, []int) { + return fileDescriptor_a49225ecd38336fe, []int{0} +} +func (m *EventRelayMiningDifficultyUpdated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRelayMiningDifficultyUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *EventRelayMiningDifficultyUpdated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRelayMiningDifficultyUpdated.Merge(m, src) +} +func (m *EventRelayMiningDifficultyUpdated) XXX_Size() int { + return m.Size() +} +func (m *EventRelayMiningDifficultyUpdated) XXX_DiscardUnknown() { + xxx_messageInfo_EventRelayMiningDifficultyUpdated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRelayMiningDifficultyUpdated proto.InternalMessageInfo + +func (m *EventRelayMiningDifficultyUpdated) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +func (m *EventRelayMiningDifficultyUpdated) GetPrevTargetHashHexEncoded() string { + if m != nil { + return m.PrevTargetHashHexEncoded + } + return "" +} + +func (m *EventRelayMiningDifficultyUpdated) GetNewTargetHashHexEncoded() string { + if m != nil { + return m.NewTargetHashHexEncoded + } + return "" +} + +func (m *EventRelayMiningDifficultyUpdated) GetPrevNumRelaysEma() uint64 { + if m != nil { + return m.PrevNumRelaysEma + } + return 0 +} + +func (m *EventRelayMiningDifficultyUpdated) GetNewNumRelaysEma() uint64 { + if m != nil { + return m.NewNumRelaysEma + } + return 0 +} + +func init() { + proto.RegisterType((*EventRelayMiningDifficultyUpdated)(nil), "poktroll.service.EventRelayMiningDifficultyUpdated") +} + +func init() { proto.RegisterFile("poktroll/service/event.proto", fileDescriptor_a49225ecd38336fe) } + +var fileDescriptor_a49225ecd38336fe = []byte{ + // 320 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x41, 0x4b, 0xc3, 0x30, + 0x14, 0xc7, 0x97, 0x39, 0x85, 0xe5, 0xe2, 0xa8, 0x82, 0x45, 0x67, 0x98, 0x9e, 0x06, 0xb2, 0x55, + 0xf0, 0x2a, 0x1e, 0xc4, 0xc1, 0x3c, 0xb8, 0xc3, 0xd0, 0x8b, 0x97, 0x90, 0xb5, 0x6f, 0x6d, 0x58, + 0x9b, 0x94, 0x34, 0x5d, 0xb7, 0x6f, 0xe1, 0x07, 0xf0, 0x03, 0x79, 0xdc, 0x71, 0x47, 0xe9, 0xbe, + 0x88, 0x24, 0xab, 0x43, 0x44, 0x6f, 0x21, 0xff, 0xdf, 0xef, 0x3d, 0xde, 0x7b, 0xb8, 0x9d, 0xca, + 0x99, 0x56, 0x32, 0x8e, 0xbd, 0x0c, 0xd4, 0x9c, 0xfb, 0xe0, 0xc1, 0x1c, 0x84, 0xee, 0xa7, 0x4a, + 0x6a, 0xe9, 0xb4, 0xbe, 0xd3, 0x7e, 0x95, 0x9e, 0x1e, 0x87, 0x32, 0x94, 0x36, 0xf4, 0xcc, 0x6b, + 0xcb, 0x5d, 0xbe, 0xd7, 0xf1, 0xc5, 0xc0, 0x78, 0x63, 0x88, 0xd9, 0xf2, 0x89, 0x0b, 0x2e, 0xc2, + 0x07, 0x3e, 0x9d, 0x72, 0x3f, 0x8f, 0xf5, 0xf2, 0x25, 0x0d, 0x98, 0x86, 0xc0, 0x39, 0xc7, 0xb8, + 0x2a, 0x43, 0x79, 0xe0, 0xa2, 0x0e, 0xea, 0x36, 0xc7, 0xcd, 0xea, 0xe7, 0x31, 0x70, 0xee, 0x70, + 0x3b, 0x55, 0x30, 0xa7, 0x9a, 0xa9, 0x10, 0x34, 0x8d, 0x58, 0x16, 0xd1, 0x08, 0x16, 0x14, 0x84, + 0x2f, 0x03, 0x08, 0xdc, 0xba, 0x15, 0x5c, 0xc3, 0x3c, 0x5b, 0x64, 0xc8, 0xb2, 0x68, 0x08, 0x8b, + 0xc1, 0x36, 0x77, 0x6e, 0xf1, 0x99, 0x80, 0xe2, 0x5f, 0x7d, 0xcf, 0xea, 0x27, 0x02, 0x8a, 0x3f, + 0xed, 0x1e, 0x3e, 0xb2, 0xdd, 0x45, 0x9e, 0x50, 0x65, 0xa6, 0xc8, 0x28, 0x24, 0xcc, 0x6d, 0x74, + 0x50, 0xb7, 0x31, 0x6e, 0x99, 0x68, 0x94, 0x27, 0x76, 0xbc, 0x6c, 0x90, 0x30, 0xe7, 0x0a, 0x3b, + 0xa6, 0xd9, 0x2f, 0x7a, 0xdf, 0xd2, 0x87, 0x02, 0x8a, 0x9f, 0xf0, 0xfd, 0xe8, 0xa3, 0x24, 0x68, + 0x55, 0x12, 0xb4, 0x2e, 0x09, 0xfa, 0x2c, 0x09, 0x7a, 0xdb, 0x90, 0xda, 0x6a, 0x43, 0x6a, 0xeb, + 0x0d, 0xa9, 0xbd, 0x5e, 0x87, 0x5c, 0x47, 0xf9, 0xa4, 0xef, 0xcb, 0xc4, 0x33, 0xfb, 0xee, 0x09, + 0xd0, 0x85, 0x54, 0x33, 0x6f, 0x77, 0x9a, 0xc5, 0xee, 0x38, 0x7a, 0x99, 0x42, 0x36, 0x39, 0xb0, + 0x5b, 0xbf, 0xf9, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x37, 0x95, 0x7d, 0xbd, 0x01, 0x00, 0x00, +} + +func (m *EventRelayMiningDifficultyUpdated) 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 *EventRelayMiningDifficultyUpdated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRelayMiningDifficultyUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NewNumRelaysEma != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NewNumRelaysEma)) + i-- + dAtA[i] = 0x28 + } + if m.PrevNumRelaysEma != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.PrevNumRelaysEma)) + i-- + dAtA[i] = 0x20 + } + if len(m.NewTargetHashHexEncoded) > 0 { + i -= len(m.NewTargetHashHexEncoded) + copy(dAtA[i:], m.NewTargetHashHexEncoded) + i = encodeVarintEvent(dAtA, i, uint64(len(m.NewTargetHashHexEncoded))) + i-- + dAtA[i] = 0x1a + } + if len(m.PrevTargetHashHexEncoded) > 0 { + i -= len(m.PrevTargetHashHexEncoded) + copy(dAtA[i:], m.PrevTargetHashHexEncoded) + i = encodeVarintEvent(dAtA, i, uint64(len(m.PrevTargetHashHexEncoded))) + i-- + dAtA[i] = 0x12 + } + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventRelayMiningDifficultyUpdated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.PrevTargetHashHexEncoded) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.NewTargetHashHexEncoded) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.PrevNumRelaysEma != 0 { + n += 1 + sovEvent(uint64(m.PrevNumRelaysEma)) + } + if m.NewNumRelaysEma != 0 { + n += 1 + sovEvent(uint64(m.NewNumRelaysEma)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventRelayMiningDifficultyUpdated) 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 ErrIntOverflowEvent + } + 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: EventRelayMiningDifficultyUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRelayMiningDifficultyUpdated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrevTargetHashHexEncoded", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PrevTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewTargetHashHexEncoded", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PrevNumRelaysEma", wireType) + } + m.PrevNumRelaysEma = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PrevNumRelaysEma |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewNumRelaysEma", wireType) + } + m.NewNumRelaysEma = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NewNumRelaysEma |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvent + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvent + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvent + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/service/types/genesis.go b/x/service/types/genesis.go index b8d040cb5..eeab9e17f 100644 --- a/x/service/types/genesis.go +++ b/x/service/types/genesis.go @@ -5,7 +5,8 @@ import sharedtypes "github.com/pokt-network/poktroll/x/shared/types" // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - ServiceList: []sharedtypes.Service{}, + ServiceList: []sharedtypes.Service{}, + RelayMiningDifficultyList: []RelayMiningDifficulty{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -15,9 +16,24 @@ func DefaultGenesis() *GenesisState { // failure. func (gs GenesisState) Validate() error { // Check for duplicated index in services + if err := validateServiceList(gs.ServiceList); err != nil { + return err + } + + // Check for duplicated index in relayMiningDifficulty + if err := validateRelayMiningDifficultyList(gs.RelayMiningDifficultyList); err != nil { + return err + } + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.ValidateBasic() +} + +// validateServiceList validates the service list. +func validateServiceList(serviceList []sharedtypes.Service) error { serviceIDMap := make(map[string]struct{}) serviceNameMap := make(map[string]struct{}) - for _, service := range gs.ServiceList { + for _, service := range serviceList { serviceID := string(ServiceKey(service.Id)) if _, ok := serviceIDMap[serviceID]; ok { return ErrServiceDuplicateIndex.Wrapf("duplicated ID for service: %v", service) @@ -29,7 +45,21 @@ func (gs GenesisState) Validate() error { } serviceNameMap[serviceName] = struct{}{} } - // this line is used by starport scaffolding # genesis/types/validate - return gs.Params.ValidateBasic() + return nil +} + +// validateRelayMiningDifficultyList validates the relayMiningDifficulty list. +func validateRelayMiningDifficultyList(relayMiningDifficultyList []RelayMiningDifficulty) error { + relayMiningDifficultyIndexMap := make(map[string]struct{}) + + for _, elem := range relayMiningDifficultyList { + index := string(RelayMiningDifficultyKey(elem.ServiceId)) + if _, ok := relayMiningDifficultyIndexMap[index]; ok { + return ErrServiceDuplicateIndex.Wrapf("duplicated index for relayMiningDifficulty: %s", index) + } + relayMiningDifficultyIndexMap[index] = struct{}{} + } + + return nil } diff --git a/x/service/types/genesis.pb.go b/x/service/types/genesis.pb.go index 1385a8f50..f31fb606f 100644 --- a/x/service/types/genesis.pb.go +++ b/x/service/types/genesis.pb.go @@ -28,8 +28,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the service module's genesis state. type GenesisState struct { // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - ServiceList []types.Service `protobuf:"bytes,2,rep,name=service_list,json=serviceList,proto3" json:"service_list"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + ServiceList []types.Service `protobuf:"bytes,2,rep,name=service_list,json=serviceList,proto3" json:"service_list"` + RelayMiningDifficultyList []RelayMiningDifficulty `protobuf:"bytes,3,rep,name=relayMiningDifficultyList,proto3" json:"relayMiningDifficultyList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -75,6 +76,13 @@ func (m *GenesisState) GetServiceList() []types.Service { return nil } +func (m *GenesisState) GetRelayMiningDifficultyList() []RelayMiningDifficulty { + if m != nil { + return m.RelayMiningDifficultyList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "poktroll.service.GenesisState") } @@ -82,24 +90,28 @@ func init() { func init() { proto.RegisterFile("poktroll/service/genesis.proto", fileDescriptor_b6c2ff81e712a1a4) } var fileDescriptor_b6c2ff81e712a1a4 = []byte{ - // 263 bytes of a gzipped FileDescriptorProto + // 322 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0xcf, 0x2e, 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x80, 0xc9, 0xeb, 0x41, 0xe5, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0x65, 0x31, 0x8c, 0x2e, 0x48, 0x2c, 0x4a, - 0xcc, 0x2d, 0xc6, 0x94, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0x81, 0xa9, 0x82, 0x48, 0x2b, 0xf5, 0x31, - 0x72, 0xf1, 0xb8, 0x43, 0x9c, 0x12, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xcd, 0xc5, 0x06, 0xd1, - 0x2f, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa1, 0x87, 0xee, 0x34, 0xbd, 0x00, 0xb0, 0xbc, - 0x13, 0xe7, 0x89, 0x7b, 0xf2, 0x0c, 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x82, 0x6a, 0x11, 0x72, - 0xe4, 0xe2, 0x81, 0x2a, 0x8a, 0xcf, 0xc9, 0x2c, 0x2e, 0x91, 0x60, 0x52, 0x60, 0x46, 0x33, 0x02, - 0xec, 0x06, 0xbd, 0x60, 0x88, 0x22, 0x27, 0x16, 0x90, 0x11, 0x41, 0xdc, 0x50, 0x3d, 0x3e, 0x99, - 0xc5, 0x25, 0x4e, 0x7e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, 0x1c, - 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, - 0x1c, 0x43, 0x94, 0x41, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xc8, - 0x50, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0xb8, 0x2f, 0x2b, 0xe0, 0xc1, 0x50, - 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0xa7, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xcb, - 0x1e, 0x0f, 0xf5, 0x82, 0x01, 0x00, 0x00, + 0xcc, 0x2d, 0xc6, 0x94, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0x81, 0xa9, 0x82, 0x4a, 0xeb, 0x61, 0xe8, + 0x2e, 0x4a, 0xcd, 0x49, 0xac, 0x8c, 0xcf, 0xcd, 0xcc, 0xcb, 0xcc, 0x4b, 0x8f, 0x4f, 0xc9, 0x4c, + 0x4b, 0xcb, 0x4c, 0x2e, 0xcd, 0x29, 0xa9, 0x84, 0xa8, 0x57, 0xfa, 0xcd, 0xc8, 0xc5, 0xe3, 0x0e, + 0x71, 0x7a, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x35, 0x17, 0x1b, 0xc4, 0x3e, 0x09, 0x46, 0x05, + 0x46, 0x0d, 0x6e, 0x23, 0x09, 0x3d, 0x74, 0xaf, 0xe8, 0x05, 0x80, 0xe5, 0x9d, 0x38, 0x4f, 0xdc, + 0x93, 0x67, 0x58, 0xf1, 0x7c, 0x83, 0x16, 0x63, 0x10, 0x54, 0x8b, 0x90, 0x23, 0x17, 0x0f, 0x54, + 0x51, 0x7c, 0x4e, 0x66, 0x71, 0x89, 0x04, 0x93, 0x02, 0x33, 0x9a, 0x11, 0x60, 0x37, 0xeb, 0x05, + 0x43, 0x14, 0x39, 0xb1, 0x80, 0x8c, 0x08, 0xe2, 0x86, 0xea, 0xf1, 0xc9, 0x2c, 0x2e, 0x11, 0xca, + 0xe6, 0x92, 0x04, 0xbb, 0xd8, 0x17, 0xec, 0x60, 0x17, 0xb8, 0x7b, 0x41, 0x92, 0x12, 0xcc, 0x60, + 0xf3, 0xd4, 0x31, 0x9d, 0x14, 0x84, 0x4d, 0x0b, 0xd4, 0x78, 0xdc, 0xe6, 0x39, 0xf9, 0x9d, 0x78, + 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, + 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x06, 0xe9, 0x99, + 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0x1b, 0x75, 0xf3, 0x52, 0x4b, 0xca, + 0xf3, 0x8b, 0xb2, 0xf5, 0xe1, 0x61, 0x5c, 0x01, 0x0f, 0xe5, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, + 0x36, 0x70, 0xa0, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc0, 0x34, 0x0b, 0xbf, 0x1f, 0x02, + 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -122,6 +134,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.RelayMiningDifficultyList) > 0 { + for iNdEx := len(m.RelayMiningDifficultyList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RelayMiningDifficultyList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } if len(m.ServiceList) > 0 { for iNdEx := len(m.ServiceList) - 1; iNdEx >= 0; iNdEx-- { { @@ -174,6 +200,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.RelayMiningDifficultyList) > 0 { + for _, e := range m.RelayMiningDifficultyList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -279,6 +311,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficultyList", 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 + } + m.RelayMiningDifficultyList = append(m.RelayMiningDifficultyList, RelayMiningDifficulty{}) + if err := m.RelayMiningDifficultyList[len(m.RelayMiningDifficultyList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/service/types/genesis_test.go b/x/service/types/genesis_test.go index aa90380bc..0e5961a4b 100644 --- a/x/service/types/genesis_test.go +++ b/x/service/types/genesis_test.go @@ -45,10 +45,33 @@ func TestGenesisState_Validate(t *testing.T) { ServiceList: []sharedtypes.Service{ *svc1, *svc2, }, + RelayMiningDifficultyList: []types.RelayMiningDifficulty{ + { + ServiceId: "0", + }, + { + ServiceId: "1", + }, + }, // this line is used by starport scaffolding # types/genesis/validField }, expectedErr: nil, }, + { + desc: "invalid - duplicated relayMiningDifficulty", + genState: &types.GenesisState{ + Params: types.DefaultParams(), + RelayMiningDifficultyList: []types.RelayMiningDifficulty{ + { + ServiceId: "0", + }, + { + ServiceId: "0", + }, + }, + }, + expectedErr: types.ErrServiceDuplicateIndex, + }, { desc: "invalid - duplicate service ID", genState: &types.GenesisState{ @@ -79,7 +102,7 @@ func TestGenesisState_Validate(t *testing.T) { *svc1, *svc2, }, }, - expectedErr: types.ErrServiceInvalidServiceFee, + expectedErr: types.ErrServiceParamInvalid, }, // this line is used by starport scaffolding # types/genesis/testcase } diff --git a/x/tokenomics/types/key_relay_mining_difficulty.go b/x/service/types/key_relay_mining_difficulty.go similarity index 100% rename from x/tokenomics/types/key_relay_mining_difficulty.go rename to x/service/types/key_relay_mining_difficulty.go diff --git a/x/service/types/message_update_param.go b/x/service/types/message_update_param.go index 04c7db8f6..7d3ad2c15 100644 --- a/x/service/types/message_update_param.go +++ b/x/service/types/message_update_param.go @@ -1,8 +1,6 @@ package types import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -10,20 +8,20 @@ var _ sdk.Msg = (*MsgUpdateParam)(nil) // NewMsgUpdateParam creates a new MsgUpdateParam instance for a single // governance parameter update. -func NewMsgUpdateParam(authority string, name string, value any) (*MsgUpdateParam, error) { - var valueAsType isMsgUpdateParam_AsType +func NewMsgUpdateParam(authority string, name string, asType any) (*MsgUpdateParam, error) { + var asTypeIface isMsgUpdateParam_AsType - switch v := value.(type) { + switch t := asType.(type) { case *sdk.Coin: - valueAsType = &MsgUpdateParam_AsCoin{AsCoin: v} + asTypeIface = &MsgUpdateParam_AsCoin{AsCoin: t} default: - return nil, fmt.Errorf("unexpected param value type: %T", value) + return nil, ErrServiceParamInvalid.Wrapf("unexpected param value type: %T", asType) } return &MsgUpdateParam{ Authority: authority, Name: name, - AsType: valueAsType, + AsType: asTypeIface, }, nil } @@ -36,17 +34,20 @@ func (msg *MsgUpdateParam) ValidateBasic() error { return ErrServiceInvalidAddress.Wrapf("invalid authority address %s; (%v)", msg.Authority, err) } - // Parameter value cannot be nil. + // Parameter value MUST NOT be nil. if msg.AsType == nil { return ErrServiceParamInvalid.Wrap("missing param AsType") } - // Parameter name must be supported by this module. + // Parameter name MUST be supported by this module. switch msg.Name { case ParamAddServiceFee: - return msg.paramTypeIsCoin() + if err := msg.paramTypeIsCoin(); err != nil { + return err + } + return ValidateAddServiceFee(msg.GetAsCoin()) default: - return ErrServiceParamNameInvalid.Wrapf("unsupported param %q", msg.Name) + return ErrServiceParamInvalid.Wrapf("unsupported param %q", msg.Name) } } diff --git a/x/service/types/message_update_param_test.go b/x/service/types/message_update_param_test.go new file mode 100644 index 000000000..75a45c41a --- /dev/null +++ b/x/service/types/message_update_param_test.go @@ -0,0 +1,57 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/sample" +) + +func TestMsgUpdateParam_ValidateBasic(t *testing.T) { + tests := []struct { + name string + desc string + msg MsgUpdateParam + expectedErr error + }{ + { + name: "invalid address", + desc: "invalid: authority address invalid", + msg: MsgUpdateParam{ + Authority: "invalid_address", + Name: "", // Doesn't matter for this test + AsType: &MsgUpdateParam_AsCoin{AsCoin: nil}, + }, + expectedErr: sdkerrors.ErrInvalidAddress, + }, { + desc: "invalid: param name incorrect (non-existent)", + msg: MsgUpdateParam{ + Authority: sample.AccAddress(), + Name: "non_existent", + AsType: &MsgUpdateParam_AsCoin{AsCoin: &MinAddServiceFee}, + }, + expectedErr: ErrServiceParamInvalid, + }, { + name: "valid address", + desc: "valid: correct address, param name, and type", + msg: MsgUpdateParam{ + Authority: sample.AccAddress(), + Name: ParamAddServiceFee, + AsType: &MsgUpdateParam_AsCoin{AsCoin: &MinAddServiceFee}, + }, + }, + } + + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := test.msg.ValidateBasic() + if test.expectedErr != nil { + require.ErrorContains(t, err, test.expectedErr.Error()) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/service/types/params.go b/x/service/types/params.go index 542eda53f..a454d86f1 100644 --- a/x/service/types/params.go +++ b/x/service/types/params.go @@ -4,6 +4,7 @@ import ( "cosmossdk.io/math" cosmostypes "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/pokt-network/poktroll/app/volatile" ) @@ -55,26 +56,26 @@ func (p Params) ValidateBasic() error { } // validateAddServiceFee validates the AddServiceFee param -func ValidateAddServiceFee(v interface{}) error { - addServiceFeeCoin, ok := v.(*cosmostypes.Coin) +func ValidateAddServiceFee(addServiceFeeAny any) error { + addServiceFee, ok := addServiceFeeAny.(*cosmostypes.Coin) if !ok { - return ErrServiceInvalidServiceFee.Wrapf("invalid parameter type: %T", v) + return ErrServiceParamInvalid.Wrapf("invalid parameter type: %T", addServiceFeeAny) } - if addServiceFeeCoin == nil { - return ErrServiceInvalidServiceFee.Wrap("missing proof_submission_fee") + if addServiceFee == nil { + return ErrServiceParamInvalid.Wrap("missing add_service_fee") } - if addServiceFeeCoin.Denom != volatile.DenomuPOKT { - return ErrServiceInvalidServiceFee.Wrapf("invalid coin denom: %s", addServiceFeeCoin.Denom) + if addServiceFee.Denom != volatile.DenomuPOKT { + return ErrServiceParamInvalid.Wrapf("invalid add_service_fee denom: %s", addServiceFee.Denom) } // TODO_MAINNET: Look into better validation - if addServiceFeeCoin.Amount.LT(MinAddServiceFee.Amount) { - return ErrServiceInvalidServiceFee.Wrapf( - "AddServiceFee param is below minimum value %s: got %s", + if addServiceFee.Amount.LT(MinAddServiceFee.Amount) { + return ErrServiceParamInvalid.Wrapf( + "add_service_fee param is below minimum value %s: got %s", MinAddServiceFee, - addServiceFeeCoin, + addServiceFee, ) } diff --git a/x/service/types/query.pb.go b/x/service/types/query.pb.go index 15c598d4e..15d6ffb31 100644 --- a/x/service/types/query.pb.go +++ b/x/service/types/query.pb.go @@ -276,6 +276,174 @@ func (m *QueryAllServicesResponse) GetPagination() *query.PageResponse { return nil } +type QueryGetRelayMiningDifficultyRequest struct { + ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` +} + +func (m *QueryGetRelayMiningDifficultyRequest) Reset() { *m = QueryGetRelayMiningDifficultyRequest{} } +func (m *QueryGetRelayMiningDifficultyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRelayMiningDifficultyRequest) ProtoMessage() {} +func (*QueryGetRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{6} +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRelayMiningDifficultyRequest.Merge(m, src) +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRelayMiningDifficultyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRelayMiningDifficultyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRelayMiningDifficultyRequest proto.InternalMessageInfo + +func (m *QueryGetRelayMiningDifficultyRequest) GetServiceId() string { + if m != nil { + return m.ServiceId + } + return "" +} + +type QueryGetRelayMiningDifficultyResponse struct { + RelayMiningDifficulty RelayMiningDifficulty `protobuf:"bytes,1,opt,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"` +} + +func (m *QueryGetRelayMiningDifficultyResponse) Reset() { *m = QueryGetRelayMiningDifficultyResponse{} } +func (m *QueryGetRelayMiningDifficultyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRelayMiningDifficultyResponse) ProtoMessage() {} +func (*QueryGetRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{7} +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRelayMiningDifficultyResponse.Merge(m, src) +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRelayMiningDifficultyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRelayMiningDifficultyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRelayMiningDifficultyResponse proto.InternalMessageInfo + +func (m *QueryGetRelayMiningDifficultyResponse) GetRelayMiningDifficulty() RelayMiningDifficulty { + if m != nil { + return m.RelayMiningDifficulty + } + return RelayMiningDifficulty{} +} + +type QueryAllRelayMiningDifficultyRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRelayMiningDifficultyRequest) Reset() { *m = QueryAllRelayMiningDifficultyRequest{} } +func (m *QueryAllRelayMiningDifficultyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRelayMiningDifficultyRequest) ProtoMessage() {} +func (*QueryAllRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{8} +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRelayMiningDifficultyRequest.Merge(m, src) +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRelayMiningDifficultyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRelayMiningDifficultyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRelayMiningDifficultyRequest proto.InternalMessageInfo + +func (m *QueryAllRelayMiningDifficultyRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllRelayMiningDifficultyResponse struct { + RelayMiningDifficulty []RelayMiningDifficulty `protobuf:"bytes,1,rep,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRelayMiningDifficultyResponse) Reset() { *m = QueryAllRelayMiningDifficultyResponse{} } +func (m *QueryAllRelayMiningDifficultyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRelayMiningDifficultyResponse) ProtoMessage() {} +func (*QueryAllRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_cc8a7bc9eee3e426, []int{9} +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRelayMiningDifficultyResponse.Merge(m, src) +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRelayMiningDifficultyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRelayMiningDifficultyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRelayMiningDifficultyResponse proto.InternalMessageInfo + +func (m *QueryAllRelayMiningDifficultyResponse) GetRelayMiningDifficulty() []RelayMiningDifficulty { + if m != nil { + return m.RelayMiningDifficulty + } + return nil +} + +func (m *QueryAllRelayMiningDifficultyResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.service.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.service.QueryParamsResponse") @@ -283,45 +451,60 @@ func init() { proto.RegisterType((*QueryGetServiceResponse)(nil), "poktroll.service.QueryGetServiceResponse") proto.RegisterType((*QueryAllServicesRequest)(nil), "poktroll.service.QueryAllServicesRequest") proto.RegisterType((*QueryAllServicesResponse)(nil), "poktroll.service.QueryAllServicesResponse") + proto.RegisterType((*QueryGetRelayMiningDifficultyRequest)(nil), "poktroll.service.QueryGetRelayMiningDifficultyRequest") + proto.RegisterType((*QueryGetRelayMiningDifficultyResponse)(nil), "poktroll.service.QueryGetRelayMiningDifficultyResponse") + proto.RegisterType((*QueryAllRelayMiningDifficultyRequest)(nil), "poktroll.service.QueryAllRelayMiningDifficultyRequest") + proto.RegisterType((*QueryAllRelayMiningDifficultyResponse)(nil), "poktroll.service.QueryAllRelayMiningDifficultyResponse") } func init() { proto.RegisterFile("poktroll/service/query.proto", fileDescriptor_cc8a7bc9eee3e426) } var fileDescriptor_cc8a7bc9eee3e426 = []byte{ - // 517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x73, 0x29, 0xa4, 0xea, 0x55, 0x42, 0x70, 0x54, 0x10, 0x59, 0xc5, 0x20, 0x8b, 0xb6, - 0x21, 0x28, 0x77, 0xb4, 0x5d, 0x90, 0x98, 0xc8, 0x40, 0x37, 0x54, 0xdc, 0x8d, 0xed, 0x92, 0x9c, - 0xdc, 0x53, 0x1d, 0x9f, 0xeb, 0xbb, 0x14, 0x2a, 0xc4, 0x82, 0xf8, 0x00, 0x48, 0x65, 0x65, 0x67, - 0x64, 0xe7, 0x0b, 0x74, 0xac, 0xc4, 0xd2, 0x09, 0xa1, 0x04, 0x89, 0xaf, 0x81, 0x7c, 0xf7, 0x0c, - 0x29, 0xae, 0x95, 0xb0, 0x24, 0x96, 0xdf, 0xff, 0xfd, 0xff, 0xbf, 0xbb, 0xf7, 0x64, 0xbc, 0x9a, - 0xaa, 0x03, 0x93, 0xa9, 0x38, 0x66, 0x5a, 0x64, 0x47, 0xb2, 0x2f, 0xd8, 0xe1, 0x48, 0x64, 0xc7, - 0x34, 0xcd, 0x94, 0x51, 0xe4, 0x7a, 0x51, 0xa5, 0x50, 0xf5, 0x6e, 0xf0, 0xa1, 0x4c, 0x14, 0xb3, - 0xbf, 0x4e, 0xe4, 0xad, 0x44, 0x2a, 0x52, 0xf6, 0x91, 0xe5, 0x4f, 0xf0, 0x76, 0x35, 0x52, 0x2a, - 0x8a, 0x05, 0xe3, 0xa9, 0x64, 0x3c, 0x49, 0x94, 0xe1, 0x46, 0xaa, 0x44, 0x43, 0xb5, 0xdd, 0x57, - 0x7a, 0xa8, 0x34, 0xeb, 0x71, 0x0d, 0x89, 0xec, 0x68, 0xb3, 0x27, 0x0c, 0xdf, 0x64, 0x29, 0x8f, - 0x64, 0x62, 0xc5, 0xa0, 0xbd, 0x53, 0x42, 0x4c, 0x79, 0xc6, 0x87, 0xba, 0x5c, 0xde, 0xe7, 0x99, - 0x18, 0x14, 0x2a, 0x57, 0x0e, 0x56, 0x30, 0x79, 0x91, 0xfb, 0xef, 0xda, 0x9e, 0x50, 0x1c, 0x8e, - 0x84, 0x36, 0x41, 0x88, 0x6f, 0x5e, 0x78, 0xab, 0x53, 0x95, 0x68, 0x41, 0x9e, 0xe0, 0x86, 0xf3, - 0x6e, 0xa2, 0x7b, 0xa8, 0xb5, 0xbc, 0xd5, 0xa4, 0xff, 0x5e, 0x00, 0x75, 0x1d, 0xdd, 0xa5, 0xd3, - 0xef, 0x77, 0x6b, 0x9f, 0x7f, 0x7d, 0x69, 0xa3, 0x10, 0x5a, 0x82, 0x16, 0xbe, 0x65, 0x3d, 0x77, - 0x84, 0xd9, 0x73, 0x62, 0x48, 0x23, 0xd7, 0x70, 0x5d, 0x0e, 0xac, 0xe5, 0x52, 0x58, 0x97, 0x83, - 0x60, 0x0f, 0xdf, 0x2e, 0x29, 0x81, 0xe0, 0x31, 0x5e, 0x84, 0xa4, 0x4b, 0x10, 0xec, 0xf9, 0x28, - 0xb4, 0x74, 0xaf, 0xe4, 0x08, 0x61, 0x21, 0x0f, 0x38, 0x98, 0x3e, 0x8d, 0x63, 0x50, 0x14, 0xa7, - 0x25, 0xcf, 0x30, 0xfe, 0x7b, 0xab, 0xe0, 0xbb, 0x4e, 0xdd, 0x08, 0x68, 0x3e, 0x02, 0xea, 0x86, - 0x0e, 0x23, 0xa0, 0xbb, 0x3c, 0x2a, 0xd8, 0xc3, 0xa9, 0xce, 0xe0, 0x13, 0xc2, 0xcd, 0x72, 0xc6, - 0x65, 0xe4, 0x0b, 0xff, 0x41, 0x4e, 0x76, 0x2e, 0xe0, 0xd5, 0x2d, 0xde, 0xc6, 0x4c, 0x3c, 0x17, - 0x3b, 0xcd, 0xb7, 0xf5, 0x75, 0x01, 0x5f, 0xb5, 0x7c, 0xe4, 0x3d, 0xc2, 0x0d, 0x37, 0x29, 0x72, - 0xbf, 0x3c, 0xc3, 0xf2, 0x42, 0x78, 0x6b, 0x33, 0x54, 0x2e, 0x2d, 0xe8, 0xbc, 0xfb, 0xf6, 0xf3, - 0xa4, 0xbe, 0x41, 0xd6, 0x58, 0x2e, 0xef, 0x24, 0xc2, 0xbc, 0x52, 0xd9, 0x01, 0xab, 0xd8, 0x50, - 0x72, 0x82, 0xf0, 0x22, 0x1c, 0x9a, 0xb4, 0x2a, 0x12, 0x4a, 0xeb, 0xe2, 0x3d, 0x98, 0x43, 0x09, - 0x3c, 0xdb, 0x96, 0xa7, 0x43, 0x1e, 0xce, 0xe0, 0x29, 0xfe, 0xdf, 0xc8, 0xc1, 0x5b, 0xf2, 0x11, - 0xe1, 0xe5, 0xa9, 0x09, 0x92, 0xaa, 0xbc, 0xf2, 0x26, 0x79, 0xed, 0x79, 0xa4, 0xc0, 0x46, 0x2d, - 0x5b, 0x8b, 0xac, 0xcf, 0xc7, 0xd6, 0x7d, 0x7e, 0x3a, 0xf6, 0xd1, 0xd9, 0xd8, 0x47, 0xe7, 0x63, - 0x1f, 0xfd, 0x18, 0xfb, 0xe8, 0xc3, 0xc4, 0xaf, 0x9d, 0x4d, 0xfc, 0xda, 0xf9, 0xc4, 0xaf, 0xbd, - 0x7c, 0x14, 0x49, 0xb3, 0x3f, 0xea, 0xd1, 0xbe, 0x1a, 0x56, 0xf8, 0xbd, 0xfe, 0xe3, 0x68, 0x8e, - 0x53, 0xa1, 0x7b, 0x0d, 0xfb, 0x01, 0xd8, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x22, 0x58, 0x15, - 0xda, 0xe3, 0x04, 0x00, 0x00, + // 689 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcf, 0x6b, 0xd4, 0x40, + 0x14, 0xde, 0xd9, 0xea, 0x96, 0x4e, 0x41, 0x74, 0x6c, 0x75, 0x59, 0x6a, 0x94, 0xd0, 0x1f, 0x6b, + 0xa5, 0x33, 0xb6, 0x85, 0x5a, 0x10, 0x84, 0x2e, 0xc5, 0xa2, 0xa0, 0xd4, 0xf4, 0xe6, 0xa5, 0xcc, + 0xee, 0x4e, 0xd3, 0xa1, 0xd9, 0x4c, 0x9a, 0x64, 0xab, 0xa5, 0xf4, 0x22, 0x1e, 0x3d, 0x08, 0xf5, + 0xea, 0xdd, 0xa3, 0x7f, 0x46, 0xc1, 0x4b, 0x41, 0x85, 0x9e, 0xa4, 0x6c, 0x05, 0xff, 0x0d, 0xd9, + 0xc9, 0x4b, 0x7f, 0x98, 0xa4, 0x69, 0xa5, 0x97, 0xdd, 0x90, 0xf9, 0xde, 0xfb, 0xbe, 0xef, 0xbd, + 0x37, 0x2f, 0x78, 0xc8, 0x53, 0x6b, 0xa1, 0xaf, 0x1c, 0x87, 0x05, 0xc2, 0xdf, 0x90, 0x0d, 0xc1, + 0xd6, 0xdb, 0xc2, 0xdf, 0xa4, 0x9e, 0xaf, 0x42, 0x45, 0xae, 0xc7, 0xa7, 0x14, 0x4e, 0x2b, 0x37, + 0x78, 0x4b, 0xba, 0x8a, 0xe9, 0xdf, 0x08, 0x54, 0x19, 0xb0, 0x95, 0xad, 0xf4, 0x23, 0xeb, 0x3e, + 0xc1, 0xdb, 0x21, 0x5b, 0x29, 0xdb, 0x11, 0x8c, 0x7b, 0x92, 0x71, 0xd7, 0x55, 0x21, 0x0f, 0xa5, + 0x72, 0x03, 0x38, 0x1d, 0x6f, 0xa8, 0xa0, 0xa5, 0x02, 0x56, 0xe7, 0x01, 0x30, 0xb2, 0x8d, 0xc9, + 0xba, 0x08, 0xf9, 0x24, 0xf3, 0xb8, 0x2d, 0x5d, 0x0d, 0x06, 0xec, 0x9d, 0x84, 0x44, 0x8f, 0xfb, + 0xbc, 0x15, 0x24, 0x8f, 0x57, 0xb9, 0x2f, 0x9a, 0x31, 0x0a, 0x8e, 0x69, 0x22, 0xda, 0x17, 0x0e, + 0xdf, 0x5c, 0x6e, 0x49, 0x57, 0xba, 0xf6, 0x72, 0x53, 0xae, 0xac, 0xc8, 0x46, 0xdb, 0x09, 0xc1, + 0xb2, 0x39, 0x80, 0xc9, 0xab, 0xae, 0x9e, 0x45, 0xcd, 0x61, 0x89, 0xf5, 0xb6, 0x08, 0x42, 0xd3, + 0xc2, 0x37, 0x4f, 0xbd, 0x0d, 0x3c, 0xe5, 0x06, 0x82, 0x3c, 0xc6, 0xa5, 0x48, 0x4b, 0x19, 0xdd, + 0x43, 0xd5, 0xfe, 0xa9, 0x32, 0xfd, 0xb7, 0x60, 0x34, 0x8a, 0xa8, 0xf5, 0xed, 0xfe, 0xba, 0x5b, + 0xf8, 0xf2, 0xe7, 0xeb, 0x38, 0xb2, 0x20, 0xc4, 0xac, 0xe2, 0x5b, 0x3a, 0xe7, 0x82, 0x08, 0x97, + 0x22, 0x30, 0xb0, 0x91, 0x6b, 0xb8, 0x28, 0x9b, 0x3a, 0x65, 0x9f, 0x55, 0x94, 0x4d, 0x73, 0x09, + 0xdf, 0x4e, 0x20, 0x41, 0xc1, 0x2c, 0xee, 0x05, 0xa6, 0x14, 0x09, 0xba, 0x1e, 0x14, 0x42, 0x6a, + 0x57, 0xba, 0x12, 0xac, 0x18, 0x6e, 0x72, 0x48, 0x3a, 0xe7, 0x38, 0x80, 0x88, 0xdd, 0x92, 0xa7, + 0x18, 0x1f, 0x77, 0x01, 0xf2, 0x8e, 0xd2, 0xa8, 0x65, 0xb4, 0xdb, 0x32, 0x1a, 0x0d, 0x09, 0xb4, + 0x8c, 0x2e, 0x72, 0x3b, 0xd6, 0x6e, 0x9d, 0x88, 0x34, 0x3f, 0x23, 0x5c, 0x4e, 0x72, 0xa4, 0x29, + 0xef, 0xb9, 0x80, 0x72, 0xb2, 0x70, 0x4a, 0x5e, 0x51, 0xcb, 0x1b, 0xcb, 0x95, 0x17, 0xd1, 0x9e, + 0xd2, 0x37, 0x8f, 0x87, 0xe3, 0xba, 0x5a, 0xdd, 0xa1, 0x78, 0xa1, 0x67, 0x62, 0xfe, 0x68, 0x24, + 0xe2, 0x7a, 0x0c, 0xe1, 0x3e, 0xe0, 0x7e, 0x16, 0xb7, 0xe5, 0xf8, 0x85, 0xf9, 0x01, 0xe1, 0x91, + 0x9c, 0x34, 0x60, 0xb9, 0x81, 0x07, 0xfd, 0x34, 0x00, 0x94, 0x78, 0x2c, 0x39, 0x3d, 0xa9, 0xf9, + 0xa0, 0x1e, 0xe9, 0xb9, 0x4c, 0x17, 0x4c, 0xcd, 0x39, 0xce, 0x99, 0xa6, 0x2e, 0xab, 0xc9, 0x3f, + 0x63, 0xfb, 0xd9, 0x84, 0xf9, 0xf6, 0x7b, 0x2e, 0xcb, 0xfe, 0xa5, 0x0d, 0xc7, 0xd4, 0x41, 0x09, + 0x5f, 0xd5, 0xbe, 0xc8, 0x7b, 0x84, 0x4b, 0xd1, 0x35, 0x26, 0xc3, 0x49, 0x8d, 0xc9, 0x6d, 0x51, + 0x19, 0xc9, 0x41, 0x45, 0x6c, 0xe6, 0xc4, 0xbb, 0xef, 0xbf, 0x77, 0x8a, 0x63, 0x64, 0x84, 0x75, + 0xe1, 0x13, 0xae, 0x08, 0xdf, 0x28, 0x7f, 0x8d, 0x65, 0xac, 0x3b, 0xb2, 0x83, 0x70, 0x2f, 0xdc, + 0x08, 0x52, 0xcd, 0x60, 0x48, 0xec, 0x92, 0xca, 0xfd, 0x73, 0x20, 0x41, 0xcf, 0xb4, 0xd6, 0x33, + 0x41, 0x1e, 0xe4, 0xe8, 0x89, 0xff, 0xb7, 0x64, 0x73, 0x9b, 0x7c, 0x42, 0xb8, 0xff, 0xc4, 0xf5, + 0x26, 0x59, 0x7c, 0xc9, 0x35, 0x53, 0x19, 0x3f, 0x0f, 0x14, 0xb4, 0x51, 0xad, 0xad, 0x4a, 0x46, + 0xcf, 0xa7, 0x8d, 0xfc, 0x40, 0x78, 0x30, 0x75, 0x7a, 0xc8, 0x4c, 0x76, 0x41, 0xce, 0xba, 0x2f, + 0x95, 0x47, 0x17, 0x8e, 0x03, 0xe9, 0xcf, 0xb5, 0xf4, 0x79, 0x52, 0xcb, 0x91, 0x9e, 0xf1, 0x5d, + 0x62, 0x5b, 0x47, 0xab, 0x66, 0x9b, 0x7c, 0x43, 0xb8, 0x9c, 0xca, 0x36, 0xe7, 0x38, 0x99, 0xce, + 0x72, 0x36, 0x41, 0xa6, 0xb3, 0xbc, 0x0b, 0x6d, 0x3e, 0xd1, 0xce, 0x66, 0xc9, 0xcc, 0xff, 0x39, + 0xab, 0xbd, 0xdc, 0xed, 0x18, 0x68, 0xaf, 0x63, 0xa0, 0xfd, 0x8e, 0x81, 0x0e, 0x3a, 0x06, 0xfa, + 0x78, 0x68, 0x14, 0xf6, 0x0e, 0x8d, 0xc2, 0xfe, 0xa1, 0x51, 0x78, 0xfd, 0xd0, 0x96, 0xe1, 0x6a, + 0xbb, 0x4e, 0x1b, 0xaa, 0x95, 0x91, 0xff, 0xed, 0x11, 0x43, 0xb8, 0xe9, 0x89, 0xa0, 0x5e, 0xd2, + 0x9f, 0xf0, 0xe9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x93, 0xde, 0x52, 0x8d, 0xd5, 0x08, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -341,6 +524,9 @@ type QueryClient interface { // Queries a list of Service items. Service(ctx context.Context, in *QueryGetServiceRequest, opts ...grpc.CallOption) (*QueryGetServiceResponse, error) AllServices(ctx context.Context, in *QueryAllServicesRequest, opts ...grpc.CallOption) (*QueryAllServicesResponse, error) + // Queries a list of RelayMiningDifficulty items. + RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) + RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) } type queryClient struct { @@ -378,6 +564,24 @@ func (c *queryClient) AllServices(ctx context.Context, in *QueryAllServicesReque return out, nil } +func (c *queryClient) RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) { + out := new(QueryGetRelayMiningDifficultyResponse) + err := c.cc.Invoke(ctx, "/poktroll.service.Query/RelayMiningDifficulty", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) { + out := new(QueryAllRelayMiningDifficultyResponse) + err := c.cc.Invoke(ctx, "/poktroll.service.Query/RelayMiningDifficultyAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -385,6 +589,9 @@ type QueryServer interface { // Queries a list of Service items. Service(context.Context, *QueryGetServiceRequest) (*QueryGetServiceResponse, error) AllServices(context.Context, *QueryAllServicesRequest) (*QueryAllServicesResponse, error) + // Queries a list of RelayMiningDifficulty items. + RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) + RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -400,6 +607,12 @@ func (*UnimplementedQueryServer) Service(ctx context.Context, req *QueryGetServi func (*UnimplementedQueryServer) AllServices(ctx context.Context, req *QueryAllServicesRequest) (*QueryAllServicesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllServices not implemented") } +func (*UnimplementedQueryServer) RelayMiningDifficulty(ctx context.Context, req *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficulty not implemented") +} +func (*UnimplementedQueryServer) RelayMiningDifficultyAll(ctx context.Context, req *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficultyAll not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -459,6 +672,42 @@ func _Query_AllServices_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_RelayMiningDifficulty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRelayMiningDifficultyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RelayMiningDifficulty(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.service.Query/RelayMiningDifficulty", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RelayMiningDifficulty(ctx, req.(*QueryGetRelayMiningDifficultyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RelayMiningDifficultyAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRelayMiningDifficultyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RelayMiningDifficultyAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/poktroll.service.Query/RelayMiningDifficultyAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RelayMiningDifficultyAll(ctx, req.(*QueryAllRelayMiningDifficultyRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "poktroll.service.Query", HandlerType: (*QueryServer)(nil), @@ -475,6 +724,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AllServices", Handler: _Query_AllServices_Handler, }, + { + MethodName: "RelayMiningDifficulty", + Handler: _Query_RelayMiningDifficulty_Handler, + }, + { + MethodName: "RelayMiningDifficultyAll", + Handler: _Query_RelayMiningDifficultyAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/service/query.proto", @@ -683,100 +940,601 @@ func (m *QueryAllServicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryGetRelayMiningDifficultyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *QueryGetRelayMiningDifficultyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRelayMiningDifficultyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n + if len(m.ServiceId) > 0 { + i -= len(m.ServiceId) + copy(dAtA[i:], m.ServiceId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryGetRelayMiningDifficultyResponse) 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 *QueryGetRelayMiningDifficultyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRelayMiningDifficultyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + { + size, err := m.RelayMiningDifficulty.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryGetServiceRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryAllRelayMiningDifficultyRequest) 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 *QueryAllRelayMiningDifficultyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRelayMiningDifficultyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryGetServiceResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryAllRelayMiningDifficultyResponse) 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 *QueryAllRelayMiningDifficultyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRelayMiningDifficultyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RelayMiningDifficulty) > 0 { + for iNdEx := len(m.RelayMiningDifficulty) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RelayMiningDifficulty[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetServiceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetServiceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Service.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllServicesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllServicesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Service) > 0 { + for _, e := range m.Service { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRelayMiningDifficultyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ServiceId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRelayMiningDifficultyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RelayMiningDifficulty.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllRelayMiningDifficultyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRelayMiningDifficultyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RelayMiningDifficulty) > 0 { + for _, e := range m.RelayMiningDifficulty { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetServiceRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetServiceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - var l int - _ = l - l = m.Service.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} -func (m *QueryAllServicesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if iNdEx > l { + return io.ErrUnexpectedEOF } - return n + return nil } - -func (m *QueryAllServicesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Service) > 0 { - for _, e := range m.Service { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryGetServiceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetServiceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllServicesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -799,12 +1557,48 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllServicesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllServicesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -826,7 +1620,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllServicesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -849,15 +1643,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllServicesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllServicesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -884,7 +1678,44 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Service = append(m.Service, types.Service{}) + if err := m.Service[len(m.Service)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -909,7 +1740,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetServiceRequest) Unmarshal(dAtA []byte) error { +func (m *QueryGetRelayMiningDifficultyRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -932,15 +1763,15 @@ func (m *QueryGetServiceRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetServiceRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -968,7 +1799,7 @@ func (m *QueryGetServiceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + m.ServiceId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -991,7 +1822,7 @@ func (m *QueryGetServiceRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetServiceResponse) Unmarshal(dAtA []byte) error { +func (m *QueryGetRelayMiningDifficultyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1014,15 +1845,15 @@ func (m *QueryGetServiceResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryGetServiceResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1049,7 +1880,7 @@ func (m *QueryGetServiceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Service.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RelayMiningDifficulty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1074,7 +1905,7 @@ func (m *QueryGetServiceResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllServicesRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllRelayMiningDifficultyRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1097,10 +1928,10 @@ func (m *QueryAllServicesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllServicesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllServicesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1160,7 +1991,7 @@ func (m *QueryAllServicesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllServicesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllRelayMiningDifficultyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1183,15 +2014,15 @@ func (m *QueryAllServicesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllServicesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllServicesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1218,8 +2049,8 @@ func (m *QueryAllServicesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Service = append(m.Service, types.Service{}) - if err := m.Service[len(m.Service)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RelayMiningDifficulty = append(m.RelayMiningDifficulty, RelayMiningDifficulty{}) + if err := m.RelayMiningDifficulty[len(m.RelayMiningDifficulty)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/service/types/query.pb.gw.go b/x/service/types/query.pb.gw.go index 621e80775..f39c1c38d 100644 --- a/x/service/types/query.pb.gw.go +++ b/x/service/types/query.pb.gw.go @@ -141,6 +141,96 @@ func local_request_Query_AllServices_0(ctx context.Context, marshaler runtime.Ma } +func request_Query_RelayMiningDifficulty_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRelayMiningDifficultyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["serviceId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "serviceId") + } + + protoReq.ServiceId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "serviceId", err) + } + + msg, err := client.RelayMiningDifficulty(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RelayMiningDifficulty_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRelayMiningDifficultyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["serviceId"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "serviceId") + } + + protoReq.ServiceId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "serviceId", err) + } + + msg, err := server.RelayMiningDifficulty(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RelayMiningDifficultyAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RelayMiningDifficultyAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRelayMiningDifficultyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RelayMiningDifficultyAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RelayMiningDifficultyAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RelayMiningDifficultyAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRelayMiningDifficultyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RelayMiningDifficultyAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RelayMiningDifficultyAll(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -216,6 +306,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_RelayMiningDifficulty_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RelayMiningDifficulty_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RelayMiningDifficulty_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RelayMiningDifficultyAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_RelayMiningDifficultyAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RelayMiningDifficultyAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -317,6 +453,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_RelayMiningDifficulty_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RelayMiningDifficulty_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RelayMiningDifficulty_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RelayMiningDifficultyAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_RelayMiningDifficultyAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_RelayMiningDifficultyAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -326,6 +502,10 @@ var ( pattern_Query_Service_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "service", "id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AllServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "service"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RelayMiningDifficulty_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"pokt-network", "poktroll", "service", "relay_mining_difficulty", "serviceId"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RelayMiningDifficultyAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "service", "relay_mining_difficulty"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -334,4 +514,8 @@ var ( forward_Query_Service_0 = runtime.ForwardResponseMessage forward_Query_AllServices_0 = runtime.ForwardResponseMessage + + forward_Query_RelayMiningDifficulty_0 = runtime.ForwardResponseMessage + + forward_Query_RelayMiningDifficultyAll_0 = runtime.ForwardResponseMessage ) diff --git a/x/tokenomics/types/relay_mining_difficulty.pb.go b/x/service/types/relay_mining_difficulty.pb.go similarity index 83% rename from x/tokenomics/types/relay_mining_difficulty.pb.go rename to x/service/types/relay_mining_difficulty.pb.go index 981a19384..751c4b433 100644 --- a/x/tokenomics/types/relay_mining_difficulty.pb.go +++ b/x/service/types/relay_mining_difficulty.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: poktroll/tokenomics/relay_mining_difficulty.proto +// source: poktroll/service/relay_mining_difficulty.proto package types @@ -25,6 +25,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // RelayMiningDifficulty is a message used to store the on-chain Relay Mining // difficulty associated with a specific service ID. +// TODO_TECHDEBT: Embed this message in the Service message. type RelayMiningDifficulty struct { // The service ID the relay mining difficulty is associated with. ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` @@ -45,7 +46,7 @@ func (m *RelayMiningDifficulty) Reset() { *m = RelayMiningDifficulty{} } func (m *RelayMiningDifficulty) String() string { return proto.CompactTextString(m) } func (*RelayMiningDifficulty) ProtoMessage() {} func (*RelayMiningDifficulty) Descriptor() ([]byte, []int) { - return fileDescriptor_1777fca7cd39aaea, []int{0} + return fileDescriptor_a9633b1df92612ec, []int{0} } func (m *RelayMiningDifficulty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -99,34 +100,33 @@ func (m *RelayMiningDifficulty) GetTargetHash() []byte { } func init() { - proto.RegisterType((*RelayMiningDifficulty)(nil), "poktroll.tokenomics.RelayMiningDifficulty") + proto.RegisterType((*RelayMiningDifficulty)(nil), "poktroll.service.RelayMiningDifficulty") } func init() { - proto.RegisterFile("poktroll/tokenomics/relay_mining_difficulty.proto", fileDescriptor_1777fca7cd39aaea) + proto.RegisterFile("poktroll/service/relay_mining_difficulty.proto", fileDescriptor_a9633b1df92612ec) } -var fileDescriptor_1777fca7cd39aaea = []byte{ - // 292 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0xf3, 0x30, - 0x14, 0x85, 0xeb, 0xbf, 0xd5, 0x2f, 0xd5, 0xad, 0x18, 0x02, 0x48, 0x11, 0x12, 0x26, 0x20, 0x86, - 0x2c, 0x34, 0x42, 0x7d, 0x03, 0x04, 0x52, 0x19, 0x18, 0xc8, 0xc8, 0x62, 0x39, 0x89, 0x6b, 0x5b, - 0x89, 0xed, 0xc8, 0x76, 0x80, 0xbc, 0x05, 0x8f, 0xc0, 0xe3, 0x30, 0x76, 0xec, 0x88, 0x92, 0x17, - 0x41, 0x71, 0xa1, 0xb0, 0x59, 0x9f, 0xef, 0x39, 0xf7, 0x9e, 0x03, 0xaf, 0x6b, 0x5d, 0x3a, 0xa3, - 0xab, 0x2a, 0x71, 0xba, 0xa4, 0x4a, 0x4b, 0x91, 0xdb, 0xc4, 0xd0, 0x8a, 0xb4, 0x58, 0x0a, 0x25, - 0x14, 0xc3, 0x85, 0x58, 0xaf, 0x45, 0xde, 0x54, 0xae, 0x5d, 0xd4, 0x46, 0x3b, 0x1d, 0x1c, 0xfe, - 0x48, 0x16, 0xbf, 0x92, 0x93, 0x23, 0xa6, 0x99, 0xf6, 0xff, 0xc9, 0xf0, 0xda, 0x8d, 0x5e, 0xbc, - 0x03, 0x78, 0x9c, 0x0e, 0x66, 0x0f, 0xde, 0xeb, 0x76, 0x6f, 0x15, 0x9c, 0x42, 0x68, 0xa9, 0x79, - 0x16, 0x39, 0xc5, 0xa2, 0x08, 0x41, 0x04, 0xe2, 0x69, 0x3a, 0xfd, 0x26, 0xf7, 0x45, 0x70, 0x0e, - 0xe7, 0x59, 0xa5, 0xf3, 0x12, 0x73, 0x2a, 0x18, 0x77, 0xe1, 0xbf, 0x08, 0xc4, 0xe3, 0x74, 0xe6, - 0xd9, 0xca, 0xa3, 0xe0, 0x12, 0x1e, 0xa8, 0x46, 0x62, 0x7f, 0xab, 0xc5, 0x54, 0x92, 0x70, 0x1c, - 0x81, 0x78, 0x92, 0xce, 0x55, 0x23, 0xfd, 0x4e, 0x7b, 0x27, 0x49, 0x70, 0x06, 0x67, 0x8e, 0x18, - 0x46, 0x1d, 0xe6, 0xc4, 0xf2, 0x70, 0x12, 0x81, 0x78, 0x9e, 0xc2, 0x1d, 0x5a, 0x11, 0xcb, 0x6f, - 0x1e, 0x3f, 0x3a, 0x04, 0x36, 0x1d, 0x02, 0xdb, 0x0e, 0x81, 0xcf, 0x0e, 0x81, 0xb7, 0x1e, 0x8d, - 0x36, 0x3d, 0x1a, 0x6d, 0x7b, 0x34, 0x7a, 0x5a, 0x32, 0xe1, 0x78, 0x93, 0x2d, 0x72, 0x2d, 0x93, - 0x21, 0xf6, 0x95, 0xa2, 0xee, 0x45, 0x9b, 0x32, 0xd9, 0xd7, 0xf6, 0xfa, 0xb7, 0x38, 0xd7, 0xd6, - 0xd4, 0x66, 0xff, 0x7d, 0xf8, 0xe5, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x9e, 0x74, 0x57, - 0x5c, 0x01, 0x00, 0x00, +var fileDescriptor_a9633b1df92612ec = []byte{ + // 285 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x90, 0xc1, 0x4a, 0xf4, 0x30, + 0x14, 0x85, 0x27, 0xff, 0x0c, 0x3f, 0x4c, 0x66, 0x10, 0x29, 0x0a, 0x45, 0x30, 0x56, 0x71, 0xd1, + 0x8d, 0xad, 0xe0, 0x1b, 0x88, 0xc2, 0xb8, 0xd0, 0x45, 0x97, 0x6e, 0x42, 0xda, 0x66, 0x92, 0xd0, + 0xa6, 0x29, 0x49, 0xaa, 0xf6, 0x2d, 0x7c, 0x04, 0x1f, 0xc7, 0xe5, 0x2c, 0x67, 0x29, 0xed, 0x8b, + 0x48, 0x33, 0xb5, 0xbb, 0xf0, 0xe5, 0xdc, 0x73, 0xef, 0x39, 0x30, 0xaa, 0x55, 0x61, 0xb5, 0x2a, + 0xcb, 0xd8, 0x50, 0xfd, 0x26, 0x32, 0x1a, 0x6b, 0x5a, 0x92, 0x16, 0x4b, 0x51, 0x89, 0x8a, 0xe1, + 0x5c, 0x6c, 0xb7, 0x22, 0x6b, 0x4a, 0xdb, 0x46, 0xb5, 0x56, 0x56, 0x79, 0xc7, 0x7f, 0xfa, 0x68, + 0xd4, 0x9f, 0x9d, 0x30, 0xc5, 0x94, 0xfb, 0x8c, 0x87, 0xd7, 0x41, 0x77, 0xf5, 0x05, 0xe0, 0x69, + 0x32, 0x38, 0x3d, 0x3b, 0xa3, 0x87, 0xc9, 0xc7, 0x3b, 0x87, 0x70, 0x1c, 0xc5, 0x22, 0xf7, 0x41, + 0x00, 0xc2, 0x65, 0xb2, 0x1c, 0xc9, 0x53, 0xee, 0x5d, 0xc2, 0x75, 0x5a, 0xaa, 0xac, 0xc0, 0x9c, + 0x0a, 0xc6, 0xad, 0xff, 0x2f, 0x00, 0xe1, 0x3c, 0x59, 0x39, 0xb6, 0x71, 0xc8, 0xbb, 0x86, 0x47, + 0x55, 0x23, 0xb1, 0x3b, 0xd4, 0x60, 0x2a, 0x89, 0x3f, 0x0f, 0x40, 0xb8, 0x48, 0xd6, 0x55, 0x23, + 0xdd, 0x4e, 0xf3, 0x28, 0x89, 0x77, 0x01, 0x57, 0x96, 0x68, 0x46, 0x2d, 0xe6, 0xc4, 0x70, 0x7f, + 0x11, 0x80, 0x70, 0x9d, 0xc0, 0x03, 0xda, 0x10, 0xc3, 0xef, 0x5f, 0xbe, 0x3b, 0x04, 0x76, 0x1d, + 0x02, 0xfb, 0x0e, 0x81, 0x9f, 0x0e, 0x81, 0xcf, 0x1e, 0xcd, 0x76, 0x3d, 0x9a, 0xed, 0x7b, 0x34, + 0x7b, 0xbd, 0x65, 0xc2, 0xf2, 0x26, 0x8d, 0x32, 0x25, 0xe3, 0x21, 0xf3, 0x4d, 0x45, 0xed, 0xbb, + 0xd2, 0x45, 0x3c, 0x15, 0xf6, 0x31, 0x55, 0x66, 0xdb, 0x9a, 0x9a, 0xf4, 0xbf, 0x4b, 0x7e, 0xf7, + 0x1b, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x5c, 0x12, 0x62, 0x53, 0x01, 0x00, 0x00, } func (m *RelayMiningDifficulty) Marshal() (dAtA []byte, err error) { diff --git a/x/shared/keeper/msg_server_update_param.go b/x/shared/keeper/msg_server_update_param.go index 6263d296d..1802360e3 100644 --- a/x/shared/keeper/msg_server_update_param.go +++ b/x/shared/keeper/msg_server_update_param.go @@ -2,105 +2,85 @@ package keeper import ( "context" + "fmt" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/pokt-network/poktroll/x/shared/types" ) func (k msgServer) UpdateParam(ctx context.Context, msg *types.MsgUpdateParam) (*types.MsgUpdateParamResponse, error) { + logger := k.logger.With( + "method", "UpdateParam", + "param_name", msg.Name, + ) + if err := msg.ValidateBasic(); err != nil { - return nil, err + return nil, status.Error(codes.InvalidArgument, err.Error()) } if k.GetAuthority() != msg.Authority { - return nil, types.ErrSharedInvalidSigner.Wrapf("invalid authority; expected %s, got %s", k.GetAuthority(), msg.Authority) + return nil, status.Error( + codes.InvalidArgument, + types.ErrSharedInvalidSigner.Wrapf( + "invalid authority; expected %s, got %s", + k.GetAuthority(), msg.Authority, + ).Error(), + ) } params := k.GetParams(ctx) switch msg.Name { case types.ParamNumBlocksPerSession: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) - if !ok { - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.NumBlocksPerSession = uint64(value.AsInt64) + logger = logger.With("param_value", msg.GetAsUint64()) + params.NumBlocksPerSession = msg.GetAsUint64() case types.ParamGracePeriodEndOffsetBlocks: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) - if !ok { - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.GracePeriodEndOffsetBlocks = uint64(value.AsInt64) + logger = logger.With("param_value", msg.GetAsUint64()) + params.GracePeriodEndOffsetBlocks = msg.GetAsUint64() case types.ParamClaimWindowOpenOffsetBlocks: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) - if !ok { - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.ClaimWindowOpenOffsetBlocks = uint64(value.AsInt64) + logger = logger.With("param_value", msg.GetAsUint64()) + params.ClaimWindowOpenOffsetBlocks = msg.GetAsUint64() case types.ParamClaimWindowCloseOffsetBlocks: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) - if !ok { - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.ClaimWindowCloseOffsetBlocks = uint64(value.AsInt64) + logger = logger.With("param_value", msg.GetAsUint64()) + params.ClaimWindowCloseOffsetBlocks = msg.GetAsUint64() case types.ParamProofWindowOpenOffsetBlocks: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) - if !ok { - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.ProofWindowOpenOffsetBlocks = uint64(value.AsInt64) + logger = logger.With("param_value", msg.GetAsUint64()) + params.ProofWindowOpenOffsetBlocks = msg.GetAsUint64() case types.ParamProofWindowCloseOffsetBlocks: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) - if !ok { - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.ProofWindowCloseOffsetBlocks = uint64(value.AsInt64) + logger = logger.With("param_value", msg.GetAsUint64()) + params.ProofWindowCloseOffsetBlocks = msg.GetAsUint64() case types.ParamSupplierUnbondingPeriodSessions: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) - if !ok { - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.SupplierUnbondingPeriodSessions = uint64(value.AsInt64) + logger = logger.With("param_value", msg.GetAsUint64()) + params.SupplierUnbondingPeriodSessions = msg.GetAsUint64() case types.ParamApplicationUnbondingPeriodSessions: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) - if !ok { - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - - params.ApplicationUnbondingPeriodSessions = uint64(value.AsInt64) + logger = logger.With("param_value", msg.GetAsUint64()) + params.ApplicationUnbondingPeriodSessions = msg.GetAsUint64() case types.ParamComputeUnitsToTokensMultiplier: - value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) - if !ok { - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) - } - computeUnitsToTokensMultiplier := uint64(value.AsInt64) - - if err := types.ValidateComputeUnitsToTokensMultiplier(computeUnitsToTokensMultiplier); err != nil { - return nil, err - } - - params.ComputeUnitsToTokensMultiplier = computeUnitsToTokensMultiplier + logger = logger.With("param_value", msg.GetAsUint64()) + params.ComputeUnitsToTokensMultiplier = msg.GetAsUint64() default: - return nil, types.ErrSharedParamInvalid.Wrapf("unsupported param %q", msg.Name) + return nil, status.Error( + codes.InvalidArgument, + types.ErrSharedParamInvalid.Wrapf("unsupported param %q", msg.Name).Error(), + ) } // Perform a global validation on all params, which includes the updated param. // This is needed to ensure that the updated param is valid in the context of all other params. if err := params.ValidateBasic(); err != nil { - return nil, err + return nil, status.Error(codes.InvalidArgument, err.Error()) } if err := k.SetParams(ctx, params); err != nil { - return nil, err + err = fmt.Errorf("unable to set params: %w", err) + logger.Error(fmt.Sprintf("ERROR: %s", err)) + return nil, status.Error(codes.Internal, err.Error()) } updatedParams := k.GetParams(ctx) + return &types.MsgUpdateParamResponse{ Params: &updatedParams, }, nil diff --git a/x/shared/keeper/msg_server_update_param_test.go b/x/shared/keeper/msg_server_update_param_test.go index da4a2ca03..74869bf3a 100644 --- a/x/shared/keeper/msg_server_update_param_test.go +++ b/x/shared/keeper/msg_server_update_param_test.go @@ -6,6 +6,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/pokt-network/poktroll/x/shared/keeper" "github.com/pokt-network/poktroll/x/shared/types" @@ -27,7 +29,7 @@ var testSharedParams = sharedtypes.Params{ } func TestMsgUpdateParam_UpdateNumBlocksPerSession(t *testing.T) { - var expectedNumBlocksPerSession int64 = 13 + var expectedNumBlocksPerSession uint64 = 13 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) @@ -36,25 +38,25 @@ func TestMsgUpdateParam_UpdateNumBlocksPerSession(t *testing.T) { require.NoError(t, k.SetParams(ctx, testSharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedNumBlocksPerSession), testSharedParams.NumBlocksPerSession) + require.NotEqual(t, expectedNumBlocksPerSession, testSharedParams.NumBlocksPerSession) // Update the number of blocks per session updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamNumBlocksPerSession, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedNumBlocksPerSession}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: expectedNumBlocksPerSession}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) - require.Equal(t, uint64(expectedNumBlocksPerSession), res.Params.NumBlocksPerSession) + require.Equal(t, expectedNumBlocksPerSession, res.Params.NumBlocksPerSession) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, "NumBlocksPerSession") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, string(sharedtypes.KeyNumBlocksPerSession)) } func TestMsgUpdateParam_UpdateClaimWindowOpenOffsetBlocks(t *testing.T) { - var expectedClaimWindowOpenOffestBlocks int64 = 4 + var expectedClaimWindowOpenOffestBlocks uint64 = 4 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) @@ -66,7 +68,7 @@ func TestMsgUpdateParam_UpdateClaimWindowOpenOffsetBlocks(t *testing.T) { minUnbodningPeriodSessions := getMinActorUnbondingPeriodSessions( &sharedParams, sharedParams.ClaimWindowOpenOffsetBlocks, - uint64(expectedClaimWindowOpenOffestBlocks), + expectedClaimWindowOpenOffestBlocks, ) // Update the SupplierUnbondingPeriodSessions such that it is greater than the @@ -81,25 +83,25 @@ func TestMsgUpdateParam_UpdateClaimWindowOpenOffsetBlocks(t *testing.T) { require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedClaimWindowOpenOffestBlocks), sharedParams.ClaimWindowOpenOffsetBlocks) + require.NotEqual(t, expectedClaimWindowOpenOffestBlocks, sharedParams.ClaimWindowOpenOffsetBlocks) // Update the claim window open offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamClaimWindowOpenOffsetBlocks, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedClaimWindowOpenOffestBlocks}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: expectedClaimWindowOpenOffestBlocks}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) - require.Equal(t, uint64(expectedClaimWindowOpenOffestBlocks), res.Params.ClaimWindowOpenOffsetBlocks) + require.Equal(t, expectedClaimWindowOpenOffestBlocks, res.Params.ClaimWindowOpenOffsetBlocks) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "ClaimWindowOpenOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, string(sharedtypes.KeyClaimWindowOpenOffsetBlocks)) } func TestMsgUpdateParam_UpdateClaimWindowCloseOffsetBlocks(t *testing.T) { - var expectedClaimWindowCloseOffestBlocks int64 = 8 + var expectedClaimWindowCloseOffestBlocks uint64 = 8 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) @@ -111,7 +113,7 @@ func TestMsgUpdateParam_UpdateClaimWindowCloseOffsetBlocks(t *testing.T) { minUnbodningPeriodSessions := getMinActorUnbondingPeriodSessions( &sharedParams, sharedParams.ClaimWindowOpenOffsetBlocks, - uint64(expectedClaimWindowCloseOffestBlocks), + expectedClaimWindowCloseOffestBlocks, ) // Update the SupplierUnbondingPeriodSessions such that it is greater than the @@ -126,25 +128,25 @@ func TestMsgUpdateParam_UpdateClaimWindowCloseOffsetBlocks(t *testing.T) { require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedClaimWindowCloseOffestBlocks), sharedParams.ClaimWindowCloseOffsetBlocks) + require.NotEqual(t, expectedClaimWindowCloseOffestBlocks, sharedParams.ClaimWindowCloseOffsetBlocks) // Update the claim window close offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamClaimWindowCloseOffsetBlocks, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedClaimWindowCloseOffestBlocks}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: expectedClaimWindowCloseOffestBlocks}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) - require.Equal(t, uint64(expectedClaimWindowCloseOffestBlocks), res.Params.ClaimWindowCloseOffsetBlocks) + require.Equal(t, expectedClaimWindowCloseOffestBlocks, res.Params.ClaimWindowCloseOffsetBlocks) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "ClaimWindowCloseOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, string(sharedtypes.KeyClaimWindowCloseOffsetBlocks)) } func TestMsgUpdateParam_UpdateProofWindowOpenOffsetBlocks(t *testing.T) { - var expectedProofWindowOpenOffestBlocks int64 = 8 + var expectedProofWindowOpenOffestBlocks uint64 = 8 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) @@ -156,7 +158,7 @@ func TestMsgUpdateParam_UpdateProofWindowOpenOffsetBlocks(t *testing.T) { minUnbodningPeriodSessions := getMinActorUnbondingPeriodSessions( &sharedParams, sharedParams.ClaimWindowOpenOffsetBlocks, - uint64(expectedProofWindowOpenOffestBlocks), + expectedProofWindowOpenOffestBlocks, ) // Update the SupplierUnbondingPeriodSessions such that it is greater than the @@ -171,25 +173,25 @@ func TestMsgUpdateParam_UpdateProofWindowOpenOffsetBlocks(t *testing.T) { require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedProofWindowOpenOffestBlocks), sharedParams.ProofWindowOpenOffsetBlocks) + require.NotEqual(t, expectedProofWindowOpenOffestBlocks, sharedParams.ProofWindowOpenOffsetBlocks) // Update the proof window open offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamProofWindowOpenOffsetBlocks, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedProofWindowOpenOffestBlocks}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: expectedProofWindowOpenOffestBlocks}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) - require.Equal(t, uint64(expectedProofWindowOpenOffestBlocks), res.Params.ProofWindowOpenOffsetBlocks) + require.Equal(t, expectedProofWindowOpenOffestBlocks, res.Params.ProofWindowOpenOffsetBlocks) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "ProofWindowOpenOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, string(sharedtypes.KeyProofWindowOpenOffsetBlocks)) } func TestMsgUpdateParam_UpdateProofWindowCloseOffsetBlocks(t *testing.T) { - var expectedProofWindowCloseOffestBlocks int64 = 8 + var expectedProofWindowCloseOffestBlocks uint64 = 8 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) @@ -201,7 +203,7 @@ func TestMsgUpdateParam_UpdateProofWindowCloseOffsetBlocks(t *testing.T) { minUnbodningPeriodSessions := getMinActorUnbondingPeriodSessions( &sharedParams, sharedParams.ClaimWindowOpenOffsetBlocks, - uint64(expectedProofWindowCloseOffestBlocks), + expectedProofWindowCloseOffestBlocks, ) // Update the SupplierUnbondingPeriodSessions such that it is greater than the @@ -216,25 +218,25 @@ func TestMsgUpdateParam_UpdateProofWindowCloseOffsetBlocks(t *testing.T) { require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedProofWindowCloseOffestBlocks), sharedParams.ProofWindowCloseOffsetBlocks) + require.NotEqual(t, expectedProofWindowCloseOffestBlocks, sharedParams.ProofWindowCloseOffsetBlocks) // Update the proof window close offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamProofWindowCloseOffsetBlocks, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedProofWindowCloseOffestBlocks}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: expectedProofWindowCloseOffestBlocks}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) - require.Equal(t, uint64(expectedProofWindowCloseOffestBlocks), res.Params.ProofWindowCloseOffsetBlocks) + require.Equal(t, expectedProofWindowCloseOffestBlocks, res.Params.ProofWindowCloseOffsetBlocks) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "ProofWindowCloseOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, string(sharedtypes.KeyProofWindowCloseOffsetBlocks)) } func TestMsgUpdateParam_UpdateGracePeriodEndOffsetBlocks(t *testing.T) { - var expectedGracePeriodEndOffestBlocks int64 = 2 + var expectedGracePeriodEndOffestBlocks uint64 = 2 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) @@ -243,31 +245,31 @@ func TestMsgUpdateParam_UpdateGracePeriodEndOffsetBlocks(t *testing.T) { // Update the claim window open offset blocks which has to be at least equal to // GracePeriodEndOffsetBlocks to pass UpdateParam validation. - sharedParams.ClaimWindowOpenOffsetBlocks = uint64(expectedGracePeriodEndOffestBlocks) + sharedParams.ClaimWindowOpenOffsetBlocks = expectedGracePeriodEndOffestBlocks // Set the parameters to their default values require.NoError(t, k.SetParams(ctx, sharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedGracePeriodEndOffestBlocks), sharedParams.GetGracePeriodEndOffsetBlocks()) + require.NotEqual(t, expectedGracePeriodEndOffestBlocks, sharedParams.GetGracePeriodEndOffsetBlocks()) // Update the proof window close offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamGracePeriodEndOffsetBlocks, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedGracePeriodEndOffestBlocks}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: expectedGracePeriodEndOffestBlocks}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) - require.Equal(t, uint64(expectedGracePeriodEndOffestBlocks), res.Params.GetGracePeriodEndOffsetBlocks()) + require.Equal(t, expectedGracePeriodEndOffestBlocks, res.Params.GetGracePeriodEndOffsetBlocks()) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, "GracePeriodEndOffsetBlocks") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &sharedParams, res.Params, string(sharedtypes.KeyGracePeriodEndOffsetBlocks)) } func TestMsgUpdateParam_UpdateSupplierUnbondingPeriodSessions(t *testing.T) { - var expectedSupplierUnbondingPerid int64 = 5 + var expectedSupplierUnbondingPeriod uint64 = 5 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) @@ -276,35 +278,41 @@ func TestMsgUpdateParam_UpdateSupplierUnbondingPeriodSessions(t *testing.T) { require.NoError(t, k.SetParams(ctx, testSharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedSupplierUnbondingPerid), testSharedParams.GetSupplierUnbondingPeriodSessions()) + require.NotEqual(t, expectedSupplierUnbondingPeriod, testSharedParams.GetSupplierUnbondingPeriodSessions()) // Update the supplier unbonding period param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamSupplierUnbondingPeriodSessions, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedSupplierUnbondingPerid}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: expectedSupplierUnbondingPeriod}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) - require.Equal(t, uint64(expectedSupplierUnbondingPerid), res.Params.GetSupplierUnbondingPeriodSessions()) + require.Equal(t, expectedSupplierUnbondingPeriod, res.Params.GetSupplierUnbondingPeriodSessions()) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, "SupplierUnbondingPeriodSessions") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, string(sharedtypes.KeySupplierUnbondingPeriodSessions)) // Ensure that a supplier unbonding period that is less than the cumulative // proof window close blocks is not allowed. updateParamMsg = &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamSupplierUnbondingPeriodSessions, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: 1}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: 1}, } _, err = msgSrv.UpdateParam(ctx, updateParamMsg) - require.ErrorIs(t, err, sharedtypes.ErrSharedParamInvalid) + require.EqualError(t, err, status.Error( + codes.InvalidArgument, + sharedtypes.ErrSharedParamInvalid.Wrapf( + "SupplierUnbondingPeriodSessions (%v session) (%v blocks) must be greater than the cumulative ProofWindowCloseOffsetBlocks (%v)", + 1, 4, 10, + ).Error(), + ).Error()) } func TestMsgUpdateParam_UpdateApplicationUnbondingPeriodSessions(t *testing.T) { - var expectedApplicationUnbondingPerid int64 = 5 + var expectedApplicationUnbondingPerid uint64 = 5 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) @@ -313,35 +321,41 @@ func TestMsgUpdateParam_UpdateApplicationUnbondingPeriodSessions(t *testing.T) { require.NoError(t, k.SetParams(ctx, testSharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedApplicationUnbondingPerid), testSharedParams.GetApplicationUnbondingPeriodSessions()) + require.NotEqual(t, expectedApplicationUnbondingPerid, testSharedParams.GetApplicationUnbondingPeriodSessions()) // Update the application unbonding period param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamApplicationUnbondingPeriodSessions, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedApplicationUnbondingPerid}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: expectedApplicationUnbondingPerid}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) - require.Equal(t, uint64(expectedApplicationUnbondingPerid), res.Params.GetApplicationUnbondingPeriodSessions()) + require.Equal(t, expectedApplicationUnbondingPerid, res.Params.GetApplicationUnbondingPeriodSessions()) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, "ApplicationUnbondingPeriodSessions") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, string(sharedtypes.KeyApplicationUnbondingPeriodSessions)) // Ensure that a application unbonding period that is less than the cumulative // proof window close blocks is not allowed. updateParamMsg = &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamApplicationUnbondingPeriodSessions, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: 1}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: 1}, } _, err = msgSrv.UpdateParam(ctx, updateParamMsg) - require.ErrorIs(t, err, sharedtypes.ErrSharedParamInvalid) + require.EqualError(t, err, status.Error( + codes.InvalidArgument, + sharedtypes.ErrSharedParamInvalid.Wrapf( + "ApplicationUnbondingPeriodSessions (%v session) (%v blocks) must be greater than the cumulative ProofWindowCloseOffsetBlocks (%v)", + 1, 4, 10, + ).Error(), + ).Error()) } func TestMsgUpdateParam_ComputeUnitsToTokenMultiplier(t *testing.T) { - var expectedComputeUnitsToTokenMultiplier int64 = 5 + var expectedComputeUnitsToTokenMultiplier uint64 = 5 k, ctx := testkeeper.SharedKeeper(t) msgSrv := keeper.NewMsgServerImpl(k) @@ -350,30 +364,35 @@ func TestMsgUpdateParam_ComputeUnitsToTokenMultiplier(t *testing.T) { require.NoError(t, k.SetParams(ctx, testSharedParams)) // Ensure the default values are different from the new values we want to set - require.NotEqual(t, uint64(expectedComputeUnitsToTokenMultiplier), testSharedParams.GetComputeUnitsToTokensMultiplier()) + require.NotEqual(t, expectedComputeUnitsToTokenMultiplier, testSharedParams.GetComputeUnitsToTokensMultiplier()) // Update the compute units to token multiplier param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamComputeUnitsToTokensMultiplier, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedComputeUnitsToTokenMultiplier}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: expectedComputeUnitsToTokenMultiplier}, } res, err := msgSrv.UpdateParam(ctx, updateParamMsg) require.NoError(t, err) - require.Equal(t, uint64(expectedComputeUnitsToTokenMultiplier), res.Params.GetComputeUnitsToTokensMultiplier()) + require.Equal(t, expectedComputeUnitsToTokenMultiplier, res.Params.GetComputeUnitsToTokensMultiplier()) // Ensure the other parameters are unchanged - testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, "ComputeUnitsToTokensMultiplier") + testkeeper.AssertDefaultParamsEqualExceptFields(t, &testSharedParams, res.Params, string(sharedtypes.KeyComputeUnitsToTokensMultiplier)) // Ensure that compute units to token multiplier that is less than 1 is not allowed. updateParamMsg = &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamComputeUnitsToTokensMultiplier, - AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: 0}, + AsType: &sharedtypes.MsgUpdateParam_AsUint64{AsUint64: 0}, } _, err = msgSrv.UpdateParam(ctx, updateParamMsg) - require.ErrorIs(t, err, sharedtypes.ErrSharedParamInvalid) + require.EqualError(t, err, status.Error( + codes.InvalidArgument, + sharedtypes.ErrSharedParamInvalid.Wrapf( + "invalid ComputeUnitsToTokensMultiplier: (%d)", 0, + ).Error(), + ).Error()) } // getMinActorUnbondingPeriodSessions returns the actors unbonding period @@ -386,6 +405,5 @@ func getMinActorUnbondingPeriodSessions( ) uint64 { deltaBlocks := newParamBlocksValue - oldParamBlocksValue newProofWindowCloseBlocks := types.GetSessionEndToProofWindowCloseBlocks(params) + deltaBlocks - return (newProofWindowCloseBlocks / params.NumBlocksPerSession) + 1 } diff --git a/x/shared/types/message_update_param.go b/x/shared/types/message_update_param.go index f609b0fd8..828379864 100644 --- a/x/shared/types/message_update_param.go +++ b/x/shared/types/message_update_param.go @@ -16,8 +16,8 @@ func NewMsgUpdateParam(authority string, name string, value any) (*MsgUpdatePara switch v := value.(type) { case string: valueAsType = &MsgUpdateParam_AsString{AsString: v} - case int64: - valueAsType = &MsgUpdateParam_AsInt64{AsInt64: v} + case uint64: + valueAsType = &MsgUpdateParam_AsUint64{AsUint64: v} case []byte: valueAsType = &MsgUpdateParam_AsBytes{AsBytes: v} default: @@ -31,9 +31,10 @@ func NewMsgUpdateParam(authority string, name string, value any) (*MsgUpdatePara }, nil } -// ValidateBasic performs a basic validation of the MsgUpdateParam fields. It ensures -// the parameter name is supported and the parameter type matches the expected type for -// a given parameter name. +// ValidateBasic performs a basic validation of the MsgUpdateParam fields. It ensures: +// 1. The parameter name is supported. +// 2. The parameter type matches the expected type for a given parameter name. +// 3. The parameter value is valid (according to its respective validation function). func (msg *MsgUpdateParam) ValidateBasic() error { // Validate the address if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { @@ -47,28 +48,62 @@ func (msg *MsgUpdateParam) ValidateBasic() error { // Parameter name must be supported by this module. switch msg.Name { - // TODO_IMPROVE: Add a Uint64 asType instead of using int64 for uint64 params. - case ParamNumBlocksPerSession, - ParamGracePeriodEndOffsetBlocks, - ParamClaimWindowOpenOffsetBlocks, - ParamClaimWindowCloseOffsetBlocks, - ParamProofWindowOpenOffsetBlocks, - ParamProofWindowCloseOffsetBlocks, - ParamSupplierUnbondingPeriodSessions, - ParamApplicationUnbondingPeriodSessions, - ParamComputeUnitsToTokensMultiplier: - return msg.paramTypeIsInt64() + case ParamNumBlocksPerSession: + if err := msg.paramTypeIsUint64(); err != nil { + return err + } + return ValidateNumBlocksPerSession(msg.GetAsUint64()) + case ParamGracePeriodEndOffsetBlocks: + if err := msg.paramTypeIsUint64(); err != nil { + return err + } + return ValidateGracePeriodEndOffsetBlocks(msg.GetAsUint64()) + case ParamClaimWindowOpenOffsetBlocks: + if err := msg.paramTypeIsUint64(); err != nil { + return err + } + return ValidateClaimWindowOpenOffsetBlocks(msg.GetAsUint64()) + case ParamClaimWindowCloseOffsetBlocks: + if err := msg.paramTypeIsUint64(); err != nil { + return err + } + return ValidateClaimWindowCloseOffsetBlocks(msg.GetAsUint64()) + case ParamProofWindowOpenOffsetBlocks: + if err := msg.paramTypeIsUint64(); err != nil { + return err + } + return ValidateProofWindowOpenOffsetBlocks(msg.GetAsUint64()) + case ParamProofWindowCloseOffsetBlocks: + if err := msg.paramTypeIsUint64(); err != nil { + return err + } + return ValidateProofWindowCloseOffsetBlocks(msg.GetAsUint64()) + case ParamSupplierUnbondingPeriodSessions: + if err := msg.paramTypeIsUint64(); err != nil { + return err + } + return ValidateSupplierUnbondingPeriodSessions(msg.GetAsUint64()) + case ParamApplicationUnbondingPeriodSessions: + if err := msg.paramTypeIsUint64(); err != nil { + return err + } + return ValidateApplicationUnbondingPeriodSessions(msg.GetAsUint64()) + case ParamComputeUnitsToTokensMultiplier: + if err := msg.paramTypeIsUint64(); err != nil { + return err + } + return ValidateComputeUnitsToTokensMultiplier(msg.GetAsUint64()) default: return ErrSharedParamNameInvalid.Wrapf("unsupported param %q", msg.Name) } } -// paramTypeIsInt64 checks if the parameter type is int64, returning an error if not. -func (msg *MsgUpdateParam) paramTypeIsInt64() error { - if _, ok := msg.AsType.(*MsgUpdateParam_AsInt64); !ok { +// paramTypeIsUint64 checks if the parameter type is int64, returning an error if not. +func (msg *MsgUpdateParam) paramTypeIsUint64() error { + if _, ok := msg.AsType.(*MsgUpdateParam_AsUint64); !ok { return ErrSharedParamInvalid.Wrapf( "invalid type for param %q expected %T, got %T", - msg.Name, &MsgUpdateParam_AsInt64{}, + msg.Name, &MsgUpdateParam_AsUint64{}, msg.AsType, ) } diff --git a/x/shared/types/message_update_param_test.go b/x/shared/types/message_update_param_test.go index 65f4931b3..ff1fa242e 100644 --- a/x/shared/types/message_update_param_test.go +++ b/x/shared/types/message_update_param_test.go @@ -19,7 +19,7 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { msg: MsgUpdateParam{ Authority: "invalid_address", Name: "", // Doesn't matter for this test - AsType: &MsgUpdateParam_AsInt64{AsInt64: 1}, + AsType: &MsgUpdateParam_AsUint64{AsUint64: 1}, }, expectedErr: ErrSharedInvalidAddress, }, { @@ -27,7 +27,7 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { msg: MsgUpdateParam{ Authority: sample.AccAddress(), Name: "WRONG_num_blocks_per_session", - AsType: &MsgUpdateParam_AsInt64{AsInt64: 1}, + AsType: &MsgUpdateParam_AsUint64{AsUint64: 1}, }, expectedErr: ErrSharedParamNameInvalid, }, { @@ -43,22 +43,23 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { msg: MsgUpdateParam{ Authority: sample.AccAddress(), Name: ParamNumBlocksPerSession, - AsType: &MsgUpdateParam_AsInt64{AsInt64: 1}, + AsType: &MsgUpdateParam_AsUint64{AsUint64: 1}, }, }, { desc: "invalid ComputeUnitsToTokensMultiplier", msg: MsgUpdateParam{ Authority: sample.AccAddress(), Name: ParamComputeUnitsToTokensMultiplier, - AsType: &MsgUpdateParam_AsInt64{AsInt64: 0}, + AsType: &MsgUpdateParam_AsUint64{AsUint64: 0}, }, + expectedErr: ErrSharedParamInvalid, }, } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - err := tt.msg.ValidateBasic() - if tt.expectedErr != nil { - require.ErrorContains(t, err, tt.expectedErr.Error()) + for _, test := range tests { + t.Run(test.desc, func(t *testing.T) { + err := test.msg.ValidateBasic() + if test.expectedErr != nil { + require.ErrorContains(t, err, test.expectedErr.Error()) return } require.NoError(t, err) diff --git a/x/shared/types/params.go b/x/shared/types/params.go index 17bc7b964..27887310c 100644 --- a/x/shared/types/params.go +++ b/x/shared/types/params.go @@ -176,8 +176,8 @@ func (params *Params) ValidateBasic() error { // ValidateNumBlocksPerSession validates the NumBlocksPerSession param // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateNumBlocksPerSession(v interface{}) error { - numBlocksPerSession, err := validateIsUint64(v) +func ValidateNumBlocksPerSession(numBlocksPerSessionAny any) error { + numBlocksPerSession, err := validateIsUint64(numBlocksPerSessionAny) if err != nil { return err } @@ -191,44 +191,44 @@ func ValidateNumBlocksPerSession(v interface{}) error { // ValidateClaimWindowOpenOffsetBlocks validates the ClaimWindowOpenOffsetBlocks param // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateClaimWindowOpenOffsetBlocks(v interface{}) error { - _, err := validateIsUint64(v) +func ValidateClaimWindowOpenOffsetBlocks(claimWindowOpenOffsetBlocksAny any) error { + _, err := validateIsUint64(claimWindowOpenOffsetBlocksAny) return err } // ValidateClaimWindowCloseOffsetBlocks validates the ClaimWindowCloseOffsetBlocks param // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateClaimWindowCloseOffsetBlocks(v interface{}) error { - _, err := validateIsUint64(v) +func ValidateClaimWindowCloseOffsetBlocks(claimWindowCloseOffsetBlocksAny any) error { + _, err := validateIsUint64(claimWindowCloseOffsetBlocksAny) return err } // ValidateProofWindowOpenOffsetBlocks validates the ProofWindowOpenOffsetBlocks param // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateProofWindowOpenOffsetBlocks(v interface{}) error { - _, err := validateIsUint64(v) +func ValidateProofWindowOpenOffsetBlocks(proofWindowOpenOffsetBlocksAny any) error { + _, err := validateIsUint64(proofWindowOpenOffsetBlocksAny) return err } // ValidateProofWindowCloseOffsetBlocks validates the ProofWindowCloseOffsetBlocks param // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateProofWindowCloseOffsetBlocks(v interface{}) error { - _, err := validateIsUint64(v) +func ValidateProofWindowCloseOffsetBlocks(proofWindowCloseOffsetBlocksAny any) error { + _, err := validateIsUint64(proofWindowCloseOffsetBlocksAny) return err } // ValidateGracePeriodEndOffsetBlocks validates the GracePeriodEndOffsetBlocks param // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateGracePeriodEndOffsetBlocks(v interface{}) error { - _, err := validateIsUint64(v) +func ValidateGracePeriodEndOffsetBlocks(gracePeriodEndOffsetBlocksAny any) error { + _, err := validateIsUint64(gracePeriodEndOffsetBlocksAny) return err } -// ValidateSupplierUnbondingPeriodSession validates the SupplierUnbondingPeriodSessions +// ValidateSupplierUnbondingPeriodSessions validates the SupplierUnbondingPeriodSessions // governance parameter. // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateSupplierUnbondingPeriodSessions(v interface{}) error { - supplierUnbondingPeriodSessions, err := validateIsUint64(v) +func ValidateSupplierUnbondingPeriodSessions(supplierUnbondingPeriodSessionsAny any) error { + supplierUnbondingPeriodSessions, err := validateIsUint64(supplierUnbondingPeriodSessionsAny) if err != nil { return err } @@ -240,11 +240,11 @@ func ValidateSupplierUnbondingPeriodSessions(v interface{}) error { return nil } -// ValidateApplicationUnbondingPeriodSession validates the ApplicationUnbondingPeriodSessions +// ValidateApplicationUnbondingPeriodSessions validates the ApplicationUnbondingPeriodSessions // governance parameter. // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateApplicationUnbondingPeriodSessions(v interface{}) error { - applicationUnbondingPeriodSessions, err := validateIsUint64(v) +func ValidateApplicationUnbondingPeriodSessions(applicationUnboindingPeriodSessionsAny any) error { + applicationUnbondingPeriodSessions, err := validateIsUint64(applicationUnboindingPeriodSessionsAny) if err != nil { return err } @@ -258,10 +258,10 @@ func ValidateApplicationUnbondingPeriodSessions(v interface{}) error { // ValidateComputeUnitsToTokensMultiplier validates the ComputeUnitsToTokensMultiplier governance parameter. // NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateComputeUnitsToTokensMultiplier(v interface{}) error { - computeUnitsToTokensMultiplier, ok := v.(uint64) +func ValidateComputeUnitsToTokensMultiplier(computeUnitsToTokensMultiplerAny any) error { + computeUnitsToTokensMultiplier, ok := computeUnitsToTokensMultiplerAny.(uint64) if !ok { - return ErrSharedParamInvalid.Wrapf("invalid parameter type: %T", v) + return ErrSharedParamInvalid.Wrapf("invalid parameter type: %T", computeUnitsToTokensMultiplerAny) } if computeUnitsToTokensMultiplier <= 0 { diff --git a/x/shared/types/tx.pb.go b/x/shared/types/tx.pb.go index 553ff6736..43f5398f5 100644 --- a/x/shared/types/tx.pb.go +++ b/x/shared/types/tx.pb.go @@ -123,7 +123,7 @@ type MsgUpdateParam struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Types that are valid to be assigned to AsType: // *MsgUpdateParam_AsString - // *MsgUpdateParam_AsInt64 + // *MsgUpdateParam_AsUint64 // *MsgUpdateParam_AsBytes AsType isMsgUpdateParam_AsType `protobuf_oneof:"as_type"` } @@ -166,15 +166,15 @@ type isMsgUpdateParam_AsType interface { type MsgUpdateParam_AsString struct { AsString string `protobuf:"bytes,3,opt,name=as_string,json=asString,proto3,oneof" json:"as_string"` } -type MsgUpdateParam_AsInt64 struct { - AsInt64 int64 `protobuf:"varint,6,opt,name=as_int64,json=asInt64,proto3,oneof" json:"as_int64"` +type MsgUpdateParam_AsUint64 struct { + AsUint64 uint64 `protobuf:"varint,6,opt,name=as_uint64,json=asUint64,proto3,oneof" json:"as_uint64"` } type MsgUpdateParam_AsBytes struct { AsBytes []byte `protobuf:"bytes,7,opt,name=as_bytes,json=asBytes,proto3,oneof" json:"as_bytes"` } func (*MsgUpdateParam_AsString) isMsgUpdateParam_AsType() {} -func (*MsgUpdateParam_AsInt64) isMsgUpdateParam_AsType() {} +func (*MsgUpdateParam_AsUint64) isMsgUpdateParam_AsType() {} func (*MsgUpdateParam_AsBytes) isMsgUpdateParam_AsType() {} func (m *MsgUpdateParam) GetAsType() isMsgUpdateParam_AsType { @@ -205,9 +205,9 @@ func (m *MsgUpdateParam) GetAsString() string { return "" } -func (m *MsgUpdateParam) GetAsInt64() int64 { - if x, ok := m.GetAsType().(*MsgUpdateParam_AsInt64); ok { - return x.AsInt64 +func (m *MsgUpdateParam) GetAsUint64() uint64 { + if x, ok := m.GetAsType().(*MsgUpdateParam_AsUint64); ok { + return x.AsUint64 } return 0 } @@ -223,7 +223,7 @@ func (m *MsgUpdateParam) GetAsBytes() []byte { func (*MsgUpdateParam) XXX_OneofWrappers() []interface{} { return []interface{}{ (*MsgUpdateParam_AsString)(nil), - (*MsgUpdateParam_AsInt64)(nil), + (*MsgUpdateParam_AsUint64)(nil), (*MsgUpdateParam_AsBytes)(nil), } } @@ -280,39 +280,39 @@ func init() { func init() { proto.RegisterFile("poktroll/shared/tx.proto", fileDescriptor_3f2a7564b43f4d89) } var fileDescriptor_3f2a7564b43f4d89 = []byte{ - // 501 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xf6, 0x11, 0x48, 0xea, 0x6b, 0x68, 0x85, 0x55, 0x11, 0xd7, 0x42, 0x8e, 0xc9, 0x82, 0x89, - 0xa8, 0x4f, 0x94, 0xaa, 0x43, 0x36, 0x3c, 0xb5, 0x43, 0x24, 0x64, 0x84, 0x90, 0xba, 0x44, 0x97, - 0xc6, 0x72, 0xac, 0xd6, 0x3e, 0xcb, 0xef, 0x0a, 0xcd, 0x86, 0x18, 0x99, 0xf8, 0x33, 0x18, 0x33, - 0xb0, 0x31, 0xb1, 0x75, 0xac, 0x98, 0x3a, 0x45, 0x28, 0x19, 0x22, 0xf5, 0x5f, 0x60, 0x41, 0x3e, - 0xff, 0x08, 0x71, 0x24, 0x22, 0x75, 0x49, 0xde, 0x7d, 0xdf, 0xf7, 0xbe, 0x7b, 0xef, 0xde, 0x33, - 0x56, 0x23, 0x76, 0xc6, 0x63, 0x76, 0x7e, 0x4e, 0x60, 0x48, 0x63, 0x77, 0x40, 0xf8, 0xa5, 0x15, - 0xc5, 0x8c, 0x33, 0x65, 0x3b, 0x67, 0xac, 0x94, 0xd1, 0x1e, 0xd1, 0xc0, 0x0f, 0x19, 0x11, 0xbf, - 0xa9, 0x46, 0x6b, 0x9c, 0x32, 0x08, 0x18, 0x90, 0x00, 0x3c, 0xf2, 0xe1, 0x65, 0xf2, 0x97, 0x11, - 0xbb, 0x29, 0xd1, 0x13, 0x27, 0x92, 0x1e, 0x32, 0x6a, 0xc7, 0x63, 0x1e, 0x4b, 0xf1, 0x24, 0xca, - 0xd0, 0x27, 0xe5, 0x3a, 0x22, 0x1a, 0xd3, 0x20, 0xcb, 0x69, 0xfd, 0x40, 0x78, 0xbb, 0x0b, 0xde, - 0xbb, 0x68, 0x40, 0xb9, 0xfb, 0x46, 0x30, 0xca, 0x21, 0x96, 0xe9, 0x05, 0x1f, 0xb2, 0xd8, 0xe7, - 0x23, 0x15, 0x19, 0xc8, 0x94, 0x6d, 0xf5, 0xd7, 0xf7, 0xbd, 0x9d, 0xec, 0xb2, 0xd7, 0x83, 0x41, - 0xec, 0x02, 0xbc, 0xe5, 0xb1, 0x1f, 0x7a, 0xce, 0x42, 0xaa, 0x74, 0x70, 0x35, 0xf5, 0x56, 0xef, - 0x19, 0xc8, 0xdc, 0xdc, 0x6f, 0x58, 0xa5, 0x46, 0xad, 0xf4, 0x02, 0x5b, 0xbe, 0x9a, 0x34, 0xa5, - 0x6f, 0xf3, 0x71, 0x1b, 0x39, 0x59, 0x46, 0xe7, 0xe0, 0xf3, 0x7c, 0xdc, 0x5e, 0x78, 0x7d, 0x99, - 0x8f, 0xdb, 0x4f, 0x8b, 0xc2, 0x2f, 0xf3, 0xd2, 0x4b, 0x95, 0xb6, 0x76, 0x71, 0xa3, 0x04, 0x39, - 0x2e, 0x44, 0x2c, 0x04, 0xb7, 0xf5, 0x07, 0xe1, 0xad, 0x65, 0xee, 0xce, 0x7d, 0x29, 0xf8, 0x7e, - 0x48, 0x03, 0x57, 0x74, 0x25, 0x3b, 0x22, 0x56, 0x5e, 0x60, 0x99, 0x42, 0x0f, 0x84, 0x56, 0xad, - 0x08, 0xaf, 0x87, 0xb7, 0x93, 0xe6, 0x02, 0x3c, 0x92, 0x9c, 0x0d, 0x9a, 0x99, 0x29, 0xcf, 0xf1, - 0x06, 0x85, 0x9e, 0x1f, 0xf2, 0xc3, 0x03, 0xb5, 0x6a, 0x20, 0xb3, 0x62, 0xd7, 0x6f, 0x27, 0xcd, - 0x02, 0x3b, 0x92, 0x9c, 0x1a, 0x85, 0xe3, 0x24, 0xcc, 0xa4, 0xfd, 0x11, 0x77, 0x41, 0xad, 0x19, - 0xc8, 0xac, 0x17, 0x52, 0x81, 0xa5, 0x52, 0x3b, 0x09, 0x3b, 0x5b, 0xcb, 0x6f, 0x66, 0xcb, 0xb8, - 0x46, 0xa1, 0xc7, 0x47, 0x91, 0xdb, 0x3a, 0xc6, 0x8f, 0x97, 0x9b, 0xcf, 0xdf, 0x45, 0x21, 0xc5, - 0x90, 0xd0, 0x7f, 0x87, 0x94, 0x4f, 0x66, 0xff, 0x27, 0xc2, 0x95, 0x2e, 0x78, 0xca, 0x09, 0xae, - 0x2f, 0x6d, 0x89, 0xb1, 0x92, 0x58, 0x1a, 0x85, 0x66, 0xae, 0x53, 0x14, 0x45, 0xbd, 0xc7, 0x9b, - 0xff, 0x0e, 0xaa, 0xb9, 0x26, 0x51, 0x7b, 0xb6, 0x46, 0x90, 0x1b, 0x6b, 0x0f, 0x3e, 0x25, 0x5b, - 0x66, 0x77, 0xaf, 0xa6, 0x3a, 0xba, 0x9e, 0xea, 0xe8, 0x66, 0xaa, 0xa3, 0xdf, 0x53, 0x1d, 0x7d, - 0x9d, 0xe9, 0xd2, 0xf5, 0x4c, 0x97, 0x6e, 0x66, 0xba, 0x74, 0x42, 0x3c, 0x9f, 0x0f, 0x2f, 0xfa, - 0xd6, 0x29, 0x0b, 0x48, 0xe2, 0xbb, 0x17, 0xba, 0xfc, 0x23, 0x8b, 0xcf, 0xc8, 0xea, 0x02, 0x26, - 0x8f, 0x0b, 0xfd, 0xaa, 0xf8, 0x76, 0x5e, 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x90, 0x6c, 0xe9, - 0x9c, 0xe3, 0x03, 0x00, 0x00, + // 502 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xf6, 0xd1, 0x92, 0xd4, 0xd7, 0xd0, 0x0a, 0xab, 0x22, 0xae, 0x85, 0x1c, 0x93, 0x05, 0x13, + 0x51, 0x9f, 0x28, 0x55, 0x87, 0x6c, 0x78, 0x2a, 0x43, 0x24, 0x64, 0x54, 0x21, 0x75, 0x89, 0x2e, + 0xcd, 0xc9, 0xb1, 0x5a, 0xfb, 0x2c, 0xdf, 0x05, 0x9a, 0x0d, 0x31, 0x32, 0xf1, 0x33, 0x18, 0x33, + 0xb0, 0x31, 0xb1, 0x75, 0xac, 0x98, 0x3a, 0x45, 0x28, 0x19, 0x22, 0xf5, 0x47, 0x20, 0xe4, 0x3b, + 0xdb, 0x21, 0x8e, 0x44, 0x24, 0x96, 0xe4, 0xdd, 0xf7, 0x7d, 0xef, 0xbb, 0xf7, 0xee, 0x3d, 0x43, + 0x3d, 0xa6, 0x17, 0x3c, 0xa1, 0x97, 0x97, 0x88, 0x0d, 0x70, 0x42, 0xfa, 0x88, 0x5f, 0x39, 0x71, + 0x42, 0x39, 0xd5, 0x76, 0x73, 0xc6, 0x91, 0x8c, 0xf1, 0x10, 0x87, 0x41, 0x44, 0x91, 0xf8, 0x95, + 0x1a, 0xa3, 0x7e, 0x4e, 0x59, 0x48, 0x19, 0x0a, 0x99, 0x8f, 0xde, 0xbf, 0x48, 0xff, 0x32, 0x62, + 0x5f, 0x12, 0x5d, 0x71, 0x42, 0xf2, 0x90, 0x51, 0x7b, 0x3e, 0xf5, 0xa9, 0xc4, 0xd3, 0x28, 0x43, + 0x1f, 0x97, 0xeb, 0x88, 0x71, 0x82, 0xc3, 0x2c, 0xa7, 0xf9, 0x1d, 0xc0, 0xdd, 0x0e, 0xf3, 0x4f, + 0xe3, 0x3e, 0xe6, 0xe4, 0x8d, 0x60, 0xb4, 0x63, 0xa8, 0xe2, 0x21, 0x1f, 0xd0, 0x24, 0xe0, 0x23, + 0x1d, 0x58, 0xc0, 0x56, 0x5d, 0xfd, 0xe7, 0xb7, 0x83, 0xbd, 0xec, 0xb2, 0x57, 0xfd, 0x7e, 0x42, + 0x18, 0x7b, 0xcb, 0x93, 0x20, 0xf2, 0xbd, 0x85, 0x54, 0x6b, 0xc3, 0x8a, 0xf4, 0xd6, 0xef, 0x59, + 0xc0, 0xde, 0x3e, 0xac, 0x3b, 0xa5, 0x46, 0x1d, 0x79, 0x81, 0xab, 0x5e, 0x4f, 0x1a, 0xca, 0xd7, + 0xf9, 0xb8, 0x05, 0xbc, 0x2c, 0xa3, 0x7d, 0xf4, 0x69, 0x3e, 0x6e, 0x2d, 0xbc, 0x3e, 0xcf, 0xc7, + 0xad, 0x27, 0x45, 0xe1, 0x57, 0x79, 0xe9, 0xa5, 0x4a, 0x9b, 0xfb, 0xb0, 0x5e, 0x82, 0x3c, 0xc2, + 0x62, 0x1a, 0x31, 0xd2, 0xfc, 0x0d, 0xe0, 0xce, 0x32, 0xf7, 0xdf, 0x7d, 0x69, 0x70, 0x33, 0xc2, + 0x21, 0x11, 0x5d, 0xa9, 0x9e, 0x88, 0xb5, 0xe7, 0x50, 0xc5, 0xac, 0xcb, 0x84, 0x56, 0xdf, 0x10, + 0x5e, 0x0f, 0xee, 0x26, 0x8d, 0x05, 0x78, 0xa2, 0x78, 0x5b, 0x38, 0x33, 0xcb, 0xd4, 0xc3, 0x20, + 0xe2, 0xc7, 0x47, 0x7a, 0xc5, 0x02, 0xf6, 0x66, 0xa1, 0x96, 0xa0, 0x54, 0x9f, 0x8a, 0x58, 0x7b, + 0x06, 0xb7, 0x30, 0xeb, 0xf6, 0x46, 0x9c, 0x30, 0xbd, 0x6a, 0x01, 0xbb, 0xe6, 0xd6, 0xee, 0x26, + 0x8d, 0x02, 0x3b, 0x51, 0xbc, 0x2a, 0x66, 0x6e, 0x1a, 0xb6, 0x77, 0x96, 0x9f, 0xcd, 0x55, 0x61, + 0x15, 0xb3, 0x2e, 0x1f, 0xc5, 0xa4, 0xf9, 0x1a, 0x3e, 0x5a, 0xee, 0x3f, 0x7f, 0x1a, 0x0d, 0x15, + 0x73, 0x02, 0xff, 0x9c, 0x53, 0x3e, 0x9c, 0xc3, 0x1f, 0x00, 0x6e, 0x74, 0x98, 0xaf, 0x9d, 0xc1, + 0xda, 0xd2, 0xa2, 0x58, 0x2b, 0x89, 0xa5, 0x69, 0x18, 0xf6, 0x3a, 0x45, 0x51, 0xd4, 0x3b, 0xb8, + 0xfd, 0xf7, 0xac, 0x1a, 0x6b, 0x12, 0x8d, 0xa7, 0x6b, 0x04, 0xb9, 0xb1, 0x71, 0xff, 0x63, 0xba, + 0x68, 0x6e, 0xe7, 0x7a, 0x6a, 0x82, 0x9b, 0xa9, 0x09, 0x6e, 0xa7, 0x26, 0xf8, 0x35, 0x35, 0xc1, + 0x97, 0x99, 0xa9, 0xdc, 0xcc, 0x4c, 0xe5, 0x76, 0x66, 0x2a, 0x67, 0xc8, 0x0f, 0xf8, 0x60, 0xd8, + 0x73, 0xce, 0x69, 0x88, 0x52, 0xdf, 0x83, 0x88, 0xf0, 0x0f, 0x34, 0xb9, 0x40, 0xab, 0x3b, 0x98, + 0x3e, 0x2e, 0xeb, 0x55, 0xc4, 0xe7, 0xf3, 0xf2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x11, + 0xde, 0xdb, 0xe6, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -558,14 +558,14 @@ func (m *MsgUpdateParam_AsString) MarshalToSizedBuffer(dAtA []byte) (int, error) dAtA[i] = 0x1a return len(dAtA) - i, nil } -func (m *MsgUpdateParam_AsInt64) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateParam_AsUint64) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParam_AsInt64) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateParam_AsUint64) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarintTx(dAtA, i, uint64(m.AsInt64)) + i = encodeVarintTx(dAtA, i, uint64(m.AsUint64)) i-- dAtA[i] = 0x30 return len(dAtA) - i, nil @@ -686,13 +686,13 @@ func (m *MsgUpdateParam_AsString) Size() (n int) { n += 1 + l + sovTx(uint64(l)) return n } -func (m *MsgUpdateParam_AsInt64) Size() (n int) { +func (m *MsgUpdateParam_AsUint64) Size() (n int) { if m == nil { return 0 } var l int _ = l - n += 1 + sovTx(uint64(m.AsInt64)) + n += 1 + sovTx(uint64(m.AsUint64)) return n } func (m *MsgUpdateParam_AsBytes) Size() (n int) { @@ -1018,9 +1018,9 @@ func (m *MsgUpdateParam) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AsInt64", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AsUint64", wireType) } - var v int64 + var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1030,12 +1030,12 @@ func (m *MsgUpdateParam) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + v |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.AsType = &MsgUpdateParam_AsInt64{v} + m.AsType = &MsgUpdateParam_AsUint64{v} case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AsBytes", wireType) diff --git a/x/supplier/keeper/msg_server_stake_supplier.go b/x/supplier/keeper/msg_server_stake_supplier.go index f750b99ff..3ed4add08 100644 --- a/x/supplier/keeper/msg_server_stake_supplier.go +++ b/x/supplier/keeper/msg_server_stake_supplier.go @@ -96,7 +96,8 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie } coinsToEscrow, err = (*msg.Stake).SafeSub(currSupplierStake) if err != nil { - return nil, err + logger.Info(fmt.Sprintf("ERROR: %s", err)) + return nil, status.Error(codes.Internal, err.Error()) } logger.Info(fmt.Sprintf("Supplier is going to escrow an additional %+v coins", coinsToEscrow)) @@ -104,13 +105,24 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie supplier.UnstakeSessionEndHeight = sharedtypes.SupplierNotUnstaking } - // Must always stake or upstake (> 0 delta) + // MUST ALWAYS stake or upstake (> 0 delta) if coinsToEscrow.IsZero() { err = types.ErrSupplierInvalidStake.Wrapf("Signer %q must escrow more than 0 additional coins", msg.Signer) logger.Info(fmt.Sprintf("WARN: %s", err)) return nil, status.Error(codes.InvalidArgument, err.Error()) } + // MUST ALWAYS have at least minimum stake. + minStake := k.GetParams(ctx).MinStake + if msg.Stake.Amount.LT(minStake.Amount) { + err = types.ErrSupplierInvalidStake.Wrapf( + "supplier with owner %q must stake at least %s", + msg.GetOwnerAddress(), minStake, + ) + logger.Info(fmt.Sprintf("ERROR: %s", err)) + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + // Retrieve the account address of the message signer msgSignerAddress, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { diff --git a/x/supplier/keeper/msg_server_stake_supplier_test.go b/x/supplier/keeper/msg_server_stake_supplier_test.go index a4c1b5815..5682425fe 100644 --- a/x/supplier/keeper/msg_server_stake_supplier_test.go +++ b/x/supplier/keeper/msg_server_stake_supplier_test.go @@ -4,15 +4,17 @@ import ( "testing" "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" + cosmostypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/pokt-network/poktroll/app/volatile" keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/testutil/sample" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" "github.com/pokt-network/poktroll/x/supplier/keeper" - "github.com/pokt-network/poktroll/x/supplier/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" ) func TestMsgServer_StakeSupplier_SuccessfulCreateAndUpdate(t *testing.T) { @@ -28,7 +30,7 @@ func TestMsgServer_StakeSupplier_SuccessfulCreateAndUpdate(t *testing.T) { require.False(t, isSupplierFound) // Prepare the stakeMsg - stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 100, "svcId") + stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 1000000, "svcId") // Stake the supplier _, err := srv.StakeSupplier(ctx, stakeMsg) @@ -38,14 +40,14 @@ func TestMsgServer_StakeSupplier_SuccessfulCreateAndUpdate(t *testing.T) { foundSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, operatorAddr) require.True(t, isSupplierFound) require.Equal(t, operatorAddr, foundSupplier.OperatorAddress) - require.Equal(t, int64(100), foundSupplier.Stake.Amount.Int64()) + require.Equal(t, int64(1000000), foundSupplier.Stake.Amount.Int64()) require.Len(t, foundSupplier.Services, 1) require.Equal(t, "svcId", foundSupplier.Services[0].ServiceId) require.Len(t, foundSupplier.Services[0].Endpoints, 1) require.Equal(t, "http://localhost:8080", foundSupplier.Services[0].Endpoints[0].Url) // Prepare an updated supplier with a higher stake and a different URL for the service - updateMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 200, "svcId2") + updateMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 2000000, "svcId2") updateMsg.Services[0].Endpoints[0].Url = "http://localhost:8082" // Update the staked supplier @@ -54,7 +56,7 @@ func TestMsgServer_StakeSupplier_SuccessfulCreateAndUpdate(t *testing.T) { foundSupplier, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, operatorAddr) require.True(t, isSupplierFound) - require.Equal(t, int64(200), foundSupplier.Stake.Amount.Int64()) + require.Equal(t, int64(2000000), foundSupplier.Stake.Amount.Int64()) require.Len(t, foundSupplier.Services, 1) require.Equal(t, "svcId2", foundSupplier.Services[0].ServiceId) require.Len(t, foundSupplier.Services[0].Endpoints, 1) @@ -70,7 +72,7 @@ func TestMsgServer_StakeSupplier_FailRestakingDueToInvalidServices(t *testing.T) operatorAddr := sample.AccAddress() // Prepare the supplier stake message - stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 100, "svcId") + stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 1000000, "svcId") // Stake the supplier _, err := srv.StakeSupplier(ctx, stakeMsg) @@ -120,7 +122,7 @@ func TestMsgServer_StakeSupplier_FailLoweringStake(t *testing.T) { operatorAddr := sample.AccAddress() // Prepare the supplier stake message - stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 100, "svcId") + stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 1000000, "svcId") // Stake the supplier & verify that the supplier exists _, err := srv.StakeSupplier(ctx, stakeMsg) @@ -140,7 +142,7 @@ func TestMsgServer_StakeSupplier_FailLoweringStake(t *testing.T) { // Verify that the supplier stake is unchanged supplierFound, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, operatorAddr) require.True(t, isSupplierFound) - require.Equal(t, int64(100), supplierFound.Stake.Amount.Int64()) + require.Equal(t, int64(1000000), supplierFound.Stake.Amount.Int64()) require.Len(t, supplierFound.Services, 1) } @@ -153,11 +155,12 @@ func TestMsgServer_StakeSupplier_FailWithNonExistingService(t *testing.T) { operatorAddr := sample.AccAddress() // Prepare the supplier stake message with a non-existing service ID - stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 100, "newService") + stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 1000000, "newService") // Stake the supplier & verify that it fails because the service does not exist. _, err := srv.StakeSupplier(ctx, stakeMsg) - require.ErrorContains(t, err, types.ErrSupplierServiceNotFound.Wrapf( + require.Equal(t, codes.InvalidArgument, status.Code(err)) + require.ErrorContains(t, err, suppliertypes.ErrSupplierServiceNotFound.Wrapf( "service %q does not exist", "newService", ).Error()) } @@ -171,7 +174,7 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { operatorAddr := sample.AccAddress() // Stake using the operator address as the signer and verify that it succeeds. - stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 100, "svcId") + stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 1000000, "svcId") setStakeMsgSigner(stakeMsg, operatorAddr) _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) @@ -181,7 +184,7 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { require.Equal(t, ownerAddr, supplier.OwnerAddress) // Update the supplier using the operator address as the signer and verify that it succeeds. - stakeMsgUpdateUrl := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 200, "svcId") + stakeMsgUpdateUrl := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 2000000, "svcId") operatorUpdatedServiceUrl := "http://localhost:8081" stakeMsgUpdateUrl.Services[0].Endpoints[0].Url = operatorUpdatedServiceUrl setStakeMsgSigner(stakeMsgUpdateUrl, operatorAddr) @@ -196,7 +199,7 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { // Update the supplier URL by using the owner address as the singer and verify that it succeeds. ownerUpdaterServiceUrl := "http://localhost:8082" stakeMsgUpdateUrl.Services[0].Endpoints[0].Url = ownerUpdaterServiceUrl - stakeMsgUpdateUrl.Stake.Amount = math.NewInt(300) + stakeMsgUpdateUrl.Stake.Amount = math.NewInt(3000000) setStakeMsgSigner(stakeMsgUpdateUrl, ownerAddr) _, err = srv.StakeSupplier(ctx, stakeMsgUpdateUrl) require.NoError(t, err) @@ -209,7 +212,7 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { // Try updating the supplier's operator address using the old operator as a signer // will create a new supplier. - stakeMsgUpdateOperator := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 300, "svcId") + stakeMsgUpdateOperator := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 3000000, "svcId") newOperatorAddress := sample.AccAddress() stakeMsgUpdateOperator.OperatorAddress = newOperatorAddress setStakeMsgSigner(stakeMsgUpdateOperator, operatorAddr) @@ -229,7 +232,7 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { // will create a new supplier. newOperatorAddress = sample.AccAddress() stakeMsgUpdateOperator.OperatorAddress = newOperatorAddress - stakeMsgUpdateOperator.Stake.Amount = math.NewInt(400) + stakeMsgUpdateOperator.Stake.Amount = math.NewInt(4000000) setStakeMsgSigner(stakeMsgUpdateOperator, ownerAddr) _, err = srv.StakeSupplier(ctx, stakeMsgUpdateOperator) require.NoError(t, err) @@ -246,10 +249,11 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { // Try updating the supplier's owner address using the operator as a signer // and verify that it fails. newOwnerAddress := sample.AccAddress() - stakeMsgUpdateOwner := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 500, "svcId") + stakeMsgUpdateOwner := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 5000000, "svcId") stakeMsgUpdateOwner.OwnerAddress = newOwnerAddress setStakeMsgSigner(stakeMsgUpdateOwner, operatorAddr) _, err = srv.StakeSupplier(ctx, stakeMsgUpdateOwner) + require.Equal(t, codes.InvalidArgument, status.Code(err)) require.ErrorContains(t, err, sharedtypes.ErrSharedUnauthorizedSupplierUpdate.Wrapf( "signer %q is not allowed to update the owner address %q", operatorAddr, ownerAddr, @@ -275,13 +279,13 @@ func TestMsgServer_StakeSupplier_ActiveSupplier(t *testing.T) { operatorAddr := sample.AccAddress() // Prepare the supplier - stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 100, "svcId") + stakeMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 1000000, "svcId") // Stake the supplier & verify that the supplier exists. _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) - sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx := cosmostypes.UnwrapSDKContext(ctx) currentHeight := sdkCtx.BlockHeight() sessionEndHeight := supplierModuleKeepers.SharedKeeper.GetSessionEndHeight(ctx, currentHeight) @@ -304,7 +308,7 @@ func TestMsgServer_StakeSupplier_ActiveSupplier(t *testing.T) { ctx = keepertest.SetBlockHeight(ctx, sessionEndHeight+1) // Prepare the supplier stake message with a different service - updateMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 200, "svcId", "svcId2") + updateMsg := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 2000000, "svcId", "svcId2") updateMsg.Signer = operatorAddr // Update the staked supplier @@ -339,7 +343,7 @@ func stakeSupplierForServicesMsg( ownerAddr, operatorAddr string, amount int64, serviceIds ...string, -) *types.MsgStakeSupplier { +) *suppliertypes.MsgStakeSupplier { services := make([]*sharedtypes.SupplierServiceConfig, 0, len(serviceIds)) for _, serviceId := range serviceIds { services = append(services, &sharedtypes.SupplierServiceConfig{ @@ -348,7 +352,7 @@ func stakeSupplierForServicesMsg( { Url: "http://localhost:8080", RpcType: sharedtypes.RPCType_JSON_RPC, - Configs: make([]*sharedtypes.ConfigOption, 0), + Configs: nil, }, }, RevShare: []*sharedtypes.ServiceRevenueShare{ @@ -360,20 +364,82 @@ func stakeSupplierForServicesMsg( }) } - return &types.MsgStakeSupplier{ + return &suppliertypes.MsgStakeSupplier{ Signer: ownerAddr, OwnerAddress: ownerAddr, OperatorAddress: operatorAddr, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(amount)}, + Stake: &cosmostypes.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(amount)}, Services: services, } } // setStakeMsgSigner sets the signer of the given MsgStakeSupplier to the given address func setStakeMsgSigner( - msg *types.MsgStakeSupplier, + msg *suppliertypes.MsgStakeSupplier, signer string, -) *types.MsgStakeSupplier { +) *suppliertypes.MsgStakeSupplier { msg.Signer = signer return msg } + +func TestMsgServer_StakeSupplier_FailBelowMinStake(t *testing.T) { + k, ctx := keepertest.SupplierKeeper(t) + srv := keeper.NewMsgServerImpl(*k.Keeper) + + addr := sample.AccAddress() + supplierStake := cosmostypes.NewInt64Coin(volatile.DenomuPOKT, 100) + minStake := supplierStake.AddAmount(math.NewInt(1)) + expectedErr := suppliertypes.ErrSupplierInvalidStake.Wrapf("supplier with owner %q must stake at least %s", addr, minStake) + + // Set the minimum stake to be greater than the supplier stake. + params := k.Keeper.GetParams(ctx) + params.MinStake = &minStake + err := k.SetParams(ctx, params) + require.NoError(t, err) + + // Prepare the supplier stake message. + stakeMsg := stakeSupplierForServicesMsg(addr, addr, 100, "svcId") + + // Attempt to stake the supplier & verify that the supplier does NOT exist. + _, err = srv.StakeSupplier(ctx, stakeMsg) + require.ErrorContains(t, err, expectedErr.Error()) + _, isSupplierFound := k.GetSupplier(ctx, addr) + require.False(t, isSupplierFound) +} + +func TestMsgServer_StakeSupplier_UpStakeFromBelowMinStake(t *testing.T) { + k, ctx := keepertest.SupplierKeeper(t) + srv := keeper.NewMsgServerImpl(*k.Keeper) + + addr := sample.AccAddress() + supplierParams := k.Keeper.GetParams(ctx) + minStake := supplierParams.GetMinStake() + belowMinStake := minStake.AddAmount(math.NewInt(-1)) + aboveMinStake := minStake.AddAmount(math.NewInt(1)) + + stakeMsg := stakeSupplierForServicesMsg(addr, addr, aboveMinStake.Amount.Int64(), "svcId") + + // Stake (via keeper methods) a supplier with stake below min. stake. + initialSupplier := sharedtypes.Supplier{ + OwnerAddress: addr, + OperatorAddress: addr, + Stake: &belowMinStake, + Services: stakeMsg.GetServices(), + ServicesActivationHeightsMap: map[string]uint64{ + "svcId": 0, + }, + } + + k.SetSupplier(ctx, initialSupplier) + + // Attempt to upstake the supplier with stake above min. stake. + _, err := srv.StakeSupplier(ctx, stakeMsg) + require.NoError(t, err) + + // Assert supplier is staked for above min. stake. + expectedSupplier := initialSupplier + expectedSupplier.Stake = &aboveMinStake + supplier, isSupplierFound := k.GetSupplier(ctx, addr) + require.True(t, isSupplierFound) + require.EqualValues(t, expectedSupplier, supplier) +} diff --git a/x/supplier/keeper/msg_server_unstake_supplier_test.go b/x/supplier/keeper/msg_server_unstake_supplier_test.go index 91d49ed7f..262d1caa9 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier_test.go +++ b/x/supplier/keeper/msg_server_unstake_supplier_test.go @@ -12,7 +12,7 @@ import ( "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" "github.com/pokt-network/poktroll/x/supplier/keeper" - "github.com/pokt-network/poktroll/x/supplier/types" + suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" ) func TestMsgServer_UnstakeSupplier_Success(t *testing.T) { @@ -28,7 +28,7 @@ func TestMsgServer_UnstakeSupplier_Success(t *testing.T) { _, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, unstakingSupplierOperatorAddr) require.False(t, isSupplierFound) - initialStake := int64(100) + initialStake := suppliertypes.DefaultMinStake.Amount.Int64() stakeMsg := createStakeMsg(unstakingSupplierOperatorAddr, initialStake) // Stake the supplier @@ -54,7 +54,7 @@ func TestMsgServer_UnstakeSupplier_Success(t *testing.T) { require.True(t, isSupplierFound) // Initiate the supplier unstaking - unstakeMsg := &types.MsgUnstakeSupplier{ + unstakeMsg := &suppliertypes.MsgUnstakeSupplier{ Signer: unstakingSupplierOperatorAddr, OperatorAddress: unstakingSupplierOperatorAddr, } @@ -95,7 +95,7 @@ func TestMsgServer_UnstakeSupplier_CancelUnbondingIfRestaked(t *testing.T) { supplierOperatorAddr := sample.AccAddress() // Stake the supplier - initialStake := int64(100) + initialStake := suppliertypes.DefaultMinStake.Amount.Int64() stakeMsg := createStakeMsg(supplierOperatorAddr, initialStake) _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) @@ -106,7 +106,7 @@ func TestMsgServer_UnstakeSupplier_CancelUnbondingIfRestaked(t *testing.T) { require.False(t, foundSupplier.IsUnbonding()) // Initiate the supplier unstaking - unstakeMsg := &types.MsgUnstakeSupplier{ + unstakeMsg := &suppliertypes.MsgUnstakeSupplier{ Signer: supplierOperatorAddr, OperatorAddress: supplierOperatorAddr, } @@ -154,13 +154,13 @@ func TestMsgServer_UnstakeSupplier_FailIfNotStaked(t *testing.T) { require.False(t, isSupplierFound) // Initiate the supplier unstaking - unstakeMsg := &types.MsgUnstakeSupplier{ + unstakeMsg := &suppliertypes.MsgUnstakeSupplier{ Signer: supplierOperatorAddr, OperatorAddress: supplierOperatorAddr, } _, err := srv.UnstakeSupplier(ctx, unstakeMsg) require.Error(t, err) - require.ErrorIs(t, err, types.ErrSupplierNotFound) + require.ErrorIs(t, err, suppliertypes.ErrSupplierNotFound) _, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, supplierOperatorAddr) require.False(t, isSupplierFound) @@ -174,13 +174,13 @@ func TestMsgServer_UnstakeSupplier_FailIfCurrentlyUnstaking(t *testing.T) { supplierOperatorAddr := sample.AccAddress() // Stake the supplier - initialStake := int64(100) + initialStake := suppliertypes.DefaultMinStake.Amount.Int64() stakeMsg := createStakeMsg(supplierOperatorAddr, initialStake) _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Initiate the supplier unstaking - unstakeMsg := &types.MsgUnstakeSupplier{ + unstakeMsg := &suppliertypes.MsgUnstakeSupplier{ Signer: supplierOperatorAddr, OperatorAddress: supplierOperatorAddr, } @@ -191,7 +191,7 @@ func TestMsgServer_UnstakeSupplier_FailIfCurrentlyUnstaking(t *testing.T) { ctx = keepertest.SetBlockHeight(ctx, int64(sdkCtx.BlockHeight()+1)) _, err = srv.UnstakeSupplier(ctx, unstakeMsg) - require.ErrorIs(t, err, types.ErrSupplierIsUnstaking) + require.ErrorIs(t, err, suppliertypes.ErrSupplierIsUnstaking) } func TestMsgServer_UnstakeSupplier_OperatorCanUnstake(t *testing.T) { @@ -203,14 +203,14 @@ func TestMsgServer_UnstakeSupplier_OperatorCanUnstake(t *testing.T) { supplierOperatorAddr := sample.AccAddress() // Stake the supplier - initialStake := int64(100) + initialStake := suppliertypes.DefaultMinStake.Amount.Int64() stakeMsg := createStakeMsg(ownerAddr, initialStake) stakeMsg.OperatorAddress = supplierOperatorAddr _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Initiate the supplier unstaking - unstakeMsg := &types.MsgUnstakeSupplier{ + unstakeMsg := &suppliertypes.MsgUnstakeSupplier{ Signer: supplierOperatorAddr, OperatorAddress: supplierOperatorAddr, } @@ -238,9 +238,9 @@ func TestMsgServer_UnstakeSupplier_OperatorCanUnstake(t *testing.T) { require.Equal(t, initialStake, supplierModuleKeepers.SupplierUnstakedFundsMap[ownerAddr]) } -func createStakeMsg(supplierOwnerAddr string, stakeAmount int64) *types.MsgStakeSupplier { +func createStakeMsg(supplierOwnerAddr string, stakeAmount int64) *suppliertypes.MsgStakeSupplier { initialStake := sdk.NewCoin("upokt", math.NewInt(stakeAmount)) - return &types.MsgStakeSupplier{ + return &suppliertypes.MsgStakeSupplier{ Signer: supplierOwnerAddr, OwnerAddress: supplierOwnerAddr, OperatorAddress: supplierOwnerAddr, diff --git a/x/supplier/types/message_update_param.go b/x/supplier/types/message_update_param.go index 2e3614d78..0e6a1cc03 100644 --- a/x/supplier/types/message_update_param.go +++ b/x/supplier/types/message_update_param.go @@ -8,7 +8,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var _ cosmostypes.Msg = &MsgUpdateParam{} +var _ cosmostypes.Msg = (*MsgUpdateParam)(nil) func NewMsgUpdateParam(authority string, name string, asType any) *MsgUpdateParam { var asTypeIface isMsgUpdateParam_AsType diff --git a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go index 079e28e85..87a90d2ad 100644 --- a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go +++ b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "context" + "math/big" "testing" "cosmossdk.io/depinject" @@ -26,10 +27,11 @@ import ( "github.com/pokt-network/poktroll/testutil/testtree" apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" + servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - "github.com/pokt-network/poktroll/x/tokenomics" tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) @@ -51,7 +53,11 @@ type TestSuite struct { claim prooftypes.Claim proof prooftypes.Proof - numRelays uint64 + numRelays uint64 + numClaimedComputeUnits uint64 + numEstimatedComputeUnits uint64 + claimedUpokt sdk.Coin + relayMiningDifficulty servicetypes.RelayMiningDifficulty } // SetupTest creates the following and stores them in the suite: @@ -157,11 +163,22 @@ func (s *TestSuite) SetupTest() { ringClient, ) + // Calculate the number of claimed compute units. + s.numClaimedComputeUnits = s.numRelays * service.ComputeUnitsPerRelay + + s.relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(sdkCtx, s.keepers.Logger(), testServiceId, servicekeeper.TargetNumRelays) + + // Calculate the number of estimated compute units. + s.numEstimatedComputeUnits = getEstimatedComputeUnits(s.numClaimedComputeUnits, s.relayMiningDifficulty) + + // Calculate the claimed amount in uPOKT. + sharedParams := s.keepers.SharedKeeper.GetParams(sdkCtx) + s.claimedUpokt = getClaimedUpokt(sharedParams, s.numEstimatedComputeUnits, s.relayMiningDifficulty) + blockHeaderHash := make([]byte, 0) expectedMerkleProofPath := protocol.GetPathForProof(blockHeaderHash, sessionHeader.SessionId) // Advance the block height to the earliest claim commit height. - sharedParams := s.keepers.SharedKeeper.GetParams(sdkCtx) claimMsgHeight := shared.GetEarliestSupplierClaimCommitHeight( &sharedParams, sessionHeader.GetSessionEndBlockHeight(), @@ -240,13 +257,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequiredAndNotProv ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // -1 to push threshold below s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits-1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Sub(uPOKTCoin(1)) // Set the proof missing penalty to half the supplier's stake so it is not // unstaked when being slashed. @@ -302,7 +317,9 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequiredAndNotProv expectedClaimExpiredEvent := expectedClaimExpiredEvents[0] require.Equal(t, tokenomicstypes.ClaimExpirationReason_PROOF_MISSING, expectedClaimExpiredEvent.GetExpirationReason()) require.Equal(t, s.numRelays, expectedClaimExpiredEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added + require.Equal(t, s.numClaimedComputeUnits, expectedClaimExpiredEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedClaimExpiredEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedClaimExpiredEvent.GetClaimedUpokt()) // Confirm that a slashing event was emitted expectedSlashingEvents := testutilevents.FilterEvents[*tokenomicstypes.EventSupplierSlashed](t, events, "poktroll.tokenomics.EventSupplierSlashed") @@ -321,13 +338,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimSettled_ProofRequiredAndProvide ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // -1 to push threshold below s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits-1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Sub(uPOKTCoin(1)) // Set the proof parameters such that s.claim requires a proof because: // - proof_request_probability is 0% @@ -368,7 +383,9 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimSettled_ProofRequiredAndProvide expectedEvent := expectedEvents[0] require.Equal(t, prooftypes.ProofRequirementReason_THRESHOLD, expectedEvent.GetProofRequirement()) require.Equal(t, s.numRelays, expectedEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added + require.Equal(t, s.numClaimedComputeUnits, expectedEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedEvent.GetClaimedUpokt()) } func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequired_InvalidOneProvided() { @@ -433,7 +450,9 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequired_InvalidOn expectedClaimExpiredEvent := expectedClaimExpiredEvents[0] require.Equal(t, tokenomicstypes.ClaimExpirationReason_PROOF_INVALID, expectedClaimExpiredEvent.GetExpirationReason()) require.Equal(t, s.numRelays, expectedClaimExpiredEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added + require.Equal(t, s.numClaimedComputeUnits, expectedClaimExpiredEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedClaimExpiredEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedClaimExpiredEvent.GetClaimedUpokt()) // Confirm that a slashing event was emitted expectedSlashingEvents := testutilevents.FilterEvents[*tokenomicstypes.EventSupplierSlashed](t, events, "poktroll.tokenomics.EventSupplierSlashed") @@ -452,13 +471,11 @@ func (s *TestSuite) TestClaimSettlement_ClaimSettled_ProofRequiredAndProvided_Vi ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) - // +1 so its not required via probability - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits+1) - require.NoError(t, err) + // +1 so it's not required via probability + proofRequirementThreshold = proofRequirementThreshold.Add(uPOKTCoin(1)) // Set the proof parameters such that s.claim requires a proof because: // - proof_request_probability is 100% @@ -499,7 +516,9 @@ func (s *TestSuite) TestClaimSettlement_ClaimSettled_ProofRequiredAndProvided_Vi expectedEvent := expectedEvents[0] require.Equal(t, prooftypes.ProofRequirementReason_PROBABILISTIC, expectedEvent.GetProofRequirement()) require.Equal(t, s.numRelays, expectedEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added + require.Equal(t, s.numClaimedComputeUnits, expectedEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedEvent.GetClaimedUpokt()) } func (s *TestSuite) TestSettlePendingClaims_Settles_WhenAProofIsNotRequired() { @@ -508,13 +527,11 @@ func (s *TestSuite) TestSettlePendingClaims_Settles_WhenAProofIsNotRequired() { ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // +1 to push threshold above s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits+1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Add(uPOKTCoin(1)) // Set the proof parameters such that s.claim DOES NOT require a proof because: // - proof_request_probability is 0% AND @@ -554,7 +571,9 @@ func (s *TestSuite) TestSettlePendingClaims_Settles_WhenAProofIsNotRequired() { expectedEvent := expectedEvents[0] require.Equal(t, prooftypes.ProofRequirementReason_NOT_REQUIRED.String(), expectedEvent.GetProofRequirement().String()) require.Equal(t, s.numRelays, expectedEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added + require.Equal(t, s.numClaimedComputeUnits, expectedEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedEvent.GetClaimedUpokt()) } func (s *TestSuite) TestSettlePendingClaims_DoesNotSettle_BeforeProofWindowCloses() { @@ -580,13 +599,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimPendingAfterSettlement() { sdkCtx := cosmostypes.UnwrapSDKContext(ctx) sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // +1 to push threshold above s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits+1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Add(uPOKTCoin(1)) // Set the proof parameters such that s.claim DOES NOT require a proof // because the proof_request_probability is 0% and the proof_request_threshold @@ -668,13 +685,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_SupplierUnstaked() { ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // -1 to push threshold below s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits-1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Sub(uPOKTCoin(1)) // Set the proof parameters such that s.claim requires a proof because: // - proof_request_probability is 0% @@ -721,3 +736,41 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_SupplierUnstaked() { require.Equal(t, uint64(1), expectedSlashingEvent.GetNumExpiredClaims()) require.Equal(t, proofParams.ProofMissingPenalty, expectedSlashingEvent.GetSlashingAmount()) } + +// getEstimatedComputeUnits returns the estimated number of compute units given +// the number of claimed compute units and the relay mining difficulty. +func getEstimatedComputeUnits( + numClaimedComputeUnits uint64, + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) uint64 { + difficultyMultiplierRat := protocol.GetRelayDifficultyMultiplier(relayMiningDifficulty.GetTargetHash()) + numClaimedComputeUnitsRat := new(big.Rat).SetUint64(numClaimedComputeUnits) + numEstimatedComputeUnitsRat := new(big.Rat).Mul(difficultyMultiplierRat, numClaimedComputeUnitsRat) + + return new(big.Int).Div(numEstimatedComputeUnitsRat.Num(), numEstimatedComputeUnitsRat.Denom()).Uint64() +} + +// getClaimedUpokt returns the claimed amount in uPOKT. +func getClaimedUpokt( + sharedParams sharedtypes.Params, + numClaimedComputeUnits uint64, + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) sdk.Coin { + // Calculate the number of estimated compute units ratio instead of directly using + // the integer value to avoid precision loss. + difficultyMultiplierRat := protocol.GetRelayDifficultyMultiplier(relayMiningDifficulty.GetTargetHash()) + numClaimedComputeUnitsRat := new(big.Rat).SetUint64(numClaimedComputeUnits) + numEstimatedComputeUnitsRat := new(big.Rat).Mul(difficultyMultiplierRat, numClaimedComputeUnitsRat) + + computeUnitsToTokenMultiplierRat := new(big.Rat).SetUint64(sharedParams.GetComputeUnitsToTokensMultiplier()) + + claimedUpoktRat := new(big.Rat).Mul(numEstimatedComputeUnitsRat, computeUnitsToTokenMultiplierRat) + claimedUpoktInt := new(big.Int).Div(claimedUpoktRat.Num(), claimedUpoktRat.Denom()) + + return sdk.NewCoin(volatile.DenomuPOKT, math.NewIntFromBigInt(claimedUpoktInt)) +} + +// uPOKTCoin returns a uPOKT coin with the given amount. +func uPOKTCoin(amount int64) sdk.Coin { + return sdk.NewCoin(volatile.DenomuPOKT, math.NewInt(amount)) +} diff --git a/x/tokenomics/keeper/settle_pending_claims.go b/x/tokenomics/keeper/settle_pending_claims.go index 712be5017..3045a304f 100644 --- a/x/tokenomics/keeper/settle_pending_claims.go +++ b/x/tokenomics/keeper/settle_pending_claims.go @@ -1,6 +1,7 @@ package keeper import ( + "context" "fmt" "cosmossdk.io/math" @@ -8,7 +9,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/pokt-network/poktroll/app/volatile" + apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" @@ -59,21 +62,41 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( // NB: Not every (Req, Res) pair in the session is inserted into the tree due // to the relay mining difficulty. This is the count of non-empty leaves that - // matched the necessary difficulty and is therefore an estimation of the total - // number of relays serviced and work done. + // matched the necessary difficulty. numClaimRelays, err = claim.GetNumRelays() if err != nil { return settledResult, expiredResult, err } - // DEV_NOTE: We are assuming that (numRelays := numComputeUnits * service.ComputeUnitsPerRelay) + // DEV_NOTE: We are assuming that (numClaimComputeUnits := numClaimRelays * service.ComputeUnitsPerRelay) // because this code path is only reached if that has already been validated. - numClaimComputeUnits, err = claim.GetNumComputeUnits() + numClaimComputeUnits, err = claim.GetNumClaimedComputeUnits() if err != nil { return settledResult, expiredResult, err } - // TODO(@red-0ne, #781): Convert numClaimedComputeUnits to numEstimatedComputeUnits to reflect reward/payment based on real usage. + // Get the relay mining difficulty for the service that this claim is for. + serviceId := claim.GetSessionHeader().GetServiceId() + relayMiningDifficulty, found := k.serviceKeeper.GetRelayMiningDifficulty(ctx, serviceId) + if !found { + relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(ctx, logger, serviceId, servicekeeper.TargetNumRelays) + } + // numEstimatedComputeUnits is the probabilistic estimation of the off-chain + // work done by the relay miner in this session. It is derived from the claimed + // work and the relay mining difficulty. + numEstimatedComputeUnits, err := claim.GetNumEstimatedComputeUnits(relayMiningDifficulty) + if err != nil { + return settledResult, expiredResult, err + } + + sharedParams := k.sharedKeeper.GetParams(ctx) + // claimeduPOKT is the amount of uPOKT that the supplier would receive if the + // claim is settled. It is derived from the claimed number of relays, the current + // service mining difficulty and the global network parameters. + claimeduPOKT, err := claim.GetClaimeduPOKT(sharedParams, relayMiningDifficulty) + if err != nil { + return settledResult, expiredResult, err + } proof, isProofFound := k.proofKeeper.GetProof(ctx, sessionId, claim.SupplierOperatorAddress) // Using the probabilistic proofs approach, determine if this expiring @@ -88,6 +111,8 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( "supplier_operator_address", claim.SupplierOperatorAddress, "num_claim_compute_units", numClaimComputeUnits, "num_relays_in_session_tree", numClaimRelays, + "num_estimated_compute_units", numEstimatedComputeUnits, + "claimed_upokt", claimeduPOKT, "proof_requirement", proofRequirement, ) @@ -113,10 +138,12 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( // Proof was required but is invalid or not found. // Emit an event that a claim has expired and being removed without being settled. claimExpiredEvent := tokenomicstypes.EventClaimExpired{ - Claim: &claim, - ExpirationReason: expirationReason, - NumRelays: numClaimRelays, - NumComputeUnits: numClaimComputeUnits, + Claim: &claim, + ExpirationReason: expirationReason, + NumRelays: numClaimRelays, + NumClaimedComputeUnits: numClaimComputeUnits, + NumEstimatedComputeUnits: numEstimatedComputeUnits, + ClaimedUpokt: &claimeduPOKT, } if err = ctx.EventManager().EmitTypedEvent(&claimExpiredEvent); err != nil { return settledResult, expiredResult, err @@ -159,10 +186,12 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( } claimSettledEvent := tokenomicstypes.EventClaimSettled{ - Claim: &claim, - NumRelays: numClaimRelays, - NumComputeUnits: numClaimComputeUnits, - ProofRequirement: proofRequirement, + Claim: &claim, + NumRelays: numClaimRelays, + NumClaimedComputeUnits: numClaimComputeUnits, + NumEstimatedComputeUnits: numEstimatedComputeUnits, + ClaimedUpokt: &claimeduPOKT, + ProofRequirement: proofRequirement, } if err = ctx.EventManager().EmitTypedEvent(&claimSettledEvent); err != nil { @@ -170,10 +199,12 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( } if err = ctx.EventManager().EmitTypedEvent(&prooftypes.EventProofUpdated{ - Claim: &claim, - Proof: nil, - NumRelays: 0, - NumComputeUnits: 0, + Claim: &claim, + Proof: nil, + NumRelays: 0, + NumClaimedComputeUnits: 0, + NumEstimatedComputeUnits: numEstimatedComputeUnits, + ClaimedUpokt: &claimeduPOKT, }); err != nil { return settledResult, expiredResult, err } @@ -199,6 +230,10 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( logger.Info(fmt.Sprintf("Successfully settled claim for session ID %q at block height %d", claim.SessionHeader.SessionId, blockHeight)) } + // Unbond applications whose post-settlement stake has dropped below the + // application minimum stake requirement. + k.unbondApplicationsBelowMinStake(ctx, expiringClaims) + // Slash all the suppliers that have been marked for slashing slashingCount times. for supplierOperatorAddress, slashingCount := range supplierToExpiredClaimCount { if err := k.slashSupplierStake(ctx, supplierOperatorAddress, slashingCount); err != nil { @@ -266,6 +301,28 @@ func (k Keeper) getExpiringClaims(ctx sdk.Context) (expiringClaims []prooftypes. return expiringClaims, nil } +// unbondApplicationsBelowMinStake unbonds applications whose post-settlement stake has dropped below the +// application minimum stake requirement. +func (k Keeper) unbondApplicationsBelowMinStake(ctx context.Context, claims []prooftypes.Claim) { + logger := k.logger.With("method", "unbondApplicationsBelowMinStake") + + for _, claim := range claims { + app, isAppFound := k.applicationKeeper.GetApplication(ctx, claim.SessionHeader.ApplicationAddress) + if !isAppFound { + logger.Error(apptypes.ErrAppNotFound.Wrapf("application address: %q", claim.SessionHeader.ApplicationAddress).Error()) + continue + } + + // Unbond the application because it has less than the minimum stake. + if app.GetUnstakeSessionEndHeight() == apptypes.ApplicationBelowMinStake { + if err := k.applicationKeeper.UnbondApplication(ctx, &app); err != nil { + logger.Error(fmt.Sprintf("unbonding application (%+v): %s", app, err)) + continue + } + } + } +} + // slashSupplierStake slashes the stake of a supplier and transfers the total // slashing amount from the supplier bank module to the tokenomics module account. func (k Keeper) slashSupplierStake( diff --git a/x/tokenomics/keeper/token_logic_modules.go b/x/tokenomics/keeper/token_logic_modules.go index 12e56959b..da686f4bf 100644 --- a/x/tokenomics/keeper/token_logic_modules.go +++ b/x/tokenomics/keeper/token_logic_modules.go @@ -16,13 +16,13 @@ import ( "github.com/pokt-network/poktroll/telemetry" apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" + servicetypes "github.com/pokt-network/poktroll/x/service/types" sessionkeeper "github.com/pokt-network/poktroll/x/session/keeper" sessiontypes "github.com/pokt-network/poktroll/x/session/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" - "github.com/pokt-network/poktroll/x/tokenomics" tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" - tokenomictypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) var ( @@ -100,7 +100,7 @@ type TokenLogicModuleProcessor func( *apptypes.Application, *sharedtypes.Supplier, cosmostypes.Coin, // This is the "actualSettlementCoin" rather than just the "claimCoin" because of how settlement functions; see ensureClaimAmountLimits for details. - *tokenomictypes.RelayMiningDifficulty, + *servicetypes.RelayMiningDifficulty, ) error // tokenLogicModuleProcessorMap is a map of TLMs to their respective independent processors. @@ -145,7 +145,10 @@ func (k Keeper) ProcessTokenLogicModules( if claimSettlementCoin.Amount.BigInt() == nil { return 0 } - return float32(claimSettlementCoin.Amount.Int64()) + + // Avoid out of range errors by converting to float64 first + claimSettlementFloat64, _ := claimSettlementCoin.Amount.BigInt().Float64() + return float32(claimSettlementFloat64) }, func() bool { return isSuccessful }, ) @@ -177,7 +180,7 @@ func (k Keeper) ProcessTokenLogicModules( } // Retrieve the sum (i.e. number of compute units) to determine the amount of work done - numClaimComputeUnits, err := claim.GetNumComputeUnits() + numClaimComputeUnits, err := claim.GetNumClaimedComputeUnits() if err != nil { return tokenomicstypes.ErrTokenomicsRootHashInvalid.Wrapf("failed to retrieve numClaimComputeUnits: %s", err) } @@ -234,12 +237,28 @@ func (k Keeper) ProcessTokenLogicModules( return tokenomicstypes.ErrTokenomicsServiceNotFound.Wrapf("service with ID %q not found", sessionHeader.ServiceId) } + // Ensure the number of compute units claimed is equal to the number of relays * CUPR + expectedClaimComputeUnits := numRelays * service.ComputeUnitsPerRelay + if numClaimComputeUnits != expectedClaimComputeUnits { + return tokenomicstypes.ErrTokenomicsRootHashInvalid.Wrapf( + "mismatch: claim compute units (%d) != number of relays (%d) * service compute units per relay (%d)", + numClaimComputeUnits, + numRelays, + service.ComputeUnitsPerRelay, + ) + } + + // Retrieving the relay mining difficulty for service. + relayMiningDifficulty, found := k.serviceKeeper.GetRelayMiningDifficulty(ctx, service.Id) + if !found { + relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(ctx, logger, service.Id, servicekeeper.TargetNumRelays) + } sharedParams := k.sharedKeeper.GetParams(ctx) // Determine the total number of tokens being claimed (i.e. for the work completed) // by the supplier for the amount of work they did to service the application // in the session. - claimSettlementCoin, err = tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits) + claimSettlementCoin, err = claim.GetClaimeduPOKT(sharedParams, relayMiningDifficulty) if err != nil { return err } @@ -264,17 +283,11 @@ func (k Keeper) ProcessTokenLogicModules( logger = logger.With("actual_settlement_upokt", actualSettlementCoin) logger.Info(fmt.Sprintf("About to start processing TLMs for (%d) compute units, equal to (%s) claimed", numClaimComputeUnits, actualSettlementCoin)) - // Retrieving the relay mining difficulty for the service at hand - relayMiningDifficulty, found := k.GetRelayMiningDifficulty(ctx, service.Id) - if !found { - relayMiningDifficulty = newDefaultRelayMiningDifficulty(ctx, logger, service.Id, numRelays) - } - // Execute all the token logic modules processors for tlm, tlmProcessor := range tokenLogicModuleProcessorMap { logger.Info(fmt.Sprintf("Starting TLM processing: %q", tlm)) if err := tlmProcessor(k, ctx, &service, claim.GetSessionHeader(), &application, &supplier, actualSettlementCoin, &relayMiningDifficulty); err != nil { - return tokenomictypes.ErrTokenomicsTLMError.Wrapf("TLM %q: %v", tlm, err) + return tokenomicstypes.ErrTokenomicsTLMError.Wrapf("TLM %q: %v", tlm, err) } logger.Info(fmt.Sprintf("Finished TLM processing: %q", tlm)) } @@ -282,19 +295,16 @@ func (k Keeper) ProcessTokenLogicModules( // TODO_CONSIDERATION: If we support multiple native tokens, we will need to // start checking the denom here. if application.Stake.Amount.LT(apptypes.DefaultMinStake.Amount) { - // Unbond the application because it has less than the minimum stake. - if err := k.applicationKeeper.UnbondApplication(ctx, &application); err != nil { - return err - } + // Mark the application as unbonding if it has less than the minimum stake. + application.UnstakeSessionEndHeight = apptypes.ApplicationBelowMinStake // TODO_UPNEXT:(@bryanchriswhite): emit a new EventApplicationUnbondedBelowMinStake event. - } else { - // State mutation: update the application's on-chain record. - k.applicationKeeper.SetApplication(ctx, application) - logger.Info(fmt.Sprintf("updated on-chain application record with address %q", application.Address)) - } + // State mutation: update the application's on-chain record. + k.applicationKeeper.SetApplication(ctx, application) + logger.Info(fmt.Sprintf("updated on-chain application record with address %q", application.Address)) + // TODO_MAINNET: If the application stake has dropped to (near?) zero, should // we unstake it? Should we use it's balance? Should there be a payee of last resort? // Make sure to document whatever decision we come to. @@ -316,7 +326,7 @@ func (k Keeper) TokenLogicModuleRelayBurnEqualsMint( application *apptypes.Application, supplier *sharedtypes.Supplier, settlementCoin cosmostypes.Coin, - relayMiningDifficulty *tokenomictypes.RelayMiningDifficulty, + relayMiningDifficulty *servicetypes.RelayMiningDifficulty, ) error { logger := k.Logger().With("method", "TokenLogicModuleRelayBurnEqualsMint") @@ -377,7 +387,7 @@ func (k Keeper) TokenLogicModuleGlobalMint( application *apptypes.Application, supplier *sharedtypes.Supplier, settlementCoin cosmostypes.Coin, - relayMiningDifficulty *tokenomictypes.RelayMiningDifficulty, + relayMiningDifficulty *servicetypes.RelayMiningDifficulty, ) error { logger := k.Logger().With("method", "TokenLogicModuleGlobalMint") @@ -394,16 +404,16 @@ func (k Keeper) TokenLogicModuleGlobalMint( } // Mint new uPOKT to the tokenomics module account - if err := k.bankKeeper.MintCoins(ctx, tokenomictypes.ModuleName, sdk.NewCoins(newMintCoin)); err != nil { + if err := k.bankKeeper.MintCoins(ctx, tokenomicstypes.ModuleName, sdk.NewCoins(newMintCoin)); err != nil { return tokenomicstypes.ErrTokenomicsModuleMintFailed.Wrapf( "minting (%s) to the tokenomics module account: %v", newMintCoin, err) } logger.Info(fmt.Sprintf("minted (%s) to the tokenomics module account", newMintCoin)) // Send a portion of the rewards to the application - appCoin, err := k.sendRewardsToAccount(ctx, tokenomictypes.ModuleName, application.GetAddress(), &newMintAmtFloat, MintAllocationApplication) + appCoin, err := k.sendRewardsToAccount(ctx, tokenomicstypes.ModuleName, application.GetAddress(), &newMintAmtFloat, MintAllocationApplication) if err != nil { - return tokenomictypes.ErrTokenomicsSendingMintRewards.Wrapf("sending rewards to application: %v", err) + return tokenomicstypes.ErrTokenomicsSendingMintRewards.Wrapf("sending rewards to application: %v", err) } logger.Debug(fmt.Sprintf("sent (%v) newley minted coins from the tokenomics module to the application with address %q", appCoin, application.Address)) @@ -429,24 +439,24 @@ func (k Keeper) TokenLogicModuleGlobalMint( logger.Debug(fmt.Sprintf("sent (%v) newley minted coins from the tokenomics module to the supplier with address %q", supplierCoin, supplier.OperatorAddress)) // Send a portion of the rewards to the DAO - daoCoin, err := k.sendRewardsToAccount(ctx, tokenomictypes.ModuleName, k.GetAuthority(), &newMintAmtFloat, MintAllocationDAO) + daoCoin, err := k.sendRewardsToAccount(ctx, tokenomicstypes.ModuleName, k.GetAuthority(), &newMintAmtFloat, MintAllocationDAO) if err != nil { - return tokenomictypes.ErrTokenomicsSendingMintRewards.Wrapf("sending rewards to DAO: %v", err) + return tokenomicstypes.ErrTokenomicsSendingMintRewards.Wrapf("sending rewards to DAO: %v", err) } logger.Debug(fmt.Sprintf("sent (%v) newley minted coins from the tokenomics module to the DAO with address %q", daoCoin, k.GetAuthority())) // Send a portion of the rewards to the source owner - serviceCoin, err := k.sendRewardsToAccount(ctx, tokenomictypes.ModuleName, service.OwnerAddress, &newMintAmtFloat, MintAllocationSourceOwner) + serviceCoin, err := k.sendRewardsToAccount(ctx, tokenomicstypes.ModuleName, service.OwnerAddress, &newMintAmtFloat, MintAllocationSourceOwner) if err != nil { - return tokenomictypes.ErrTokenomicsSendingMintRewards.Wrapf("sending rewards to source owner: %v", err) + return tokenomicstypes.ErrTokenomicsSendingMintRewards.Wrapf("sending rewards to source owner: %v", err) } logger.Debug(fmt.Sprintf("sent (%v) newley minted coins from the tokenomics module to the source owner with address %q", serviceCoin, service.OwnerAddress)) // Send a portion of the rewards to the block proposer proposerAddr := cosmostypes.AccAddress(sdk.UnwrapSDKContext(ctx).BlockHeader().ProposerAddress).String() - proposerCoin, err := k.sendRewardsToAccount(ctx, tokenomictypes.ModuleName, proposerAddr, &newMintAmtFloat, MintAllocationProposer) + proposerCoin, err := k.sendRewardsToAccount(ctx, tokenomicstypes.ModuleName, proposerAddr, &newMintAmtFloat, MintAllocationProposer) if err != nil { - return tokenomictypes.ErrTokenomicsSendingMintRewards.Wrapf("sending rewards to proposer: %v", err) + return tokenomicstypes.ErrTokenomicsSendingMintRewards.Wrapf("sending rewards to proposer: %v", err) } logger.Debug(fmt.Sprintf("sent (%v) newley minted coins from the tokenomics module to the proposer with address %q", proposerCoin, proposerAddr)) @@ -481,7 +491,7 @@ func (k Keeper) ensureMintedCoinsAreDistributed( // Discrepancy exists and is too large, return an error if isPercentDifferenceTooLarge && isAbsDifferenceSignificant { - return tokenomictypes.ErrTokenomicsAmountMismatchTooLarge.Wrapf( + return tokenomicstypes.ErrTokenomicsAmountMismatchTooLarge.Wrapf( "the total distributed coins (%v) do not equal the amount of newly minted coins (%v) with a percent difference of (%f). Likely floating point arithmetic.\n"+ "appCoin: %v, supplierCoin: %v, daoCoin: %v, serviceCoin: %v, proposerCoin: %v", totalMintDistributedCoin, newMintCoin, percentDifference, @@ -647,6 +657,11 @@ func calculateGlobalPerClaimMintInflationFromSettlementAmount(settlementCoin sdk // TODO_MAINNET: Consider using fixed point arithmetic for deterministic results. settlementAmtFloat := new(big.Float).SetUint64(settlementCoin.Amount.Uint64()) newMintAmtFloat := new(big.Float).Mul(settlementAmtFloat, big.NewFloat(MintPerClaimedTokenGlobalInflation)) + // DEV_NOTE: If new mint is less than 1 and more than 0, ceil it to 1 so that + // we never expect to process a claim with 0 minted tokens. + if newMintAmtFloat.Cmp(big.NewFloat(1)) < 0 && newMintAmtFloat.Cmp(big.NewFloat(0)) > 0 { + newMintAmtFloat = big.NewFloat(1) + } newMintAmtInt, _ := newMintAmtFloat.Int64() mintAmtCoin := cosmostypes.NewCoin(volatile.DenomuPOKT, math.NewInt(newMintAmtInt)) return mintAmtCoin, *newMintAmtFloat diff --git a/x/tokenomics/keeper/token_logic_modules_test.go b/x/tokenomics/keeper/token_logic_modules_test.go index 812090ae7..913179e8d 100644 --- a/x/tokenomics/keeper/token_logic_modules_test.go +++ b/x/tokenomics/keeper/token_logic_modules_test.go @@ -509,7 +509,13 @@ func TestProcessTokenLogicModules_InvalidRoot(t *testing.T) { { desc: "correct size but invalid value", root: func() []byte { - return bytes.Repeat([]byte("a"), protocol.TrieRootSize) + // A root with all 'a's is a valid value since each of the hash, sum and size + // will be []byte{0x61, 0x61, ...} with their respective sizes. + // The current test suite sets the CUPR to 1, making sum == count * CUPR + // valid. So, we can change the last byte to 'b' to make it invalid. + root := bytes.Repeat([]byte("a"), protocol.TrieRootSize) + root = append(root[:len(root)-1], 'b') + return root }(), errExpected: true, }, diff --git a/x/tokenomics/keeper/update_relay_mining_difficulty.go b/x/tokenomics/keeper/update_relay_mining_difficulty.go index 395af022c..298578e4c 100644 --- a/x/tokenomics/keeper/update_relay_mining_difficulty.go +++ b/x/tokenomics/keeper/update_relay_mining_difficulty.go @@ -1,167 +1,19 @@ package keeper import ( - "bytes" "context" - "encoding/hex" - "fmt" - "math/big" - "cosmossdk.io/log" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/pokt-network/poktroll/pkg/crypto/protocol" - prooftypes "github.com/pokt-network/poktroll/x/proof/types" - "github.com/pokt-network/poktroll/x/tokenomics/types" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" + "github.com/pokt-network/poktroll/x/service/types" ) -// TargetNumRelays is the target number of relays we want the network to mine for -// a specific service across all applications & suppliers per session. -// This number determines the total number of leafs to be created across in -// the off-chain SMTs, across all suppliers, for each service. -// It indirectly drives the off-chain resource requirements of the network -// in additional to playing a critical role in Relay Mining. -// TODO_MAINNET(#542): Make this a governance parameter and figure out the correct value. -const TargetNumRelays = uint64(10e4) - -// Exponential moving average (ema) smoothing factor, commonly known as alpha. -// Usually, alpha = 2 / (N+1), where N is the number of periods. -// Large alpha -> more weight on recent data; less smoothing and fast response. -// Small alpha -> more weight on past data; more smoothing and slow response. -// -// TODO_MAINNET: Use a language agnostic float implementation or arithmetic library -// to ensure deterministic results across different language implementations of the -// protocol. -// -// TODO_MAINNET(@olshansk, @rawthil): Play around with the value N for EMA to -// capture what the memory should be. -var emaSmoothingFactor = new(big.Float).SetFloat64(0.1) - // UpdateRelayMiningDifficulty updates the on-chain relay mining difficulty // based on the amount of on-chain relays for each service, given a map of serviceId->numRelays. +// This is a wrapper around the service keeper's UpdateRelayMiningDifficulty method +// to allow the tokenomics EndBlocker to update the relay mining difficulty after +// all claims have settled. func (k Keeper) UpdateRelayMiningDifficulty( ctx context.Context, relaysPerServiceMap map[string]uint64, ) (difficultyPerServiceMap map[string]types.RelayMiningDifficulty, err error) { - logger := k.Logger().With("method", "UpdateRelayMiningDifficulty") - sdkCtx := sdk.UnwrapSDKContext(ctx) - - difficultyPerServiceMap = make(map[string]types.RelayMiningDifficulty, len(relaysPerServiceMap)) - for serviceId, numRelays := range relaysPerServiceMap { - prevDifficulty, found := k.GetRelayMiningDifficulty(ctx, serviceId) - if !found { - prevDifficulty = newDefaultRelayMiningDifficulty(ctx, logger, serviceId, numRelays) - } - - // TODO_MAINNET(@Olshansk): We could potentially compute the smoothing factor - // using a common formula, such as alpha = 2 / (N+1), where N is the number - // of periods. - // N := ctx.BlockHeight() - prevDifficulty.BlockHeight - // alpha := 2 / (1 + N) - alpha := emaSmoothingFactor - - // Compute the updated EMA of the number of relays. - prevRelaysEma := prevDifficulty.NumRelaysEma - newRelaysEma := computeEma(alpha, prevRelaysEma, numRelays) - - // CRITICAL_DEV_NOTE: We changed this code to pass in "DefaultRelayDifficultyTargetHash" instead of "prevDifficulty.TargetHash" - // to "ComputeNewDifficultyTargetHash" because we used to have 2 moving variables: - // 1. Input difficulty - // 2. Relays EMA - // However, since the "TargetNumRelays" remained constant, the following case would keep scaling down the difficulty: - // - newRelaysEma = 100 -> scaled by 10 / 100 -> scaled down by 0.1 - // - newRelaysEma = 50 -> scaled by 10 / 50 -> scaled down by 0.2 - // - newRelaysEma = 20 -> scaled by 10 / 20 -> scaled down by 0.5 - // We kept scaling down even though numRelaysEma was decreasing. - // To avoid continuing to increase the difficulty (i.e. scaling down), the - // relative starting difficulty has to be kept constant. - difficultyHash := protocol.ComputeNewDifficultyTargetHash(prooftypes.DefaultRelayDifficultyTargetHash, TargetNumRelays, newRelaysEma) - newDifficulty := types.RelayMiningDifficulty{ - ServiceId: serviceId, - BlockHeight: sdkCtx.BlockHeight(), - NumRelaysEma: newRelaysEma, - TargetHash: difficultyHash, - } - k.SetRelayMiningDifficulty(ctx, newDifficulty) - - // Emit an event for the updated relay mining difficulty regardless of - // whether the difficulty changed or not. - - relayMiningDifficultyUpdateEvent := types.EventRelayMiningDifficultyUpdated{ - ServiceId: serviceId, - PrevTargetHashHexEncoded: hex.EncodeToString(prevDifficulty.TargetHash), - NewTargetHashHexEncoded: hex.EncodeToString(newDifficulty.TargetHash), - PrevNumRelaysEma: prevDifficulty.NumRelaysEma, - NewNumRelaysEma: newDifficulty.NumRelaysEma, - } - if err := sdkCtx.EventManager().EmitTypedEvent(&relayMiningDifficultyUpdateEvent); err != nil { - return nil, err - } - - // Output the appropriate log message based on whether the difficulty was initialized, updated or unchanged. - var logMessage string - switch { - case !found: - logMessage = fmt.Sprintf("Initialized RelayMiningDifficulty for service %s at height %d with difficulty %x", serviceId, sdkCtx.BlockHeight(), newDifficulty.TargetHash) - case !bytes.Equal(prevDifficulty.TargetHash, newDifficulty.TargetHash): - logMessage = fmt.Sprintf("Updated RelayMiningDifficulty for service %s at height %d from %x to %x", serviceId, sdkCtx.BlockHeight(), prevDifficulty.TargetHash, newDifficulty.TargetHash) - default: - logMessage = fmt.Sprintf("No change in RelayMiningDifficulty for service %s at height %d. Current difficulty: %x", serviceId, sdkCtx.BlockHeight(), newDifficulty.TargetHash) - } - logger.Info(logMessage) - - // Store the updated difficulty in the map for telemetry. - // This is done to only emit the telemetry event if all the difficulties - // are updated successfully. - difficultyPerServiceMap[serviceId] = newDifficulty - } - - return difficultyPerServiceMap, nil -} - -// computeEma computes the EMA at time t, given the EMA at time t-1, the raw -// data revealed at time t, and the smoothing factor α. -// Src: https://en.wikipedia.org/wiki/Exponential_smoothing -// -// TODO_MAINNET: Use a language agnostic float implementation or arithmetic library -// to ensure deterministic results across different language implementations of the -// protocol. -func computeEma(alpha *big.Float, prevEma, currValue uint64) uint64 { - oneMinusAlpha := new(big.Float).Sub(new(big.Float).SetInt64(1), alpha) - prevEmaFloat := new(big.Float).SetUint64(prevEma) - - weightedCurrentContribution := new(big.Float).Mul(alpha, new(big.Float).SetUint64(currValue)) - weightedPreviousContribution := new(big.Float).Mul(oneMinusAlpha, prevEmaFloat) - newEma, _ := new(big.Float).Add(weightedCurrentContribution, weightedPreviousContribution).Uint64() - return newEma -} - -// newDefaultRelayMiningDifficulty is a helper that creates a new RelayMiningDifficulty -// structure if one is not available. It is often used to set the default when a service's -// difficulty is being initialized for the first time. -func newDefaultRelayMiningDifficulty( - ctx context.Context, - logger log.Logger, - serviceId string, - numRelays uint64, -) tokenomicstypes.RelayMiningDifficulty { - logger = logger.With("helper", "NewDefaultRelayMiningDifficulty") - - // Compute the target hash based on the number of relays seen for the first time. - newDifficultyHash := protocol.ComputeNewDifficultyTargetHash(prooftypes.DefaultRelayDifficultyTargetHash, TargetNumRelays, numRelays) - - logger.Warn(types.ErrTokenomicsMissingRelayMiningDifficulty.Wrapf( - "No previous relay mining difficulty found for service %s.\n"+ - "Creating a new relay mining difficulty with %d relays and an initial target hash %x", - serviceId, numRelays, newDifficultyHash).Error()) - - // Return a new RelayMiningDifficulty with the computed target hash. - return tokenomicstypes.RelayMiningDifficulty{ - ServiceId: serviceId, - BlockHeight: sdk.UnwrapSDKContext(ctx).BlockHeight(), - NumRelaysEma: numRelays, - TargetHash: newDifficultyHash, - } - + return k.serviceKeeper.UpdateRelayMiningDifficulty(ctx, relaysPerServiceMap) } diff --git a/x/tokenomics/module/genesis.go b/x/tokenomics/module/genesis.go index e4e09b61d..c877263d1 100644 --- a/x/tokenomics/module/genesis.go +++ b/x/tokenomics/module/genesis.go @@ -9,10 +9,6 @@ import ( // InitGenesis initializes the module's state from a provided genesis state. func InitGenesis(ctx context.Context, k keeper.Keeper, genState types.GenesisState) { - // Set all the relayMiningDifficulty - for _, difficulty := range genState.RelayMiningDifficultyList { - k.SetRelayMiningDifficulty(ctx, difficulty) - } // this line is used by starport scaffolding # genesis/module/init if err := k.SetParams(ctx, genState.Params); err != nil { panic(err) @@ -24,7 +20,6 @@ func ExportGenesis(ctx context.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - genesis.RelayMiningDifficultyList = k.GetAllRelayMiningDifficulty(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/tokenomics/module/genesis_test.go b/x/tokenomics/module/genesis_test.go index d9d206ef5..d50e182d6 100644 --- a/x/tokenomics/module/genesis_test.go +++ b/x/tokenomics/module/genesis_test.go @@ -14,15 +14,6 @@ import ( func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ Params: types.DefaultParams(), - - RelayMiningDifficultyList: []types.RelayMiningDifficulty{ - { - ServiceId: "0", - }, - { - ServiceId: "1", - }, - }, // this line is used by starport scaffolding # genesis/test/state } @@ -34,6 +25,5 @@ func TestGenesis(t *testing.T) { nullify.Fill(&genesisState) nullify.Fill(got) - require.ElementsMatch(t, genesisState.RelayMiningDifficultyList, got.RelayMiningDifficultyList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/tokenomics/tokenomics.go b/x/tokenomics/tokenomics.go deleted file mode 100644 index 4811023a2..000000000 --- a/x/tokenomics/tokenomics.go +++ /dev/null @@ -1,28 +0,0 @@ -package tokenomics - -import ( - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/pokt-network/poktroll/app/volatile" - sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" -) - -// NumComputeUnitsToCoin converts compute units to uPOKT to mint based on global -// network parameters. -func NumComputeUnitsToCoin(params sharedtypes.Params, numClaimComputeUnits uint64) (sdk.Coin, error) { - // CUTTM is a GLOBAL network wide parameter. - // TODO(@red-0ne, #781): Convert numClaimComputeUnits to numEstimatedComputeUnits to reflect reward/payment based on real usage. - upoktAmount := math.NewInt(int64(numClaimComputeUnits * params.GetComputeUnitsToTokensMultiplier())) - if upoktAmount.IsNegative() { - return sdk.Coin{}, tokenomicstypes.ErrTokenomicsCalculation.Wrapf( - "num compute units to coin (%d) * CUTTM (%d) resulted in a negative amount: %d", - numClaimComputeUnits, - params.GetComputeUnitsToTokensMultiplier(), - upoktAmount, - ) - } - - return sdk.NewCoin(volatile.DenomuPOKT, upoktAmount), nil -} diff --git a/x/tokenomics/types/errors.go b/x/tokenomics/types/errors.go index 05afa3e9e..2d80c19ea 100644 --- a/x/tokenomics/types/errors.go +++ b/x/tokenomics/types/errors.go @@ -24,17 +24,16 @@ var ( ErrTokenomicsParamInvalid = sdkerrors.Register(ModuleName, 1115, "the provided param is invalid") ErrTokenomicsUnmarshalInvalid = sdkerrors.Register(ModuleName, 1116, "failed to unmarshal the provided bytes") ErrTokenomicsDuplicateIndex = sdkerrors.Register(ModuleName, 1117, "cannot have a duplicate index") - ErrTokenomicsMissingRelayMiningDifficulty = sdkerrors.Register(ModuleName, 1118, "missing relay mining difficulty") - ErrTokenomicsEmittingEventFailed = sdkerrors.Register(ModuleName, 1119, "failed to emit event") - ErrTokenomicsServiceNotFound = sdkerrors.Register(ModuleName, 1120, "service not found") - ErrTokenomicsModuleMintFailed = sdkerrors.Register(ModuleName, 1121, "failed to mint uPOKT to tokenomics module account") - ErrTokenomicsSendingMintRewards = sdkerrors.Register(ModuleName, 1122, "failed to send minted rewards") - ErrTokenomicsSupplierModuleMintFailed = sdkerrors.Register(ModuleName, 1123, "failed to mint uPOKT to supplier module account") - ErrTokenomicsSupplierOwnerAddressInvalid = sdkerrors.Register(ModuleName, 1124, "the supplier owner address in the claim is not a valid bech32 address") - ErrTokenomicsSupplierRevShareFailed = sdkerrors.Register(ModuleName, 1125, "failed to send rev share to supplier shareholders") - ErrTokenomicsApplicationReimbursementRequestFailed = sdkerrors.Register(ModuleName, 1126, "failed to send application reimbursement request event") - ErrTokenomicsAmountMismatchTooLarge = sdkerrors.Register(ModuleName, 1127, "an unexpected amount mismatch occurred") - ErrTokenomicsMintAmountZero = sdkerrors.Register(ModuleName, 1128, "mint amount cannot be zero") - ErrTokenomicsTLMError = sdkerrors.Register(ModuleName, 1129, "failed to process TLM") - ErrTokenomicsCalculation = sdkerrors.Register(ModuleName, 1130, "tokenomics calculation error") + ErrTokenomicsEmittingEventFailed = sdkerrors.Register(ModuleName, 1118, "failed to emit event") + ErrTokenomicsServiceNotFound = sdkerrors.Register(ModuleName, 1119, "service not found") + ErrTokenomicsModuleMintFailed = sdkerrors.Register(ModuleName, 1120, "failed to mint uPOKT to tokenomics module account") + ErrTokenomicsSendingMintRewards = sdkerrors.Register(ModuleName, 1121, "failed to send minted rewards") + ErrTokenomicsSupplierModuleMintFailed = sdkerrors.Register(ModuleName, 1122, "failed to mint uPOKT to supplier module account") + ErrTokenomicsSupplierOwnerAddressInvalid = sdkerrors.Register(ModuleName, 1123, "the supplier owner address in the claim is not a valid bech32 address") + ErrTokenomicsSupplierRevShareFailed = sdkerrors.Register(ModuleName, 1124, "failed to send rev share to supplier shareholders") + ErrTokenomicsApplicationReimbursementRequestFailed = sdkerrors.Register(ModuleName, 1125, "failed to send application reimbursement request event") + ErrTokenomicsAmountMismatchTooLarge = sdkerrors.Register(ModuleName, 1126, "an unexpected amount mismatch occurred") + ErrTokenomicsMintAmountZero = sdkerrors.Register(ModuleName, 1127, "mint amount cannot be zero") + ErrTokenomicsTLMError = sdkerrors.Register(ModuleName, 1128, "failed to process TLM") + ErrTokenomicsCalculation = sdkerrors.Register(ModuleName, 1129, "tokenomics calculation error") ) diff --git a/x/tokenomics/types/event.pb.go b/x/tokenomics/types/event.pb.go index 889236fed..6f4278908 100644 --- a/x/tokenomics/types/event.pb.go +++ b/x/tokenomics/types/event.pb.go @@ -64,7 +64,13 @@ type EventClaimExpired struct { NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` // Number of compute units claimed as a function of the number of relays // and the compute units per relay for the particular service. - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` + // Number of estimated compute units claimed as a function of the number of claimed + // compute units and the relay difficulty multiplier for the particular service. + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` + // The uPOKT coin claimed to be rewarded for the work done as a function of + // the number of estimated compute units and the compute uints to token multiplier. + ClaimedUpokt *types1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventClaimExpired) Reset() { *m = EventClaimExpired{} } @@ -117,13 +123,27 @@ func (m *EventClaimExpired) GetNumRelays() uint64 { return 0 } -func (m *EventClaimExpired) GetNumComputeUnits() uint64 { +func (m *EventClaimExpired) GetNumClaimedComputeUnits() uint64 { if m != nil { - return m.NumComputeUnits + return m.NumClaimedComputeUnits } return 0 } +func (m *EventClaimExpired) GetNumEstimatedComputeUnits() uint64 { + if m != nil { + return m.NumEstimatedComputeUnits + } + return 0 +} + +func (m *EventClaimExpired) GetClaimedUpokt() *types1.Coin { + if m != nil { + return m.ClaimedUpokt + } + return nil +} + // EventClaimSettled is an event emitted whenever a claim is settled. // The proof_required determines whether the claim requires a proof that has been submitted or not type EventClaimSettled struct { @@ -134,7 +154,13 @@ type EventClaimSettled struct { NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` // Number of compute units claimed as a function of the number of relays // and the compute units per relay for the particular service. - NumComputeUnits uint64 `protobuf:"varint,4,opt,name=num_compute_units,json=numComputeUnits,proto3" json:"num_compute_units"` + NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` + // Number of estimated compute units claimed as a function of the number of claimed + // compute units and the relay difficulty multiplier for the particular service. + NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` + // The uPOKT coin claimed to be rewarded for the work done as a function of + // the number of estimated compute units and the compute uints to token multiplier. + ClaimedUpokt *types1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventClaimSettled) Reset() { *m = EventClaimSettled{} } @@ -187,85 +213,25 @@ func (m *EventClaimSettled) GetNumRelays() uint64 { return 0 } -func (m *EventClaimSettled) GetNumComputeUnits() uint64 { +func (m *EventClaimSettled) GetNumClaimedComputeUnits() uint64 { if m != nil { - return m.NumComputeUnits + return m.NumClaimedComputeUnits } return 0 } -// EventRelayMiningDifficultyUpdated is an event emitted whenever the relay mining difficulty is updated -// for a given service. -type EventRelayMiningDifficultyUpdated struct { - ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - PrevTargetHashHexEncoded string `protobuf:"bytes,2,opt,name=prev_target_hash_hex_encoded,json=prevTargetHashHexEncoded,proto3" json:"prev_target_hash_hex_encoded,omitempty"` - NewTargetHashHexEncoded string `protobuf:"bytes,3,opt,name=new_target_hash_hex_encoded,json=newTargetHashHexEncoded,proto3" json:"new_target_hash_hex_encoded,omitempty"` - PrevNumRelaysEma uint64 `protobuf:"varint,4,opt,name=prev_num_relays_ema,json=prevNumRelaysEma,proto3" json:"prev_num_relays_ema,omitempty"` - NewNumRelaysEma uint64 `protobuf:"varint,5,opt,name=new_num_relays_ema,json=newNumRelaysEma,proto3" json:"new_num_relays_ema,omitempty"` -} - -func (m *EventRelayMiningDifficultyUpdated) Reset() { *m = EventRelayMiningDifficultyUpdated{} } -func (m *EventRelayMiningDifficultyUpdated) String() string { return proto.CompactTextString(m) } -func (*EventRelayMiningDifficultyUpdated) ProtoMessage() {} -func (*EventRelayMiningDifficultyUpdated) Descriptor() ([]byte, []int) { - return fileDescriptor_a78874bbf91a58c7, []int{2} -} -func (m *EventRelayMiningDifficultyUpdated) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventRelayMiningDifficultyUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *EventRelayMiningDifficultyUpdated) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventRelayMiningDifficultyUpdated.Merge(m, src) -} -func (m *EventRelayMiningDifficultyUpdated) XXX_Size() int { - return m.Size() -} -func (m *EventRelayMiningDifficultyUpdated) XXX_DiscardUnknown() { - xxx_messageInfo_EventRelayMiningDifficultyUpdated.DiscardUnknown(m) -} - -var xxx_messageInfo_EventRelayMiningDifficultyUpdated proto.InternalMessageInfo - -func (m *EventRelayMiningDifficultyUpdated) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - -func (m *EventRelayMiningDifficultyUpdated) GetPrevTargetHashHexEncoded() string { - if m != nil { - return m.PrevTargetHashHexEncoded - } - return "" -} - -func (m *EventRelayMiningDifficultyUpdated) GetNewTargetHashHexEncoded() string { +func (m *EventClaimSettled) GetNumEstimatedComputeUnits() uint64 { if m != nil { - return m.NewTargetHashHexEncoded - } - return "" -} - -func (m *EventRelayMiningDifficultyUpdated) GetPrevNumRelaysEma() uint64 { - if m != nil { - return m.PrevNumRelaysEma + return m.NumEstimatedComputeUnits } return 0 } -func (m *EventRelayMiningDifficultyUpdated) GetNewNumRelaysEma() uint64 { +func (m *EventClaimSettled) GetClaimedUpokt() *types1.Coin { if m != nil { - return m.NewNumRelaysEma + return m.ClaimedUpokt } - return 0 + return nil } // EventApplicationOverserviced is emitted when an application has less stake than @@ -289,7 +255,7 @@ func (m *EventApplicationOverserviced) Reset() { *m = EventApplicationOv func (m *EventApplicationOverserviced) String() string { return proto.CompactTextString(m) } func (*EventApplicationOverserviced) ProtoMessage() {} func (*EventApplicationOverserviced) Descriptor() ([]byte, []int) { - return fileDescriptor_a78874bbf91a58c7, []int{3} + return fileDescriptor_a78874bbf91a58c7, []int{2} } func (m *EventApplicationOverserviced) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -357,7 +323,7 @@ func (m *EventSupplierSlashed) Reset() { *m = EventSupplierSlashed{} } func (m *EventSupplierSlashed) String() string { return proto.CompactTextString(m) } func (*EventSupplierSlashed) ProtoMessage() {} func (*EventSupplierSlashed) Descriptor() ([]byte, []int) { - return fileDescriptor_a78874bbf91a58c7, []int{4} + return fileDescriptor_a78874bbf91a58c7, []int{3} } func (m *EventSupplierSlashed) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -407,7 +373,6 @@ func init() { proto.RegisterEnum("poktroll.tokenomics.ClaimExpirationReason", ClaimExpirationReason_name, ClaimExpirationReason_value) proto.RegisterType((*EventClaimExpired)(nil), "poktroll.tokenomics.EventClaimExpired") proto.RegisterType((*EventClaimSettled)(nil), "poktroll.tokenomics.EventClaimSettled") - proto.RegisterType((*EventRelayMiningDifficultyUpdated)(nil), "poktroll.tokenomics.EventRelayMiningDifficultyUpdated") proto.RegisterType((*EventApplicationOverserviced)(nil), "poktroll.tokenomics.EventApplicationOverserviced") proto.RegisterType((*EventSupplierSlashed)(nil), "poktroll.tokenomics.EventSupplierSlashed") } @@ -415,58 +380,54 @@ func init() { func init() { proto.RegisterFile("poktroll/tokenomics/event.proto", fileDescriptor_a78874bbf91a58c7) } var fileDescriptor_a78874bbf91a58c7 = []byte{ - // 812 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95, 0xc1, 0x72, 0xdb, 0x44, - 0x18, 0xc7, 0x23, 0x37, 0x65, 0xc6, 0x5b, 0x92, 0xd8, 0xdb, 0x04, 0x4c, 0x68, 0x9d, 0x34, 0x07, - 0x26, 0x14, 0x22, 0x4d, 0x53, 0x86, 0x13, 0xd3, 0xc1, 0x4e, 0x54, 0xaa, 0x19, 0x6a, 0x07, 0xb9, - 0x61, 0x18, 0x2e, 0xcb, 0x5a, 0xfa, 0x6c, 0x2f, 0x91, 0x76, 0xc5, 0xee, 0xca, 0x71, 0x8e, 0xbc, - 0x01, 0x0f, 0xc0, 0x0b, 0x70, 0xe0, 0x15, 0x38, 0x73, 0xec, 0xb1, 0xa7, 0x0c, 0x93, 0xdc, 0xf2, - 0x14, 0xcc, 0xae, 0xe4, 0xd8, 0x24, 0xa1, 0x39, 0x70, 0xe0, 0x92, 0xac, 0xbf, 0xef, 0xff, 0xff, - 0x3e, 0xed, 0x6f, 0xac, 0xbf, 0xd1, 0x46, 0x26, 0x8e, 0xb4, 0x14, 0x49, 0xe2, 0x69, 0x71, 0x04, - 0x5c, 0xa4, 0x2c, 0x52, 0x1e, 0x8c, 0x81, 0x6b, 0x37, 0x93, 0x42, 0x0b, 0x7c, 0x7f, 0x2a, 0x70, - 0x67, 0x82, 0xf5, 0x66, 0x24, 0x54, 0x2a, 0x94, 0xd7, 0xa7, 0x0a, 0xbc, 0xf1, 0x93, 0x3e, 0x68, - 0xfa, 0xc4, 0x8b, 0x04, 0xe3, 0x85, 0x69, 0x7d, 0x75, 0x28, 0x86, 0xc2, 0x1e, 0x3d, 0x73, 0x2a, - 0xab, 0xeb, 0x97, 0xbb, 0x32, 0x29, 0xc4, 0xc0, 0xd3, 0x27, 0x19, 0xa8, 0xa2, 0xb7, 0xf5, 0x7b, - 0x05, 0xd5, 0x7d, 0xb3, 0x76, 0x2f, 0xa1, 0x2c, 0xf5, 0x27, 0x19, 0x93, 0x10, 0xe3, 0xcf, 0xd1, - 0xdd, 0xc8, 0x7c, 0x6e, 0x38, 0x9b, 0xce, 0xf6, 0xbd, 0xdd, 0x35, 0xf7, 0xf2, 0x61, 0xec, 0x04, - 0xd7, 0x8a, 0xdb, 0xd5, 0x8b, 0xd3, 0x8d, 0x42, 0x17, 0x16, 0xff, 0x30, 0x47, 0x75, 0x30, 0x23, - 0xa8, 0x66, 0x82, 0x13, 0x09, 0x54, 0x09, 0xde, 0xa8, 0x6c, 0x3a, 0xdb, 0xcb, 0xbb, 0x8f, 0xdd, - 0x1b, 0x2e, 0xe4, 0xce, 0xb6, 0x5a, 0x4b, 0x68, 0x1d, 0xed, 0xb5, 0x8b, 0xd3, 0x8d, 0xeb, 0x83, - 0xc2, 0x1a, 0x5c, 0x11, 0xe2, 0x1d, 0x84, 0x78, 0x9e, 0x12, 0x09, 0x09, 0x3d, 0x51, 0x8d, 0x3b, - 0x9b, 0xce, 0xf6, 0x62, 0x7b, 0xf9, 0xe2, 0x74, 0x63, 0xae, 0x1a, 0x56, 0x79, 0x9e, 0x86, 0xf6, - 0x88, 0x5b, 0xa8, 0x6e, 0x1a, 0x91, 0x48, 0xb3, 0x5c, 0x03, 0xc9, 0x39, 0xd3, 0xaa, 0xb1, 0x68, - 0x5d, 0x76, 0xe5, 0xb5, 0x66, 0xb8, 0xc2, 0xf3, 0x74, 0xaf, 0xa8, 0x1c, 0x9a, 0xc2, 0xd6, 0x6f, - 0xff, 0xe0, 0xd5, 0x03, 0xad, 0x93, 0xff, 0xc0, 0xeb, 0x47, 0x54, 0xb7, 0x02, 0x22, 0xe1, 0xa7, - 0x9c, 0x49, 0x48, 0x81, 0xeb, 0x92, 0xd7, 0x47, 0x57, 0x67, 0x1c, 0x98, 0xbf, 0xe1, 0x4c, 0x37, - 0xcf, 0xea, 0xda, 0x90, 0xb0, 0x96, 0x5d, 0x91, 0xff, 0x0f, 0xac, 0x7e, 0xad, 0xa0, 0x47, 0x96, - 0x95, 0x1d, 0xf9, 0x92, 0x71, 0xc6, 0x87, 0xfb, 0x6c, 0x30, 0x60, 0x51, 0x9e, 0xe8, 0x93, 0xc3, - 0x2c, 0xa6, 0x1a, 0x62, 0xfc, 0x10, 0x21, 0x05, 0x72, 0xcc, 0x22, 0x20, 0x2c, 0xb6, 0x00, 0xab, - 0x61, 0xb5, 0xac, 0x04, 0x31, 0x7e, 0x86, 0x1e, 0x64, 0x12, 0xc6, 0x44, 0x53, 0x39, 0x04, 0x4d, - 0x46, 0x54, 0x8d, 0xc8, 0x08, 0x26, 0x04, 0x78, 0x24, 0x62, 0x88, 0x2d, 0xad, 0x6a, 0xd8, 0x30, - 0x9a, 0x57, 0x56, 0xf2, 0x82, 0xaa, 0xd1, 0x0b, 0x98, 0xf8, 0x45, 0x1f, 0x7f, 0x81, 0x3e, 0xe4, - 0x70, 0xfc, 0xaf, 0xf6, 0x3b, 0xd6, 0xfe, 0x3e, 0x87, 0xe3, 0x1b, 0xdd, 0x3b, 0xe8, 0xbe, 0xdd, - 0x3e, 0x63, 0x44, 0x20, 0xa5, 0x05, 0x07, 0xc3, 0x18, 0xc6, 0x9d, 0x29, 0x31, 0x3f, 0xa5, 0xf8, - 0x13, 0x84, 0xcd, 0xb2, 0x2b, 0xea, 0xbb, 0x56, 0xbd, 0xc2, 0xe1, 0x78, 0x5e, 0xbc, 0xf5, 0x73, - 0x05, 0x3d, 0xb0, 0x78, 0x5a, 0x59, 0x96, 0xb0, 0xc8, 0x7e, 0xaf, 0xbb, 0x63, 0x90, 0xe5, 0xdd, - 0x63, 0xfc, 0x31, 0xaa, 0xd1, 0x59, 0x8b, 0xd0, 0x38, 0x96, 0x25, 0x9f, 0x95, 0xb9, 0x7a, 0x2b, - 0x8e, 0x25, 0xfe, 0x0c, 0xbd, 0xa7, 0x72, 0x53, 0x03, 0x49, 0x44, 0x06, 0x92, 0x6a, 0x21, 0x0b, - 0x43, 0xc1, 0x67, 0x75, 0xda, 0xed, 0x96, 0x4d, 0xeb, 0x7a, 0x86, 0x96, 0x60, 0x92, 0x41, 0xa4, - 0x21, 0x26, 0xfd, 0x5c, 0x72, 0x4b, 0xe3, 0xde, 0xee, 0x07, 0x6e, 0x11, 0x33, 0xae, 0x89, 0x19, - 0xb7, 0x8c, 0x19, 0x77, 0x4f, 0x30, 0x1e, 0xbe, 0x3b, 0xd5, 0xb7, 0x73, 0xc9, 0xf1, 0x97, 0x68, - 0x19, 0x06, 0x03, 0x88, 0x34, 0x1b, 0x43, 0x31, 0x60, 0xf1, 0xb6, 0x01, 0x4b, 0x97, 0x06, 0x33, - 0x61, 0xeb, 0x0f, 0x07, 0xad, 0x5a, 0x06, 0xbd, 0xf2, 0xf9, 0x7a, 0x09, 0x55, 0x23, 0x88, 0xdf, - 0x72, 0x21, 0xe7, 0x2d, 0x17, 0xfa, 0x14, 0x61, 0xc3, 0x1e, 0x8a, 0x18, 0x23, 0xf6, 0x25, 0x53, - 0x16, 0xc1, 0x62, 0x58, 0xe3, 0xf9, 0x34, 0xdf, 0xec, 0xeb, 0xa8, 0x70, 0x1b, 0xad, 0x28, 0xb3, - 0x8e, 0xf1, 0x21, 0xa1, 0xa9, 0xc8, 0xb9, 0xbe, 0x1d, 0xc0, 0xf2, 0xd4, 0xd1, 0xb2, 0x86, 0xc7, - 0x3f, 0xa0, 0xb5, 0x1b, 0x33, 0x0c, 0x3f, 0x42, 0x0f, 0xfd, 0xef, 0x0e, 0x82, 0xb0, 0xf5, 0x2a, - 0xe8, 0x76, 0x48, 0xe8, 0xb7, 0x7a, 0xdd, 0x0e, 0x39, 0xec, 0xf4, 0x0e, 0xfc, 0xbd, 0xe0, 0x79, - 0xe0, 0xef, 0xd7, 0x16, 0x70, 0x1d, 0x2d, 0x1d, 0x84, 0xdd, 0xee, 0x73, 0xf2, 0x32, 0xe8, 0xf5, - 0x82, 0xce, 0x57, 0x35, 0x67, 0x56, 0x0a, 0x3a, 0xdf, 0xb6, 0xbe, 0x0e, 0xf6, 0x6b, 0x95, 0xf6, - 0x37, 0x7f, 0x9e, 0x35, 0x9d, 0xd7, 0x67, 0x4d, 0xe7, 0xcd, 0x59, 0xd3, 0xf9, 0xeb, 0xac, 0xe9, - 0xfc, 0x72, 0xde, 0x5c, 0x78, 0x7d, 0xde, 0x5c, 0x78, 0x73, 0xde, 0x5c, 0xf8, 0xfe, 0xe9, 0x90, - 0xe9, 0x51, 0xde, 0x77, 0x23, 0x91, 0x7a, 0x26, 0x30, 0x76, 0x38, 0xe8, 0x63, 0x21, 0x8f, 0xbc, - 0xcb, 0xcc, 0x9f, 0xcc, 0xff, 0xc2, 0xd8, 0xe8, 0xef, 0xbf, 0x63, 0xb3, 0xff, 0xe9, 0xdf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x43, 0x7d, 0x6b, 0xef, 0x85, 0x06, 0x00, 0x00, + // 739 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0x4d, 0x53, 0xdb, 0x3a, + 0x14, 0x8d, 0x43, 0x60, 0x06, 0x3d, 0x12, 0x12, 0x3f, 0x60, 0x02, 0xef, 0x61, 0xf3, 0x58, 0xbc, + 0xa1, 0x4c, 0xb1, 0x07, 0xe8, 0x74, 0xd9, 0x69, 0x12, 0x42, 0xc7, 0x33, 0x6d, 0x12, 0x94, 0xd2, + 0x61, 0xba, 0xa8, 0xeb, 0xd8, 0x22, 0xb8, 0xc4, 0x92, 0x2b, 0xc9, 0x29, 0x2c, 0xfb, 0x0f, 0xfa, + 0x8b, 0xba, 0xee, 0x92, 0x25, 0xab, 0x4c, 0x27, 0xec, 0xb2, 0xed, 0xa2, 0xdb, 0x8e, 0xe4, 0x7c, + 0xf1, 0xd1, 0xb0, 0x60, 0xdb, 0x4d, 0x22, 0xdd, 0x7b, 0xce, 0x91, 0x74, 0xcf, 0xb5, 0x04, 0xf4, + 0x90, 0x9c, 0x72, 0x4a, 0x5a, 0x2d, 0x93, 0x93, 0x53, 0x84, 0x49, 0xe0, 0xbb, 0xcc, 0x44, 0x6d, + 0x84, 0xb9, 0x11, 0x52, 0xc2, 0x89, 0xfa, 0xf7, 0x00, 0x60, 0x8c, 0x00, 0x2b, 0x9a, 0x4b, 0x58, + 0x40, 0x98, 0xd9, 0x70, 0x18, 0x32, 0xdb, 0xdb, 0x0d, 0xc4, 0x9d, 0x6d, 0xd3, 0x25, 0x3e, 0x8e, + 0x49, 0x2b, 0x0b, 0x4d, 0xd2, 0x24, 0x72, 0x68, 0x8a, 0x51, 0x3f, 0xba, 0x32, 0x5c, 0x2b, 0xa4, + 0x84, 0x1c, 0x9b, 0xfc, 0x3c, 0x44, 0x2c, 0xce, 0xad, 0xff, 0x9c, 0x02, 0xb9, 0xb2, 0x58, 0xb6, + 0xd4, 0x72, 0xfc, 0xa0, 0x7c, 0x16, 0xfa, 0x14, 0x79, 0xea, 0x53, 0x30, 0xed, 0x8a, 0x79, 0x5e, + 0x59, 0x53, 0x36, 0xfe, 0xda, 0x59, 0x34, 0x86, 0x9b, 0x91, 0x0a, 0x86, 0x04, 0x17, 0x67, 0x7b, + 0x1d, 0x3d, 0xc6, 0xc1, 0xf8, 0x4f, 0xc5, 0x20, 0x87, 0x84, 0x84, 0xc3, 0x7d, 0x82, 0x6d, 0x8a, + 0x1c, 0x46, 0x70, 0x3e, 0xb9, 0xa6, 0x6c, 0x64, 0x76, 0x36, 0x8d, 0x3b, 0x0e, 0x64, 0x8c, 0x56, + 0x95, 0x14, 0x28, 0x19, 0xc5, 0xc5, 0x5e, 0x47, 0xbf, 0x2d, 0x04, 0xb3, 0xe8, 0x06, 0x50, 0xdd, + 0x02, 0x00, 0x47, 0x81, 0x4d, 0x51, 0xcb, 0x39, 0x67, 0xf9, 0xa9, 0x35, 0x65, 0x23, 0x55, 0xcc, + 0xf4, 0x3a, 0xfa, 0x58, 0x14, 0xce, 0xe2, 0x28, 0x80, 0x72, 0xa8, 0x1e, 0x81, 0x65, 0x91, 0x90, + 0x7b, 0x45, 0x9e, 0xed, 0x92, 0x20, 0x8c, 0x38, 0xb2, 0x23, 0xec, 0x73, 0x96, 0x4f, 0x49, 0xf6, + 0x6a, 0xaf, 0xa3, 0xff, 0x1e, 0x04, 0x97, 0x70, 0x14, 0x94, 0xe2, 0x4c, 0x29, 0x4e, 0x1c, 0x8a, + 0xb8, 0xfa, 0x0e, 0xfc, 0x23, 0x48, 0x88, 0x71, 0x3f, 0x70, 0xf8, 0x2d, 0xed, 0x69, 0xa9, 0xad, + 0xf7, 0x3a, 0xfa, 0x24, 0x18, 0xcc, 0xe3, 0x28, 0x28, 0x0f, 0x72, 0xd7, 0xf4, 0x0f, 0x40, 0x7a, + 0xb0, 0xa1, 0x48, 0xd4, 0x31, 0x3f, 0x23, 0x8d, 0x59, 0x36, 0xe2, 0x86, 0x30, 0x44, 0x43, 0x18, + 0xfd, 0x86, 0x30, 0x4a, 0xc4, 0xc7, 0xc5, 0x5c, 0xaf, 0xa3, 0x5f, 0xe7, 0xc0, 0xb9, 0xfe, 0xf4, + 0x50, 0xcc, 0xd6, 0x7f, 0x5c, 0x73, 0xbe, 0x8e, 0x38, 0x6f, 0x3d, 0xc0, 0xf9, 0x0f, 0x20, 0x27, + 0x01, 0x36, 0x45, 0x1f, 0x23, 0x9f, 0xa2, 0x00, 0x61, 0xde, 0x77, 0xfe, 0xff, 0x9b, 0x1a, 0x35, + 0xf1, 0x0b, 0x47, 0xb8, 0x71, 0xd7, 0x6f, 0x89, 0xc0, 0x6c, 0x78, 0x03, 0xfe, 0xc7, 0xf5, 0x07, + 0xb8, 0xfe, 0x39, 0x09, 0xfe, 0x95, 0xae, 0x17, 0xc2, 0xb0, 0xe5, 0xbb, 0xf2, 0x63, 0xaa, 0xb6, + 0x11, 0x65, 0x88, 0xb6, 0x7d, 0x17, 0x79, 0xea, 0x23, 0x90, 0x75, 0x46, 0x29, 0xdb, 0xf1, 0x3c, + 0x2a, 0x7b, 0x61, 0x16, 0xce, 0x8f, 0xc5, 0x0b, 0x9e, 0x47, 0xd5, 0x27, 0x60, 0x89, 0x45, 0x22, + 0x86, 0xa8, 0x4d, 0x42, 0x44, 0x1d, 0x4e, 0x68, 0x4c, 0x48, 0x4a, 0xc2, 0xc2, 0x20, 0x5b, 0xed, + 0x27, 0x25, 0xeb, 0x19, 0x48, 0xa3, 0xb3, 0x10, 0xb9, 0xa2, 0x10, 0x8d, 0x88, 0x62, 0x69, 0xe0, + 0xa4, 0x43, 0xc1, 0xb9, 0x01, 0xbe, 0x18, 0x51, 0xac, 0x3e, 0x07, 0x19, 0x74, 0x7c, 0x8c, 0x5c, + 0xee, 0xb7, 0x51, 0x2c, 0x90, 0xba, 0x4f, 0x20, 0x3d, 0x24, 0x08, 0x85, 0xf5, 0xaf, 0x0a, 0x58, + 0x90, 0x35, 0xa8, 0xf7, 0xf7, 0x57, 0x6f, 0x39, 0xec, 0x04, 0x79, 0x13, 0x0e, 0xa4, 0x4c, 0x38, + 0xd0, 0x63, 0xa0, 0x4a, 0x7b, 0xe3, 0xbb, 0x33, 0x6e, 0x21, 0x26, 0x4b, 0x90, 0x82, 0x59, 0xe1, + 0x6d, 0x9c, 0x90, 0x0d, 0xc4, 0xd4, 0x22, 0x98, 0x67, 0x62, 0x39, 0x1f, 0x37, 0x6d, 0x27, 0x20, + 0x11, 0xe6, 0xf7, 0x17, 0x20, 0x33, 0x60, 0x14, 0x24, 0x61, 0xf3, 0x3d, 0x58, 0xbc, 0xf3, 0xe2, + 0x54, 0xff, 0x03, 0xab, 0xe5, 0xa3, 0x9a, 0x05, 0x0b, 0xaf, 0xad, 0x6a, 0xc5, 0x86, 0xe5, 0x42, + 0xbd, 0x5a, 0xb1, 0x0f, 0x2b, 0xf5, 0x5a, 0xb9, 0x64, 0xed, 0x5b, 0xe5, 0xbd, 0x6c, 0x42, 0xcd, + 0x81, 0x74, 0x0d, 0x56, 0xab, 0xfb, 0xf6, 0x2b, 0xab, 0x5e, 0xb7, 0x2a, 0x2f, 0xb2, 0xca, 0x28, + 0x64, 0x55, 0xde, 0x14, 0x5e, 0x5a, 0x7b, 0xd9, 0x64, 0xf1, 0xe0, 0x5b, 0x57, 0x53, 0x2e, 0xba, + 0x9a, 0x72, 0xd9, 0xd5, 0x94, 0xef, 0x5d, 0x4d, 0xf9, 0x72, 0xa5, 0x25, 0x2e, 0xae, 0xb4, 0xc4, + 0xe5, 0x95, 0x96, 0x78, 0xbb, 0xdb, 0xf4, 0xf9, 0x49, 0xd4, 0x30, 0x5c, 0x12, 0x98, 0xa2, 0xab, + 0xb6, 0x30, 0xe2, 0x9f, 0x08, 0x3d, 0x35, 0x87, 0x0f, 0xcd, 0xd9, 0xf8, 0xb3, 0x26, 0xdf, 0x9b, + 0xc6, 0x8c, 0x7c, 0x70, 0x76, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x71, 0x30, 0x08, 0xfa, + 0x06, 0x00, 0x00, } func (m *EventClaimExpired) Marshal() (dAtA []byte, err error) { @@ -489,8 +450,25 @@ func (m *EventClaimExpired) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + if m.ClaimedUpokt != nil { + { + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.NumEstimatedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumEstimatedComputeUnits)) + i-- + dAtA[i] = 0x28 + } + if m.NumClaimedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumClaimedComputeUnits)) i-- dAtA[i] = 0x20 } @@ -539,8 +517,25 @@ func (m *EventClaimSettled) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NumComputeUnits != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NumComputeUnits)) + if m.ClaimedUpokt != nil { + { + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.NumEstimatedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumEstimatedComputeUnits)) + i-- + dAtA[i] = 0x28 + } + if m.NumClaimedComputeUnits != 0 { + i = encodeVarintEvent(dAtA, i, uint64(m.NumClaimedComputeUnits)) i-- dAtA[i] = 0x20 } @@ -569,60 +564,6 @@ func (m *EventClaimSettled) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *EventRelayMiningDifficultyUpdated) 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 *EventRelayMiningDifficultyUpdated) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventRelayMiningDifficultyUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NewNumRelaysEma != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.NewNumRelaysEma)) - i-- - dAtA[i] = 0x28 - } - if m.PrevNumRelaysEma != 0 { - i = encodeVarintEvent(dAtA, i, uint64(m.PrevNumRelaysEma)) - i-- - dAtA[i] = 0x20 - } - if len(m.NewTargetHashHexEncoded) > 0 { - i -= len(m.NewTargetHashHexEncoded) - copy(dAtA[i:], m.NewTargetHashHexEncoded) - i = encodeVarintEvent(dAtA, i, uint64(len(m.NewTargetHashHexEncoded))) - i-- - dAtA[i] = 0x1a - } - if len(m.PrevTargetHashHexEncoded) > 0 { - i -= len(m.PrevTargetHashHexEncoded) - copy(dAtA[i:], m.PrevTargetHashHexEncoded) - i = encodeVarintEvent(dAtA, i, uint64(len(m.PrevTargetHashHexEncoded))) - i-- - dAtA[i] = 0x12 - } - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintEvent(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *EventApplicationOverserviced) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -758,8 +699,15 @@ func (m *EventClaimExpired) Size() (n int) { if m.NumRelays != 0 { n += 1 + sovEvent(uint64(m.NumRelays)) } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) + if m.NumClaimedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumClaimedComputeUnits)) + } + if m.NumEstimatedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) + } + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() + n += 1 + l + sovEvent(uint64(l)) } return n } @@ -780,36 +728,16 @@ func (m *EventClaimSettled) Size() (n int) { if m.NumRelays != 0 { n += 1 + sovEvent(uint64(m.NumRelays)) } - if m.NumComputeUnits != 0 { - n += 1 + sovEvent(uint64(m.NumComputeUnits)) + if m.NumClaimedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumClaimedComputeUnits)) } - return n -} - -func (m *EventRelayMiningDifficultyUpdated) Size() (n int) { - if m == nil { - return 0 + if m.NumEstimatedComputeUnits != 0 { + n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) } - var l int - _ = l - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - l = len(m.PrevTargetHashHexEncoded) - if l > 0 { + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() n += 1 + l + sovEvent(uint64(l)) } - l = len(m.NewTargetHashHexEncoded) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - if m.PrevNumRelaysEma != 0 { - n += 1 + sovEvent(uint64(m.PrevNumRelaysEma)) - } - if m.NewNumRelaysEma != 0 { - n += 1 + sovEvent(uint64(m.NewNumRelaysEma)) - } return n } @@ -969,9 +897,47 @@ func (m *EventClaimExpired) Unmarshal(dAtA []byte) error { } case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) + } + m.NumClaimedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumClaimedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) + } + m.NumEstimatedComputeUnits = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } - m.NumComputeUnits = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -981,11 +947,28 @@ func (m *EventClaimExpired) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types1.Coin{} + } + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvent(dAtA[iNdEx:]) @@ -1112,9 +1095,9 @@ func (m *EventClaimSettled) Unmarshal(dAtA []byte) error { } case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumComputeUnits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumClaimedComputeUnits", wireType) } - m.NumComputeUnits = 0 + m.NumClaimedComputeUnits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1124,66 +1107,16 @@ func (m *EventClaimSettled) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumComputeUnits |= uint64(b&0x7F) << shift + m.NumClaimedComputeUnits |= uint64(b&0x7F) << shift if b < 0x80 { break } } - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventRelayMiningDifficultyUpdated) 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 ErrIntOverflowEvent - } - 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: EventRelayMiningDifficultyUpdated: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventRelayMiningDifficultyUpdated: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEstimatedComputeUnits", wireType) } - var stringLen uint64 + m.NumEstimatedComputeUnits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1193,29 +1126,16 @@ func (m *EventRelayMiningDifficultyUpdated) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.NumEstimatedComputeUnits |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevTargetHashHexEncoded", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1225,94 +1145,28 @@ func (m *EventRelayMiningDifficultyUpdated) 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 ErrInvalidLengthEvent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - m.PrevTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewTargetHashHexEncoded", wireType) + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types1.Coin{} } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.NewTargetHashHexEncoded = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevNumRelaysEma", wireType) - } - m.PrevNumRelaysEma = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PrevNumRelaysEma |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NewNumRelaysEma", wireType) - } - m.NewNumRelaysEma = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NewNumRelaysEma |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipEvent(dAtA[iNdEx:]) diff --git a/x/tokenomics/types/expected_keepers.go b/x/tokenomics/types/expected_keepers.go index 01a568390..6d198a320 100644 --- a/x/tokenomics/types/expected_keepers.go +++ b/x/tokenomics/types/expected_keepers.go @@ -11,6 +11,7 @@ import ( apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -85,6 +86,8 @@ type SupplierKeeper interface { type ServiceKeeper interface { GetService(ctx context.Context, serviceID string) (sharedtypes.Service, bool) + GetRelayMiningDifficulty(ctx context.Context, serviceID string) (servicetypes.RelayMiningDifficulty, bool) + UpdateRelayMiningDifficulty(ctx context.Context, relaysPerServiceMap map[string]uint64) (map[string]servicetypes.RelayMiningDifficulty, error) // Only used for testing & simulation SetService(ctx context.Context, service sharedtypes.Service) } diff --git a/x/tokenomics/types/genesis.go b/x/tokenomics/types/genesis.go index 2d38fc760..099ccffee 100644 --- a/x/tokenomics/types/genesis.go +++ b/x/tokenomics/types/genesis.go @@ -3,7 +3,6 @@ package types // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - RelayMiningDifficultyList: []RelayMiningDifficulty{}, // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } @@ -12,16 +11,6 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // Check for duplicated index in relayMiningDifficulty - relayMiningDifficultyIndexMap := make(map[string]struct{}) - - for _, elem := range gs.RelayMiningDifficultyList { - index := string(RelayMiningDifficultyKey(elem.ServiceId)) - if _, ok := relayMiningDifficultyIndexMap[index]; ok { - return ErrTokenomicsDuplicateIndex.Wrapf("duplicated index for relayMiningDifficulty: %s", index) - } - relayMiningDifficultyIndexMap[index] = struct{}{} - } // this line is used by starport scaffolding # genesis/types/validate return gs.Params.ValidateBasic() diff --git a/x/tokenomics/types/genesis.pb.go b/x/tokenomics/types/genesis.pb.go index 72f5188ed..b5fd44dff 100644 --- a/x/tokenomics/types/genesis.pb.go +++ b/x/tokenomics/types/genesis.pb.go @@ -27,8 +27,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the tokenomics module's genesis state. type GenesisState struct { // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - RelayMiningDifficultyList []RelayMiningDifficulty `protobuf:"bytes,2,rep,name=relayMiningDifficultyList,proto3" json:"relayMiningDifficultyList"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -67,13 +66,6 @@ func (m *GenesisState) GetParams() Params { return Params{} } -func (m *GenesisState) GetRelayMiningDifficultyList() []RelayMiningDifficulty { - if m != nil { - return m.RelayMiningDifficultyList - } - return nil -} - func init() { proto.RegisterType((*GenesisState)(nil), "poktroll.tokenomics.GenesisState") } @@ -81,26 +73,21 @@ func init() { func init() { proto.RegisterFile("poktroll/tokenomics/genesis.proto", fileDescriptor_a4de321d172b0811) } var fileDescriptor_a4de321d172b0811 = []byte{ - // 289 bytes of a gzipped FileDescriptorProto + // 220 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0xc8, 0xcf, 0x2e, 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0xcb, 0xcf, 0xcd, 0x4c, 0x2e, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x29, 0xd1, 0x43, 0x28, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x75, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x55, 0xc0, 0x66, 0x41, - 0x41, 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x7c, 0x29, 0x43, 0x6c, 0x2a, 0x8a, 0x52, 0x73, 0x12, 0x2b, - 0xe3, 0x73, 0x33, 0xf3, 0x32, 0xf3, 0xd2, 0xe3, 0x53, 0x32, 0xd3, 0xd2, 0x32, 0x93, 0x4b, 0x73, - 0x4a, 0x2a, 0x21, 0x5a, 0x94, 0xf6, 0x31, 0x72, 0xf1, 0xb8, 0x43, 0x1c, 0x19, 0x5c, 0x92, 0x58, - 0x92, 0x2a, 0x64, 0xc7, 0xc5, 0x06, 0x31, 0x53, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x5a, - 0x0f, 0x8b, 0xa3, 0xf5, 0x02, 0xc0, 0x4a, 0x9c, 0x38, 0x4f, 0xdc, 0x93, 0x67, 0x58, 0xf1, 0x7c, - 0x83, 0x16, 0x63, 0x10, 0x54, 0x97, 0x50, 0x1e, 0x97, 0x24, 0xd8, 0x46, 0x5f, 0xb0, 0x85, 0x2e, - 0x70, 0xfb, 0x7c, 0x32, 0x8b, 0x4b, 0x24, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0xb4, 0xb0, 0x1a, - 0x19, 0x84, 0x4d, 0x97, 0x13, 0x0b, 0xc8, 0x86, 0x20, 0xdc, 0x46, 0x3a, 0x05, 0x9e, 0x78, 0x24, - 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x8d, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, - 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xc6, 0xe9, 0x99, 0x25, - 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0x4b, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, - 0x8b, 0xb2, 0xf5, 0xe1, 0x21, 0x55, 0x81, 0x1c, 0x56, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, - 0xe0, 0xa0, 0x31, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xfa, 0xac, 0xa4, 0x6f, 0xd2, 0x01, 0x00, - 0x00, + 0x41, 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x7c, 0x25, 0x3f, 0x2e, 0x1e, 0x77, 0x88, 0x85, 0xc1, 0x25, + 0x89, 0x25, 0xa9, 0x42, 0x76, 0x5c, 0x6c, 0x10, 0x79, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, + 0x69, 0x3d, 0x2c, 0x0e, 0xd0, 0x0b, 0x00, 0x2b, 0x71, 0xe2, 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, + 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x5d, 0x4e, 0x81, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, + 0xc7, 0x78, 0xe3, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, + 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x71, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, + 0x72, 0x7e, 0xae, 0x3e, 0xc8, 0x5c, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x7d, 0xb8, + 0x3b, 0x2b, 0x90, 0x5d, 0x5a, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x76, 0xa9, 0x31, 0x20, + 0x00, 0x00, 0xff, 0xff, 0x26, 0x41, 0xdb, 0xc7, 0x2e, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -123,20 +110,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.RelayMiningDifficultyList) > 0 { - for iNdEx := len(m.RelayMiningDifficultyList) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RelayMiningDifficultyList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } { size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -169,12 +142,6 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.Params.Size() n += 1 + l + sovGenesis(uint64(l)) - if len(m.RelayMiningDifficultyList) > 0 { - for _, e := range m.RelayMiningDifficultyList { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } return n } @@ -246,40 +213,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficultyList", 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 - } - m.RelayMiningDifficultyList = append(m.RelayMiningDifficultyList, RelayMiningDifficulty{}) - if err := m.RelayMiningDifficultyList[len(m.RelayMiningDifficultyList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/tokenomics/types/genesis_test.go b/x/tokenomics/types/genesis_test.go index 737132e3c..0e84dc6be 100644 --- a/x/tokenomics/types/genesis_test.go +++ b/x/tokenomics/types/genesis_test.go @@ -23,32 +23,10 @@ func TestGenesisState_Validate(t *testing.T) { desc: "valid genesis state", genState: &types.GenesisState{ Params: types.Params{}, - RelayMiningDifficultyList: []types.RelayMiningDifficulty{ - { - ServiceId: "0", - }, - { - ServiceId: "1", - }, - }, // this line is used by starport scaffolding # types/genesis/validField }, isValid: true, }, - { - desc: "duplicated relayMiningDifficulty", - genState: &types.GenesisState{ - RelayMiningDifficultyList: []types.RelayMiningDifficulty{ - { - ServiceId: "0", - }, - { - ServiceId: "0", - }, - }, - }, - isValid: false, - }, // this line is used by starport scaffolding # types/genesis/testcase } for _, test := range tests { diff --git a/x/tokenomics/types/query.pb.go b/x/tokenomics/types/query.pb.go index 70675f20f..51dc467a8 100644 --- a/x/tokenomics/types/query.pb.go +++ b/x/tokenomics/types/query.pb.go @@ -7,8 +7,6 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -108,223 +106,35 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -type QueryGetRelayMiningDifficultyRequest struct { - ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` -} - -func (m *QueryGetRelayMiningDifficultyRequest) Reset() { *m = QueryGetRelayMiningDifficultyRequest{} } -func (m *QueryGetRelayMiningDifficultyRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGetRelayMiningDifficultyRequest) ProtoMessage() {} -func (*QueryGetRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{2} -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetRelayMiningDifficultyRequest.Merge(m, src) -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGetRelayMiningDifficultyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetRelayMiningDifficultyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetRelayMiningDifficultyRequest proto.InternalMessageInfo - -func (m *QueryGetRelayMiningDifficultyRequest) GetServiceId() string { - if m != nil { - return m.ServiceId - } - return "" -} - -type QueryGetRelayMiningDifficultyResponse struct { - RelayMiningDifficulty RelayMiningDifficulty `protobuf:"bytes,1,opt,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"` -} - -func (m *QueryGetRelayMiningDifficultyResponse) Reset() { *m = QueryGetRelayMiningDifficultyResponse{} } -func (m *QueryGetRelayMiningDifficultyResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGetRelayMiningDifficultyResponse) ProtoMessage() {} -func (*QueryGetRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{3} -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGetRelayMiningDifficultyResponse.Merge(m, src) -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGetRelayMiningDifficultyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGetRelayMiningDifficultyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGetRelayMiningDifficultyResponse proto.InternalMessageInfo - -func (m *QueryGetRelayMiningDifficultyResponse) GetRelayMiningDifficulty() RelayMiningDifficulty { - if m != nil { - return m.RelayMiningDifficulty - } - return RelayMiningDifficulty{} -} - -type QueryAllRelayMiningDifficultyRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllRelayMiningDifficultyRequest) Reset() { *m = QueryAllRelayMiningDifficultyRequest{} } -func (m *QueryAllRelayMiningDifficultyRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllRelayMiningDifficultyRequest) ProtoMessage() {} -func (*QueryAllRelayMiningDifficultyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{4} -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRelayMiningDifficultyRequest.Merge(m, src) -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllRelayMiningDifficultyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRelayMiningDifficultyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllRelayMiningDifficultyRequest proto.InternalMessageInfo - -func (m *QueryAllRelayMiningDifficultyRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -type QueryAllRelayMiningDifficultyResponse struct { - RelayMiningDifficulty []RelayMiningDifficulty `protobuf:"bytes,1,rep,name=relayMiningDifficulty,proto3" json:"relayMiningDifficulty"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllRelayMiningDifficultyResponse) Reset() { *m = QueryAllRelayMiningDifficultyResponse{} } -func (m *QueryAllRelayMiningDifficultyResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllRelayMiningDifficultyResponse) ProtoMessage() {} -func (*QueryAllRelayMiningDifficultyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_19d6daded0c54373, []int{5} -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRelayMiningDifficultyResponse.Merge(m, src) -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllRelayMiningDifficultyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRelayMiningDifficultyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllRelayMiningDifficultyResponse proto.InternalMessageInfo - -func (m *QueryAllRelayMiningDifficultyResponse) GetRelayMiningDifficulty() []RelayMiningDifficulty { - if m != nil { - return m.RelayMiningDifficulty - } - return nil -} - -func (m *QueryAllRelayMiningDifficultyResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - func init() { proto.RegisterType((*QueryParamsRequest)(nil), "poktroll.tokenomics.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "poktroll.tokenomics.QueryParamsResponse") - proto.RegisterType((*QueryGetRelayMiningDifficultyRequest)(nil), "poktroll.tokenomics.QueryGetRelayMiningDifficultyRequest") - proto.RegisterType((*QueryGetRelayMiningDifficultyResponse)(nil), "poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse") - proto.RegisterType((*QueryAllRelayMiningDifficultyRequest)(nil), "poktroll.tokenomics.QueryAllRelayMiningDifficultyRequest") - proto.RegisterType((*QueryAllRelayMiningDifficultyResponse)(nil), "poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse") } func init() { proto.RegisterFile("poktroll/tokenomics/query.proto", fileDescriptor_19d6daded0c54373) } var fileDescriptor_19d6daded0c54373 = []byte{ - // 575 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xc7, 0x33, 0xb5, 0x06, 0x32, 0x9e, 0x9c, 0xb6, 0x50, 0x63, 0xd9, 0x96, 0x45, 0x6d, 0x08, - 0xb8, 0x63, 0xda, 0x53, 0x15, 0x84, 0x84, 0x6a, 0xf0, 0x50, 0x68, 0x17, 0xbc, 0x78, 0x09, 0x93, - 0xed, 0x64, 0x1d, 0xb2, 0x3b, 0xb3, 0xdd, 0x9d, 0x54, 0x83, 0x78, 0xf1, 0x2e, 0x0a, 0x7e, 0x09, - 0x8f, 0x7e, 0x8c, 0x9e, 0xa4, 0xa0, 0x87, 0x5c, 0x14, 0x49, 0x04, 0xbf, 0x86, 0xec, 0xcc, 0xa4, - 0x49, 0x71, 0x37, 0x0b, 0xc5, 0xcb, 0xb2, 0x3b, 0xf3, 0xde, 0xfb, 0xff, 0x7f, 0x6f, 0xde, 0x0e, - 0xdc, 0x8c, 0x44, 0x5f, 0xc6, 0x22, 0x08, 0xb0, 0x14, 0x7d, 0xca, 0x45, 0xc8, 0xbc, 0x04, 0x9f, - 0x0c, 0x68, 0x3c, 0x74, 0xa2, 0x58, 0x48, 0x81, 0x56, 0xa6, 0x01, 0xce, 0x2c, 0xa0, 0x7a, 0x93, - 0x84, 0x8c, 0x0b, 0xac, 0x9e, 0x3a, 0xae, 0xba, 0xea, 0x0b, 0x5f, 0xa8, 0x57, 0x9c, 0xbe, 0x99, - 0xd5, 0x0d, 0x5f, 0x08, 0x3f, 0xa0, 0x98, 0x44, 0x0c, 0x13, 0xce, 0x85, 0x24, 0x92, 0x09, 0x9e, - 0x98, 0xdd, 0x5b, 0x9e, 0x48, 0x42, 0x91, 0x74, 0x74, 0x9a, 0xfe, 0x30, 0x5b, 0x75, 0xfd, 0x85, - 0xbb, 0x24, 0xa1, 0xda, 0x0f, 0x3e, 0x6d, 0x74, 0xa9, 0x24, 0x0d, 0x1c, 0x11, 0x9f, 0x71, 0x55, - 0xc7, 0xc4, 0x5a, 0xf3, 0xb1, 0xd3, 0x28, 0x4f, 0xb0, 0xe9, 0xfe, 0x56, 0x16, 0x63, 0x44, 0x62, - 0x12, 0x4e, 0xd5, 0x1a, 0x59, 0x11, 0x31, 0x0d, 0xc8, 0xb0, 0x13, 0x32, 0xce, 0xb8, 0xdf, 0x39, - 0x66, 0xbd, 0x1e, 0xf3, 0x06, 0x81, 0x34, 0x7d, 0xb1, 0x57, 0x21, 0x3a, 0x4a, 0x6d, 0x1d, 0xaa, - 0x3a, 0x2e, 0x3d, 0x19, 0xd0, 0x44, 0xda, 0xcf, 0xe1, 0xca, 0xa5, 0xd5, 0x24, 0x12, 0x3c, 0xa1, - 0xe8, 0x31, 0x2c, 0x6b, 0xbd, 0x75, 0xb0, 0x05, 0x6a, 0x37, 0x76, 0x6e, 0x3b, 0x19, 0x5d, 0x75, - 0x74, 0x52, 0xab, 0x72, 0xf6, 0x73, 0xb3, 0xf4, 0xf9, 0xcf, 0x97, 0x3a, 0x70, 0x4d, 0x96, 0xbd, - 0x0f, 0xef, 0xa8, 0xb2, 0x6d, 0x2a, 0xdd, 0xd4, 0xd5, 0x81, 0x32, 0xb5, 0x7f, 0xe1, 0xc9, 0xc8, - 0xa3, 0x0d, 0x58, 0x49, 0x68, 0x7c, 0xca, 0x3c, 0xfa, 0xec, 0x58, 0x49, 0x55, 0xdc, 0xd9, 0x82, - 0xfd, 0x01, 0xc0, 0xbb, 0x05, 0x65, 0x8c, 0xdf, 0x1e, 0x5c, 0x8b, 0xb3, 0x02, 0x8c, 0xfd, 0x7a, - 0xa6, 0xfd, 0xcc, 0x92, 0xad, 0xe5, 0x94, 0xc6, 0xcd, 0x2e, 0x67, 0x73, 0xc3, 0xd5, 0x0c, 0x82, - 0x85, 0x5c, 0x4f, 0x21, 0x9c, 0x9d, 0xba, 0x31, 0x71, 0xcf, 0x31, 0x03, 0x93, 0x1e, 0xbb, 0xa3, - 0x47, 0xd6, 0x1c, 0xbe, 0x73, 0x48, 0x7c, 0x6a, 0x72, 0xdd, 0xb9, 0x4c, 0x7b, 0x34, 0xed, 0x40, - 0xbe, 0x60, 0x71, 0x07, 0xae, 0xfd, 0xc7, 0x0e, 0xa0, 0xf6, 0x25, 0xb2, 0x25, 0x45, 0xb6, 0x5d, - 0x48, 0xa6, 0x4d, 0xce, 0xa3, 0xed, 0x7c, 0x5d, 0x86, 0xd7, 0x15, 0x1a, 0x7a, 0x0f, 0x60, 0x59, - 0x8f, 0x12, 0xda, 0xce, 0xb4, 0xf9, 0xef, 0xdc, 0x56, 0x6b, 0xc5, 0x81, 0x5a, 0xd3, 0x7e, 0xf0, - 0xee, 0xdb, 0xef, 0x4f, 0x4b, 0x75, 0x54, 0xc3, 0x69, 0xc6, 0x7d, 0x4e, 0xe5, 0x2b, 0x11, 0xf7, - 0x71, 0xfe, 0x2f, 0x86, 0x7e, 0x00, 0xb8, 0x96, 0xd9, 0x19, 0xb4, 0x97, 0xaf, 0x5a, 0x30, 0xe9, - 0xd5, 0x87, 0x57, 0x49, 0x35, 0x08, 0x07, 0x0a, 0xa1, 0x8d, 0x9e, 0x14, 0x23, 0xe4, 0xdc, 0x01, - 0xf8, 0xcd, 0xc5, 0x5f, 0xf5, 0x16, 0x7d, 0x07, 0x70, 0x3d, 0x53, 0xb0, 0x19, 0x04, 0x8b, 0x10, - 0x0b, 0x86, 0x7e, 0x11, 0x62, 0xd1, 0xf8, 0xda, 0x4d, 0x85, 0xf8, 0x08, 0xed, 0x5d, 0x19, 0xb1, - 0x75, 0x74, 0x36, 0xb6, 0xc0, 0xf9, 0xd8, 0x02, 0xa3, 0xb1, 0x05, 0x7e, 0x8d, 0x2d, 0xf0, 0x71, - 0x62, 0x95, 0xce, 0x27, 0x56, 0x69, 0x34, 0xb1, 0x4a, 0x2f, 0x76, 0x7d, 0x26, 0x5f, 0x0e, 0xba, - 0x8e, 0x27, 0xc2, 0x1c, 0x89, 0xd7, 0xf3, 0x22, 0x72, 0x18, 0xd1, 0xa4, 0x5b, 0x56, 0x57, 0xe7, - 0xee, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x5a, 0x86, 0x05, 0x75, 0x06, 0x00, 0x00, + // 314 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0xc8, 0xcf, 0x2e, + 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0xcb, 0xcf, 0xcd, 0x4c, 0x2e, 0xd6, + 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x29, 0xd0, + 0x43, 0x28, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x75, 0x52, 0x22, + 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x95, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, + 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, + 0x2b, 0x86, 0xca, 0x4a, 0x26, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xc7, 0x43, 0xb4, 0x41, 0x38, 0x50, + 0x29, 0x05, 0x6c, 0xee, 0x2a, 0x48, 0x2c, 0x4a, 0xcc, 0x85, 0xaa, 0x50, 0x12, 0xe1, 0x12, 0x0a, + 0x04, 0xb9, 0x33, 0x00, 0x2c, 0x18, 0x94, 0x5a, 0x58, 0x9a, 0x5a, 0x5c, 0xa2, 0x14, 0xca, 0x25, + 0x8c, 0x22, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a, 0x64, 0xc7, 0xc5, 0x06, 0xd1, 0x2c, 0xc1, + 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xad, 0x87, 0xc5, 0x5b, 0x7a, 0x10, 0x4d, 0x4e, 0x9c, 0x27, + 0xee, 0xc9, 0x33, 0xac, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x08, 0xaa, 0xcb, 0x68, 0x3a, 0x23, 0x17, + 0x2b, 0xd8, 0x5c, 0xa1, 0x5e, 0x46, 0x2e, 0x36, 0x88, 0x3a, 0x21, 0x75, 0xac, 0x86, 0x60, 0x3a, + 0x4a, 0x4a, 0x83, 0xb0, 0x42, 0x88, 0x3b, 0x95, 0x0c, 0x9a, 0x2e, 0x3f, 0x99, 0xcc, 0xa4, 0x25, + 0xa4, 0xa1, 0x0f, 0xd2, 0xa1, 0x9b, 0x97, 0x5a, 0x52, 0x9e, 0x5f, 0x94, 0xad, 0x8f, 0x3b, 0x30, + 0x9c, 0x02, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc6, 0x23, 0x39, 0xc6, 0x07, + 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, + 0x28, 0xe3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x1c, 0x26, 0x56, 0x20, + 0x9b, 0x59, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x60, 0x63, 0x40, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x9f, 0xe5, 0xec, 0x63, 0x1c, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -341,9 +151,6 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Queries a list of RelayMiningDifficulty items. - RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) - RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) } type queryClient struct { @@ -363,31 +170,10 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) RelayMiningDifficulty(ctx context.Context, in *QueryGetRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryGetRelayMiningDifficultyResponse, error) { - out := new(QueryGetRelayMiningDifficultyResponse) - err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Query/RelayMiningDifficulty", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) RelayMiningDifficultyAll(ctx context.Context, in *QueryAllRelayMiningDifficultyRequest, opts ...grpc.CallOption) (*QueryAllRelayMiningDifficultyResponse, error) { - out := new(QueryAllRelayMiningDifficultyResponse) - err := c.cc.Invoke(ctx, "/poktroll.tokenomics.Query/RelayMiningDifficultyAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Queries a list of RelayMiningDifficulty items. - RelayMiningDifficulty(context.Context, *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) - RelayMiningDifficultyAll(context.Context, *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -397,12 +183,6 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) RelayMiningDifficulty(ctx context.Context, req *QueryGetRelayMiningDifficultyRequest) (*QueryGetRelayMiningDifficultyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficulty not implemented") -} -func (*UnimplementedQueryServer) RelayMiningDifficultyAll(ctx context.Context, req *QueryAllRelayMiningDifficultyRequest) (*QueryAllRelayMiningDifficultyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RelayMiningDifficultyAll not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -426,42 +206,6 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_RelayMiningDifficulty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGetRelayMiningDifficultyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RelayMiningDifficulty(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.tokenomics.Query/RelayMiningDifficulty", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RelayMiningDifficulty(ctx, req.(*QueryGetRelayMiningDifficultyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_RelayMiningDifficultyAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllRelayMiningDifficultyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).RelayMiningDifficultyAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/poktroll.tokenomics.Query/RelayMiningDifficultyAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).RelayMiningDifficultyAll(ctx, req.(*QueryAllRelayMiningDifficultyRequest)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "poktroll.tokenomics.Query", HandlerType: (*QueryServer)(nil), @@ -470,14 +214,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "RelayMiningDifficulty", - Handler: _Query_RelayMiningDifficulty_Handler, - }, - { - MethodName: "RelayMiningDifficultyAll", - Handler: _Query_RelayMiningDifficultyAll_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "poktroll/tokenomics/query.proto", @@ -539,153 +275,6 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryGetRelayMiningDifficultyRequest) 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 *QueryGetRelayMiningDifficultyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetRelayMiningDifficultyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ServiceId) > 0 { - i -= len(m.ServiceId) - copy(dAtA[i:], m.ServiceId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGetRelayMiningDifficultyResponse) 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 *QueryGetRelayMiningDifficultyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGetRelayMiningDifficultyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.RelayMiningDifficulty.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAllRelayMiningDifficultyRequest) 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 *QueryAllRelayMiningDifficultyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllRelayMiningDifficultyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllRelayMiningDifficultyResponse) 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 *QueryAllRelayMiningDifficultyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllRelayMiningDifficultyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.RelayMiningDifficulty) > 0 { - for iNdEx := len(m.RelayMiningDifficulty) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RelayMiningDifficulty[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -717,64 +306,8 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryGetRelayMiningDifficultyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGetRelayMiningDifficultyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.RelayMiningDifficulty.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAllRelayMiningDifficultyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllRelayMiningDifficultyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.RelayMiningDifficulty) > 0 { - for _, e := range m.RelayMiningDifficulty { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -912,377 +445,6 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryGetRelayMiningDifficultyRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGetRelayMiningDifficultyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGetRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RelayMiningDifficulty.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllRelayMiningDifficultyRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRelayMiningDifficultyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllRelayMiningDifficultyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRelayMiningDifficultyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RelayMiningDifficulty", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RelayMiningDifficulty = append(m.RelayMiningDifficulty, RelayMiningDifficulty{}) - if err := m.RelayMiningDifficulty[len(m.RelayMiningDifficulty)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/tokenomics/types/query.pb.gw.go b/x/tokenomics/types/query.pb.gw.go index 15d7f5446..08c31f3c5 100644 --- a/x/tokenomics/types/query.pb.gw.go +++ b/x/tokenomics/types/query.pb.gw.go @@ -51,96 +51,6 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -func request_Query_RelayMiningDifficulty_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetRelayMiningDifficultyRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["serviceId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "serviceId") - } - - protoReq.ServiceId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "serviceId", err) - } - - msg, err := client.RelayMiningDifficulty(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_RelayMiningDifficulty_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetRelayMiningDifficultyRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["serviceId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "serviceId") - } - - protoReq.ServiceId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "serviceId", err) - } - - msg, err := server.RelayMiningDifficulty(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_RelayMiningDifficultyAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_RelayMiningDifficultyAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRelayMiningDifficultyRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RelayMiningDifficultyAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RelayMiningDifficultyAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_RelayMiningDifficultyAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRelayMiningDifficultyRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RelayMiningDifficultyAll_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RelayMiningDifficultyAll(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -170,52 +80,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_RelayMiningDifficulty_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_RelayMiningDifficulty_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RelayMiningDifficulty_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RelayMiningDifficultyAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_RelayMiningDifficultyAll_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RelayMiningDifficultyAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -277,61 +141,13 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_RelayMiningDifficulty_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_RelayMiningDifficulty_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RelayMiningDifficulty_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_RelayMiningDifficultyAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_RelayMiningDifficultyAll_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_RelayMiningDifficultyAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "tokenomics", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_RelayMiningDifficulty_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"pokt-network", "poktroll", "tokenomics", "relay_mining_difficulty", "serviceId"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_RelayMiningDifficultyAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "tokenomics", "relay_mining_difficulty"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_RelayMiningDifficulty_0 = runtime.ForwardResponseMessage - - forward_Query_RelayMiningDifficultyAll_0 = runtime.ForwardResponseMessage )