From 879401e18eb73b944f26d047a9559b3a83ac9259 Mon Sep 17 00:00:00 2001 From: Redouane Lakrache Date: Thu, 10 Oct 2024 05:08:19 +0200 Subject: [PATCH] [DifficultyHash] Prepare for difficulty multiplier usage (#836) ## Summary This PR prepares for claimed amount calculation to use the `RelayDifficultyMultiplier`. * It removes the `RelayDifficultyTargetHash` `proof` param. * Replace `prooftypes.DefaultRelayDifficultyTargetHash` occurrences with `protocol.BaseRelayDifficultyHashBz`. * Moves the `RleayMiningDifficulty` logic to the `service` module due to cyclic dependencies. * Rename `num_compute_units` to `num_claimed_compute_units` and add `num_estimated_compute_units` and `claimed_amount_upokt` * Remove the no longer used tokenomics querier to retrieve a service difficulty target hash. The PR is only renaming and moving of files most (~13200LOC) changes are auto-generated code. ## Type of change Select one or more from the following: - [ ] New feature, functionality or library - [x] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [ ] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [x] **Unit Tests**: `make go_develop_and_test` - [x] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [ ] I have left TODOs throughout the codebase, if applicable --- api/poktroll/proof/event.pulsar.go | 1048 ++++++-- api/poktroll/proof/params.pulsar.go | 174 +- api/poktroll/service/event.pulsar.go | 842 ++++++ api/poktroll/service/genesis.pulsar.go | 212 +- api/poktroll/service/query.pulsar.go | 2269 ++++++++++++++++- api/poktroll/service/query_grpc.pb.go | 84 +- .../service/relay_mining_difficulty.pulsar.go | 775 ++++++ api/poktroll/tokenomics/event.pulsar.go | 1505 ++++------- api/poktroll/tokenomics/genesis.pulsar.go | 215 +- api/poktroll/tokenomics/query.pulsar.go | 2235 +--------------- api/poktroll/tokenomics/query_grpc.pb.go | 80 +- docusaurus/docs/protocol/governance/params.md | 6 +- e2e/tests/0_settlement.feature | 2 - e2e/tests/parse_params_test.go | 3 - e2e/tests/session.feature | 1 - e2e/tests/session_steps_test.go | 3 +- e2e/tests/update_params_test.go | 6 - pkg/client/interface.go | 16 +- pkg/client/query/servicequerier.go | 17 + pkg/client/query/tokenomicsquerier.go | 55 - pkg/deps/config/suppliers.go | 18 - pkg/relayer/cmd/cmd.go | 3 +- pkg/relayer/miner/miner.go | 13 +- pkg/relayer/miner/miner_test.go | 4 +- pkg/relayer/session/proof.go | 2 +- pkg/relayer/session/session.go | 4 - pkg/relayer/session/session_test.go | 2 - proto/poktroll/proof/event.proto | 17 +- proto/poktroll/proof/params.proto | 4 - proto/poktroll/service/event.proto | 17 + proto/poktroll/service/genesis.proto | 2 + proto/poktroll/service/query.proto | 26 + .../relay_mining_difficulty.proto | 4 +- proto/poktroll/tokenomics/event.proto | 30 +- proto/poktroll/tokenomics/genesis.proto | 6 +- proto/poktroll/tokenomics/query.proto | 31 - .../relay_mining_difficulty_test.go | 11 +- .../relay_mining_integration_test.go | 4 +- testutil/integration/suites/param_configs.go | 1 - testutil/keeper/tokenomics.go | 10 +- .../testqueryclients/servicequerier.go | 43 + .../testqueryclients/tokenomicsquerier.go | 66 - x/proof/keeper/msg_server_create_claim.go | 16 +- .../keeper/msg_server_create_claim_test.go | 34 +- x/proof/keeper/msg_server_submit_proof.go | 32 +- .../keeper/msg_server_submit_proof_test.go | 11 +- x/proof/keeper/msg_server_update_param.go | 7 - .../keeper/msg_server_update_param_test.go | 28 - x/proof/keeper/msg_update_params_test.go | 5 +- x/proof/keeper/params_test.go | 29 - x/proof/keeper/proof_validation.go | 15 +- x/proof/keeper/proof_validation_test.go | 28 +- x/proof/types/claim.go | 4 +- x/proof/types/event.pb.go | 542 +++- x/proof/types/expected_keepers.go | 3 + x/proof/types/message_update_param.go | 14 - x/proof/types/message_update_param_test.go | 8 +- x/proof/types/params.go | 41 - x/proof/types/params.pb.go | 114 +- .../keeper/query_relay_mining_difficulty.go | 2 +- .../query_relay_mining_difficulty_test.go | 6 +- .../keeper/relay_mining_difficulty.go | 2 +- .../keeper/relay_mining_difficulty_test.go | 10 +- .../keeper/scale_difficulty_test.go | 0 .../keeper/update_relay_mining_difficulty.go | 165 ++ .../update_relay_mining_difficulty_test.go | 40 +- x/service/module/genesis.go | 5 + x/service/module/genesis_test.go | 10 + x/service/types/errors.go | 31 +- x/service/types/event.pb.go | 495 ++++ x/service/types/genesis.go | 38 +- x/service/types/genesis.pb.go | 96 +- x/service/types/genesis_test.go | 23 + .../types/key_relay_mining_difficulty.go | 0 x/service/types/query.pb.go | 1089 +++++++- x/service/types/query.pb.gw.go | 184 ++ .../types/relay_mining_difficulty.pb.go | 49 +- .../keeper_settle_pending_claims_test.go | 26 +- x/tokenomics/keeper/settle_pending_claims.go | 29 +- x/tokenomics/keeper/token_logic_modules.go | 37 +- .../keeper/update_relay_mining_difficulty.go | 158 +- x/tokenomics/module/genesis.go | 5 - x/tokenomics/module/genesis_test.go | 10 - x/tokenomics/types/errors.go | 25 +- x/tokenomics/types/event.pb.go | 578 ++--- x/tokenomics/types/expected_keepers.go | 3 + x/tokenomics/types/genesis.go | 11 - x/tokenomics/types/genesis.pb.go | 89 +- x/tokenomics/types/genesis_test.go | 22 - x/tokenomics/types/query.pb.go | 884 +------ x/tokenomics/types/query.pb.gw.go | 184 -- x/tokenomics/types/tx.pb.go | 1 - 92 files changed, 8676 insertions(+), 6428 deletions(-) create mode 100644 api/poktroll/service/event.pulsar.go create mode 100644 api/poktroll/service/relay_mining_difficulty.pulsar.go delete mode 100644 pkg/client/query/tokenomicsquerier.go create mode 100644 proto/poktroll/service/event.proto rename proto/poktroll/{tokenomics => service}/relay_mining_difficulty.proto (92%) rename tests/integration/{tokenomics => service}/relay_mining_difficulty_test.go (94%) delete mode 100644 testutil/testclient/testqueryclients/tokenomicsquerier.go rename x/{tokenomics => service}/keeper/query_relay_mining_difficulty.go (97%) rename x/{tokenomics => service}/keeper/query_relay_mining_difficulty_test.go (95%) rename x/{tokenomics => service}/keeper/relay_mining_difficulty.go (97%) rename x/{tokenomics => service}/keeper/relay_mining_difficulty_test.go (85%) rename x/{tokenomics => service}/keeper/scale_difficulty_test.go (100%) create mode 100644 x/service/keeper/update_relay_mining_difficulty.go rename x/{tokenomics => service}/keeper/update_relay_mining_difficulty_test.go (87%) create mode 100644 x/service/types/event.pb.go rename x/{tokenomics => service}/types/key_relay_mining_difficulty.go (100%) rename x/{tokenomics => service}/types/relay_mining_difficulty.pb.go (83%) diff --git a/api/poktroll/proof/event.pulsar.go b/api/poktroll/proof/event.pulsar.go index 50fdd4646..be2eeaf14 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_amount_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_amount_upokt = md_EventClaimCreated.Fields().ByName("claimed_amount_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.ClaimedAmountUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + if !f(fd_EventClaimCreated_claimed_amount_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_amount_upokt": + return x.ClaimedAmountUpokt != 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + value := x.ClaimedAmountUpokt + 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + if x.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.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_amount_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.ClaimedAmountUpokt != nil { + l = options.Size(x.ClaimedAmountUpokt) + 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.ClaimedAmountUpokt != nil { + encoded, err := options.Marshal(x.ClaimedAmountUpokt) + 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,11 @@ 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 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 @@ -504,11 +577,66 @@ func (x *fastReflection_EventClaimCreated) 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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); 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_amount_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_amount_upokt = md_EventClaimUpdated.Fields().ByName("claimed_amount_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.ClaimedAmountUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + if !f(fd_EventClaimUpdated_claimed_amount_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_amount_upokt": + return x.ClaimedAmountUpokt != 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + value := x.ClaimedAmountUpokt + 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + if x.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.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_amount_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.ClaimedAmountUpokt != nil { + l = options.Size(x.ClaimedAmountUpokt) + 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.ClaimedAmountUpokt != nil { + encoded, err := options.Marshal(x.ClaimedAmountUpokt) + 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,49 @@ 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 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 + } } - x.NumComputeUnits = 0 + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -1035,11 +1273,28 @@ func (x *fastReflection_EventClaimUpdated) 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.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); 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_amount_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_amount_upokt = md_EventProofSubmitted.Fields().ByName("claimed_amount_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.ClaimedAmountUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + if !f(fd_EventProofSubmitted_claimed_amount_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_amount_upokt": + return x.ClaimedAmountUpokt != 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + value := x.ClaimedAmountUpokt + 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + if x.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.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_amount_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.ClaimedAmountUpokt != nil { + l = options.Size(x.ClaimedAmountUpokt) + 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.ClaimedAmountUpokt != nil { + encoded, err := options.Marshal(x.ClaimedAmountUpokt) + 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 + } } - x.NumComputeUnits = 0 + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + } + 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.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); 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_amount_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_amount_upokt = md_EventProofUpdated.Fields().ByName("claimed_amount_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.ClaimedAmountUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + if !f(fd_EventProofUpdated_claimed_amount_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_amount_upokt": + return x.ClaimedAmountUpokt != 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + value := x.ClaimedAmountUpokt + 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + if x.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.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_amount_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.ClaimedAmountUpokt != nil { + l = options.Size(x.ClaimedAmountUpokt) + 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.ClaimedAmountUpokt != nil { + encoded, err := options.Marshal(x.ClaimedAmountUpokt) + 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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); 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"` + ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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.NumClaimedComputeUnits + } + return 0 +} + +func (x *EventClaimCreated) GetNumEstimatedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumEstimatedComputeUnits } return 0 } +func (x *EventClaimCreated) GetClaimedAmountUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedAmountUpokt + } + 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"` + ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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.NumClaimedComputeUnits + } + return 0 +} + +func (x *EventClaimUpdated) GetNumEstimatedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumEstimatedComputeUnits } return 0 } +func (x *EventClaimUpdated) GetClaimedAmountUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedAmountUpokt + } + 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"` + ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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.NumClaimedComputeUnits + } + return 0 +} + +func (x *EventProofSubmitted) GetNumEstimatedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumEstimatedComputeUnits } return 0 } +func (x *EventProofSubmitted) GetClaimedAmountUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedAmountUpokt + } + 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"` + ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt,omitempty"` } func (x *EventProofUpdated) Reset() { @@ -2523,88 +3082,160 @@ func (x *EventProofUpdated) GetNumRelays() uint64 { return 0 } -func (x *EventProofUpdated) GetNumComputeUnits() uint64 { +func (x *EventProofUpdated) GetNumClaimedComputeUnits() uint64 { if x != nil { - return x.NumComputeUnits + return x.NumClaimedComputeUnits } return 0 } +func (x *EventProofUpdated) GetNumEstimatedComputeUnits() uint64 { + if x != nil { + return x.NumEstimatedComputeUnits + } + return 0 +} + +func (x *EventProofUpdated) GetClaimedAmountUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedAmountUpokt + } + 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, - 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, + 0x6f, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9b, + 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, 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, - 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, + 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, 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 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, 0x18, + 0xea, 0xde, 0x1f, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, + 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0x9b, 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, 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, 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 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, 0x18, 0xea, 0xde, + 0x1f, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0xd5, 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, 0x65, 0x0a, 0x14, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 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, 0x18, 0xea, 0xde, 0x1f, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, + 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x6f, + 0x6b, 0x74, 0x22, 0xd3, 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, 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 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, 0x18, 0xea, 0xde, 0x1f, 0x14, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, + 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 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 +3257,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_amount_upokt:type_name -> cosmos.base.v1beta1.Coin + 4, // 2: poktroll.proof.EventClaimUpdated.claim:type_name -> poktroll.proof.Claim + 5, // 3: poktroll.proof.EventClaimUpdated.claimed_amount_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_amount_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_amount_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/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..ba6a6bea4 --- /dev/null +++ b/api/poktroll/service/relay_mining_difficulty.pulsar.go @@ -0,0 +1,775 @@ +// 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. +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/tokenomics/event.pulsar.go b/api/poktroll/tokenomics/event.pulsar.go index f5d74bcf5..f69665680 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_amount_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_amount_upokt = md_EventClaimExpired.Fields().ByName("claimed_amount_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.ClaimedAmountUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + if !f(fd_EventClaimExpired_claimed_amount_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_amount_upokt": + return x.ClaimedAmountUpokt != 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + value := x.ClaimedAmountUpokt + 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + if x.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.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_amount_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.ClaimedAmountUpokt != nil { + l = options.Size(x.ClaimedAmountUpokt) + 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.ClaimedAmountUpokt != nil { + encoded, err := options.Marshal(x.ClaimedAmountUpokt) + 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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); 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_amount_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_amount_upokt = md_EventClaimSettled.Fields().ByName("claimed_amount_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.ClaimedAmountUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + if !f(fd_EventClaimSettled_claimed_amount_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_amount_upokt": + return x.ClaimedAmountUpokt != 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_amount_upokt": + x.ClaimedAmountUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) @@ -767,613 +918,25 @@ func (x *fastReflection_EventClaimSettled) Get(descriptor protoreflect.FieldDesc 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 + 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.EventRelayMiningDifficultyUpdated.new_num_relays_ema": - value := x.NewNumRelaysEma + case "poktroll.tokenomics.EventClaimSettled.num_claimed_compute_units": + value := x.NumClaimedComputeUnits return protoreflect.ValueOfUint64(value) + case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": + value := x.NumEstimatedComputeUnits + return protoreflect.ValueOfUint64(value) + case "poktroll.tokenomics.EventClaimSettled.claimed_amount_upokt": + value := x.ClaimedAmountUpokt + 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_amount_upokt": + x.ClaimedAmountUpokt = 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_amount_upokt": + if x.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.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.EventRelayMiningDifficultyUpdated.new_num_relays_ema": + case "poktroll.tokenomics.EventClaimSettled.num_claimed_compute_units": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": + return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.tokenomics.EventClaimSettled.claimed_amount_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.NumClaimedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumClaimedComputeUnits)) } - if x.PrevNumRelaysEma != 0 { - n += 1 + runtime.Sov(uint64(x.PrevNumRelaysEma)) + if x.NumEstimatedComputeUnits != 0 { + n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) } - if x.NewNumRelaysEma != 0 { - n += 1 + runtime.Sov(uint64(x.NewNumRelaysEma)) + if x.ClaimedAmountUpokt != nil { + l = options.Size(x.ClaimedAmountUpokt) + 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.ClaimedAmountUpokt != nil { + encoded, err := options.Marshal(x.ClaimedAmountUpokt) + 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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + x.ClaimedAmountUpokt = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); 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 amount of uPOKT 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. + ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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) GetClaimedAmountUpokt() *v1beta1.Coin { + if x != nil { + return x.ClaimedAmountUpokt + } + 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 amount of uPOKT 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. + ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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) GetClaimedAmountUpokt() *v1beta1.Coin { if x != nil { - return x.NewNumRelaysEma + return x.ClaimedAmountUpokt } - 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, 0x8b, 0x04, 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,104 @@ 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, - 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, + 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, + 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 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, 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, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, 0xea, 0xde, 0x1f, 0x14, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, + 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0x87, 0x04, 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, 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 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, 0x18, 0xea, 0xde, 0x1f, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 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 +3113,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_amount_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_amount_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 +3172,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 +3183,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 +3202,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/protocol/governance/params.md b/docusaurus/docs/protocol/governance/params.md index 37400c7e4..d57425768 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) @@ -35,8 +37,8 @@ Please follow the instructions in [this guide](../../develop/developer_guide/add |Module | Field Type | Field Name |Comment | -|-------|------------|------------|--------|| `application` | `uint64 ` | `max_delegated_gateways` | max_delegated_gateways defines the maximum number of gateways that a single application can delegate to. This is used to prevent performance issues in case the relay ring signature becomes too large. | -| `proof ` | `bytes ` | `relay_difficulty_target_hash` | 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. | +|-------|------------|------------|--------| +| `application` | `uint64 ` | `max_delegated_gateways` | max_delegated_gateways defines the maximum number of gateways that a single application can delegate to. This is used to prevent performance issues in case the relay ring signature becomes too large. | | `proof ` | `float ` | `proof_request_probability` | 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. | | `shared ` | `uint64 ` | `num_blocks_per_session` | num_blocks_per_session is the number of blocks between the session start & end heights. | | `shared ` | `uint64 ` | `grace_period_end_offset_blocks` | grace_period_end_offset_blocks is the number of blocks, after the session end height, during which the supplier can still service payable relays. Suppliers will need to recreate a claim for the previous session (if already created) to get paid for the additional relays. | 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..ea447957b 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: 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/pkg/client/interface.go b/pkg/client/interface.go index 502773709..fd294b8e8 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) + GetServiceRelayDifficultyTargetHash(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..af0ec64e9 100644 --- a/pkg/client/query/servicequerier.go +++ b/pkg/client/query/servicequerier.go @@ -60,3 +60,20 @@ func (servq *serviceQuerier) GetService( } return res.Service, nil } + +// GetServiceRelayDifficultyTargetHash queries the onchain data for +// the relay mining difficulty associated with the given service. +func (servq *serviceQuerier) GetServiceRelayDifficultyTargetHash( + ctx context.Context, + serviceId string, +) (servicetypes.RelayMiningDifficulty, error) { + req := &servicetypes.QueryGetRelayMiningDifficultyRequest{ + ServiceId: serviceId, + } + + res, err := servq.serviceQuerier.RelayMiningDifficulty(ctx, req) + 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/miner.go b/pkg/relayer/miner/miner.go index f22a85760..8205ae5f7 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,11 @@ 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.GetServiceRelayDifficultyTargetHash(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 protocol.BaseRelayDifficultyHashBz, nil } return serviceRelayDifficulty.GetTargetHash(), nil diff --git a/pkg/relayer/miner/miner_test.go b/pkg/relayer/miner/miner_test.go index 01a67c37c..fc0df6b6c 100644 --- a/pkg/relayer/miner/miner_test.go +++ b/pkg/relayer/miner/miner_test.go @@ -49,9 +49,9 @@ func TestMiner_MinedRelays(t *testing.T) { 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(proofQueryClientMock, serviceQueryClientMock) mnr, err := miner.NewMiner(deps) require.NoError(t, err) diff --git a/pkg/relayer/session/proof.go b/pkg/relayer/session/proof.go index 1b97e838e..5bb965f34 100644 --- a/pkg/relayer/session/proof.go +++ b/pkg/relayer/session/proof.go @@ -278,7 +278,7 @@ func (rs *relayerSessionsManager) isProofRequired( claim := claimFromSessionTree(sessionTree) // Get the number of compute units accumulated through the given session. - numClaimComputeUnits, err := claim.GetNumComputeUnits() + numClaimComputeUnits, err := claim.GetNumClaimedComputeUnits() 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..5fccd391b 100644 --- a/pkg/relayer/session/session_test.go +++ b/pkg/relayer/session/session_test.go @@ -313,7 +313,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 +322,6 @@ func setupDependencies( sharedQueryClientMock, serviceQueryClientMock, proofQueryClientMock, - tokenomicsQueryClient, bankQueryClient, ) storesDirectoryOpt := testrelayer.WithTempStoresDirectory(t) diff --git a/proto/poktroll/proof/event.proto b/proto/poktroll/proof/event.proto index c1a53ceb8..303e684a9 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_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_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_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_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_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_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_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_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/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 92% rename from proto/poktroll/tokenomics/relay_mining_difficulty.proto rename to proto/poktroll/service/relay_mining_difficulty.proto index 36a671d0a..b994c5db5 100644 --- a/proto/poktroll/tokenomics/relay_mining_difficulty.proto +++ b/proto/poktroll/service/relay_mining_difficulty.proto @@ -1,7 +1,7 @@ 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"; diff --git a/proto/poktroll/tokenomics/event.proto b/proto/poktroll/tokenomics/event.proto index b16f7f001..18dc68ea2 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 amount of uPOKT 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_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_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 amount of uPOKT 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_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_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/tokenomics/relay_mining_difficulty_test.go b/tests/integration/service/relay_mining_difficulty_test.go similarity index 94% rename from tests/integration/tokenomics/relay_mining_difficulty_test.go rename to tests/integration/service/relay_mining_difficulty_test.go index eb6ad935c..f3048fed4 100644 --- a/tests/integration/tokenomics/relay_mining_difficulty_test.go +++ b/tests/integration/service/relay_mining_difficulty_test.go @@ -3,7 +3,6 @@ package integration_test import ( "context" "testing" - "time" "github.com/pokt-network/smt" "github.com/pokt-network/smt/kvstore/pebble" @@ -16,10 +15,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() { @@ -91,14 +90,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) diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index 9cf1d21a6..3b296b298 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -15,9 +15,9 @@ import ( "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" + 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 ( @@ -140,7 +140,7 @@ func prepareRealClaim( supplier *sharedtypes.Supplier, session *sessiontypes.Session, service *sharedtypes.Service, - relayMiningDifficulty *tokenomicstypes.RelayMiningDifficulty, + relayMiningDifficulty *servicetypes.RelayMiningDifficulty, ) *prooftypes.Claim { t.Helper() diff --git a/testutil/integration/suites/param_configs.go b/testutil/integration/suites/param_configs.go index ca8354fe7..0c884ffea 100644 --- a/testutil/integration/suites/param_configs.go +++ b/testutil/integration/suites/param_configs.go @@ -196,7 +196,6 @@ var ( QueryParamsResponse: prooftypes.QueryParamsResponse{}, }, ValidParams: prooftypes.Params{ - RelayDifficultyTargetHash: ValidRelayDifficultyTargetHash, ProofRequestProbability: 0.1, ProofRequirementThreshold: &ValidProofRequirementThresholdCoin, ProofMissingPenalty: &ValidProofMissingPenaltyCoin, diff --git a/testutil/keeper/tokenomics.go b/testutil/keeper/tokenomics.go index 610824cee..e3bf52440 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. @@ -221,6 +223,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), @@ -236,8 +244,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) diff --git a/testutil/testclient/testqueryclients/servicequerier.go b/testutil/testclient/testqueryclients/servicequerier.go index 0557078c0..d68c2ea3c 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().GetServiceRelayDifficultyTargetHash(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/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..b7f90fa36 100644 --- a/x/proof/keeper/msg_server_submit_proof.go +++ b/x/proof/keeper/msg_server_submit_proof.go @@ -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,7 +120,7 @@ func (k msgServer) SubmitProof( if err != nil { return nil, status.Error(codes.Internal, types.ErrProofInvalidClaimRootHash.Wrap(err.Error()).Error()) } - numComputeUnits, err = claim.GetNumComputeUnits() + numClaimComputeUnits, err = claim.GetNumClaimedComputeUnits() if err != nil { return nil, status.Error(codes.Internal, types.ErrProofInvalidClaimRootHash.Wrap(err.Error()).Error()) } @@ -139,19 +139,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 }, ) } @@ -225,7 +227,7 @@ func (k Keeper) ProofRequirementForClaim(ctx context.Context, claim *types.Claim // 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() + numClaimComputeUnits, err = claim.GetNumClaimedComputeUnits() 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..d98db8206 100644 --- a/x/proof/keeper/msg_server_update_param.go +++ b/x/proof/keeper/msg_server_update_param.go @@ -23,13 +23,6 @@ func (k msgServer) UpdateParam( 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 { diff --git a/x/proof/keeper/msg_server_update_param_test.go b/x/proof/keeper/msg_server_update_param_test.go index 52078f52a..ba3a39c31 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 diff --git a/x/proof/keeper/msg_update_params_test.go b/x/proof/keeper/msg_update_params_test.go index f50570c46..2c6739855 100644 --- a/x/proof/keeper/msg_update_params_test.go +++ b/x/proof/keeper/msg_update_params_test.go @@ -42,9 +42,8 @@ func TestMsgUpdateParams(t *testing.T) { params: &types.MsgUpdateParams{ Authority: k.GetAuthority(), Params: types.Params{ - ProofMissingPenalty: &types.DefaultProofMissingPenalty, - ProofSubmissionFee: &types.MinProofSubmissionFee, - RelayDifficultyTargetHash: types.DefaultRelayDifficultyTargetHash, + ProofMissingPenalty: &types.DefaultProofMissingPenalty, + ProofSubmissionFee: &types.MinProofSubmissionFee, }, }, shouldError: false, diff --git a/x/proof/keeper/params_test.go b/x/proof/keeper/params_test.go index 50370a3d2..128ada551 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 { 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..37b144d6d 100644 --- a/x/proof/types/claim.go +++ b/x/proof/types/claim.go @@ -7,9 +7,9 @@ import ( poktrand "github.com/pokt-network/poktroll/pkg/crypto/rand" ) -// 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() } diff --git a/x/proof/types/event.pb.go b/x/proof/types/event.pb.go index 2ef856138..6660aa44e 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"` + ClaimedAmountUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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) GetClaimedAmountUpokt() *types.Coin { + if m != nil { + return m.ClaimedAmountUpokt + } + 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"` + ClaimedAmountUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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) GetClaimedAmountUpokt() *types.Coin { + if m != nil { + return m.ClaimedAmountUpokt + } + 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"` + ClaimedAmountUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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) GetClaimedAmountUpokt() *types.Coin { + if m != nil { + return m.ClaimedAmountUpokt + } + 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"` + ClaimedAmountUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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) GetClaimedAmountUpokt() *types.Coin { + if m != nil { + return m.ClaimedAmountUpokt + } + 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, + // 456 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x41, 0x6b, 0xdb, 0x30, + 0x14, 0xc7, 0xe3, 0xa5, 0x29, 0x54, 0x83, 0xc2, 0xbc, 0x6e, 0xb8, 0x19, 0x93, 0xcb, 0x4e, 0xbd, + 0x54, 0xa2, 0x1b, 0xf4, 0xbe, 0x98, 0xde, 0x76, 0x18, 0x1e, 0x81, 0xb1, 0xc3, 0x82, 0xed, 0x68, + 0x99, 0x69, 0xa4, 0x67, 0x6c, 0xa9, 0x5b, 0xbf, 0xc5, 0xee, 0xfb, 0x42, 0x3b, 0x16, 0xc6, 0xa0, + 0x27, 0x33, 0x92, 0x9b, 0x3f, 0xc5, 0xd0, 0x53, 0x3c, 0x5a, 0xd3, 0xed, 0x92, 0x4b, 0x0e, 0x39, + 0x49, 0xfe, 0xff, 0xff, 0x4f, 0x92, 0xdf, 0x0f, 0x21, 0x32, 0x2c, 0xe0, 0x42, 0x97, 0x30, 0x9f, + 0xf3, 0xa2, 0x04, 0xf8, 0xc4, 0xc5, 0xa5, 0x50, 0x9a, 0x15, 0x25, 0x68, 0xf0, 0xf7, 0x5b, 0x8f, + 0xa1, 0x37, 0xa4, 0x19, 0x54, 0x12, 0x2a, 0x9e, 0x26, 0x95, 0xe0, 0x97, 0xa7, 0xa9, 0xd0, 0xc9, + 0x29, 0xcf, 0x20, 0x57, 0x2e, 0x3f, 0x3c, 0x98, 0xc1, 0x0c, 0x70, 0xca, 0xed, 0x6c, 0xa5, 0x76, + 0x77, 0xd0, 0x57, 0x85, 0xa8, 0x9c, 0xf7, 0xe2, 0x7b, 0x9f, 0x3c, 0x3a, 0xb7, 0x3b, 0x46, 0xf3, + 0x24, 0x97, 0x51, 0x29, 0x12, 0x2d, 0xa6, 0xfe, 0x19, 0x19, 0x64, 0xf6, 0x3b, 0xf0, 0x8e, 0xbc, + 0xe3, 0x87, 0x2f, 0x9f, 0xb0, 0xbb, 0xe7, 0x60, 0x18, 0x1e, 0xed, 0x35, 0x75, 0xe8, 0x72, 0xb1, + 0x1b, 0xfc, 0x13, 0x42, 0x94, 0x91, 0x93, 0x52, 0xcc, 0x93, 0xab, 0x2a, 0x78, 0x70, 0xe4, 0x1d, + 0xef, 0x8c, 0xf6, 0x9b, 0x3a, 0xbc, 0xa5, 0xc6, 0x7b, 0xca, 0xc8, 0x18, 0xa7, 0xfe, 0x7b, 0x72, + 0x68, 0x0d, 0xac, 0x15, 0xd3, 0x49, 0x06, 0xb2, 0x30, 0x5a, 0x4c, 0x8c, 0xca, 0x75, 0x15, 0xec, + 0x60, 0xf5, 0xf3, 0xa6, 0x0e, 0xff, 0x1d, 0x8a, 0x9f, 0x2a, 0x23, 0x23, 0xe7, 0x44, 0xce, 0x18, + 0x5b, 0xdd, 0xff, 0x48, 0x9e, 0xd9, 0x22, 0x51, 0xe9, 0x5c, 0xda, 0x3f, 0xea, 0xac, 0x3d, 0xc0, + 0xb5, 0xc3, 0xa6, 0x0e, 0xff, 0x17, 0x8b, 0x03, 0x65, 0xe4, 0x79, 0xeb, 0xdd, 0x59, 0x5f, 0x90, + 0x83, 0xf6, 0x40, 0x89, 0x04, 0xa3, 0xf4, 0xc4, 0xd8, 0x16, 0x05, 0xbb, 0xd8, 0xaf, 0x43, 0xe6, + 0x38, 0x31, 0xcb, 0x89, 0xad, 0x38, 0xb1, 0x08, 0x72, 0x35, 0x0a, 0x9a, 0x3a, 0xbc, 0xb7, 0x34, + 0xf6, 0x57, 0xea, 0x6b, 0x14, 0xc7, 0x56, 0xeb, 0xd0, 0x19, 0x17, 0xd3, 0x2d, 0x9d, 0x0d, 0xa2, + 0xf3, 0xab, 0x4f, 0x1e, 0x23, 0x9d, 0xb7, 0xb6, 0xed, 0xef, 0x4c, 0x2a, 0x73, 0xbd, 0x0e, 0x9f, + 0x33, 0x32, 0xc0, 0x00, 0xa2, 0xb9, 0xa7, 0x0e, 0xb7, 0x71, 0x75, 0x28, 0xc4, 0x6e, 0xe8, 0x70, + 0xed, 0x6f, 0xb9, 0xae, 0xc9, 0xf5, 0x67, 0x7b, 0xeb, 0xb0, 0xe1, 0xeb, 0xde, 0xba, 0x2d, 0xd5, + 0x8d, 0xa0, 0x3a, 0x7a, 0xf3, 0x63, 0x41, 0xbd, 0xeb, 0x05, 0xf5, 0x6e, 0x16, 0xd4, 0xfb, 0xbd, + 0xa0, 0xde, 0xb7, 0x25, 0xed, 0x5d, 0x2f, 0x69, 0xef, 0x66, 0x49, 0x7b, 0x1f, 0xd8, 0x2c, 0xd7, + 0x9f, 0x4d, 0xca, 0x32, 0x90, 0xdc, 0xc6, 0x4f, 0x94, 0xd0, 0x5f, 0xa0, 0xbc, 0xe0, 0x7f, 0xdf, + 0xce, 0xaf, 0xb7, 0x5f, 0xcf, 0x74, 0x17, 0x9f, 0xcf, 0x57, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x9b, 0x4e, 0x00, 0x80, 0xbe, 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.ClaimedAmountUpokt != nil { + { + size, err := m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + { + size, err := m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + { + size, err := m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + { + size, err := m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + l = m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + l = m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + l = m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + l = m.ClaimedAmountUpokt.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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + m.ClaimedAmountUpokt = &types.Coin{} + } + if err := m.ClaimedAmountUpokt.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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + m.ClaimedAmountUpokt = &types.Coin{} + } + if err := m.ClaimedAmountUpokt.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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + m.ClaimedAmountUpokt = &types.Coin{} + } + if err := m.ClaimedAmountUpokt.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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + m.ClaimedAmountUpokt = &types.Coin{} + } + if err := m.ClaimedAmountUpokt.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..b4ed1960d 100644 --- a/x/proof/types/message_update_param.go +++ b/x/proof/types/message_update_param.go @@ -49,8 +49,6 @@ 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() case ParamProofRequirementThreshold: @@ -64,18 +62,6 @@ func (msg *MsgUpdateParam) ValidateBasic() error { } } -// 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..470e95498 100644 --- a/x/proof/types/message_update_param_test.go +++ b/x/proof/types/message_update_param_test.go @@ -28,7 +28,7 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { name: "invalid: param name incorrect (non-existent)", msg: MsgUpdateParam{ Authority: sample.AccAddress(), - Name: "WRONG_relay_difficulty_target_hash", + Name: "non_existent", AsType: &MsgUpdateParam_AsInt64{AsInt64: 1}, }, @@ -37,7 +37,7 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { name: "invalid: incorrect param type", msg: MsgUpdateParam{ Authority: sample.AccAddress(), - Name: ParamRelayDifficultyTargetHash, + Name: ParamProofMissingPenalty, AsType: &MsgUpdateParam_AsString{AsString: "invalid"}, }, expectedErr: ErrProofParamInvalid, @@ -45,8 +45,8 @@ func TestMsgUpdateParam_ValidateBasic(t *testing.T) { 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..2a46bda77 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,26 +116,6 @@ func (params *Params) ValidateBasic() error { return nil } -// ValidateRelayDifficultyTargetHash validates the MinRelayDifficultyBits param. -// NB: The argument is an interface type to satisfy the ParamSetPair function signature. -func ValidateRelayDifficultyTargetHash(v interface{}) error { - relayDifficultyTargetHash, ok := v.([]byte) - if !ok { - return ErrProofParamInvalid.Wrapf("invalid parameter type: %T", v) - } - - if len(relayDifficultyTargetHash) != protocol.RelayHasherSize { - return ErrProofParamInvalid.Wrapf( - "invalid RelayDifficultyTargetHash: (%x); length wanted: %d; got: %d", - relayDifficultyTargetHash, - 32, - len(relayDifficultyTargetHash), - ) - } - - return nil -} - // ValidateProofRequestProbability validates the ProofRequestProbability param. // NB: The argument is an interface type to satisfy the ParamSetPair function signature. func ValidateProofRequestProbability(v interface{}) error { 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/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..f4aaf2a4e --- /dev/null +++ b/x/service/keeper/update_relay_mining_difficulty.go @@ -0,0 +1,165 @@ +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" + "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. +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 "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, + } + +} 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..b5e6797b8 100644 --- a/x/service/types/errors.go +++ b/x/service/types/errors.go @@ -6,19 +6,20 @@ 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") + 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") + 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..66017e75d 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{ 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/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..bb0b0d17b 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 @@ -45,7 +45,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 +99,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/tokenomics/keeper/keeper_settle_pending_claims_test.go b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go index 079e28e85..f2870c114 100644 --- a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go +++ b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go @@ -241,11 +241,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequiredAndNotProv sharedParams := s.keepers.SharedKeeper.GetParams(ctx) // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() require.NoError(t, err) // -1 to push threshold below s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits-1) + proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits-1) require.NoError(t, err) // Set the proof missing penalty to half the supplier's stake so it is not @@ -303,6 +303,7 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequiredAndNotProv 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 + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt // Confirm that a slashing event was emitted expectedSlashingEvents := testutilevents.FilterEvents[*tokenomicstypes.EventSupplierSlashed](t, events, "poktroll.tokenomics.EventSupplierSlashed") @@ -322,11 +323,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimSettled_ProofRequiredAndProvide sharedParams := s.keepers.SharedKeeper.GetParams(ctx) // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() require.NoError(t, err) // -1 to push threshold below s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits-1) + proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits-1) require.NoError(t, err) // Set the proof parameters such that s.claim requires a proof because: @@ -453,11 +454,11 @@ func (s *TestSuite) TestClaimSettlement_ClaimSettled_ProofRequiredAndProvided_Vi sharedParams := s.keepers.SharedKeeper.GetParams(ctx) // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() require.NoError(t, err) // +1 so its not required via probability - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits+1) + proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits+1) require.NoError(t, err) // Set the proof parameters such that s.claim requires a proof because: @@ -500,6 +501,7 @@ func (s *TestSuite) TestClaimSettlement_ClaimSettled_ProofRequiredAndProvided_Vi 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 + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt } func (s *TestSuite) TestSettlePendingClaims_Settles_WhenAProofIsNotRequired() { @@ -509,11 +511,11 @@ func (s *TestSuite) TestSettlePendingClaims_Settles_WhenAProofIsNotRequired() { sharedParams := s.keepers.SharedKeeper.GetParams(ctx) // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() require.NoError(t, err) // +1 to push threshold above s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits+1) + proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits+1) require.NoError(t, err) // Set the proof parameters such that s.claim DOES NOT require a proof because: @@ -581,11 +583,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimPendingAfterSettlement() { sharedParams := s.keepers.SharedKeeper.GetParams(ctx) // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() require.NoError(t, err) // +1 to push threshold above s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits+1) + proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits+1) require.NoError(t, err) // Set the proof parameters such that s.claim DOES NOT require a proof @@ -669,11 +671,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_SupplierUnstaked() { sharedParams := s.keepers.SharedKeeper.GetParams(ctx) // Retrieve the number of compute units in the claim - numComputeUnits, err := s.claim.GetNumComputeUnits() + numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() require.NoError(t, err) // -1 to push threshold below s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numComputeUnits-1) + proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits-1) require.NoError(t, err) // Set the proof parameters such that s.claim requires a proof because: diff --git a/x/tokenomics/keeper/settle_pending_claims.go b/x/tokenomics/keeper/settle_pending_claims.go index 321196f1d..c0f9917c8 100644 --- a/x/tokenomics/keeper/settle_pending_claims.go +++ b/x/tokenomics/keeper/settle_pending_claims.go @@ -66,9 +66,9 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( return settledResult, expiredResult, err } - // DEV_NOTE: We are assuming that (numRelays := numComputeUnits * service.ComputeUnitsPerRelay) + // DEV_NOTE: We are assuming that (numClaimComputeUnits := numComputeUnits * 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 } @@ -113,10 +113,11 @@ 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, + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt } if err = ctx.EventManager().EmitTypedEvent(&claimExpiredEvent); err != nil { return settledResult, expiredResult, err @@ -159,9 +160,10 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( } claimSettledEvent := tokenomicstypes.EventClaimSettled{ - Claim: &claim, - NumRelays: numClaimRelays, - NumComputeUnits: numClaimComputeUnits, + Claim: &claim, + NumRelays: numClaimRelays, + NumClaimedComputeUnits: numClaimComputeUnits, + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt ProofRequirement: proofRequirement, } @@ -170,10 +172,11 @@ 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, + // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt }); err != nil { return settledResult, expiredResult, err } diff --git a/x/tokenomics/keeper/token_logic_modules.go b/x/tokenomics/keeper/token_logic_modules.go index 4ff96e027..dd9058eec 100644 --- a/x/tokenomics/keeper/token_logic_modules.go +++ b/x/tokenomics/keeper/token_logic_modules.go @@ -16,13 +16,14 @@ 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 +101,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. @@ -177,7 +178,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) } @@ -265,16 +266,16 @@ func (k Keeper) ProcessTokenLogicModules( 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) + relayMiningDifficulty, found := k.serviceKeeper.GetRelayMiningDifficulty(ctx, service.Id) if !found { - relayMiningDifficulty = newDefaultRelayMiningDifficulty(ctx, logger, service.Id, numRelays) + relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(ctx, logger, service.Id, servicekeeper.TargetNumRelays) } // 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)) } @@ -304,7 +305,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") @@ -365,7 +366,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") @@ -382,16 +383,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)) @@ -417,24 +418,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)) @@ -469,7 +470,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, 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/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..24a5b1e9d 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 amount of uPOKT 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. + ClaimedAmountUpokt *types1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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) GetClaimedAmountUpokt() *types1.Coin { + if m != nil { + return m.ClaimedAmountUpokt + } + 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 amount of uPOKT 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. + ClaimedAmountUpokt *types1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_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) GetClaimedAmountUpokt() *types1.Coin { if m != nil { - return m.NewNumRelaysEma + return m.ClaimedAmountUpokt } - 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, + // 744 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0xcd, 0x53, 0xdb, 0x46, + 0x14, 0xb7, 0x5c, 0xc3, 0x0c, 0xdb, 0x62, 0x6c, 0xd5, 0x30, 0x86, 0x16, 0x89, 0x72, 0xe8, 0x50, + 0xa6, 0x48, 0x03, 0x74, 0x7a, 0xec, 0xd4, 0x36, 0xa6, 0xa3, 0x99, 0xc6, 0x76, 0xd6, 0x21, 0xc3, + 0xe4, 0x10, 0x45, 0x96, 0x1e, 0x46, 0xc1, 0xda, 0x55, 0x56, 0x2b, 0x07, 0x8e, 0x39, 0xe5, 0x90, + 0x4b, 0xfe, 0xa2, 0x9c, 0x73, 0xe4, 0xc8, 0xc9, 0x93, 0x31, 0x37, 0xff, 0x15, 0x99, 0x5d, 0xf9, + 0x8b, 0x8f, 0x98, 0x43, 0x72, 0xcc, 0xc5, 0x96, 0xdf, 0xef, 0x63, 0x77, 0xdf, 0xfb, 0x59, 0x8b, + 0xf4, 0x90, 0x9e, 0x71, 0x46, 0x3b, 0x1d, 0x93, 0xd3, 0x33, 0x20, 0x34, 0xf0, 0xdd, 0xc8, 0x84, + 0x2e, 0x10, 0x6e, 0x84, 0x8c, 0x72, 0xaa, 0xfe, 0x3c, 0x22, 0x18, 0x13, 0xc2, 0x9a, 0xe6, 0xd2, + 0x28, 0xa0, 0x91, 0xd9, 0x72, 0x22, 0x30, 0xbb, 0xbb, 0x2d, 0xe0, 0xce, 0xae, 0xe9, 0x52, 0x9f, + 0x24, 0xa2, 0xb5, 0x42, 0x9b, 0xb6, 0xa9, 0x7c, 0x34, 0xc5, 0xd3, 0xb0, 0xba, 0x36, 0x5e, 0x2b, + 0x64, 0x94, 0x9e, 0x98, 0xfc, 0x22, 0x84, 0x28, 0xc1, 0x36, 0xdf, 0x65, 0x50, 0xbe, 0x2a, 0x96, + 0xad, 0x74, 0x1c, 0x3f, 0xa8, 0x9e, 0x87, 0x3e, 0x03, 0x4f, 0xfd, 0x1b, 0xcd, 0xb9, 0xe2, 0x77, + 0x51, 0xd9, 0x50, 0xb6, 0x7e, 0xdc, 0x5b, 0x36, 0xc6, 0x9b, 0x91, 0x0e, 0x86, 0x24, 0x97, 0x17, + 0x06, 0x3d, 0x3d, 0xe1, 0xe1, 0xe4, 0x4b, 0x25, 0x28, 0x0f, 0xc2, 0xc2, 0xe1, 0x3e, 0x25, 0x36, + 0x03, 0x27, 0xa2, 0xa4, 0x98, 0xde, 0x50, 0xb6, 0xb2, 0x7b, 0xdb, 0xc6, 0x3d, 0x07, 0x32, 0x26, + 0xab, 0x4a, 0x09, 0x96, 0x8a, 0xf2, 0xf2, 0xa0, 0xa7, 0xdf, 0x35, 0xc2, 0x39, 0xb8, 0x45, 0x54, + 0x77, 0x10, 0x22, 0x71, 0x60, 0x33, 0xe8, 0x38, 0x17, 0x51, 0xf1, 0x87, 0x0d, 0x65, 0x2b, 0x53, + 0xce, 0x0e, 0x7a, 0xfa, 0x54, 0x15, 0x2f, 0x90, 0x38, 0xc0, 0xf2, 0x51, 0x3d, 0x46, 0xab, 0x02, + 0x90, 0x7b, 0x05, 0xcf, 0x76, 0x69, 0x10, 0xc6, 0x1c, 0xec, 0x98, 0xf8, 0x3c, 0x2a, 0x66, 0xa4, + 0x7a, 0x7d, 0xd0, 0xd3, 0xbf, 0x4c, 0xc2, 0x2b, 0x24, 0x0e, 0x2a, 0x09, 0x52, 0x49, 0x80, 0x23, + 0x51, 0x57, 0x9f, 0xa3, 0x5f, 0x84, 0x08, 0x22, 0xee, 0x07, 0x0e, 0xbf, 0xe3, 0x3d, 0x27, 0xbd, + 0xf5, 0x41, 0x4f, 0x9f, 0x45, 0xc3, 0x45, 0x12, 0x07, 0xd5, 0x11, 0x76, 0xc3, 0x1f, 0x50, 0x61, + 0xb4, 0x21, 0x27, 0xa0, 0x31, 0xe1, 0x76, 0x2c, 0xda, 0x59, 0x9c, 0x97, 0xf3, 0x59, 0x35, 0x92, + 0x5c, 0x18, 0x22, 0x17, 0xc6, 0x30, 0x17, 0x46, 0x85, 0xfa, 0xa4, 0x5c, 0x1c, 0xf4, 0xf4, 0x7b, + 0xa5, 0x58, 0x1d, 0x56, 0x4b, 0xb2, 0x78, 0x24, 0x6a, 0x9b, 0x6f, 0x6f, 0xa4, 0xa1, 0x09, 0x9c, + 0x77, 0xbe, 0x22, 0x0d, 0x2f, 0x51, 0x5e, 0x12, 0x6c, 0x06, 0xaf, 0x62, 0x9f, 0x41, 0x00, 0x84, + 0x0f, 0xd3, 0xf0, 0xfb, 0x6d, 0x8f, 0x86, 0xf8, 0xc4, 0x13, 0xde, 0x74, 0x12, 0xee, 0x98, 0xe0, + 0x5c, 0x78, 0x8b, 0xfe, 0x3d, 0x09, 0xdf, 0x38, 0x09, 0x6f, 0xd2, 0xe8, 0x57, 0x99, 0x84, 0x52, + 0x18, 0x76, 0x7c, 0x57, 0xfe, 0xe9, 0xea, 0x5d, 0x60, 0x11, 0xb0, 0xae, 0xef, 0x82, 0xa7, 0xfe, + 0x81, 0x72, 0xce, 0x04, 0xb2, 0x1d, 0xcf, 0x63, 0x32, 0x1f, 0x0b, 0x78, 0x69, 0xaa, 0x5e, 0xf2, + 0x3c, 0xa6, 0xfe, 0x85, 0x56, 0xa2, 0x58, 0xd4, 0x80, 0xd9, 0x34, 0x04, 0xe6, 0x70, 0xca, 0x12, + 0x41, 0x5a, 0x0a, 0x0a, 0x23, 0xb4, 0x3e, 0x04, 0xa5, 0xea, 0x1f, 0xb4, 0x08, 0xe7, 0x21, 0xb8, + 0xa2, 0x39, 0xad, 0x98, 0x11, 0x39, 0xd4, 0x59, 0x27, 0xc4, 0x3f, 0x8d, 0xf8, 0xe5, 0x98, 0x11, + 0xf5, 0x5f, 0x94, 0x85, 0x93, 0x13, 0x70, 0xb9, 0xdf, 0x85, 0xc4, 0x20, 0xf3, 0x90, 0xc1, 0xe2, + 0x58, 0x20, 0x1c, 0x36, 0x3f, 0x28, 0xa8, 0x20, 0x7b, 0xd0, 0x1c, 0xee, 0xaf, 0xd9, 0x71, 0xa2, + 0x53, 0xf0, 0x66, 0x1c, 0x48, 0x99, 0x71, 0xa0, 0x3f, 0x91, 0x2a, 0x47, 0x9e, 0xbc, 0x63, 0x93, + 0x58, 0x45, 0xb2, 0x05, 0x19, 0x9c, 0x13, 0xf3, 0x4e, 0x00, 0x19, 0xaa, 0x48, 0x2d, 0xa3, 0xa5, + 0x48, 0x2c, 0xe7, 0x93, 0xf6, 0x70, 0x5a, 0x0f, 0x37, 0x20, 0x3b, 0x52, 0x24, 0x93, 0xdc, 0x7e, + 0x81, 0x96, 0xef, 0x7d, 0xc1, 0xaa, 0xbf, 0xa1, 0xf5, 0xea, 0x71, 0xc3, 0xc2, 0xa5, 0x27, 0x56, + 0xbd, 0x66, 0xe3, 0x6a, 0xa9, 0x59, 0xaf, 0xd9, 0x47, 0xb5, 0x66, 0xa3, 0x5a, 0xb1, 0x0e, 0xad, + 0xea, 0x41, 0x2e, 0xa5, 0xe6, 0xd1, 0x62, 0x03, 0xd7, 0xeb, 0x87, 0xf6, 0x23, 0xab, 0xd9, 0xb4, + 0x6a, 0xff, 0xe5, 0x94, 0x49, 0xc9, 0xaa, 0x3d, 0x2d, 0xfd, 0x6f, 0x1d, 0xe4, 0xd2, 0xe5, 0xc7, + 0x1f, 0xfb, 0x9a, 0x72, 0xd9, 0xd7, 0x94, 0xab, 0xbe, 0xa6, 0x7c, 0xea, 0x6b, 0xca, 0xfb, 0x6b, + 0x2d, 0x75, 0x79, 0xad, 0xa5, 0xae, 0xae, 0xb5, 0xd4, 0xb3, 0xfd, 0xb6, 0xcf, 0x4f, 0xe3, 0x96, + 0xe1, 0xd2, 0xc0, 0x14, 0xa9, 0xda, 0x21, 0xc0, 0x5f, 0x53, 0x76, 0x66, 0x8e, 0x2f, 0xa4, 0xf3, + 0xe9, 0xeb, 0x4f, 0xde, 0x4b, 0xad, 0x79, 0x79, 0x31, 0xed, 0x7f, 0x0e, 0x00, 0x00, 0xff, 0xff, + 0x3e, 0x16, 0x9d, 0x3a, 0x22, 0x07, 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.ClaimedAmountUpokt != nil { + { + size, err := m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + { + size, err := m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + l = m.ClaimedAmountUpokt.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.ClaimedAmountUpokt != nil { + l = m.ClaimedAmountUpokt.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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + m.ClaimedAmountUpokt = &types1.Coin{} + } + if err := m.ClaimedAmountUpokt.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 ClaimedAmountUpokt", 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.ClaimedAmountUpokt == nil { + m.ClaimedAmountUpokt = &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.ClaimedAmountUpokt.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 6cb4318d9..084436e0e 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" ) @@ -84,6 +85,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 ) diff --git a/x/tokenomics/types/tx.pb.go b/x/tokenomics/types/tx.pb.go index e4fec264c..9f18a148c 100644 --- a/x/tokenomics/types/tx.pb.go +++ b/x/tokenomics/types/tx.pb.go @@ -125,7 +125,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