From bfcaff988506c17eddab6a0be94267ec09e82f6d Mon Sep 17 00:00:00 2001 From: Riccardo <9119016+RiccardoM@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:09:44 +0900 Subject: [PATCH] refactor!: update user preferences structure (#26) ## Description This PR updates the structure of the `UserPreferences` . Now users can no loger specify to trust all accredited or non accredited service. Instead, they are required to specify the list of services that they trust individually. Additionally, for each service they can specify a list of pools that they trust. This means, the following new use case is supported: > Alice wants to share the cryptoeconomic security provided by her restaked MILK to AVS 1 and AVS 3, but she wants to share the cryptoeconomic security provided by her restaked OSMO to AVS 3 and AVS 4 This means, different subsets of services can be trusted with different pools of tokens. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [x] included the necessary unit and integration [tests](https://github.com/milkyway-labs/milkyway/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --------- Co-authored-by: Hanjun Kim Co-authored-by: Alpo <62043214+AlpinYukseloglu@users.noreply.github.com> (cherry picked from commit 50af532e80818756b917558d5c24ab3c31c99729) --- proto/milkyway/restaking/v1/models.proto | 24 +- .../milkyway/rewards/{v2 => v1}/genesis.proto | 6 +- .../rewards/{v2 => v1}/messages.proto | 6 +- proto/milkyway/rewards/v1/models.proto | 232 +- .../milkyway/rewards/{v2 => v1}/params.proto | 2 +- proto/milkyway/rewards/{v2 => v1}/query.proto | 6 +- proto/milkyway/rewards/v2/models.proto | 270 -- utils/slices.go | 37 +- x/pools/keeper/pools.go | 5 + x/restaking/client/cli/tx.go | 34 +- x/restaking/client/cli/utils.go | 36 + x/restaking/keeper/alias_functions.go | 23 +- x/restaking/keeper/alias_functions_test.go | 38 +- x/restaking/keeper/genesis_test.go | 40 +- x/restaking/keeper/msg_server.go | 18 +- x/restaking/keeper/msg_server_test.go | 36 +- x/restaking/keeper/user_preferences_test.go | 66 +- x/restaking/migrations/v2/models.go | 7 + x/restaking/migrations/v2/models.pb.go | 2164 +++++++++++++++++ x/restaking/migrations/v2/store.go | 65 +- x/restaking/migrations/v2/store_test.go | 75 + x/restaking/simulation/utils.go | 15 +- x/restaking/types/expected_keepers.go | 1 + x/restaking/types/genesis_test.go | 18 +- x/restaking/types/messages_test.go | 20 +- x/restaking/types/models.go | 128 +- x/restaking/types/models.pb.go | 374 ++- x/restaking/types/models_test.go | 251 +- x/rewards/client/cli/utils_test.go | 24 +- x/rewards/keeper/allocation_test.go | 59 +- x/rewards/keeper/common_test.go | 11 +- x/rewards/keeper/grpc_query_test.go | 3 - x/rewards/keeper/hooks.go | 89 +- x/rewards/keeper/pool_service_shares.go | 61 - x/rewards/keeper/services_hooks.go | 4 +- x/rewards/migrations/v2/models.pb.go | 4 - x/rewards/types/codec.go | 4 +- x/rewards/types/expected_keepers.go | 1 + x/rewards/types/genesis.pb.go | 166 +- x/rewards/types/messages.pb.go | 232 +- x/rewards/types/models.pb.go | 362 +-- x/rewards/types/params.pb.go | 42 +- x/rewards/types/query.pb.go | 319 ++- x/rewards/types/query.pb.gw.go | 2 +- 44 files changed, 3941 insertions(+), 1439 deletions(-) rename proto/milkyway/rewards/{v2 => v1}/genesis.proto (98%) rename proto/milkyway/rewards/{v2 => v1}/messages.proto (98%) rename proto/milkyway/rewards/{v2 => v1}/params.proto (95%) rename proto/milkyway/rewards/{v2 => v1}/query.proto (98%) delete mode 100644 proto/milkyway/rewards/v2/models.proto create mode 100644 x/restaking/client/cli/utils.go create mode 100644 x/restaking/migrations/v2/models.go create mode 100644 x/restaking/migrations/v2/models.pb.go delete mode 100644 x/rewards/keeper/pool_service_shares.go diff --git a/proto/milkyway/restaking/v1/models.proto b/proto/milkyway/restaking/v1/models.proto index 5e5c0977b..481af703c 100644 --- a/proto/milkyway/restaking/v1/models.proto +++ b/proto/milkyway/restaking/v1/models.proto @@ -150,15 +150,21 @@ message DTDataList { // UserPreferences is a struct that contains a user's preferences for // restaking. message UserPreferences { - // TrustNonAccreditedServices tells whether the user trusts all non-accredited - // services present on the platform. - bool trust_non_accredited_services = 1; + // TrustedServices is a list of services that the user trusts + repeated TrustedServiceEntry trusted_services = 4 [ + (gogoproto.customname) = "TrustedServices", + (gogoproto.nullable) = false + ]; + + reserved 1 to 3; // trusted_non_accredited_services, trust_accredited_services, trusted_services_ids +} - // TrustAccreditedServices tells whether the user trusts all accredited - // services present on the platform. - bool trust_accredited_services = 2; +// TrustedServiceEntry is a struct that contains the ID of a service that the user trusts +// and the IDs of the pools that the user wants the service to access +message TrustedServiceEntry { + // ServiceID represents the ID of the service that the user trusts + uint32 service_id = 1 [(gogoproto.customname) = "ServiceID"]; - // TrustedServicesIDs is a list of service IDs that the user trusts (both - // accredited and non-accredited). - repeated uint32 trusted_services_ids = 3 [(gogoproto.customname) = "TrustedServicesIDs"]; + // PoolsIDs represents the IDs of the pools that the user wants the service with ServiceID to access + repeated uint32 pools_ids = 2 [(gogoproto.customname) = "PoolsIDs"]; } diff --git a/proto/milkyway/rewards/v2/genesis.proto b/proto/milkyway/rewards/v1/genesis.proto similarity index 98% rename from proto/milkyway/rewards/v2/genesis.proto rename to proto/milkyway/rewards/v1/genesis.proto index ed5ec3548..6abcbacd1 100644 --- a/proto/milkyway/rewards/v2/genesis.proto +++ b/proto/milkyway/rewards/v1/genesis.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package milkyway.rewards.v2; +package milkyway.rewards.v1; import "amino/amino.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -import "milkyway/rewards/v2/models.proto"; -import "milkyway/rewards/v2/params.proto"; +import "milkyway/rewards/v1/models.proto"; +import "milkyway/rewards/v1/params.proto"; option go_package = "github.com/milkyway-labs/milkyway/v7/x/rewards/types"; diff --git a/proto/milkyway/rewards/v2/messages.proto b/proto/milkyway/rewards/v1/messages.proto similarity index 98% rename from proto/milkyway/rewards/v2/messages.proto rename to proto/milkyway/rewards/v1/messages.proto index 705a43d58..c66a35ba1 100644 --- a/proto/milkyway/rewards/v2/messages.proto +++ b/proto/milkyway/rewards/v1/messages.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package milkyway.rewards.v2; +package milkyway.rewards.v1; import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; @@ -8,8 +8,8 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "milkyway/restaking/v1/models.proto"; -import "milkyway/rewards/v2/models.proto"; -import "milkyway/rewards/v2/params.proto"; +import "milkyway/rewards/v1/models.proto"; +import "milkyway/rewards/v1/params.proto"; option go_package = "github.com/milkyway-labs/milkyway/v7/x/rewards/types"; diff --git a/proto/milkyway/rewards/v1/models.proto b/proto/milkyway/rewards/v1/models.proto index e6b124b0d..205d3c9a1 100644 --- a/proto/milkyway/rewards/v1/models.proto +++ b/proto/milkyway/rewards/v1/models.proto @@ -1,13 +1,15 @@ syntax = "proto3"; package milkyway.rewards.v1; +import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; -import "milkyway/rewards/v2/models.proto"; +import "milkyway/restaking/v1/models.proto"; -option go_package = "github.com/milkyway-labs/milkyway/v7/x/rewards/migrations/v2"; +option go_package = "github.com/milkyway-labs/milkyway/v7/x/rewards/types"; option (gogoproto.goproto_getters_all) = false; // RewardsPlan represents a rewards allocation plan. @@ -25,10 +27,7 @@ message RewardsPlan { // AmountPerDay is the amount of rewards to be distributed, per day. // The rewards amount for every block will be calculated based on this. - repeated cosmos.base.v1beta1.Coin amount_per_day = 4 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.nullable) = false - ]; + cosmos.base.v1beta1.Coin amount_per_day = 11 [(gogoproto.nullable) = false]; // StartTime is the starting time of the plan. google.protobuf.Timestamp start_time = 5 [ @@ -48,11 +47,226 @@ message RewardsPlan { string rewards_pool = 7 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // PoolsDistribution is the rewards distribution parameters for pools. - milkyway.rewards.v2.Distribution pools_distribution = 8 [(gogoproto.nullable) = false]; + Distribution pools_distribution = 8 [(gogoproto.nullable) = false]; // OperatorsDistribution is the rewards distribution parameters for operators. - milkyway.rewards.v2.Distribution operators_distribution = 9 [(gogoproto.nullable) = false]; + Distribution operators_distribution = 9 [(gogoproto.nullable) = false]; // UsersDistribution is the rewards distribution parameters for users. - milkyway.rewards.v2.UsersDistribution users_distribution = 10 [(gogoproto.nullable) = false]; + UsersDistribution users_distribution = 10 [(gogoproto.nullable) = false]; + + reserved 4; // old amount_per_day +} + +// Distribution represents distribution parameters for restaking +// pools/operators. +message Distribution { + option (gogoproto.equal) = true; + + // DelegationType is the type of delegation target which this distribution + // parameters are for. It can be one of DELEGATION_TYPE_POOL and + // DELEGATION_TYPE_OPERATOR. + milkyway.restaking.v1.DelegationType delegation_type = 1; + + // Weight is the rewards distribution weight among other types of delegation + // targets. + uint32 weight = 2; + + // Type is one of basic/weighted/egalitarian distributions. + google.protobuf.Any type = 3 [(cosmos_proto.accepts_interface) = "milkyway.rewards.v1.DistributionType"]; +} + +// DistributionTypeBasic represents the simplest form of distribution. +// Rewards are allocated to entities based on their delegation values. +// For example, if there are three operators with delegation values of +// $1000, $1500, and $2000, their rewards will be distributed in a +// 2:3:4 ratio. +message DistributionTypeBasic { + option (cosmos_proto.implements_interface) = "milkyway.rewards.v1.DistributionType"; +} + +// DistributionTypeWeighted is a type of distribution where the reward +// weights for each entity are explicitly defined. Only the specified +// delegation targets will receive rewards. +message DistributionTypeWeighted { + option (cosmos_proto.implements_interface) = "milkyway.rewards.v1.DistributionType"; + + repeated DistributionWeight weights = 1 [(gogoproto.nullable) = false]; +} + +// DistributionWeight defines a delegation target and its assigned weight. +message DistributionWeight { + uint32 delegation_target_id = 1 [(gogoproto.customname) = "DelegationTargetID"]; + + uint32 weight = 2; +} + +// DistributionTypeEgalitarian is a distribution method where all entities +// receive an equal share of rewards(a.k.a. egalitarian method). +message DistributionTypeEgalitarian { + option (cosmos_proto.implements_interface) = "milkyway.rewards.v1.DistributionType"; +} + +// Distribution represents distribution parameters for delegators who directly +// staked their tokens to the service. +message UsersDistribution { + option (gogoproto.equal) = true; + + // Weight is the rewards distribution weight among other types of delegation + // targets. + uint32 weight = 1; + + // Type defines the rewards distribution method. Currently only the basic + // distribution is allowed. + google.protobuf.Any type = 2 [(cosmos_proto.accepts_interface) = "milkyway.rewards.v1.UsersDistributionType"]; +} + +// UsersDistributionTypeBasic represents the simplest form of distribution. +// Rewards are allocated to entities based on their delegation values. +// For example, if there are three users with delegation values of +// $1000, $1500, and $2000, their rewards will be distributed in a +// 2:3:4 ratio. +message UsersDistributionTypeBasic { + option (cosmos_proto.implements_interface) = "milkyway.rewards.v1.UsersDistributionType"; +} + +// HistoricalRewards represents historical rewards for a delegation target. +// Height is implicit within the store key. +// Cumulative reward ratio is the sum from the zeroeth period +// until this period of rewards / tokens, per the spec. +// The reference count indicates the number of objects +// which might need to reference this historical entry at any point. +// ReferenceCount = +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization +message HistoricalRewards { + repeated ServicePool cumulative_reward_ratios = 1 [ + (gogoproto.moretags) = "yaml:\"cumulative_reward_ratios\"", + (gogoproto.castrepeated) = "ServicePools", + (gogoproto.nullable) = false + ]; + uint32 reference_count = 2 [(gogoproto.moretags) = "yaml:\"reference_count\""]; +} + +// CurrentRewards represents current rewards and current +// period for a delegation target kept as a running counter and incremented +// each block as long as the delegation target's tokens remain constant. +message CurrentRewards { + repeated ServicePool rewards = 1 [ + (gogoproto.moretags) = "yaml:\"rewards\"", + (gogoproto.castrepeated) = "ServicePools", + (gogoproto.nullable) = false + ]; + uint64 period = 2; +} + +// OutstandingRewards represents outstanding (un-withdrawn) rewards +// for a delegation target inexpensive to track, allows simple sanity checks. +message OutstandingRewards { + repeated DecPool rewards = 1 [ + (gogoproto.moretags) = "yaml:\"rewards\"", + (gogoproto.castrepeated) = "DecPools", + (gogoproto.nullable) = false + ]; +} + +// AccumulatedCommission represents accumulated commission +// for a delegation target kept as a running counter, can be withdrawn at any +// time. +message AccumulatedCommission { + repeated DecPool commissions = 1 [ + (gogoproto.castrepeated) = "DecPools", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// DelegatorStartingInfo represents the starting info for a delegator reward +// period. It tracks the previous delegation target period, the delegation's +// amount of staking token, and the creation height (to check later on if any +// slashes have occurred). NOTE: Even though validators are slashed to whole +// staking tokens, the delegators within the validator may be left with less +// than a full token, thus sdk.Dec is used. +message DelegatorStartingInfo { + uint64 previous_period = 1 [(gogoproto.moretags) = "yaml:\"previous_period\""]; + repeated cosmos.base.v1beta1.DecCoin stakes = 2 [ + (gogoproto.moretags) = "yaml:\"stakes\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; + uint64 height = 3 [ + (gogoproto.moretags) = "yaml:\"creation_height\"", + (gogoproto.jsontag) = "creation_height" + ]; +} + +// DelegationDelegatorReward represents the properties of a delegator's +// delegation reward. The delegator address implicit in the within the +// query request. +message DelegationDelegatorReward { + milkyway.restaking.v1.DelegationType delegation_type = 1; + + uint32 delegation_target_id = 2 [(gogoproto.customname) = "DelegationTargetID"]; + + repeated DecPool reward = 3 [ + (gogoproto.castrepeated) = "DecPools", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// TODO: add SlashEvent + +// --------------------------------------------------------------------------- + +// PoolServiceTotalDelegatorShares represents the total delegator shares for a +// pool-service pair. +message PoolServiceTotalDelegatorShares { + uint32 pool_id = 1 [(gogoproto.customname) = "PoolID"]; + uint32 service_id = 2 [(gogoproto.customname) = "ServiceID"]; + repeated cosmos.base.v1beta1.DecCoin shares = 3 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; +} + +// --------------------------------------------------------------------------- + +// Types below are taken from Initia's modified version of x/distribution. +// See +// https://github.com/initia-labs/initia/blob/v0.2.10/proto/initia/distribution/v1/distribution.proto#L38-L56 + +// Pool is a Coins wrapper with denom which represents the rewards pool for the +// given denom. It is used to represent the rewards associated with the denom. +message Pool { + string denom = 1 [(gogoproto.moretags) = "yaml:\"denom\""]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.moretags) = "yaml:\"coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +// DecPool is a DecCoins wrapper with denom which represents the rewards pool +// for the given denom. It is used to represent the rewards associated with the +// denom. +message DecPool { + string denom = 1 [(gogoproto.moretags) = "yaml:\"denom\""]; + repeated cosmos.base.v1beta1.DecCoin dec_coins = 2 [ + (gogoproto.moretags) = "yaml:\"dec_coins\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false + ]; +} + +// ServicePool represents the rewards pool for a service. +message ServicePool { + uint32 service_id = 1 [(gogoproto.customname) = "ServiceID"]; + repeated DecPool dec_pools = 2 [ + (gogoproto.castrepeated) = "DecPools", + (gogoproto.nullable) = false + ]; } diff --git a/proto/milkyway/rewards/v2/params.proto b/proto/milkyway/rewards/v1/params.proto similarity index 95% rename from proto/milkyway/rewards/v2/params.proto rename to proto/milkyway/rewards/v1/params.proto index b7edaffed..df2a2fc8b 100644 --- a/proto/milkyway/rewards/v2/params.proto +++ b/proto/milkyway/rewards/v1/params.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package milkyway.rewards.v2; +package milkyway.rewards.v1; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; diff --git a/proto/milkyway/rewards/v2/query.proto b/proto/milkyway/rewards/v1/query.proto similarity index 98% rename from proto/milkyway/rewards/v2/query.proto rename to proto/milkyway/rewards/v1/query.proto index 9351a0724..96f8086fd 100644 --- a/proto/milkyway/rewards/v2/query.proto +++ b/proto/milkyway/rewards/v1/query.proto @@ -1,13 +1,13 @@ syntax = "proto3"; -package milkyway.rewards.v2; +package milkyway.rewards.v1; import "amino/amino.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "milkyway/rewards/v2/models.proto"; -import "milkyway/rewards/v2/params.proto"; +import "milkyway/rewards/v1/models.proto"; +import "milkyway/rewards/v1/params.proto"; option go_package = "github.com/milkyway-labs/milkyway/v7/x/rewards/types"; option (gogoproto.goproto_getters_all) = false; diff --git a/proto/milkyway/rewards/v2/models.proto b/proto/milkyway/rewards/v2/models.proto deleted file mode 100644 index aab9c1589..000000000 --- a/proto/milkyway/rewards/v2/models.proto +++ /dev/null @@ -1,270 +0,0 @@ -syntax = "proto3"; -package milkyway.rewards.v2; - -import "amino/amino.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; -import "milkyway/restaking/v1/models.proto"; - -option go_package = "github.com/milkyway-labs/milkyway/v7/x/rewards/types"; -option (gogoproto.goproto_getters_all) = false; - -// RewardsPlan represents a rewards allocation plan. -message RewardsPlan { - option (gogoproto.equal) = true; - - // ID is the unique identifier of the plan. - uint64 id = 1 [(gogoproto.customname) = "ID"]; - - // Description is the description of the plan. - string description = 2; - - // ServiceID is the service ID which the plan is related to. - uint32 service_id = 3 [(gogoproto.customname) = "ServiceID"]; - - // AmountPerDay is the amount of rewards to be distributed, per day. - // The rewards amount for every block will be calculated based on this. - cosmos.base.v1beta1.Coin amount_per_day = 4 [(gogoproto.nullable) = false]; - - // StartTime is the starting time of the plan. - google.protobuf.Timestamp start_time = 5 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; - - // EndTime is the ending time of the plan. - google.protobuf.Timestamp end_time = 6 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; - - // RewardsPool is the address where rewards to be distributed are stored. - // If the rewards pool doesn't have enough funds to be distributed, then - // the rewards allocation for this plan will be skipped. - string rewards_pool = 7 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // PoolsDistribution is the rewards distribution parameters for pools. - Distribution pools_distribution = 8 [(gogoproto.nullable) = false]; - - // OperatorsDistribution is the rewards distribution parameters for operators. - Distribution operators_distribution = 9 [(gogoproto.nullable) = false]; - - // UsersDistribution is the rewards distribution parameters for users. - UsersDistribution users_distribution = 10 [(gogoproto.nullable) = false]; -} - -// Distribution represents distribution parameters for restaking -// pools/operators. -message Distribution { - option (gogoproto.equal) = true; - - // DelegationType is the type of delegation target which this distribution - // parameters are for. It can be one of DELEGATION_TYPE_POOL and - // DELEGATION_TYPE_OPERATOR. - milkyway.restaking.v1.DelegationType delegation_type = 1; - - // Weight is the rewards distribution weight among other types of delegation - // targets. - uint32 weight = 2; - - // Type is one of basic/weighted/egalitarian distributions. - google.protobuf.Any type = 3 [(cosmos_proto.accepts_interface) = "milkyway.rewards.v1.DistributionType"]; -} - -// DistributionTypeBasic represents the simplest form of distribution. -// Rewards are allocated to entities based on their delegation values. -// For example, if there are three operators with delegation values of -// $1000, $1500, and $2000, their rewards will be distributed in a -// 2:3:4 ratio. -message DistributionTypeBasic { - option (cosmos_proto.implements_interface) = "milkyway.rewards.v1.DistributionType"; -} - -// DistributionTypeWeighted is a type of distribution where the reward -// weights for each entity are explicitly defined. Only the specified -// delegation targets will receive rewards. -message DistributionTypeWeighted { - option (cosmos_proto.implements_interface) = "milkyway.rewards.v1.DistributionType"; - - repeated DistributionWeight weights = 1 [(gogoproto.nullable) = false]; -} - -// DistributionWeight defines a delegation target and its assigned weight. -message DistributionWeight { - uint32 delegation_target_id = 1 [(gogoproto.customname) = "DelegationTargetID"]; - - uint32 weight = 2; -} - -// DistributionTypeEgalitarian is a distribution method where all entities -// receive an equal share of rewards(a.k.a. egalitarian method). -message DistributionTypeEgalitarian { - option (cosmos_proto.implements_interface) = "milkyway.rewards.v1.DistributionType"; -} - -// Distribution represents distribution parameters for delegators who directly -// staked their tokens to the service. -message UsersDistribution { - option (gogoproto.equal) = true; - - // Weight is the rewards distribution weight among other types of delegation - // targets. - uint32 weight = 1; - - // Type defines the rewards distribution method. Currently only the basic - // distribution is allowed. - google.protobuf.Any type = 2 [(cosmos_proto.accepts_interface) = "milkyway.rewards.v1.UsersDistributionType"]; -} - -// UsersDistributionTypeBasic represents the simplest form of distribution. -// Rewards are allocated to entities based on their delegation values. -// For example, if there are three users with delegation values of -// $1000, $1500, and $2000, their rewards will be distributed in a -// 2:3:4 ratio. -message UsersDistributionTypeBasic { - option (cosmos_proto.implements_interface) = "milkyway.rewards.v1.UsersDistributionType"; -} - -// HistoricalRewards represents historical rewards for a delegation target. -// Height is implicit within the store key. -// Cumulative reward ratio is the sum from the zeroeth period -// until this period of rewards / tokens, per the spec. -// The reference count indicates the number of objects -// which might need to reference this historical entry at any point. -// ReferenceCount = -// number of outstanding delegations which ended the associated period (and -// might need to read that record) -// + number of slashes which ended the associated period (and might need to -// read that record) -// + one per validator for the zeroeth period, set on initialization -message HistoricalRewards { - repeated ServicePool cumulative_reward_ratios = 1 [ - (gogoproto.moretags) = "yaml:\"cumulative_reward_ratios\"", - (gogoproto.castrepeated) = "ServicePools", - (gogoproto.nullable) = false - ]; - uint32 reference_count = 2 [(gogoproto.moretags) = "yaml:\"reference_count\""]; -} - -// CurrentRewards represents current rewards and current -// period for a delegation target kept as a running counter and incremented -// each block as long as the delegation target's tokens remain constant. -message CurrentRewards { - repeated ServicePool rewards = 1 [ - (gogoproto.moretags) = "yaml:\"rewards\"", - (gogoproto.castrepeated) = "ServicePools", - (gogoproto.nullable) = false - ]; - uint64 period = 2; -} - -// OutstandingRewards represents outstanding (un-withdrawn) rewards -// for a delegation target inexpensive to track, allows simple sanity checks. -message OutstandingRewards { - repeated DecPool rewards = 1 [ - (gogoproto.moretags) = "yaml:\"rewards\"", - (gogoproto.castrepeated) = "DecPools", - (gogoproto.nullable) = false - ]; -} - -// AccumulatedCommission represents accumulated commission -// for a delegation target kept as a running counter, can be withdrawn at any -// time. -message AccumulatedCommission { - repeated DecPool commissions = 1 [ - (gogoproto.castrepeated) = "DecPools", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} - -// DelegatorStartingInfo represents the starting info for a delegator reward -// period. It tracks the previous delegation target period, the delegation's -// amount of staking token, and the creation height (to check later on if any -// slashes have occurred). NOTE: Even though validators are slashed to whole -// staking tokens, the delegators within the validator may be left with less -// than a full token, thus sdk.Dec is used. -message DelegatorStartingInfo { - uint64 previous_period = 1 [(gogoproto.moretags) = "yaml:\"previous_period\""]; - repeated cosmos.base.v1beta1.DecCoin stakes = 2 [ - (gogoproto.moretags) = "yaml:\"stakes\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; - uint64 height = 3 [ - (gogoproto.moretags) = "yaml:\"creation_height\"", - (gogoproto.jsontag) = "creation_height" - ]; -} - -// DelegationDelegatorReward represents the properties of a delegator's -// delegation reward. The delegator address implicit in the within the -// query request. -message DelegationDelegatorReward { - milkyway.restaking.v1.DelegationType delegation_type = 1; - - uint32 delegation_target_id = 2 [(gogoproto.customname) = "DelegationTargetID"]; - - repeated DecPool reward = 3 [ - (gogoproto.castrepeated) = "DecPools", - (gogoproto.nullable) = false, - (amino.dont_omitempty) = true - ]; -} - -// TODO: add SlashEvent - -// --------------------------------------------------------------------------- - -// PoolServiceTotalDelegatorShares represents the total delegator shares for a -// pool-service pair. -message PoolServiceTotalDelegatorShares { - uint32 pool_id = 1 [(gogoproto.customname) = "PoolID"]; - uint32 service_id = 2 [(gogoproto.customname) = "ServiceID"]; - repeated cosmos.base.v1beta1.DecCoin shares = 3 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; -} - -// --------------------------------------------------------------------------- - -// Types below are taken from Initia's modified version of x/distribution. -// See -// https://github.com/initia-labs/initia/blob/v0.2.10/proto/initia/distribution/v1/distribution.proto#L38-L56 - -// Pool is a Coins wrapper with denom which represents the rewards pool for the -// given denom. It is used to represent the rewards associated with the denom. -message Pool { - string denom = 1 [(gogoproto.moretags) = "yaml:\"denom\""]; - repeated cosmos.base.v1beta1.Coin coins = 2 [ - (gogoproto.moretags) = "yaml:\"coins\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.nullable) = false - ]; -} - -// DecPool is a DecCoins wrapper with denom which represents the rewards pool -// for the given denom. It is used to represent the rewards associated with the -// denom. -message DecPool { - string denom = 1 [(gogoproto.moretags) = "yaml:\"denom\""]; - repeated cosmos.base.v1beta1.DecCoin dec_coins = 2 [ - (gogoproto.moretags) = "yaml:\"dec_coins\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; -} - -// ServicePool represents the rewards pool for a service. -message ServicePool { - uint32 service_id = 1 [(gogoproto.customname) = "ServiceID"]; - repeated DecPool dec_pools = 2 [ - (gogoproto.castrepeated) = "DecPools", - (gogoproto.nullable) = false - ]; -} diff --git a/utils/slices.go b/utils/slices.go index 822420ef7..ed3036872 100644 --- a/utils/slices.go +++ b/utils/slices.go @@ -44,6 +44,19 @@ func Map[T, U any](slice []T, f func(T) U) []U { return result } +// MapWithErr applies the given function to each element in the slice and returns a new slice with the results. +func MapWithErr[T, U any](slice []T, f func(T) (U, error)) ([]U, error) { + result := make([]U, len(slice)) + for i, v := range slice { + res, err := f(v) + if err != nil { + return nil, err + } + result[i] = res + } + return result, nil +} + // RemoveDuplicates removes all duplicate elements from the slice. func RemoveDuplicates[T comparable](slice []T) []T { seen := make(map[T]bool) @@ -88,7 +101,9 @@ func Remove[T comparable](slice []T, value T) (newSlice []T, removed bool) { return append(slice[:index], slice[index+1:]...), true } -// Intersect returns the intersection of two slices. +// Intersect returns the intersection of two slices (A ∩ B). +// Examples: +// Intersect([]int{1, 2, 3}, []int{2, 3, 4}) => []int{2, 3} func Intersect[T comparable](a, b []T) []T { var result []T for _, v := range a { @@ -100,6 +115,26 @@ func Intersect[T comparable](a, b []T) []T { return result } +// Difference returns the elements that are in a but not in b (A - B). +// Examples: +// Difference([]int{1, 2, 3}, []int{2, 3, 4}) => []int{1} +func Difference[T comparable](a, b []T) []T { + var result []T + for _, v := range RemoveDuplicates(a) { + if !slices.Contains(b, v) { + result = append(result, v) + } + } + return result +} + +// Union returns the union of two slices (A ∪ B). +// Examples: +// Union([]int{1, 2, 3}, []int{2, 3, 4}) => []int{1, 2, 3, 4} +func Union[T comparable](a, b []T) []T { + return RemoveDuplicates(append(a, b...)) +} + // Filter returns the elements of the slice that satisfy the given predicate. func Filter[T any](slice []T, f func(T) bool) []T { var result []T diff --git a/x/pools/keeper/pools.go b/x/pools/keeper/pools.go index da4be6f3b..0839fb4d8 100644 --- a/x/pools/keeper/pools.go +++ b/x/pools/keeper/pools.go @@ -49,6 +49,11 @@ func (k *Keeper) SavePool(ctx context.Context, pool types.Pool) error { return k.poolAddressSet.Set(ctx, pool.Address) } +// HasPool checks if a pool with the given ID exists in the store +func (k *Keeper) HasPool(ctx context.Context, id uint32) (bool, error) { + return k.pools.Has(ctx, id) +} + // GetPool retrieves the pool with the given ID from the store. // If the pool does not exist, false is returned instead func (k *Keeper) GetPool(ctx context.Context, id uint32) (types.Pool, error) { diff --git a/x/restaking/client/cli/tx.go b/x/restaking/client/cli/tx.go index 4c33340c6..7df11e50a 100644 --- a/x/restaking/client/cli/tx.go +++ b/x/restaking/client/cli/tx.go @@ -567,11 +567,8 @@ func GetCeasePoolSecurityBorrowTxCmd() *cobra.Command { // -------------------------------------------------------------------------------------------------------------------- -//nolint:gosec // This is not a hardcoded credential const ( - trustNonAccreditedServicesFlag = "trust-non-accredited-services" - trustAccreditedServicesFlag = "trust-accredited-services" - trustedServicesIDsFlag = "trusted-services-ids" + trustedServiceFlag = "trusted-service" ) func GetUserTxCmd() *cobra.Command { @@ -594,12 +591,16 @@ func GetSetUserPreferencesCmd() *cobra.Command { Short: "Set your user preferences regarding the restaking module", Long: `Set your user preferences regarding the restaking module. +The trusted services must be provided in the following format: +-,, + +Each trusted service must be provided separately using the --trusted-service flag. + If you are updating your preferences, you must provide all the flags that you want to set (i.e. the values you provide will completely override the existing ones)`, Example: fmt.Sprintf(`%s tx %s user set-preferences \ ---trust-accredited-services \ ---trust-non-accredited-services \ ---trusted-services-ids 1,2,3 \ +--trusted-service 1-1,2,3 \ +--trusted-service 2-4,5,6 --from alice`, version.AppName, types.ModuleName), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) @@ -607,24 +608,19 @@ If you are updating your preferences, you must provide all the flags that you wa return err } - trustAccreditedServices, err := cmd.Flags().GetBool(trustAccreditedServicesFlag) + trustedServicesStrings, err := cmd.Flags().GetStringArray(trustedServiceFlag) if err != nil { return err } - trustNonAccreditedServices, err := cmd.Flags().GetBool(trustNonAccreditedServicesFlag) + // Parse the trusted services + trustedServices, err := utils.MapWithErr(trustedServicesStrings, ParseTrustedServiceEntry) if err != nil { - return err - } - - trustedServices, err := cmd.Flags().GetUintSlice(trustedServicesIDsFlag) - if err != nil { - return err + return fmt.Errorf("invalid trusted services: %w", err) } - trustedServicesIDs := utils.Map(trustedServices, func(t uint) uint32 { return uint32(t) }) // Create and validate the message - preferences := types.NewUserPreferences(trustNonAccreditedServices, trustAccreditedServices, trustedServicesIDs) + preferences := types.NewUserPreferences(trustedServices) msg := types.NewMsgSetUserPreferences(preferences, clientCtx.FromAddress.String()) if err = msg.ValidateBasic(); err != nil { return fmt.Errorf("message validation failed: %w", err) @@ -634,9 +630,7 @@ If you are updating your preferences, you must provide all the flags that you wa }, } - cmd.Flags().Bool(trustNonAccreditedServicesFlag, false, "Trust non-accredited services") - cmd.Flags().Bool(trustAccreditedServicesFlag, false, "Trust accredited services") - cmd.Flags().UintSlice(trustedServicesIDsFlag, nil, "List of IDs of the services you trust") + cmd.Flags().StringArray(trustedServiceFlag, nil, "List of services to trust") flags.AddTxFlagsToCmd(cmd) diff --git a/x/restaking/client/cli/utils.go b/x/restaking/client/cli/utils.go new file mode 100644 index 000000000..999e5f1e7 --- /dev/null +++ b/x/restaking/client/cli/utils.go @@ -0,0 +1,36 @@ +package cli + +import ( + "fmt" + "strings" + + poolstypes "github.com/milkyway-labs/milkyway/v7/x/pools/types" + "github.com/milkyway-labs/milkyway/v7/x/restaking/types" + servicestypes "github.com/milkyway-labs/milkyway/v7/x/services/types" +) + +// ParseTrustedServiceEntry parses a string into a TrustedServiceEntry. +// The value provided must be in the format: "-,," +func ParseTrustedServiceEntry(value string) (types.TrustedServiceEntry, error) { + var serviceIDString, poolsIDsStrings string + _, err := fmt.Sscanf(value, "%s-%s", &serviceIDString, &poolsIDsStrings) + if err != nil { + return types.TrustedServiceEntry{}, err + } + + serviceID, err := servicestypes.ParseServiceID(serviceIDString) + if err != nil { + return types.TrustedServiceEntry{}, err + } + + var poolsIDs []uint32 + for _, poolID := range strings.Split(poolsIDsStrings, ",") { + parsedPoolID, err := poolstypes.ParsePoolID(poolID) + if err != nil { + return types.TrustedServiceEntry{}, err + } + poolsIDs = append(poolsIDs, parsedPoolID) + } + + return types.NewTrustedServiceEntry(serviceID, poolsIDs), nil +} diff --git a/x/restaking/keeper/alias_functions.go b/x/restaking/keeper/alias_functions.go index afbeab256..b29a36269 100644 --- a/x/restaking/keeper/alias_functions.go +++ b/x/restaking/keeper/alias_functions.go @@ -1083,19 +1083,22 @@ func (k *Keeper) GetUserTrustedServicesIDs(ctx context.Context, userAddress stri if err != nil { return nil, err } - - var trustedServicesIDs []uint32 - err = k.servicesKeeper.IterateServices(ctx, func(service servicestypes.Service) (stop bool, err error) { - if preferences.IsServiceTrusted(service) { - trustedServicesIDs = append(trustedServicesIDs, service.ID) + if len(preferences.TrustedServices) == 0 { + // Return all service IDs + var serviceIDs []uint32 + err = k.servicesKeeper.IterateServices(ctx, func(service servicestypes.Service) (bool, error) { + serviceIDs = append(serviceIDs, service.ID) + return false, nil + }) + if err != nil { + return nil, err } - return false, nil - }) - if err != nil { - return nil, err + return serviceIDs, nil } - return trustedServicesIDs, nil + return utils.Map(preferences.TrustedServices, func(entry types.TrustedServiceEntry) uint32 { + return entry.ServiceID + }), nil } // -------------------------------------------------------------------------------------------------------------------- diff --git a/x/restaking/keeper/alias_functions_test.go b/x/restaking/keeper/alias_functions_test.go index 69c934e8f..80e2a9ca5 100644 --- a/x/restaking/keeper/alias_functions_test.go +++ b/x/restaking/keeper/alias_functions_test.go @@ -1017,36 +1017,34 @@ func (suite *KeeperTestSuite) TestKeeper_GetUserPreferencesEntries() { { name: "entries are returned properly", store: func(ctx sdk.Context) { - err := suite.k.SetUserPreferences(ctx, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - )) + err := suite.k.SetUserPreferences(ctx, "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + })) suite.Require().NoError(err) - err = suite.k.SetUserPreferences(ctx, "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4", types.NewUserPreferences( - false, - true, - []uint32{4, 5}, - )) + err = suite.k.SetUserPreferences(ctx, "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4", types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(4, nil), + types.NewTrustedServiceEntry(5, nil), + })) suite.Require().NoError(err) }, expEntries: []types.UserPreferencesEntry{ types.NewUserPreferencesEntry( "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4", - types.NewUserPreferences( - false, - true, - []uint32{4, 5}, - ), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(4, nil), + types.NewTrustedServiceEntry(5, nil), + }), ), types.NewUserPreferencesEntry( "cosmos1y54exmx84cqtasvjnskf9f63djuuj68p7hqf47", - types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - ), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + }), ), }, }, diff --git a/x/restaking/keeper/genesis_test.go b/x/restaking/keeper/genesis_test.go index 07c1d0238..e769b43db 100644 --- a/x/restaking/keeper/genesis_test.go +++ b/x/restaking/keeper/genesis_test.go @@ -308,11 +308,11 @@ func (suite *KeeperTestSuite) TestKeeper_ExportGenesis() { err := suite.k.SetParams(ctx, types.DefaultParams()) suite.Require().NoError(err) - err = suite.k.SetUserPreferences(ctx, "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - )) + err = suite.k.SetUserPreferences(ctx, "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + })) suite.Require().NoError(err) }, expGenesis: &types.GenesisState{ @@ -320,11 +320,11 @@ func (suite *KeeperTestSuite) TestKeeper_ExportGenesis() { UsersPreferences: []types.UserPreferencesEntry{ types.NewUserPreferencesEntry( "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", - types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - ), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + }), ), }, }, @@ -628,11 +628,11 @@ func (suite *KeeperTestSuite) TestKeeper_InitGenesis() { UsersPreferences: []types.UserPreferencesEntry{ types.NewUserPreferencesEntry( "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", - types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - ), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + }), ), }, }, @@ -642,11 +642,11 @@ func (suite *KeeperTestSuite) TestKeeper_InitGenesis() { suite.Require().Equal([]types.UserPreferencesEntry{ types.NewUserPreferencesEntry( "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", - types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - ), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + }), ), }, stored) }, diff --git a/x/restaking/keeper/msg_server.go b/x/restaking/keeper/msg_server.go index 4cc9827b9..613e38f56 100644 --- a/x/restaking/keeper/msg_server.go +++ b/x/restaking/keeper/msg_server.go @@ -582,14 +582,26 @@ func (k msgServer) UndelegateService(ctx context.Context, msg *types.MsgUndelega // SetUserPreferences defines the rpc method for Msg/SetUserPreferences func (k msgServer) SetUserPreferences(ctx context.Context, msg *types.MsgSetUserPreferences) (*types.MsgSetUserPreferencesResponse, error) { // Make sure that each service exists - for _, serviceID := range msg.Preferences.TrustedServicesIDs { - hasService, err := k.servicesKeeper.HasService(ctx, serviceID) + for _, entry := range msg.Preferences.TrustedServices { + hasService, err := k.servicesKeeper.HasService(ctx, entry.ServiceID) if err != nil { return nil, err } if !hasService { - return nil, errors.Wrapf(servicestypes.ErrServiceNotFound, "service %d does not exist", serviceID) + return nil, errors.Wrapf(servicestypes.ErrServiceNotFound, "service %d does not exist", entry.ServiceID) + } + + // Make sure the pools exist + for _, poolID := range entry.PoolsIDs { + hasPool, err := k.poolsKeeper.HasPool(ctx, poolID) + if err != nil { + return nil, err + } + + if !hasPool { + return nil, errors.Wrapf(poolstypes.ErrPoolNotFound, "pool %d does not exist", poolID) + } } } diff --git a/x/restaking/keeper/msg_server_test.go b/x/restaking/keeper/msg_server_test.go index d6ee94847..ee114e617 100644 --- a/x/restaking/keeper/msg_server_test.go +++ b/x/restaking/keeper/msg_server_test.go @@ -2455,7 +2455,10 @@ func (suite *KeeperTestSuite) TestMsgServer_SetUserPreferences() { { name: "not found services return error", msg: types.NewMsgSetUserPreferences( - types.NewUserPreferences(true, true, []uint32{1, 2}), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + }), "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4", ), shouldErr: true, @@ -2463,7 +2466,9 @@ func (suite *KeeperTestSuite) TestMsgServer_SetUserPreferences() { { name: "invalid user preferences return error", msg: types.NewMsgSetUserPreferences( - types.NewUserPreferences(true, true, []uint32{0}), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(0, nil), + }), "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4", ), shouldErr: true, @@ -2497,7 +2502,10 @@ func (suite *KeeperTestSuite) TestMsgServer_SetUserPreferences() { suite.Require().NoError(err) }, msg: types.NewMsgSetUserPreferences( - types.NewUserPreferences(true, true, []uint32{1, 2}), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + }), "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4", ), shouldErr: false, @@ -2511,11 +2519,10 @@ func (suite *KeeperTestSuite) TestMsgServer_SetUserPreferences() { // Make sure the preferences are stored properly stored, err := suite.k.GetUserPreferences(ctx, "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4") suite.Require().NoError(err) - suite.Require().Equal(types.NewUserPreferences( - true, - true, - []uint32{1, 2}, - ), stored) + suite.Require().Equal(types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + }), stored) }, }, { @@ -2547,12 +2554,15 @@ func (suite *KeeperTestSuite) TestMsgServer_SetUserPreferences() { suite.Require().NoError(err) // Set the user preferences - preferences := types.NewUserPreferences(true, true, []uint32{1, 2}) + preferences := types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + }) err = suite.k.SetUserPreferences(ctx, "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4", preferences) suite.Require().NoError(err) }, msg: types.NewMsgSetUserPreferences( - types.NewUserPreferences(false, false, nil), + types.NewUserPreferences(nil), "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4", ), shouldErr: false, @@ -2566,11 +2576,7 @@ func (suite *KeeperTestSuite) TestMsgServer_SetUserPreferences() { // Make sure the preferences are stored properly stored, err := suite.k.GetUserPreferences(ctx, "cosmos167x6ehhple8gwz5ezy9x0464jltvdpzl6qfdt4") suite.Require().NoError(err) - suite.Require().Equal(types.NewUserPreferences( - false, - false, - nil, - ), stored) + suite.Require().Equal(types.NewUserPreferences(nil), stored) }, }, } diff --git a/x/restaking/keeper/user_preferences_test.go b/x/restaking/keeper/user_preferences_test.go index c6d9f2c69..81c974da6 100644 --- a/x/restaking/keeper/user_preferences_test.go +++ b/x/restaking/keeper/user_preferences_test.go @@ -18,47 +18,43 @@ func (suite *KeeperTestSuite) TestKeeper_SetUserPreferences() { { name: "User preferences are saved correctly", userAddress: "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", - preferences: types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - ), + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + }), shouldErr: false, check: func(ctx sdk.Context) { stored, err := suite.k.GetUserPreferences(ctx, "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw") suite.Require().NoError(err) - suite.Require().Equal(types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - ), stored) + suite.Require().Equal(types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + }), stored) }, }, { name: "existing preferences are overridden properly", store: func(ctx sdk.Context) { - err := suite.k.SetUserPreferences(ctx, "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - )) + err := suite.k.SetUserPreferences(ctx, "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + })) suite.Require().NoError(err) }, userAddress: "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", - preferences: types.NewUserPreferences( - false, - true, - []uint32{7}, - ), + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(7, nil), + }), shouldErr: false, check: func(ctx sdk.Context) { stored, err := suite.k.GetUserPreferences(ctx, "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw") suite.Require().NoError(err) - suite.Require().Equal(types.NewUserPreferences( - false, - true, - []uint32{7}, - ), stored) + suite.Require().Equal(types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(7, nil), + }), stored) }, }, } @@ -104,20 +100,20 @@ func (suite *KeeperTestSuite) TestKeeper_GetUserPreferences() { { name: "custom preferences are returned properly", store: func(ctx sdk.Context) { - err := suite.k.SetUserPreferences(ctx, "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - )) + err := suite.k.SetUserPreferences(ctx, "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + })) suite.Require().NoError(err) }, userAddress: "cosmos1jseuux3pktht0kkhlcsv4kqff3mql65udqs4jw", shouldErr: false, - expPreferences: types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - ), + expPreferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + }), }, } diff --git a/x/restaking/migrations/v2/models.go b/x/restaking/migrations/v2/models.go new file mode 100644 index 000000000..e7f07e850 --- /dev/null +++ b/x/restaking/migrations/v2/models.go @@ -0,0 +1,7 @@ +package v2 + +// UserPreferencesEntry represents a user preferences entry. +type UserPreferencesEntry struct { + UserAddress string + Preferences UserPreferences +} diff --git a/x/restaking/migrations/v2/models.pb.go b/x/restaking/migrations/v2/models.pb.go new file mode 100644 index 000000000..a02e9bc2b --- /dev/null +++ b/x/restaking/migrations/v2/models.pb.go @@ -0,0 +1,2164 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: milkyway/restaking/v1/models.proto + +package v2 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// DelegationType defines the type of delegation. +type DelegationType int32 + +const ( + // DELEGATION_TYPE_UNSPECIFIED defines an unspecified delegation type. + DELEGATION_TYPE_UNSPECIFIED DelegationType = 0 + // DELEGATION_TYPE_POOL defines a delegation to a pool. + DELEGATION_TYPE_POOL DelegationType = 1 + // DELEGATION_TYPE_OPERATOR defines a delegation to an operator. + DELEGATION_TYPE_OPERATOR DelegationType = 2 + // DELEGATION_TYPE_SERVICE defines a delegation to a service. + DELEGATION_TYPE_SERVICE DelegationType = 3 +) + +var DelegationType_name = map[int32]string{ + 0: "DELEGATION_TYPE_UNSPECIFIED", + 1: "DELEGATION_TYPE_POOL", + 2: "DELEGATION_TYPE_OPERATOR", + 3: "DELEGATION_TYPE_SERVICE", +} + +var DelegationType_value = map[string]int32{ + "DELEGATION_TYPE_UNSPECIFIED": 0, + "DELEGATION_TYPE_POOL": 1, + "DELEGATION_TYPE_OPERATOR": 2, + "DELEGATION_TYPE_SERVICE": 3, +} + +func (x DelegationType) String() string { + return proto.EnumName(DelegationType_name, int32(x)) +} + +func (DelegationType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_86f4cd48423b1e2f, []int{0} +} + +// Delegation represents the bond with tokens held by an account with a +// given target. +type Delegation struct { + // Type is the type of delegation. + Type DelegationType `protobuf:"varint,1,opt,name=type,proto3,enum=milkyway.restaking.v1.DelegationType" json:"type,omitempty"` + // UserAddress is the encoded address of the user. + UserAddress string `protobuf:"bytes,2,opt,name=user_address,json=userAddress,proto3" json:"user_address,omitempty"` + // TargetID is the id of the target to which the delegation is associated + // (pool, operator, service). + TargetID uint32 `protobuf:"varint,3,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` + // Shares define the delegation shares received. + Shares github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,4,rep,name=shares,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"shares"` +} + +func (m *Delegation) Reset() { *m = Delegation{} } +func (m *Delegation) String() string { return proto.CompactTextString(m) } +func (*Delegation) ProtoMessage() {} +func (*Delegation) Descriptor() ([]byte, []int) { + return fileDescriptor_86f4cd48423b1e2f, []int{0} +} +func (m *Delegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Delegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Delegation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Delegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Delegation.Merge(m, src) +} +func (m *Delegation) XXX_Size() int { + return m.Size() +} +func (m *Delegation) XXX_DiscardUnknown() { + xxx_messageInfo_Delegation.DiscardUnknown(m) +} + +var xxx_messageInfo_Delegation proto.InternalMessageInfo + +// DelegationResponse is equivalent to Delegation except that it +// contains a balance in addition to shares which is more suitable for client +// responses. +type DelegationResponse struct { + Delegation Delegation `protobuf:"bytes,1,opt,name=delegation,proto3" json:"delegation"` + Balance github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=balance,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balance"` +} + +func (m *DelegationResponse) Reset() { *m = DelegationResponse{} } +func (m *DelegationResponse) String() string { return proto.CompactTextString(m) } +func (*DelegationResponse) ProtoMessage() {} +func (*DelegationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_86f4cd48423b1e2f, []int{1} +} +func (m *DelegationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegationResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DelegationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegationResponse.Merge(m, src) +} +func (m *DelegationResponse) XXX_Size() int { + return m.Size() +} +func (m *DelegationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DelegationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegationResponse proto.InternalMessageInfo + +func (m *DelegationResponse) GetDelegation() Delegation { + if m != nil { + return m.Delegation + } + return Delegation{} +} + +func (m *DelegationResponse) GetBalance() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Balance + } + return nil +} + +// UnbondingDelegation stores all of a single delegator's unbonding bonds +// for a single target in an time-ordered list. +type UnbondingDelegation struct { + // Type is the type of the unbonding delegation. + Type DelegationType `protobuf:"varint,1,opt,name=type,proto3,enum=milkyway.restaking.v1.DelegationType" json:"type,omitempty"` + // DelegatorAddress is the encoded address of the delegator. + DelegatorAddress string `protobuf:"bytes,2,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + // TargetID is the ID of the target from which the tokens will be undelegated + // (pool, service, operator) + TargetID uint32 `protobuf:"varint,3,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` + // Entries are the unbonding delegation entries. + Entries []UnbondingDelegationEntry `protobuf:"bytes,4,rep,name=entries,proto3" json:"entries"` +} + +func (m *UnbondingDelegation) Reset() { *m = UnbondingDelegation{} } +func (m *UnbondingDelegation) String() string { return proto.CompactTextString(m) } +func (*UnbondingDelegation) ProtoMessage() {} +func (*UnbondingDelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_86f4cd48423b1e2f, []int{2} +} +func (m *UnbondingDelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UnbondingDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnbondingDelegation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UnbondingDelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnbondingDelegation.Merge(m, src) +} +func (m *UnbondingDelegation) XXX_Size() int { + return m.Size() +} +func (m *UnbondingDelegation) XXX_DiscardUnknown() { + xxx_messageInfo_UnbondingDelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_UnbondingDelegation proto.InternalMessageInfo + +// UnbondingDelegationEntry defines an unbonding object with relevant metadata. +type UnbondingDelegationEntry struct { + // CreationHeight is the height which the unbonding took place. + CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"` + // CompletionTime is the unix time for unbonding completion. + CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` + // InitialBalance defines the tokens initially scheduled to receive at + // completion. + InitialBalance github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=initial_balance,json=initialBalance,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_balance"` + // Balance defines the tokens to receive at completion. + Balance github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=balance,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balance"` + // Incrementing id that uniquely identifies this entry + UnbondingID uint64 `protobuf:"varint,5,opt,name=unbonding_id,json=unbondingId,proto3" json:"unbonding_id,omitempty"` +} + +func (m *UnbondingDelegationEntry) Reset() { *m = UnbondingDelegationEntry{} } +func (m *UnbondingDelegationEntry) String() string { return proto.CompactTextString(m) } +func (*UnbondingDelegationEntry) ProtoMessage() {} +func (*UnbondingDelegationEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_86f4cd48423b1e2f, []int{3} +} +func (m *UnbondingDelegationEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UnbondingDelegationEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnbondingDelegationEntry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UnbondingDelegationEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnbondingDelegationEntry.Merge(m, src) +} +func (m *UnbondingDelegationEntry) XXX_Size() int { + return m.Size() +} +func (m *UnbondingDelegationEntry) XXX_DiscardUnknown() { + xxx_messageInfo_UnbondingDelegationEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_UnbondingDelegationEntry proto.InternalMessageInfo + +func (m *UnbondingDelegationEntry) GetCreationHeight() int64 { + if m != nil { + return m.CreationHeight + } + return 0 +} + +func (m *UnbondingDelegationEntry) GetCompletionTime() time.Time { + if m != nil { + return m.CompletionTime + } + return time.Time{} +} + +func (m *UnbondingDelegationEntry) GetInitialBalance() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.InitialBalance + } + return nil +} + +func (m *UnbondingDelegationEntry) GetBalance() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Balance + } + return nil +} + +func (m *UnbondingDelegationEntry) GetUnbondingID() uint64 { + if m != nil { + return m.UnbondingID + } + return 0 +} + +// DTData is a struct that contains the basic information about an unbonding +// delegation. It is intended to be used as a marshalable pointer. For example, +// a DTData can be used to construct the key to getting an UnbondingDelegation +// from state. +type DTData struct { + UnbondingDelegationType DelegationType `protobuf:"varint,1,opt,name=unbonding_delegation_type,json=unbondingDelegationType,proto3,enum=milkyway.restaking.v1.DelegationType" json:"unbonding_delegation_type,omitempty"` + DelegatorAddress string `protobuf:"bytes,2,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + TargetID uint32 `protobuf:"varint,3,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` +} + +func (m *DTData) Reset() { *m = DTData{} } +func (m *DTData) String() string { return proto.CompactTextString(m) } +func (*DTData) ProtoMessage() {} +func (*DTData) Descriptor() ([]byte, []int) { + return fileDescriptor_86f4cd48423b1e2f, []int{4} +} +func (m *DTData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DTData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DTData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DTData) XXX_Merge(src proto.Message) { + xxx_messageInfo_DTData.Merge(m, src) +} +func (m *DTData) XXX_Size() int { + return m.Size() +} +func (m *DTData) XXX_DiscardUnknown() { + xxx_messageInfo_DTData.DiscardUnknown(m) +} + +var xxx_messageInfo_DTData proto.InternalMessageInfo + +// DTDataList defines an array of DTData objects. +type DTDataList struct { + Data []DTData `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` +} + +func (m *DTDataList) Reset() { *m = DTDataList{} } +func (m *DTDataList) String() string { return proto.CompactTextString(m) } +func (*DTDataList) ProtoMessage() {} +func (*DTDataList) Descriptor() ([]byte, []int) { + return fileDescriptor_86f4cd48423b1e2f, []int{5} +} +func (m *DTDataList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DTDataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DTDataList.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DTDataList) XXX_Merge(src proto.Message) { + xxx_messageInfo_DTDataList.Merge(m, src) +} +func (m *DTDataList) XXX_Size() int { + return m.Size() +} +func (m *DTDataList) XXX_DiscardUnknown() { + xxx_messageInfo_DTDataList.DiscardUnknown(m) +} + +var xxx_messageInfo_DTDataList proto.InternalMessageInfo + +func (m *DTDataList) GetData() []DTData { + if m != nil { + return m.Data + } + return nil +} + +// UserPreferences is a struct that contains a user's preferences for +// restaking. +type UserPreferences struct { + // TrustNonAccreditedServices tells whether the user trusts all non-accredited + // services present on the platform. + TrustNonAccreditedServices bool `protobuf:"varint,1,opt,name=trust_non_accredited_services,json=trustNonAccreditedServices,proto3" json:"trust_non_accredited_services,omitempty"` + // TrustAccreditedServices tells whether the user trusts all accredited + // services present on the platform. + TrustAccreditedServices bool `protobuf:"varint,2,opt,name=trust_accredited_services,json=trustAccreditedServices,proto3" json:"trust_accredited_services,omitempty"` + // TrustedServicesIDs is a list of service IDs that the user trusts (both + // accredited and non-accredited). + TrustedServicesIDs []uint32 `protobuf:"varint,3,rep,packed,name=trusted_services_ids,json=trustedServicesIds,proto3" json:"trusted_services_ids,omitempty"` +} + +func (m *UserPreferences) Reset() { *m = UserPreferences{} } +func (m *UserPreferences) String() string { return proto.CompactTextString(m) } +func (*UserPreferences) ProtoMessage() {} +func (*UserPreferences) Descriptor() ([]byte, []int) { + return fileDescriptor_86f4cd48423b1e2f, []int{6} +} +func (m *UserPreferences) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UserPreferences) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UserPreferences.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UserPreferences) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserPreferences.Merge(m, src) +} +func (m *UserPreferences) XXX_Size() int { + return m.Size() +} +func (m *UserPreferences) XXX_DiscardUnknown() { + xxx_messageInfo_UserPreferences.DiscardUnknown(m) +} + +var xxx_messageInfo_UserPreferences proto.InternalMessageInfo + +func (m *UserPreferences) GetTrustNonAccreditedServices() bool { + if m != nil { + return m.TrustNonAccreditedServices + } + return false +} + +func (m *UserPreferences) GetTrustAccreditedServices() bool { + if m != nil { + return m.TrustAccreditedServices + } + return false +} + +func (m *UserPreferences) GetTrustedServicesIDs() []uint32 { + if m != nil { + return m.TrustedServicesIDs + } + return nil +} + +var fileDescriptor_86f4cd48423b1e2f = []byte{ + // 926 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xda, 0x26, 0x4d, 0xc6, 0x89, 0xed, 0x0e, 0x81, 0x6c, 0xdc, 0xd6, 0x6b, 0x2c, 0x21, + 0x4c, 0x51, 0x76, 0x89, 0x7b, 0x40, 0x04, 0x84, 0x64, 0xc7, 0x0b, 0x35, 0x8a, 0x62, 0x6b, 0xb3, + 0x41, 0xc0, 0x65, 0x35, 0xde, 0x9d, 0x6e, 0x46, 0xb1, 0x67, 0xac, 0x9d, 0xb1, 0xc1, 0xff, 0xa0, + 0x07, 0x0e, 0xfd, 0x09, 0x15, 0x70, 0x40, 0x1c, 0x10, 0x07, 0x7e, 0x44, 0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b0, 0x6d, 0xb6, 0x8a, 0x29, 0xa8, 0x82, 0xed, 0x65, 0x40, 0xb7, + 0xd3, 0x39, 0x2a, 0x2a, 0xf0, 0x36, 0x50, 0x97, 0x33, 0x9d, 0xae, 0x69, 0x35, 0xec, 0x8e, 0x55, + 0x4c, 0xc3, 0x5b, 0x60, 0x67, 0x39, 0x7b, 0x62, 0x5a, 0x9f, 0xb4, 0x0f, 0xcd, 0x62, 0xa6, 0x94, + 0x7d, 0xf8, 0x4d, 0x39, 0xd5, 0xfc, 0xf4, 0xc9, 0xb4, 0xac, 0x3c, 0x9d, 0x96, 0x95, 0xdf, 0xa7, + 0x65, 0xe5, 0xd1, 0x65, 0x39, 0xf5, 0xf4, 0xb2, 0x9c, 0xfa, 0xf5, 0xb2, 0x9c, 0xfa, 0xfc, 0x83, + 0x85, 0x45, 0x49, 0xe6, 0xb7, 0xd7, 0x47, 0x3d, 0x3e, 0x3b, 0x19, 0xe3, 0x77, 0x8c, 0x2f, 0x17, + 0x7e, 0x68, 0x0c, 0x88, 0x1f, 0x48, 0x55, 0xdc, 0x18, 0xd7, 0x7b, 0x6b, 0xf2, 0x5b, 0xe4, 0xde, + 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf3, 0xf8, 0xa7, 0x7d, 0x93, 0x08, 0x00, 0x00, +} + +func (this *UnbondingDelegationEntry) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*UnbondingDelegationEntry) + if !ok { + that2, ok := that.(UnbondingDelegationEntry) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.CreationHeight != that1.CreationHeight { + return false + } + if !this.CompletionTime.Equal(that1.CompletionTime) { + return false + } + if len(this.InitialBalance) != len(that1.InitialBalance) { + return false + } + for i := range this.InitialBalance { + if !this.InitialBalance[i].Equal(&that1.InitialBalance[i]) { + return false + } + } + if len(this.Balance) != len(that1.Balance) { + return false + } + for i := range this.Balance { + if !this.Balance[i].Equal(&that1.Balance[i]) { + return false + } + } + if this.UnbondingID != that1.UnbondingID { + return false + } + return true +} +func (m *Delegation) 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 *Delegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Shares) > 0 { + for iNdEx := len(m.Shares) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Shares[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.TargetID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.TargetID)) + i-- + dAtA[i] = 0x18 + } + if len(m.UserAddress) > 0 { + i -= len(m.UserAddress) + copy(dAtA[i:], m.UserAddress) + i = encodeVarintModels(dAtA, i, uint64(len(m.UserAddress))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DelegationResponse) 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 *DelegationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Balance) > 0 { + for iNdEx := len(m.Balance) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balance[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Delegation.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *UnbondingDelegation) 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 *UnbondingDelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnbondingDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.TargetID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.TargetID)) + i-- + dAtA[i] = 0x18 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintModels(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UnbondingDelegationEntry) 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 *UnbondingDelegationEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnbondingDelegationEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UnbondingID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.UnbondingID)) + i-- + dAtA[i] = 0x28 + } + if len(m.Balance) > 0 { + for iNdEx := len(m.Balance) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balance[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.InitialBalance) > 0 { + for iNdEx := len(m.InitialBalance) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InitialBalance[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CompletionTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintModels(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 + if m.CreationHeight != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.CreationHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DTData) 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 *DTData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DTData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TargetID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.TargetID)) + i-- + dAtA[i] = 0x18 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintModels(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0x12 + } + if m.UnbondingDelegationType != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.UnbondingDelegationType)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DTDataList) 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 *DTDataList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DTDataList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *UserPreferences) 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 *UserPreferences) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UserPreferences) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TrustedServicesIDs) > 0 { + dAtA4 := make([]byte, len(m.TrustedServicesIDs)*10) + var j3 int + for _, num := range m.TrustedServicesIDs { + for num >= 1<<7 { + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j3++ + } + dAtA4[j3] = uint8(num) + j3++ + } + i -= j3 + copy(dAtA[i:], dAtA4[:j3]) + i = encodeVarintModels(dAtA, i, uint64(j3)) + i-- + dAtA[i] = 0x1a + } + if m.TrustAccreditedServices { + i-- + if m.TrustAccreditedServices { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.TrustNonAccreditedServices { + i-- + if m.TrustNonAccreditedServices { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintModels(dAtA []byte, offset int, v uint64) int { + offset -= sovModels(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Delegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovModels(uint64(m.Type)) + } + l = len(m.UserAddress) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if m.TargetID != 0 { + n += 1 + sovModels(uint64(m.TargetID)) + } + if len(m.Shares) > 0 { + for _, e := range m.Shares { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + return n +} + +func (m *DelegationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Delegation.Size() + n += 1 + l + sovModels(uint64(l)) + if len(m.Balance) > 0 { + for _, e := range m.Balance { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + return n +} + +func (m *UnbondingDelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sovModels(uint64(m.Type)) + } + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if m.TargetID != 0 { + n += 1 + sovModels(uint64(m.TargetID)) + } + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + return n +} + +func (m *UnbondingDelegationEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CreationHeight != 0 { + n += 1 + sovModels(uint64(m.CreationHeight)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CompletionTime) + n += 1 + l + sovModels(uint64(l)) + if len(m.InitialBalance) > 0 { + for _, e := range m.InitialBalance { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + if len(m.Balance) > 0 { + for _, e := range m.Balance { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + if m.UnbondingID != 0 { + n += 1 + sovModels(uint64(m.UnbondingID)) + } + return n +} + +func (m *DTData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UnbondingDelegationType != 0 { + n += 1 + sovModels(uint64(m.UnbondingDelegationType)) + } + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovModels(uint64(l)) + } + if m.TargetID != 0 { + n += 1 + sovModels(uint64(m.TargetID)) + } + return n +} + +func (m *DTDataList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Data) > 0 { + for _, e := range m.Data { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + return n +} + +func (m *UserPreferences) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TrustNonAccreditedServices { + n += 2 + } + if m.TrustAccreditedServices { + n += 2 + } + if len(m.TrustedServicesIDs) > 0 { + l = 0 + for _, e := range m.TrustedServicesIDs { + l += sovModels(uint64(e)) + } + n += 1 + sovModels(uint64(l)) + l + } + return n +} + +func sovModels(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozModels(x uint64) (n int) { + return sovModels(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Delegation) 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 ErrIntOverflowModels + } + 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: Delegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Delegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= DelegationType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UserAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UserAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetID", wireType) + } + m.TargetID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TargetID |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shares = append(m.Shares, types.DecCoin{}) + if err := m.Shares[len(m.Shares)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegationResponse) 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 ErrIntOverflowModels + } + 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: DelegationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Delegation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Balance = append(m.Balance, types.Coin{}) + if err := m.Balance[len(m.Balance)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UnbondingDelegation) 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 ErrIntOverflowModels + } + 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: UnbondingDelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnbondingDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= DelegationType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetID", wireType) + } + m.TargetID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TargetID |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Entries = append(m.Entries, UnbondingDelegationEntry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UnbondingDelegationEntry) 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 ErrIntOverflowModels + } + 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: UnbondingDelegationEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnbondingDelegationEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType) + } + m.CreationHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.CompletionTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialBalance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InitialBalance = append(m.InitialBalance, types.Coin{}) + if err := m.InitialBalance[len(m.InitialBalance)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Balance = append(m.Balance, types.Coin{}) + if err := m.Balance[len(m.Balance)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingID", wireType) + } + m.UnbondingID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondingID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DTData) 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 ErrIntOverflowModels + } + 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: DTData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DTData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingDelegationType", wireType) + } + m.UnbondingDelegationType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondingDelegationType |= DelegationType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + 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 ErrInvalidLengthModels + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetID", wireType) + } + m.TargetID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TargetID |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DTDataList) 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 ErrIntOverflowModels + } + 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: DTDataList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DTDataList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data, DTData{}) + if err := m.Data[len(m.Data)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UserPreferences) 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 ErrIntOverflowModels + } + 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: UserPreferences: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UserPreferences: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustNonAccreditedServices", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TrustNonAccreditedServices = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustAccreditedServices", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TrustAccreditedServices = bool(v != 0) + case 3: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TrustedServicesIDs = append(m.TrustedServicesIDs, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.TrustedServicesIDs) == 0 { + m.TrustedServicesIDs = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowModels + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TrustedServicesIDs = append(m.TrustedServicesIDs, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field TrustedServicesIDs", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipModels(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, ErrIntOverflowModels + } + 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, ErrIntOverflowModels + } + 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, ErrIntOverflowModels + } + 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, ErrInvalidLengthModels + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupModels + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthModels + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthModels = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowModels = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupModels = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/restaking/migrations/v2/store.go b/x/restaking/migrations/v2/store.go index 44273cc75..66e802ca7 100644 --- a/x/restaking/migrations/v2/store.go +++ b/x/restaking/migrations/v2/store.go @@ -4,13 +4,21 @@ import ( corestoretypes "cosmossdk.io/core/store" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/milkyway-labs/milkyway/v7/x/restaking/types" ) // MigrateStore performs in-place store migrations from v1 to v2. The migrations include: // - Properly setting the delegation-by-target-id values // - Removing joined operators that are not allowed by the services they have joined +// - Upgrading the user preferences to the new format func MigrateStore(ctx sdk.Context, keeper Keeper, storeService corestoretypes.KVStoreService, cdc codec.BinaryCodec) error { - return removeNotAllowedJoinedServices(ctx, keeper) + err := removeNotAllowedJoinedServices(ctx, keeper) + if err != nil { + return err + } + + return upgradeUserPreferences(ctx, storeService, cdc) } // -------------------------------------------------------------------------------------------------------------------- @@ -55,3 +63,58 @@ func removeNotAllowedJoinedServices(ctx sdk.Context, keeper Keeper) error { return nil } + +// -------------------------------------------------------------------------------------------------------------------- + +type userPreferencesEntry struct { + Key []byte + Value UserPreferences +} + +// upgradeUserPreferences upgrades the user preferences to the new format +func upgradeUserPreferences(ctx sdk.Context, storeService corestoretypes.KVStoreService, cdc codec.BinaryCodec) error { + store := storeService.OpenKVStore(ctx) + + iterator, err := store.Iterator(types.UserPreferencesPrefix, nil) + if err != nil { + return err + } + + // Get all the preferences + var entries []userPreferencesEntry + for ; iterator.Valid(); iterator.Next() { + var preferences UserPreferences + if err = cdc.Unmarshal(iterator.Value(), &preferences); err != nil { + return err + } + + entries = append(entries, userPreferencesEntry{ + Key: iterator.Key(), + Value: preferences, + }) + } + + // Close the iterator + if err = iterator.Close(); err != nil { + return err + } + + // Upgrade the preferences + for _, entry := range entries { + // Create the new preferences + var trustedServices []types.TrustedServiceEntry + for _, serviceID := range entry.Value.TrustedServicesIDs { + trustedServices = append(trustedServices, types.NewTrustedServiceEntry(serviceID, nil)) + } + + newPreferences := types.NewUserPreferences(trustedServices) + + // Store the preferences + err = store.Set(entry.Key, cdc.MustMarshal(&newPreferences)) + if err != nil { + return err + } + } + + return nil +} diff --git a/x/restaking/migrations/v2/store_test.go b/x/restaking/migrations/v2/store_test.go index a90d19ccf..5e6f91878 100644 --- a/x/restaking/migrations/v2/store_test.go +++ b/x/restaking/migrations/v2/store_test.go @@ -9,6 +9,7 @@ import ( operatorstypes "github.com/milkyway-labs/milkyway/v7/x/operators/types" v2 "github.com/milkyway-labs/milkyway/v7/x/restaking/migrations/v2" "github.com/milkyway-labs/milkyway/v7/x/restaking/testutils" + "github.com/milkyway-labs/milkyway/v7/x/restaking/types" servicestypes "github.com/milkyway-labs/milkyway/v7/x/services/types" ) @@ -155,3 +156,77 @@ func TestMigrateStore_removeNotAllowedJoinedServices(t *testing.T) { }) } } + +func TestMigrateStore_migratePreferences(t *testing.T) { + testData := testutils.NewKeeperTestData(t) + + testCases := []struct { + name string + oldPreferences []v2.UserPreferencesEntry + shouldErr bool + expPreferences []types.UserPreferencesEntry + }{ + { + name: "preferences are migrated properly", + oldPreferences: []v2.UserPreferencesEntry{ + { + UserAddress: "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + Preferences: v2.UserPreferences{ + TrustAccreditedServices: false, + TrustNonAccreditedServices: true, + TrustedServicesIDs: []uint32{1, 2, 3}, + }, + }, + { + UserAddress: "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", + Preferences: v2.UserPreferences{ + TrustAccreditedServices: false, + TrustNonAccreditedServices: true, + TrustedServicesIDs: []uint32{4, 5}, + }, + }, + }, + shouldErr: false, + expPreferences: []types.UserPreferencesEntry{ + types.NewUserPreferencesEntry("cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + })), + types.NewUserPreferencesEntry("cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(4, nil), + types.NewTrustedServiceEntry(5, nil), + })), + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + ctx, _ := testData.Context.CacheContext() + + // Store the delegations + store := testData.StoreService.OpenKVStore(ctx) + for _, entry := range tc.oldPreferences { + key := append(types.UserPreferencesPrefix, []byte(entry.UserAddress)...) + err := store.Set(key, testData.Cdc.MustMarshal(&entry.Preferences)) + require.NoError(t, err) + } + + err := v2.MigrateStore(ctx, testData.Keeper, testData.StoreService, testData.Cdc) + if tc.shouldErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + + // Check the new preferences + for _, entry := range tc.expPreferences { + stored, err := testData.Keeper.GetUserPreferences(ctx, entry.UserAddress) + require.NoError(t, err) + require.Equal(t, entry.Preferences, stored) + } + }) + } +} diff --git a/x/restaking/simulation/utils.go b/x/restaking/simulation/utils.go index b288a4ac9..59584c617 100644 --- a/x/restaking/simulation/utils.go +++ b/x/restaking/simulation/utils.go @@ -129,19 +129,12 @@ func RandomParams(r *rand.Rand) types.Params { func RandomUserPreferences(r *rand.Rand, services []servicestypes.Service) types.UserPreferences { // Add some services to the user's trusted services - userTrustedServiceIDs := utils.Map(simtesting.RandomSubSlice(r, services), func(s servicestypes.Service) uint32 { - return s.ID + trustedServices := simtesting.RandomSubSlice(r, services) + trustedServiceEntries := utils.Map(trustedServices, func(s servicestypes.Service) types.TrustedServiceEntry { + return types.NewTrustedServiceEntry(s.ID, nil) }) - // Create the user preferences - userPreferences := types.NewUserPreferences( - // 50% of trusting non accredited service - r.Intn(2) == 0, - // 50% of trusting accredited service - r.Intn(2) == 0, - userTrustedServiceIDs, - ) - return userPreferences + return types.NewUserPreferences(trustedServiceEntries) } func GetRandomExistingDelegation( diff --git a/x/restaking/types/expected_keepers.go b/x/restaking/types/expected_keepers.go index e320a805a..9ee8a6bfe 100644 --- a/x/restaking/types/expected_keepers.go +++ b/x/restaking/types/expected_keepers.go @@ -27,6 +27,7 @@ type BankKeeper interface { type PoolsKeeper interface { GetPoolByDenom(ctx context.Context, denom string) (poolstypes.Pool, bool, error) CreateOrGetPoolByDenom(ctx context.Context, denom string) (poolstypes.Pool, error) + HasPool(ctx context.Context, poolID uint32) (bool, error) GetPool(ctx context.Context, poolID uint32) (poolstypes.Pool, error) SavePool(ctx context.Context, pool poolstypes.Pool) error IteratePools(ctx context.Context, cb func(poolstypes.Pool) (bool, error)) error diff --git a/x/restaking/types/genesis_test.go b/x/restaking/types/genesis_test.go index 7607e8c9f..593a8c6fe 100644 --- a/x/restaking/types/genesis_test.go +++ b/x/restaking/types/genesis_test.go @@ -242,11 +242,9 @@ func TestGenesis_Validate(t *testing.T) { []types.UserPreferencesEntry{ types.NewUserPreferencesEntry( "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - types.NewUserPreferences( - true, - false, - []uint32{0}, - ), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(0, []uint32{1}), + }), ), }, types.DefaultParams(), @@ -318,11 +316,11 @@ func TestGenesis_Validate(t *testing.T) { []types.UserPreferencesEntry{ types.NewUserPreferencesEntry( "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - ), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + }), ), }, types.NewParams(5*24*time.Hour, nil, sdkmath.LegacyNewDec(100000)), diff --git a/x/restaking/types/messages_test.go b/x/restaking/types/messages_test.go index 40a27791f..069d24384 100644 --- a/x/restaking/types/messages_test.go +++ b/x/restaking/types/messages_test.go @@ -512,11 +512,11 @@ func TestMsgUndelegateService_GetSigners(t *testing.T) { // -------------------------------------------------------------------------------------------------------------------- var msgSetUserPreferences = types.NewMsgSetUserPreferences( - types.NewUserPreferences( - true, - false, - []uint32{1, 2, 3}, - ), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(2, nil), + types.NewTrustedServiceEntry(3, nil), + }), "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", ) @@ -529,11 +529,9 @@ func TestMsgSetUserPreferences_ValidateBasic(t *testing.T) { { name: "invalid preferences returns error", msg: types.NewMsgSetUserPreferences( - types.NewUserPreferences( - false, - true, - []uint32{0}, - ), + types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(0, nil), + }), msgSetUserPreferences.User, ), shouldErr: true, @@ -566,7 +564,7 @@ func TestMsgSetUserPreferences_ValidateBasic(t *testing.T) { } func TestMsgSetUserPreferences_GetSignBytes(t *testing.T) { - expected := `{"type":"milkyway/MsgSetUserPreferences","value":{"preferences":{"trust_non_accredited_services":true,"trusted_services_ids":[1,2,3]},"user":"cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"}}` + expected := `{"type":"milkyway/MsgSetUserPreferences","value":{"preferences":{"trusted_services":[{"service_id":1},{"service_id":2},{"service_id":3}]},"user":"cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd"}}` require.Equal(t, expected, string(msgSetUserPreferences.GetSignBytes())) } diff --git a/x/restaking/types/models.go b/x/restaking/types/models.go index cc1452f9a..ad017c128 100644 --- a/x/restaking/types/models.go +++ b/x/restaking/types/models.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/milkyway-labs/milkyway/v7/utils" operatorstypes "github.com/milkyway-labs/milkyway/v7/x/operators/types" poolstypes "github.com/milkyway-labs/milkyway/v7/x/pools/types" servicestypes "github.com/milkyway-labs/milkyway/v7/x/services/types" @@ -303,35 +304,132 @@ func MustUnmarshalUnbondingDelegation(cdc codec.BinaryCodec, bz []byte) Unbondin // -------------------------------------------------------------------------------------------------------------------- // NewUserPreferences creates a new UserPreferences instance -func NewUserPreferences(trustNonAccreditedServices bool, trustAccreditedServices bool, trustedServiceIDs []uint32) UserPreferences { +func NewUserPreferences(trustedServices []TrustedServiceEntry) UserPreferences { return UserPreferences{ - TrustNonAccreditedServices: trustNonAccreditedServices, - TrustAccreditedServices: trustAccreditedServices, - TrustedServicesIDs: trustedServiceIDs, + TrustedServices: trustedServices, } } // DefaultUserPreferences returns the default user preferences func DefaultUserPreferences() UserPreferences { - return NewUserPreferences(false, true, nil) + return NewUserPreferences(nil) } // Validate validates the user preferences func (p UserPreferences) Validate() error { - for _, serviceID := range p.TrustedServicesIDs { - if serviceID == 0 { - return fmt.Errorf("invalid service id") + var trustedServicesIDs []uint32 + for _, entry := range p.TrustedServices { + // Validate the entry + if err := entry.Validate(); err != nil { + return err + } + + // Make sure there are no other entries for the same service id + if slices.Contains(trustedServicesIDs, entry.ServiceID) { + return fmt.Errorf("duplicate service id: %d", entry.ServiceID) } - } - // TODO: check duplicate service IDs + trustedServicesIDs = append(trustedServicesIDs, entry.ServiceID) + } return nil } -// IsServiceTrusted returns whether the user trusts the given service -func (p UserPreferences) IsServiceTrusted(service servicestypes.Service) bool { - return slices.Contains(p.TrustedServicesIDs, service.ID) || - (service.Accredited && p.TrustAccreditedServices) || - (!service.Accredited && p.TrustNonAccreditedServices) +// GetTrustedServiceEntry returns the trusted service entry for the given service id +func (p UserPreferences) GetTrustedServiceEntry(serviceID uint32) TrustedServiceEntry { + for _, entry := range p.TrustedServices { + if entry.ServiceID == serviceID { + return entry + } + } + return TrustedServiceEntry{} +} + +// TrustedServicesIDs returns the list of service ids that the user trusts +func (p UserPreferences) TrustedServicesIDs() []uint32 { + return utils.Map(p.TrustedServices, func(entry TrustedServiceEntry) uint32 { return entry.ServiceID }) +} + +// IsServiceTrusted tells whether the user trusts the given service +func (p UserPreferences) IsServiceTrusted(serviceID uint32) bool { + return len(p.TrustedServices) == 0 || slices.Contains(p.TrustedServicesIDs(), serviceID) +} + +// IsServiceTrustedWithPool tells whether the user trusts the given service with the given pool +func (p UserPreferences) IsServiceTrustedWithPool(serviceID, poolID uint32) bool { + if len(p.TrustedServices) == 0 { + return true + } + entry := p.GetTrustedServiceEntry(serviceID) + return entry.ServiceID != 0 && (len(entry.PoolsIDs) == 0 || slices.Contains(entry.PoolsIDs, poolID)) +} + +// ComputeChangedServices returns the list of services that have changed between the two user preferences. +// A service is considered changed in the following cases: +// - It was trusted in the old preferences but not in the new preferences +// - It was not trusted in the old preferences but it is in the new preferences +// - It was trusted in both preferences but the pools have changed +// +// The returned list will contain an entry for each service that has changed. +// The entry will contain the service id and the pools ids that have changed (either removed or added). +// CONTRACT: this function is never triggered in Begin/End block or any proposal execution +func ComputeChangedServices(before UserPreferences, after UserPreferences) (changed []TrustedServiceEntry) { + beforeTrusted := before.TrustedServicesIDs() + afterTrusted := after.TrustedServicesIDs() + + // Get the deleted entries (A - B) + for _, serviceID := range utils.Difference(beforeTrusted, afterTrusted) { + changed = append(changed, before.GetTrustedServiceEntry(serviceID)) + } + + // Get the added entries (B - A) + for _, serviceID := range utils.Difference(afterTrusted, beforeTrusted) { + changed = append(changed, after.GetTrustedServiceEntry(serviceID)) + } + + // Find the list of services that have changed pools (A ∩ B) + for _, serviceID := range utils.Intersect(beforeTrusted, afterTrusted) { + beforePools := before.GetTrustedServiceEntry(serviceID).PoolsIDs + afterPools := after.GetTrustedServiceEntry(serviceID).PoolsIDs + + removedPools := utils.Difference(beforePools, afterPools) + addedPools := utils.Difference(afterPools, beforePools) + + if !slices.Equal(beforePools, afterPools) { + changed = append(changed, NewTrustedServiceEntry( + serviceID, + utils.Union(removedPools, addedPools), + )) + } + } + + return changed +} + +// NewTrustedServiceEntry creates a new TrustedServiceEntry instance +func NewTrustedServiceEntry(serviceID uint32, poolsIDs []uint32) TrustedServiceEntry { + return TrustedServiceEntry{ + ServiceID: serviceID, + PoolsIDs: poolsIDs, + } +} + +// Validate validates the trusted service entry +func (e TrustedServiceEntry) Validate() error { + if e.ServiceID == 0 { + return fmt.Errorf("invalid service id") + } + + for _, poolID := range e.PoolsIDs { + if poolID == 0 { + return fmt.Errorf("invalid pool id") + } + } + + duplicated := utils.FindDuplicate(e.PoolsIDs) + if duplicated != nil { + return fmt.Errorf("duplicated pool id: %d", *duplicated) + } + + return nil } diff --git a/x/restaking/types/models.pb.go b/x/restaking/types/models.pb.go index 5246b849e..341290274 100644 --- a/x/restaking/types/models.pb.go +++ b/x/restaking/types/models.pb.go @@ -390,15 +390,8 @@ func (m *DTDataList) GetData() []DTData { // UserPreferences is a struct that contains a user's preferences for // restaking. type UserPreferences struct { - // TrustNonAccreditedServices tells whether the user trusts all non-accredited - // services present on the platform. - TrustNonAccreditedServices bool `protobuf:"varint,1,opt,name=trust_non_accredited_services,json=trustNonAccreditedServices,proto3" json:"trust_non_accredited_services,omitempty"` - // TrustAccreditedServices tells whether the user trusts all accredited - // services present on the platform. - TrustAccreditedServices bool `protobuf:"varint,2,opt,name=trust_accredited_services,json=trustAccreditedServices,proto3" json:"trust_accredited_services,omitempty"` - // TrustedServicesIDs is a list of service IDs that the user trusts (both - // accredited and non-accredited). - TrustedServicesIDs []uint32 `protobuf:"varint,3,rep,packed,name=trusted_services_ids,json=trustedServicesIds,proto3" json:"trusted_services_ids,omitempty"` + // TrustedServices is a list of services that the user trusts + TrustedServices []TrustedServiceEntry `protobuf:"bytes,4,rep,name=trusted_services,json=trustedServices,proto3" json:"trusted_services"` } func (m *UserPreferences) Reset() { *m = UserPreferences{} } @@ -434,23 +427,65 @@ func (m *UserPreferences) XXX_DiscardUnknown() { var xxx_messageInfo_UserPreferences proto.InternalMessageInfo -func (m *UserPreferences) GetTrustNonAccreditedServices() bool { +func (m *UserPreferences) GetTrustedServices() []TrustedServiceEntry { if m != nil { - return m.TrustNonAccreditedServices + return m.TrustedServices } - return false + return nil +} + +// TrustedServiceEntry is a struct that contains the ID of a service that the user trusts +// and the IDs of the pools that the user wants the service to access +type TrustedServiceEntry struct { + // ServiceID represents the ID of the service that the user trusts + ServiceID uint32 `protobuf:"varint,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + // PoolsIDs represents the IDs of the pools that the user wants the service with ServiceID to access + PoolsIDs []uint32 `protobuf:"varint,2,rep,packed,name=pools_ids,json=poolsIds,proto3" json:"pools_ids,omitempty"` +} + +func (m *TrustedServiceEntry) Reset() { *m = TrustedServiceEntry{} } +func (m *TrustedServiceEntry) String() string { return proto.CompactTextString(m) } +func (*TrustedServiceEntry) ProtoMessage() {} +func (*TrustedServiceEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_86f4cd48423b1e2f, []int{7} +} +func (m *TrustedServiceEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TrustedServiceEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TrustedServiceEntry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TrustedServiceEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_TrustedServiceEntry.Merge(m, src) +} +func (m *TrustedServiceEntry) XXX_Size() int { + return m.Size() +} +func (m *TrustedServiceEntry) XXX_DiscardUnknown() { + xxx_messageInfo_TrustedServiceEntry.DiscardUnknown(m) } -func (m *UserPreferences) GetTrustAccreditedServices() bool { +var xxx_messageInfo_TrustedServiceEntry proto.InternalMessageInfo + +func (m *TrustedServiceEntry) GetServiceID() uint32 { if m != nil { - return m.TrustAccreditedServices + return m.ServiceID } - return false + return 0 } -func (m *UserPreferences) GetTrustedServicesIDs() []uint32 { +func (m *TrustedServiceEntry) GetPoolsIDs() []uint32 { if m != nil { - return m.TrustedServicesIDs + return m.PoolsIDs } return nil } @@ -464,6 +499,7 @@ func init() { proto.RegisterType((*DTData)(nil), "milkyway.restaking.v1.DTData") proto.RegisterType((*DTDataList)(nil), "milkyway.restaking.v1.DTDataList") proto.RegisterType((*UserPreferences)(nil), "milkyway.restaking.v1.UserPreferences") + proto.RegisterType((*TrustedServiceEntry)(nil), "milkyway.restaking.v1.TrustedServiceEntry") } func init() { @@ -471,65 +507,66 @@ func init() { } var fileDescriptor_86f4cd48423b1e2f = []byte{ - // 919 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xda, 0x26, 0x4d, 0xc6, 0x89, 0xed, 0x0e, 0x81, 0x6c, 0xdc, 0xd6, 0x6b, 0x2c, 0x21, - 0x4c, 0x51, 0x76, 0x89, 0x2b, 0x81, 0x08, 0x5c, 0xec, 0x78, 0xa1, 0x46, 0x51, 0x6c, 0x6d, 0x36, - 0x48, 0x70, 0x59, 0x8d, 0x77, 0xa7, 0x9b, 0x51, 0xec, 0x19, 0x6b, 0x67, 0x6c, 0xf0, 0x3f, 0xe8, - 0x81, 0x43, 0x7f, 0x42, 0x05, 0x1c, 0x10, 0x07, 0xc4, 0x81, 0x1f, 0xd1, 0x1b, 0x15, 0x27, 0xc4, - 0x21, 0x45, 0xce, 0xa1, 0xfc, 0x0c, 0xb4, 0xb3, 0xbb, 0xb6, 0x65, 0x1c, 0x51, 0x50, 0x50, 0x2f, - 0x89, 0xe7, 0xbd, 0xef, 0x9b, 0x79, 0xdf, 0x7b, 0xdf, 0xb3, 0x0c, 0xaa, 0x03, 0xd2, 0x3f, 0x9f, - 0x7c, 0x89, 0x26, 0x46, 0x80, 0xb9, 0x40, 0xe7, 0x84, 0xfa, 0xc6, 0x78, 0xdf, 0x18, 0x30, 0x0f, - 0xf7, 0xb9, 0x3e, 0x0c, 0x98, 0x60, 0xf0, 0xb5, 0x04, 0xa3, 0xcf, 0x30, 0xfa, 0x78, 0xbf, 0x74, - 0x13, 0x0d, 0x08, 0x65, 0x86, 0xfc, 0x1b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xef, 0x2d, - 0x2c, 0x4a, 0x32, 0xbf, 0xbd, 0x3e, 0xea, 0xf1, 0xd9, 0xc9, 0x18, 0xbf, 0x6f, 0x7c, 0xb5, 0xf0, - 0x43, 0x43, 0x2e, 0x4f, 0x6f, 0x4d, 0x7e, 0x7b, 0xdc, 0xfb, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x63, - 0x80, 0x46, 0xe8, 0x8b, 0x08, 0x00, 0x00, + // 936 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x41, 0x6f, 0x1b, 0xc5, + 0x17, 0xf7, 0xd8, 0xfe, 0xa7, 0xf6, 0x38, 0xb1, 0xdd, 0x69, 0xfe, 0xca, 0x26, 0x2d, 0x5e, 0x63, + 0x09, 0x61, 0x02, 0xd9, 0x25, 0xae, 0x04, 0xa2, 0x70, 0x89, 0xb3, 0x0b, 0x6c, 0x15, 0xd5, 0xd6, + 0x66, 0x83, 0x04, 0x97, 0xd5, 0xd8, 0x3b, 0xdd, 0x8c, 0x62, 0xef, 0x58, 0x3b, 0x63, 0x83, 0x3f, + 0x01, 0x3d, 0x70, 0xe8, 0x47, 0xa8, 0x80, 0x03, 0xe2, 0x80, 0x38, 0xf0, 0x21, 0x7a, 0xa3, 0xe2, + 0xc4, 0xc9, 0x45, 0xce, 0xa1, 0x7c, 0x0c, 0xb4, 0xb3, 0xbb, 0xb6, 0x1b, 0x12, 0x51, 0x50, 0x11, + 0x97, 0x24, 0xf3, 0xde, 0xef, 0xbd, 0x79, 0xbf, 0xdf, 0xfc, 0xde, 0x2a, 0xb0, 0x31, 0xa4, 0x83, + 0xb3, 0xe9, 0xe7, 0x78, 0xaa, 0x87, 0x84, 0x0b, 0x7c, 0x46, 0x03, 0x5f, 0x9f, 0xec, 0xeb, 0x43, + 0xe6, 0x91, 0x01, 0xd7, 0x46, 0x21, 0x13, 0x0c, 0xfd, 0x3f, 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e, + 0x27, 0xff, 0xe0, 0x9b, 0x5a, 0xa6, 0xdd, 0x7d, 0x3c, 0xaf, 0x81, 0x27, 0xf3, 0x1a, 0xf8, 0x6d, + 0x5e, 0x03, 0x0f, 0xcf, 0x6b, 0x99, 0x27, 0xe7, 0xb5, 0xcc, 0xaf, 0xe7, 0xb5, 0xcc, 0x67, 0xef, + 0xac, 0x6c, 0x51, 0x2a, 0xff, 0xde, 0x00, 0xf7, 0xf8, 0xe2, 0xa4, 0x4f, 0xde, 0xd5, 0xbf, 0x58, + 0xf9, 0x2f, 0x44, 0x6e, 0x56, 0x6f, 0x4d, 0x7e, 0x5a, 0x6e, 0xff, 0x11, 0x00, 0x00, 0xff, 0xff, + 0x47, 0x12, 0x31, 0x4a, 0xa8, 0x08, 0x00, 0x00, } func (this *UnbondingDelegationEntry) Equal(that interface{}) bool { @@ -899,10 +936,47 @@ func (m *UserPreferences) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.TrustedServicesIDs) > 0 { - dAtA4 := make([]byte, len(m.TrustedServicesIDs)*10) + if len(m.TrustedServices) > 0 { + for iNdEx := len(m.TrustedServices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TrustedServices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + return len(dAtA) - i, nil +} + +func (m *TrustedServiceEntry) 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 *TrustedServiceEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TrustedServiceEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PoolsIDs) > 0 { + dAtA4 := make([]byte, len(m.PoolsIDs)*10) var j3 int - for _, num := range m.TrustedServicesIDs { + for _, num := range m.PoolsIDs { for num >= 1<<7 { dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -915,25 +989,10 @@ func (m *UserPreferences) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], dAtA4[:j3]) i = encodeVarintModels(dAtA, i, uint64(j3)) i-- - dAtA[i] = 0x1a - } - if m.TrustAccreditedServices { - i-- - if m.TrustAccreditedServices { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if m.TrustNonAccreditedServices { - i-- - if m.TrustNonAccreditedServices { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + if m.ServiceID != 0 { + i = encodeVarintModels(dAtA, i, uint64(m.ServiceID)) i-- dAtA[i] = 0x8 } @@ -1087,15 +1146,27 @@ func (m *UserPreferences) Size() (n int) { } var l int _ = l - if m.TrustNonAccreditedServices { - n += 2 + if len(m.TrustedServices) > 0 { + for _, e := range m.TrustedServices { + l = e.Size() + n += 1 + l + sovModels(uint64(l)) + } + } + return n +} + +func (m *TrustedServiceEntry) Size() (n int) { + if m == nil { + return 0 } - if m.TrustAccreditedServices { - n += 2 + var l int + _ = l + if m.ServiceID != 0 { + n += 1 + sovModels(uint64(m.ServiceID)) } - if len(m.TrustedServicesIDs) > 0 { + if len(m.PoolsIDs) > 0 { l = 0 - for _, e := range m.TrustedServicesIDs { + for _, e := range m.PoolsIDs { l += sovModels(uint64(e)) } n += 1 + sovModels(uint64(l)) + l @@ -1956,11 +2027,11 @@ func (m *UserPreferences) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: UserPreferences: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TrustNonAccreditedServices", wireType) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrustedServices", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowModels @@ -1970,17 +2041,81 @@ func (m *UserPreferences) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.TrustNonAccreditedServices = bool(v != 0) - case 2: + if msglen < 0 { + return ErrInvalidLengthModels + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModels + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TrustedServices = append(m.TrustedServices, TrustedServiceEntry{}) + if err := m.TrustedServices[len(m.TrustedServices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipModels(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthModels + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TrustedServiceEntry) 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 ErrIntOverflowModels + } + 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: TrustedServiceEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TrustedServiceEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TrustAccreditedServices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ServiceID", wireType) } - var v int + m.ServiceID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowModels @@ -1990,13 +2125,12 @@ func (m *UserPreferences) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + m.ServiceID |= uint32(b&0x7F) << shift if b < 0x80 { break } } - m.TrustAccreditedServices = bool(v != 0) - case 3: + case 2: if wireType == 0 { var v uint32 for shift := uint(0); ; shift += 7 { @@ -2013,7 +2147,7 @@ func (m *UserPreferences) Unmarshal(dAtA []byte) error { break } } - m.TrustedServicesIDs = append(m.TrustedServicesIDs, v) + m.PoolsIDs = append(m.PoolsIDs, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { @@ -2048,8 +2182,8 @@ func (m *UserPreferences) Unmarshal(dAtA []byte) error { } } elementCount = count - if elementCount != 0 && len(m.TrustedServicesIDs) == 0 { - m.TrustedServicesIDs = make([]uint32, 0, elementCount) + if elementCount != 0 && len(m.PoolsIDs) == 0 { + m.PoolsIDs = make([]uint32, 0, elementCount) } for iNdEx < postIndex { var v uint32 @@ -2067,10 +2201,10 @@ func (m *UserPreferences) Unmarshal(dAtA []byte) error { break } } - m.TrustedServicesIDs = append(m.TrustedServicesIDs, v) + m.PoolsIDs = append(m.PoolsIDs, v) } } else { - return fmt.Errorf("proto: wrong wireType = %d for field TrustedServicesIDs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolsIDs", wireType) } default: iNdEx = preIndex diff --git a/x/restaking/types/models_test.go b/x/restaking/types/models_test.go index cf0772adf..b228017b9 100644 --- a/x/restaking/types/models_test.go +++ b/x/restaking/types/models_test.go @@ -193,18 +193,31 @@ func TestUserPreferences_Validate(t *testing.T) { }{ { name: "invalid service id returns error", - preferences: types.UserPreferences{ - TrustedServicesIDs: []uint32{0}, - }, + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(0, nil), + }), + shouldErr: true, + }, + { + name: "invalid pool id returns error", + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{0}), + }), + shouldErr: true, + }, + { + name: "duplicated entry for the same service id returns error", + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + types.NewTrustedServiceEntry(1, nil), + }), shouldErr: true, }, { name: "valid preferences returns no error", - preferences: types.NewUserPreferences( - false, - true, - []uint32{1, 2, 6, 7}, - ), + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1, 2}), + }), shouldErr: false, }, } @@ -222,46 +235,18 @@ func TestUserPreferences_Validate(t *testing.T) { } } -func TestUserPreferences_IsServiceTrusted(t *testing.T) { +func TestUserPreferences_TrustedServicesIDs(t *testing.T) { testCases := []struct { name string preferences types.UserPreferences service servicestypes.Service - trusted bool + expTrusted bool }{ { - name: "user does not trust any services - accredited service", - preferences: types.NewUserPreferences(false, false, nil), - service: servicestypes.NewService( - 1, - servicestypes.SERVICE_STATUS_ACTIVE, - "MilkyWay", - "MilkyWay is an AVS of a restaking platform", - "https://milkyway.com", - "https://milkyway.com/logo.png", - "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - true, - ), - trusted: false, - }, - { - name: "user does not trust any services - non-accredited service", - preferences: types.NewUserPreferences(false, false, nil), - service: servicestypes.NewService( - 1, - servicestypes.SERVICE_STATUS_ACTIVE, - "MilkyWay", - "MilkyWay is an AVS of a restaking platform", - "https://milkyway.com", - "https://milkyway.com/logo.png", - "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - false, - ), - trusted: false, - }, - { - name: "user only trusts accredited services - accredited service", - preferences: types.NewUserPreferences(false, true, nil), + name: "user trusts only specified services - specified and accredited service", + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + }), service: servicestypes.NewService( 1, servicestypes.SERVICE_STATUS_ACTIVE, @@ -272,11 +257,13 @@ func TestUserPreferences_IsServiceTrusted(t *testing.T) { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", true, ), - trusted: true, + expTrusted: true, }, { - name: "user only trusts accredited services - non-accredited service", - preferences: types.NewUserPreferences(false, true, nil), + name: "user trusts only specified services - specified and non-accredited service", + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + }), service: servicestypes.NewService( 1, servicestypes.SERVICE_STATUS_ACTIVE, @@ -287,13 +274,15 @@ func TestUserPreferences_IsServiceTrusted(t *testing.T) { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", false, ), - trusted: false, + expTrusted: true, }, { - name: "user only trusts non-accredited services - accredited service", - preferences: types.NewUserPreferences(true, false, nil), + name: "user trusts only specified services - not specified and accredited service", + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + }), service: servicestypes.NewService( - 1, + 2, servicestypes.SERVICE_STATUS_ACTIVE, "MilkyWay", "MilkyWay is an AVS of a restaking platform", @@ -302,13 +291,14 @@ func TestUserPreferences_IsServiceTrusted(t *testing.T) { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", true, ), - trusted: false, + expTrusted: false, }, { - name: "user only trusts non-accredited services - non-accredited service", - preferences: types.NewUserPreferences(true, false, nil), - service: servicestypes.NewService( - 1, + name: "user trusts only specified services - not specified and non-accredited service", + preferences: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, nil), + }), service: servicestypes.NewService( + 2, servicestypes.SERVICE_STATUS_ACTIVE, "MilkyWay", "MilkyWay is an AVS of a restaking platform", @@ -317,104 +307,91 @@ func TestUserPreferences_IsServiceTrusted(t *testing.T) { "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", false, ), - trusted: true, - }, - { - name: "user trusts both accredited and non-accredited services - accredited service", - preferences: types.NewUserPreferences(true, true, nil), - service: servicestypes.NewService( - 1, - servicestypes.SERVICE_STATUS_ACTIVE, - "MilkyWay", - "MilkyWay is an AVS of a restaking platform", - "https://milkyway.com", - "https://milkyway.com/logo.png", - "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - true, - ), - trusted: true, + expTrusted: false, }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + trusted := tc.preferences.TrustedServicesIDs() + if tc.expTrusted { + require.Contains(t, trusted, tc.service.ID) + } else { + require.NotContains(t, trusted, tc.service.ID) + } + }) + } +} + +// -------------------------------------------------------------------------------------------------------------------- + +func TestComputeChangedServices(t *testing.T) { + testCases := []struct { + name string + before types.UserPreferences + after types.UserPreferences + expEntries []types.TrustedServiceEntry + }{ { - name: "user trusts both accredited and non-accredited services - non-accredited service", - preferences: types.NewUserPreferences(true, true, nil), - service: servicestypes.NewService( - 1, - servicestypes.SERVICE_STATUS_ACTIVE, - "MilkyWay", - "MilkyWay is an AVS of a restaking platform", - "https://milkyway.com", - "https://milkyway.com/logo.png", - "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - false, - ), - trusted: true, + name: "no changes", + before: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1, 2}), + }), + after: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1, 2}), + }), + expEntries: nil, }, { - name: "user trusts only specified services - specified and accredited service", - preferences: types.NewUserPreferences(false, false, []uint32{1}), - service: servicestypes.NewService( - 1, - servicestypes.SERVICE_STATUS_ACTIVE, - "MilkyWay", - "MilkyWay is an AVS of a restaking platform", - "https://milkyway.com", - "https://milkyway.com/logo.png", - "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - true, - ), - trusted: true, + name: "service removed", + before: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1, 2}), + }), + after: types.NewUserPreferences(nil), + expEntries: []types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1, 2}), + }, }, { - name: "user trusts only specified services - specified and non-accredited service", - preferences: types.NewUserPreferences(false, false, []uint32{1}), - service: servicestypes.NewService( - 1, - servicestypes.SERVICE_STATUS_ACTIVE, - "MilkyWay", - "MilkyWay is an AVS of a restaking platform", - "https://milkyway.com", - "https://milkyway.com/logo.png", - "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - false, - ), - trusted: true, + name: "service added", + before: types.NewUserPreferences(nil), + after: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1, 2}), + }), + expEntries: []types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1, 2}), + }, }, { - name: "user trusts only specified services - not specified and accredited service", - preferences: types.NewUserPreferences(false, false, []uint32{1}), - service: servicestypes.NewService( - 2, - servicestypes.SERVICE_STATUS_ACTIVE, - "MilkyWay", - "MilkyWay is an AVS of a restaking platform", - "https://milkyway.com", - "https://milkyway.com/logo.png", - "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - true, - ), - trusted: false, + name: "pool within service removed", + before: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1, 2}), + }), + after: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1}), + }), + expEntries: []types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{2}), + }, }, { - name: "user trusts only specified services - not specified and non-accredited service", - preferences: types.NewUserPreferences(false, false, []uint32{1}), - service: servicestypes.NewService( - 2, - servicestypes.SERVICE_STATUS_ACTIVE, - "MilkyWay", - "MilkyWay is an AVS of a restaking platform", - "https://milkyway.com", - "https://milkyway.com/logo.png", - "cosmos13t6y2nnugtshwuy0zkrq287a95lyy8vzleaxmd", - false, - ), - trusted: false, + name: "pool within service added", + before: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1}), + }), + after: types.NewUserPreferences([]types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{1, 2}), + }), + expEntries: []types.TrustedServiceEntry{ + types.NewTrustedServiceEntry(1, []uint32{2}), + }, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - trusted := tc.preferences.IsServiceTrusted(tc.service) - require.Equal(t, tc.trusted, trusted) + entries := types.ComputeChangedServices(tc.before, tc.after) + require.Equal(t, tc.expEntries, entries) }) } } diff --git a/x/rewards/client/cli/utils_test.go b/x/rewards/client/cli/utils_test.go index 6510731a1..0b0fcc908 100644 --- a/x/rewards/client/cli/utils_test.go +++ b/x/rewards/client/cli/utils_test.go @@ -35,19 +35,19 @@ func TestCLIUtils_parseRewardsPlan(t *testing.T) { "pools_distribution": { "weight": 1, "type": { - "@type":"/milkyway.rewards.v2.DistributionTypeBasic" + "@type":"/milkyway.rewards.v1.DistributionTypeBasic" } }, "operators_distribution": { "weight": 2, "type": { - "@type": "/milkyway.rewards.v2.DistributionTypeBasic" + "@type": "/milkyway.rewards.v1.DistributionTypeBasic" } }, "users_distribution": { "weight": 3, "type": { - "@type": "/milkyway.rewards.v2.UsersDistributionTypeBasic" + "@type": "/milkyway.rewards.v1.UsersDistributionTypeBasic" } }, "fee_amount": "100uinit" @@ -79,19 +79,19 @@ func TestCLIUtils_parseRewardsPlan(t *testing.T) { "pools_distribution": { "weight": 1, "type": { - "@type":"/milkyway.rewards.v2.DistributionTypeBasic" + "@type":"/milkyway.rewards.v1.DistributionTypeBasic" } }, "operators_distribution": { "weight": 2, "type": { - "@type": "/milkyway.rewards.v2.DistributionTypeEgalitarian" + "@type": "/milkyway.rewards.v1.DistributionTypeEgalitarian" } }, "users_distribution": { "weight": 3, "type": { - "@type": "/milkyway.rewards.v2.UsersDistributionTypeBasic" + "@type": "/milkyway.rewards.v1.UsersDistributionTypeBasic" } }, "fee_amount": "100uinit" @@ -123,21 +123,21 @@ func TestCLIUtils_parseRewardsPlan(t *testing.T) { "pools_distribution": { "weight": 1, "type": { - "@type":"/milkyway.rewards.v2.DistributionTypeWeighted", + "@type":"/milkyway.rewards.v1.DistributionTypeWeighted", "weights": [{ "delegation_target_id": 1, "weight": 1 }] } }, "operators_distribution": { "weight": 2, "type": { - "@type": "/milkyway.rewards.v2.DistributionTypeWeighted", + "@type": "/milkyway.rewards.v1.DistributionTypeWeighted", "weights": [{ "delegation_target_id": 2, "weight": 2 }] } }, "users_distribution": { "weight": 3, "type": { - "@type": "/milkyway.rewards.v2.UsersDistributionTypeBasic" + "@type": "/milkyway.rewards.v1.UsersDistributionTypeBasic" } }, "fee_amount": "100uinit" @@ -168,19 +168,19 @@ func TestCLIUtils_parseRewardsPlan(t *testing.T) { "pools_distribution": { "weight": 1, "type": { - "@type":"/milkyway.rewards.v2.DistributionTypeBasic" + "@type":"/milkyway.rewards.v1.DistributionTypeBasic" } }, "operators_distribution": { "weight": 2, "type": { - "@type": "/milkyway.rewards.v2.DistributionTypeBasic" + "@type": "/milkyway.rewards.v1.DistributionTypeBasic" } }, "users_distribution": { "weight": 3, "type": { - "@type": "/milkyway.rewards.v2.UsersDistributionTypeBasic" + "@type": "/milkyway.rewards.v1.UsersDistributionTypeBasic" } } }`), diff --git a/x/rewards/keeper/allocation_test.go b/x/rewards/keeper/allocation_test.go index 4554c987e..71e902467 100644 --- a/x/rewards/keeper/allocation_test.go +++ b/x/rewards/keeper/allocation_test.go @@ -130,25 +130,37 @@ func (suite *KeeperTestSuite) TestAllocateRewards_BasicScenario() { suite.Require().NoError(err) aliceAddr := testutil.TestAddress(1) - suite.SetUserPreferences(ctx, aliceAddr.String(), false, true, nil) + suite.SetUserPreferences(ctx, aliceAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(service1.ID, nil), + restakingtypes.NewTrustedServiceEntry(service2.ID, nil), + }) suite.DelegatePool(ctx, utils.MustParseCoin("100_000000umilk"), aliceAddr.String(), true) // $200 suite.DelegatePool(ctx, utils.MustParseCoin("100_000000uinit"), aliceAddr.String(), true) // $300 suite.DelegatePool(ctx, utils.MustParseCoin("500_000000uusd"), aliceAddr.String(), true) // $500 bobAddr := testutil.TestAddress(2) - suite.SetUserPreferences(ctx, bobAddr.String(), false, true, nil) + suite.SetUserPreferences(ctx, bobAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(service1.ID, nil), + restakingtypes.NewTrustedServiceEntry(service2.ID, nil), + }) suite.DelegateService(ctx, service1.ID, utils.MustParseCoins("100_000000uinit"), bobAddr.String(), true) // $300 suite.DelegateService(ctx, service2.ID, utils.MustParseCoins("200_000000uinit"), bobAddr.String(), true) // $600 suite.DelegateService(ctx, service3.ID, utils.MustParseCoins("300_000000uinit"), bobAddr.String(), true) // $900 charlieAddr := testutil.TestAddress(3) - suite.SetUserPreferences(ctx, charlieAddr.String(), false, true, nil) + suite.SetUserPreferences(ctx, charlieAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(service1.ID, nil), + restakingtypes.NewTrustedServiceEntry(service2.ID, nil), + }) suite.DelegateOperator(ctx, operator1.ID, utils.MustParseCoins("1000_000000uusd"), charlieAddr.String(), true) // $1000 suite.DelegateOperator(ctx, operator2.ID, utils.MustParseCoins("1000_000000uusd"), charlieAddr.String(), true) // $1000 suite.DelegateOperator(ctx, operator3.ID, utils.MustParseCoins("500_000000uusd"), charlieAddr.String(), true) // $500 davidAddr := testutil.TestAddress(4) - suite.SetUserPreferences(ctx, davidAddr.String(), false, true, nil) + suite.SetUserPreferences(ctx, davidAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(service1.ID, nil), + restakingtypes.NewTrustedServiceEntry(service2.ID, nil), + }) suite.DelegatePool(ctx, utils.MustParseCoin("200_000000umilk"), davidAddr.String(), true) // $400 suite.DelegatePool(ctx, utils.MustParseCoin("200_000000uinit"), davidAddr.String(), true) // $600 suite.DelegatePool(ctx, utils.MustParseCoin("200_000000uusd"), davidAddr.String(), true) // $200 @@ -381,7 +393,6 @@ func (suite *KeeperTestSuite) TestAllocateRewards_ZeroDelegations() { // Two users delegate the same amount of $MILK to a pool and the service. delAddr1 := testutil.TestAddress(1) - suite.SetUserPreferences(ctx, delAddr1.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("10_000000umilk"), delAddr1.String(), true) delAddr2 := testutil.TestAddress(2) suite.DelegateService(ctx, service.ID, utils.MustParseCoins("10_000000umilk"), delAddr2.String(), true) @@ -435,17 +446,13 @@ func (suite *KeeperTestSuite) TestAllocateRewards_WeightedDistributions() { // Delegate to $MILK pool. delAddr1 := testutil.TestAddress(1) - suite.SetUserPreferences(ctx, delAddr1.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("300_000000umilk"), delAddr1.String(), true) delAddr2 := testutil.TestAddress(2) - suite.SetUserPreferences(ctx, delAddr2.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("200_000000umilk"), delAddr2.String(), true) // Delegate to $INIT pool. delAddr3 := testutil.TestAddress(3) - suite.SetUserPreferences(ctx, delAddr3.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("200_000000uinit"), delAddr3.String(), true) delAddr4 := testutil.TestAddress(4) - suite.SetUserPreferences(ctx, delAddr4.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("300_000000uinit"), delAddr4.String(), true) // Delegate to Operator1. delAddr5 := testutil.TestAddress(5) @@ -568,18 +575,14 @@ func (suite *KeeperTestSuite) TestAllocateRewards_EgalitarianDistributions() { // Delegate to $MILK pool. delAddr1 := testutil.TestAddress(1) - suite.SetUserPreferences(ctx, delAddr1.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("300_000000umilk"), delAddr1.String(), true) delAddr2 := testutil.TestAddress(2) - suite.SetUserPreferences(ctx, delAddr2.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("200_000000umilk"), delAddr2.String(), true) // Delegate to $INIT pool. delAddr3 := testutil.TestAddress(3) - suite.SetUserPreferences(ctx, delAddr3.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("200_000000uinit"), delAddr3.String(), true) delAddr4 := testutil.TestAddress(4) - suite.SetUserPreferences(ctx, delAddr4.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("300_000000uinit"), delAddr4.String(), true) // Delegate to Operator1. @@ -680,10 +683,16 @@ func (suite *KeeperTestSuite) TestAllocateRewards_TrustedServices() { // Delegate to $MILK pool. aliceAddr := testutil.TestAddress(1) - suite.SetUserPreferences(ctx, aliceAddr.String(), false, false, []uint32{service1.ID, service2.ID}) + suite.SetUserPreferences(ctx, aliceAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(service1.ID, nil), + restakingtypes.NewTrustedServiceEntry(service2.ID, nil), + }) suite.DelegatePool(ctx, utils.MustParseCoin("300_000000umilk"), aliceAddr.String(), true) + bobAddr := testutil.TestAddress(2) - suite.SetUserPreferences(ctx, bobAddr.String(), false, false, []uint32{service2.ID}) + suite.SetUserPreferences(ctx, bobAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(service2.ID, nil), + }) suite.DelegatePool(ctx, utils.MustParseCoin("200_000000umilk"), bobAddr.String(), true) // Rewards plan 1 allocates 1000 * 10 / 86400 ~= 0.115741 $SERVICE1 @@ -704,7 +713,7 @@ func (suite *KeeperTestSuite) TestAllocateRewards_TrustedServices() { suite.Require().Equal("231481.200000000000000000service2", rewards.Sum().String()) // By trusting all services, service 1 will be trusted by Bob as well. - suite.SetUserPreferences(ctx, bobAddr.String(), true, true, nil) + suite.SetUserPreferences(ctx, bobAddr.String(), nil) // Withdraw all rewards to make calculation easier. _, err = keeper.NewMsgServer(suite.keeper).WithdrawDelegatorReward( @@ -738,7 +747,9 @@ func (suite *KeeperTestSuite) TestAllocateRewards_TrustedServices() { // Now Alice decides to not trust service 2. // This will make Alice's rewards for the pool to be withdrawn automatically. - suite.SetUserPreferences(ctx, aliceAddr.String(), false, false, []uint32{service1.ID}) + suite.SetUserPreferences(ctx, aliceAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(service1.ID, nil), + }) rewards, err = suite.keeper.GetPoolDelegationRewards(ctx, aliceAddr, 1) suite.Require().NoError(err) @@ -786,10 +797,16 @@ func (suite *KeeperTestSuite) TestAllocateRewards_UserTrustedServiceUpdated() { // Delegate to $MILK pool. aliceAddr := testutil.TestAddress(1) - suite.SetUserPreferences(ctx, aliceAddr.String(), false, false, []uint32{service1.ID, service2.ID}) + suite.SetUserPreferences(ctx, aliceAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(service1.ID, nil), + restakingtypes.NewTrustedServiceEntry(service2.ID, nil), + }) suite.DelegatePool(ctx, utils.MustParseCoin("300_000000umilk"), aliceAddr.String(), true) + bobAddr := testutil.TestAddress(2) - suite.SetUserPreferences(ctx, bobAddr.String(), false, false, []uint32{service2.ID}) + suite.SetUserPreferences(ctx, bobAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(service2.ID, nil), + }) suite.DelegatePool(ctx, utils.MustParseCoin("200_000000umilk"), bobAddr.String(), true) // Rewards plan 1 allocates 1000 * 10 / 86400 ~= 0.115741 $SERVICE1 @@ -810,6 +827,10 @@ func (suite *KeeperTestSuite) TestAllocateRewards_UserTrustedServiceUpdated() { suite.Require().Equal("231481.200000000000000000service2", rewards.Sum().String()) charlieAddr := testutil.TestAddress(3) + // Service 3 doesn't exist, this means Charlie doesn't trust either service 1 or 2. + suite.SetUserPreferences(ctx, charlieAddr.String(), []restakingtypes.TrustedServiceEntry{ + restakingtypes.NewTrustedServiceEntry(3, nil), + }) suite.DelegatePool(ctx, utils.MustParseCoin("200_000000umilk"), charlieAddr.String(), true) // Withdraw all rewards to make calculation easier. diff --git a/x/rewards/keeper/common_test.go b/x/rewards/keeper/common_test.go index db1e3c51c..ad759066c 100644 --- a/x/rewards/keeper/common_test.go +++ b/x/rewards/keeper/common_test.go @@ -198,15 +198,10 @@ func (suite *KeeperTestSuite) UpdateOperatorParams( func (suite *KeeperTestSuite) SetUserPreferences( ctx sdk.Context, userAddress string, - trustNonAccreditedServices, - trustAccreditedServices bool, - trustedServicesIDs []uint32, + trustedServices []restakingtypes.TrustedServiceEntry, ) { - err := suite.restakingKeeper.SetUserPreferences( - ctx, - userAddress, - restakingtypes.NewUserPreferences(trustNonAccreditedServices, trustAccreditedServices, trustedServicesIDs), - ) + preferences := restakingtypes.NewUserPreferences(trustedServices) + err := suite.restakingKeeper.SetUserPreferences(ctx, userAddress, preferences) suite.Require().NoError(err) } diff --git a/x/rewards/keeper/grpc_query_test.go b/x/rewards/keeper/grpc_query_test.go index 7402635ee..7c36729aa 100644 --- a/x/rewards/keeper/grpc_query_test.go +++ b/x/rewards/keeper/grpc_query_test.go @@ -252,7 +252,6 @@ func (suite *KeeperTestSuite) TestQuerier_PoolOutstandingRewards() { // Delegate to the pool delAddr := testutil.TestAddress(1) - suite.SetUserPreferences(ctx, delAddr.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("100_000000umilk"), delAddr.String(), true) }, updateCtx: func(ctx sdk.Context) sdk.Context { @@ -563,7 +562,6 @@ func (suite *KeeperTestSuite) TestQuerier_PoolDelegationRewards() { // Delegate to the pool delAddr := testutil.TestAddress(1) - suite.SetUserPreferences(ctx, delAddr.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("100_000000umilk"), delAddr.String(), true) }, updateCtx: func(ctx sdk.Context) sdk.Context { @@ -802,7 +800,6 @@ func (suite *KeeperTestSuite) TestQuerier_DelegatorTotalRewards() { // Delegate to pools, operators and services delAddr := testutil.TestAddress(1) - suite.SetUserPreferences(ctx, delAddr.String(), true, true, nil) suite.DelegatePool(ctx, utils.MustParseCoin("100_000000umilk"), delAddr.String(), true) suite.DelegateOperator(ctx, operator.ID, utils.MustParseCoins("100_000000umilk"), delAddr.String(), true) suite.DelegateService(ctx, service.ID, utils.MustParseCoins("100_000000umilk"), delAddr.String(), true) diff --git a/x/rewards/keeper/hooks.go b/x/rewards/keeper/hooks.go index 432844225..b44b7e422 100644 --- a/x/rewards/keeper/hooks.go +++ b/x/rewards/keeper/hooks.go @@ -2,11 +2,10 @@ package keeper import ( "context" - "errors" - "cosmossdk.io/collections" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/milkyway-labs/milkyway/v7/utils" restakingtypes "github.com/milkyway-labs/milkyway/v7/x/restaking/types" servicestypes "github.com/milkyway-labs/milkyway/v7/x/services/types" ) @@ -133,60 +132,72 @@ func (k *Keeper) AfterDelegationModified(ctx context.Context, delType restakingt return nil } -// AfterServiceAccreditationModified implements servicestypes.ServicesHooks -func (k *Keeper) AfterServiceAccreditationModified(ctx context.Context, serviceID uint32) error { - service, err := k.servicesKeeper.GetService(ctx, serviceID) +// AfterUserPreferencesModified is called after a user's trust in a service is +// updated. It updates the total delegator shares for the service in all pools +// where the user has a delegation. +func (k *Keeper) AfterUserPreferencesModified( + ctx context.Context, + userAddress string, + oldPreferences restakingtypes.UserPreferences, + newPreferences restakingtypes.UserPreferences, +) error { + delAddr, err := k.accountKeeper.AddressCodec().StringToBytes(userAddress) + if err != nil { + return err + } + + allServices, err := k.servicesKeeper.GetServices(ctx) if err != nil { - if errors.Is(err, collections.ErrNotFound) { - return servicestypes.ErrServiceNotFound - } return err } + allServicesIDs := utils.Map(allServices, func(service servicestypes.Service) uint32 { + return service.ID + }) + + err = k.restakingKeeper.IterateUserPoolDelegations(ctx, userAddress, func(delegation restakingtypes.Delegation) (stop bool, err error) { + poolID := delegation.TargetID - err = k.restakingKeeper.IterateServiceDelegations(ctx, serviceID, func(del restakingtypes.Delegation) (stop bool, err error) { - preferences, err := k.restakingKeeper.GetUserPreferences(ctx, del.UserAddress) + pool, err := k.GetDelegationTarget(ctx, restakingtypes.DELEGATION_TYPE_POOL, poolID) if err != nil { return true, err } - // Clone the service and invert the accreditation status to get the - // previous state - serviceBefore := service - serviceBefore.Accredited = !serviceBefore.Accredited + for _, serviceID := range allServicesIDs { + trustedBefore := oldPreferences.IsServiceTrustedWithPool(serviceID, poolID) + trustedAfter := newPreferences.IsServiceTrustedWithPool(serviceID, poolID) - trustedBefore := preferences.IsServiceTrusted(serviceBefore) - trustedAfter := preferences.IsServiceTrusted(service) - if trustedBefore != trustedAfter { - err = k.AfterUserTrustedServiceUpdated(ctx, del.UserAddress, service.ID, trustedAfter) + if trustedBefore == trustedAfter { + continue + } + + // Calling these two methods has same effect as calling + // BeforePoolDelegationSharesModified and then AfterPoolDelegationModified. + _, err = k.withdrawDelegationRewards(ctx, pool, delegation) if err != nil { return true, err } - } - return false, nil - }) - if err != nil { - return err - } - return nil -} -// AfterUserPreferencesModified is called after a user's trust in a service is -// updated. It updates the total delegator shares for the service in all pools -// where the user has a delegation. -func (k *Keeper) AfterUserPreferencesModified( - ctx context.Context, - userAddress string, - oldPreferences, newPreferences restakingtypes.UserPreferences, -) error { - return k.servicesKeeper.IterateServices(ctx, func(service servicestypes.Service) (bool, error) { - trustedBefore := oldPreferences.IsServiceTrusted(service) - trustedAfter := newPreferences.IsServiceTrusted(service) - if trustedBefore != trustedAfter { - err := k.AfterUserTrustedServiceUpdated(ctx, userAddress, service.ID, trustedAfter) + err = k.initializeDelegation(ctx, pool, delAddr) + if err != nil { + return true, err + } + + if trustedAfter { + err = k.IncrementPoolServiceTotalDelegatorShares(ctx, poolID, serviceID, delegation.Shares) + } else { + err = k.DecrementPoolServiceTotalDelegatorShares(ctx, poolID, serviceID, delegation.Shares) + } + if err != nil { return true, err } } + return false, nil }) + if err != nil { + return err + } + + return nil } diff --git a/x/rewards/keeper/pool_service_shares.go b/x/rewards/keeper/pool_service_shares.go deleted file mode 100644 index c2ad4615a..000000000 --- a/x/rewards/keeper/pool_service_shares.go +++ /dev/null @@ -1,61 +0,0 @@ -package keeper - -import ( - "context" - - restakingtypes "github.com/milkyway-labs/milkyway/v7/x/restaking/types" -) - -// AfterUserTrustedServiceUpdated is called after a user's trust in a service is -// updated. AfterUserTrustedServiceUpdated updates the total delegator shares for -// the service in all pools where the user has a delegation. -func (k *Keeper) AfterUserTrustedServiceUpdated( - ctx context.Context, - userAddress string, - serviceID uint32, - trusted bool, -) error { - delAddr, err := k.accountKeeper.AddressCodec().StringToBytes(userAddress) - if err != nil { - return err - } - - return k.restakingKeeper.IterateUserPoolDelegations(ctx, userAddress, func(del restakingtypes.Delegation) (stop bool, err error) { - isSecured, err := k.restakingKeeper.IsServiceSecuredByPool(ctx, serviceID, del.TargetID) - if err != nil { - return true, err - } - - if !isSecured { - return false, nil - } - - pool, err := k.GetDelegationTarget(ctx, restakingtypes.DELEGATION_TYPE_POOL, del.TargetID) - if err != nil { - return true, err - } - - // Calling these two methods has same effect as calling - // BeforePoolDelegationSharesModified and then AfterPoolDelegationModified. - _, err = k.withdrawDelegationRewards(ctx, pool, del) - if err != nil { - return true, err - } - - err = k.initializeDelegation(ctx, pool, delAddr) - if err != nil { - return true, err - } - - if trusted { - err = k.IncrementPoolServiceTotalDelegatorShares(ctx, del.TargetID, serviceID, del.Shares) - } else { - err = k.DecrementPoolServiceTotalDelegatorShares(ctx, del.TargetID, serviceID, del.Shares) - } - if err != nil { - return true, err - } - - return false, nil - }) -} diff --git a/x/rewards/keeper/services_hooks.go b/x/rewards/keeper/services_hooks.go index ccfd0532c..15933c337 100644 --- a/x/rewards/keeper/services_hooks.go +++ b/x/rewards/keeper/services_hooks.go @@ -38,6 +38,6 @@ func (h ServicesHooks) BeforeServiceDeleted(ctx context.Context, serviceID uint3 } // AfterServiceAccreditationModified implements servicestypes.ServicesHooks -func (h ServicesHooks) AfterServiceAccreditationModified(ctx context.Context, serviceID uint32) error { - return h.k.AfterServiceAccreditationModified(ctx, serviceID) +func (h ServicesHooks) AfterServiceAccreditationModified(context.Context, uint32) error { + return nil } diff --git a/x/rewards/migrations/v2/models.pb.go b/x/rewards/migrations/v2/models.pb.go index bec329404..a45d34557 100644 --- a/x/rewards/migrations/v2/models.pb.go +++ b/x/rewards/migrations/v2/models.pb.go @@ -91,10 +91,6 @@ func (m *RewardsPlan) XXX_DiscardUnknown() { var xxx_messageInfo_RewardsPlan proto.InternalMessageInfo -func init() { - proto.RegisterType((*RewardsPlan)(nil), "milkyway.rewards.v1.RewardsPlan") -} - func init() { proto.RegisterFile("milkyway/rewards/v1/models.proto", fileDescriptor_fcf66d1f3415f5b6) } var fileDescriptor_fcf66d1f3415f5b6 = []byte{ diff --git a/x/rewards/types/codec.go b/x/rewards/types/codec.go index 5aca06d42..7a4b3f591 100644 --- a/x/rewards/types/codec.go +++ b/x/rewards/types/codec.go @@ -37,14 +37,14 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgUpdateParams{}, ) registry.RegisterInterface( - "milkyway.rewards.v2.DistributionType", + "milkyway.rewards.v1.DistributionType", (*DistributionType)(nil), &DistributionTypeBasic{}, &DistributionTypeWeighted{}, &DistributionTypeEgalitarian{}, ) registry.RegisterInterface( - "milkyway.rewards.v2.UsersDistributionType", + "milkyway.rewards.v1.UsersDistributionType", (*UsersDistributionType)(nil), &UsersDistributionTypeBasic{}, ) diff --git a/x/rewards/types/expected_keepers.go b/x/rewards/types/expected_keepers.go index d0d829f3a..b194e6460 100644 --- a/x/rewards/types/expected_keepers.go +++ b/x/rewards/types/expected_keepers.go @@ -58,6 +58,7 @@ type OperatorsKeeper interface { type ServicesKeeper interface { GetService(ctx context.Context, serviceID uint32) (servicestypes.Service, error) GetServiceParams(ctx context.Context, serviceID uint32) (servicestypes.ServiceParams, error) + GetServices(ctx context.Context) ([]servicestypes.Service, error) IterateServices(ctx context.Context, cb func(service servicestypes.Service) (stop bool, err error)) error } diff --git a/x/rewards/types/genesis.pb.go b/x/rewards/types/genesis.pb.go index 093887c7c..920e67da0 100644 --- a/x/rewards/types/genesis.pb.go +++ b/x/rewards/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: milkyway/rewards/v2/genesis.proto +// source: milkyway/rewards/v1/genesis.proto package types @@ -43,7 +43,7 @@ func (m *DelegatorWithdrawInfo) Reset() { *m = DelegatorWithdrawInfo{} } func (m *DelegatorWithdrawInfo) String() string { return proto.CompactTextString(m) } func (*DelegatorWithdrawInfo) ProtoMessage() {} func (*DelegatorWithdrawInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_c6e6d103ced41894, []int{0} + return fileDescriptor_95f74caade7824f2, []int{0} } func (m *DelegatorWithdrawInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -85,7 +85,7 @@ func (m *OutstandingRewardsRecord) Reset() { *m = OutstandingRewardsReco func (m *OutstandingRewardsRecord) String() string { return proto.CompactTextString(m) } func (*OutstandingRewardsRecord) ProtoMessage() {} func (*OutstandingRewardsRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_c6e6d103ced41894, []int{1} + return fileDescriptor_95f74caade7824f2, []int{1} } func (m *OutstandingRewardsRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -129,7 +129,7 @@ func (m *HistoricalRewardsRecord) Reset() { *m = HistoricalRewardsRecord func (m *HistoricalRewardsRecord) String() string { return proto.CompactTextString(m) } func (*HistoricalRewardsRecord) ProtoMessage() {} func (*HistoricalRewardsRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_c6e6d103ced41894, []int{2} + return fileDescriptor_95f74caade7824f2, []int{2} } func (m *HistoricalRewardsRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -170,7 +170,7 @@ func (m *CurrentRewardsRecord) Reset() { *m = CurrentRewardsRecord{} } func (m *CurrentRewardsRecord) String() string { return proto.CompactTextString(m) } func (*CurrentRewardsRecord) ProtoMessage() {} func (*CurrentRewardsRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_c6e6d103ced41894, []int{3} + return fileDescriptor_95f74caade7824f2, []int{3} } func (m *CurrentRewardsRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -213,7 +213,7 @@ func (m *DelegatorStartingInfoRecord) Reset() { *m = DelegatorStartingIn func (m *DelegatorStartingInfoRecord) String() string { return proto.CompactTextString(m) } func (*DelegatorStartingInfoRecord) ProtoMessage() {} func (*DelegatorStartingInfoRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_c6e6d103ced41894, []int{4} + return fileDescriptor_95f74caade7824f2, []int{4} } func (m *DelegatorStartingInfoRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -253,7 +253,7 @@ func (m *OperatorAccumulatedCommissionRecord) Reset() { *m = OperatorAcc func (m *OperatorAccumulatedCommissionRecord) String() string { return proto.CompactTextString(m) } func (*OperatorAccumulatedCommissionRecord) ProtoMessage() {} func (*OperatorAccumulatedCommissionRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_c6e6d103ced41894, []int{5} + return fileDescriptor_95f74caade7824f2, []int{5} } func (m *OperatorAccumulatedCommissionRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -303,7 +303,7 @@ func (m *DelegationTypeRecords) Reset() { *m = DelegationTypeRecords{} } func (m *DelegationTypeRecords) String() string { return proto.CompactTextString(m) } func (*DelegationTypeRecords) ProtoMessage() {} func (*DelegationTypeRecords) Descriptor() ([]byte, []int) { - return fileDescriptor_c6e6d103ced41894, []int{6} + return fileDescriptor_95f74caade7824f2, []int{6} } func (m *DelegationTypeRecords) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -393,7 +393,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_c6e6d103ced41894, []int{7} + return fileDescriptor_95f74caade7824f2, []int{7} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -493,84 +493,84 @@ func (m *GenesisState) GetPoolServiceTotalDelegatorShares() []PoolServiceTotalDe } func init() { - proto.RegisterType((*DelegatorWithdrawInfo)(nil), "milkyway.rewards.v2.DelegatorWithdrawInfo") - proto.RegisterType((*OutstandingRewardsRecord)(nil), "milkyway.rewards.v2.OutstandingRewardsRecord") - proto.RegisterType((*HistoricalRewardsRecord)(nil), "milkyway.rewards.v2.HistoricalRewardsRecord") - proto.RegisterType((*CurrentRewardsRecord)(nil), "milkyway.rewards.v2.CurrentRewardsRecord") - proto.RegisterType((*DelegatorStartingInfoRecord)(nil), "milkyway.rewards.v2.DelegatorStartingInfoRecord") - proto.RegisterType((*OperatorAccumulatedCommissionRecord)(nil), "milkyway.rewards.v2.OperatorAccumulatedCommissionRecord") - proto.RegisterType((*DelegationTypeRecords)(nil), "milkyway.rewards.v2.DelegationTypeRecords") - proto.RegisterType((*GenesisState)(nil), "milkyway.rewards.v2.GenesisState") + proto.RegisterType((*DelegatorWithdrawInfo)(nil), "milkyway.rewards.v1.DelegatorWithdrawInfo") + proto.RegisterType((*OutstandingRewardsRecord)(nil), "milkyway.rewards.v1.OutstandingRewardsRecord") + proto.RegisterType((*HistoricalRewardsRecord)(nil), "milkyway.rewards.v1.HistoricalRewardsRecord") + proto.RegisterType((*CurrentRewardsRecord)(nil), "milkyway.rewards.v1.CurrentRewardsRecord") + proto.RegisterType((*DelegatorStartingInfoRecord)(nil), "milkyway.rewards.v1.DelegatorStartingInfoRecord") + proto.RegisterType((*OperatorAccumulatedCommissionRecord)(nil), "milkyway.rewards.v1.OperatorAccumulatedCommissionRecord") + proto.RegisterType((*DelegationTypeRecords)(nil), "milkyway.rewards.v1.DelegationTypeRecords") + proto.RegisterType((*GenesisState)(nil), "milkyway.rewards.v1.GenesisState") } -func init() { proto.RegisterFile("milkyway/rewards/v2/genesis.proto", fileDescriptor_c6e6d103ced41894) } +func init() { proto.RegisterFile("milkyway/rewards/v1/genesis.proto", fileDescriptor_95f74caade7824f2) } -var fileDescriptor_c6e6d103ced41894 = []byte{ +var fileDescriptor_95f74caade7824f2 = []byte{ // 1025 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcb, 0x6e, 0xdb, 0x46, - 0x17, 0x16, 0x6d, 0xfd, 0xbe, 0x8c, 0xec, 0xd8, 0x9a, 0xc8, 0xfe, 0x19, 0x27, 0x10, 0x55, 0x1b, - 0x28, 0xdc, 0xa0, 0x16, 0x0b, 0x35, 0x40, 0x2f, 0xbb, 0xc8, 0x6a, 0x6b, 0xa1, 0x40, 0x62, 0xc8, - 0x06, 0x02, 0x04, 0x28, 0xd8, 0x11, 0x39, 0xa6, 0x06, 0x25, 0x39, 0xc4, 0xcc, 0xc8, 0x97, 0x37, - 0xe8, 0xa6, 0x40, 0x16, 0x7d, 0x80, 0x2c, 0x8b, 0x02, 0x05, 0xba, 0xc8, 0xa6, 0xbb, 0x2e, 0xb3, - 0x0c, 0x82, 0x2e, 0xba, 0x72, 0x0a, 0x79, 0xd1, 0x3e, 0x40, 0x1f, 0xa0, 0xe0, 0x70, 0x78, 0x91, - 0x45, 0x47, 0x2e, 0xd2, 0x6c, 0x04, 0xcd, 0xcc, 0x77, 0xce, 0xf9, 0xce, 0x39, 0xf3, 0x1d, 0x0e, - 0x78, 0xc7, 0x27, 0xde, 0x37, 0x67, 0x27, 0xe8, 0xcc, 0x64, 0xf8, 0x04, 0x31, 0x87, 0x9b, 0xc7, - 0x2d, 0xd3, 0xc5, 0x01, 0xe6, 0x84, 0x37, 0x43, 0x46, 0x05, 0x85, 0x37, 0x13, 0x48, 0x53, 0x41, - 0x9a, 0xc7, 0xad, 0x8d, 0x2a, 0xf2, 0x49, 0x40, 0x4d, 0xf9, 0x1b, 0xe3, 0x36, 0x6e, 0xd9, 0x94, - 0xfb, 0x94, 0x5b, 0x72, 0x65, 0xc6, 0x0b, 0x75, 0x54, 0x73, 0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- 0xa7, 0xcf, 0x34, 0x66, 0xb7, 0x2b, 0xad, 0x3b, 0xcd, 0x82, 0x96, 0x37, 0x3b, 0xd8, 0xde, 0xa7, - 0xd4, 0x6b, 0xaf, 0x3d, 0x3f, 0x37, 0x4a, 0x3f, 0xbe, 0x32, 0x16, 0xd4, 0x06, 0xff, 0xe1, 0xcf, - 0x9f, 0xef, 0x6a, 0x3d, 0x48, 0x27, 0x58, 0xe7, 0xd2, 0x7a, 0xa9, 0x81, 0xff, 0xef, 0x11, 0x2e, - 0x28, 0x23, 0x36, 0xf2, 0xde, 0x56, 0x56, 0xeb, 0x60, 0x2e, 0xc4, 0x8c, 0x50, 0x47, 0x76, 0xa0, - 0xdc, 0x53, 0x2b, 0xf8, 0x25, 0x98, 0x4f, 0x32, 0x9c, 0x6d, 0x68, 0xdb, 0x95, 0xd6, 0xbb, 0x85, - 0x19, 0x4e, 0x10, 0x6c, 0x2f, 0x46, 0xb9, 0xc6, 0xf9, 0x25, 0x1e, 0x72, 0x49, 0x3d, 0xd3, 0x40, - 0x6d, 0x77, 0xc8, 0x18, 0x0e, 0xc4, 0xdb, 0xca, 0x68, 0x2f, 0x63, 0x3e, 0x23, 0x99, 0x6f, 0x15, - 0x32, 0x1f, 0x67, 0x31, 0x85, 0xf6, 0xf7, 0x33, 0xe0, 0x76, 0x2a, 0x89, 0x03, 0x81, 0x98, 0x20, - 0x81, 0x1b, 0x49, 0x42, 0xb1, 0xff, 0x8f, 0x84, 0x71, 0x55, 0x11, 0x66, 0xfe, 0x75, 0x11, 0x1e, - 0x83, 0x65, 0xae, 0x68, 0x5a, 0x24, 0x38, 0xa2, 0xaa, 0x89, 0x77, 0xaf, 0xb8, 0xa6, 0x05, 0x99, - 0xe5, 0x2b, 0xb2, 0xc4, 0x73, 0x07, 0xb9, 0xb2, 0xfc, 0xa2, 0x81, 0xad, 0x87, 0x21, 0x66, 0x32, - 0x07, 0xdb, 0x1e, 0xfa, 0x43, 0x0f, 0x09, 0xec, 0xec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, 0x9e, 0x47, + 0x81, 0xda, 0xe1, 0x21, 0x80, 0xfd, 0x54, 0x41, 0x17, 0x46, 0xca, 0x87, 0x57, 0x13, 0xdc, 0x78, + 0xa0, 0x6a, 0xff, 0x22, 0x06, 0x7e, 0x03, 0x96, 0xec, 0xf8, 0xbe, 0x5b, 0x99, 0xaa, 0xa3, 0x20, + 0x1f, 0x5c, 0x41, 0x1b, 0xe3, 0x11, 0xae, 0xd9, 0x23, 0x00, 0x38, 0x00, 0x7a, 0x76, 0xfd, 0x47, + 0xee, 0x1d, 0xd7, 0xcb, 0x32, 0xce, 0x47, 0x57, 0xbf, 0x78, 0xe3, 0xe1, 0x56, 0x9d, 0x22, 0x1c, + 0x5f, 0xff, 0x77, 0x16, 0x2c, 0x7c, 0x15, 0x7f, 0x78, 0xf7, 0x05, 0x12, 0x18, 0x7e, 0x06, 0x66, + 0xe2, 0x2f, 0x99, 0xbc, 0x62, 0x95, 0xed, 0x9b, 0x85, 0x51, 0xf7, 0x24, 0xa4, 0x55, 0x8e, 0x02, + 0x74, 0x95, 0x01, 0xfc, 0x12, 0xd4, 0x02, 0x7c, 0x92, 0x96, 0xc7, 0x0a, 0x3d, 0x14, 0x24, 0xd2, + 0x2b, 0xb7, 0x56, 0x86, 0x67, 0x46, 0xf5, 0x3e, 0x3e, 0x49, 0x32, 0xde, 0xf3, 0x50, 0xd0, 0x69, + 0x77, 0xab, 0xc1, 0x85, 0xad, 0x68, 0x6e, 0x2e, 0xe6, 0x5d, 0x24, 0x75, 0x6e, 0x14, 0x32, 0xc9, + 0x99, 0x2a, 0x3a, 0x0b, 0x2c, 0xdb, 0xe2, 0x10, 0x81, 0x5b, 0x1e, 0xe2, 0x19, 0x29, 0xe4, 0x79, + 0xd4, 0x56, 0xc3, 0x81, 0xf8, 0x58, 0x2f, 0xcb, 0x2c, 0xd7, 0x9a, 0xf1, 0xab, 0xa0, 0x99, 0xbc, + 0x0a, 0x9a, 0x07, 0xc9, 0xab, 0xa0, 0x55,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xf4, 0xe7, 0x79, 0xbd, + 0xf4, 0xe8, 0xae, 0x4b, 0x44, 0x7f, 0xd0, 0x6b, 0xda, 0xd4, 0x37, 0x13, 0x16, 0x5b, 0x1e, 0xea, + 0xf1, 0x74, 0x65, 0x1e, 0x7d, 0x62, 0x9e, 0xa4, 0x2f, 0x5f, 0x71, 0x1a, 0x62, 0xde, 0x9b, 0x91, + 0xba, 0xf9, 0xf8, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x09, 0x12, 0x60, 0x85, 0xd9, 0x0b, 0x00, 0x00, } diff --git a/x/rewards/types/messages.pb.go b/x/rewards/types/messages.pb.go index 2a43a2b3a..a38cfacde 100644 --- a/x/rewards/types/messages.pb.go +++ b/x/rewards/types/messages.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: milkyway/rewards/v2/messages.proto +// source: milkyway/rewards/v1/messages.proto package types @@ -72,7 +72,7 @@ func (m *MsgCreateRewardsPlan) Reset() { *m = MsgCreateRewardsPlan{} } func (m *MsgCreateRewardsPlan) String() string { return proto.CompactTextString(m) } func (*MsgCreateRewardsPlan) ProtoMessage() {} func (*MsgCreateRewardsPlan) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{0} + return fileDescriptor_1bde47e6c27c581f, []int{0} } func (m *MsgCreateRewardsPlan) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -112,7 +112,7 @@ func (m *MsgCreateRewardsPlanResponse) Reset() { *m = MsgCreateRewardsPl func (m *MsgCreateRewardsPlanResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateRewardsPlanResponse) ProtoMessage() {} func (*MsgCreateRewardsPlanResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{1} + return fileDescriptor_1bde47e6c27c581f, []int{1} } func (m *MsgCreateRewardsPlanResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -176,7 +176,7 @@ func (m *MsgEditRewardsPlan) Reset() { *m = MsgEditRewardsPlan{} } func (m *MsgEditRewardsPlan) String() string { return proto.CompactTextString(m) } func (*MsgEditRewardsPlan) ProtoMessage() {} func (*MsgEditRewardsPlan) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{2} + return fileDescriptor_1bde47e6c27c581f, []int{2} } func (m *MsgEditRewardsPlan) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -214,7 +214,7 @@ func (m *MsgEditRewardsPlanResponse) Reset() { *m = MsgEditRewardsPlanRe func (m *MsgEditRewardsPlanResponse) String() string { return proto.CompactTextString(m) } func (*MsgEditRewardsPlanResponse) ProtoMessage() {} func (*MsgEditRewardsPlanResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{3} + return fileDescriptor_1bde47e6c27c581f, []int{3} } func (m *MsgEditRewardsPlanResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -254,7 +254,7 @@ func (m *MsgSetWithdrawAddress) Reset() { *m = MsgSetWithdrawAddress{} } func (m *MsgSetWithdrawAddress) String() string { return proto.CompactTextString(m) } func (*MsgSetWithdrawAddress) ProtoMessage() {} func (*MsgSetWithdrawAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{4} + return fileDescriptor_1bde47e6c27c581f, []int{4} } func (m *MsgSetWithdrawAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -292,7 +292,7 @@ func (m *MsgSetWithdrawAddressResponse) Reset() { *m = MsgSetWithdrawAdd func (m *MsgSetWithdrawAddressResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetWithdrawAddressResponse) ProtoMessage() {} func (*MsgSetWithdrawAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{5} + return fileDescriptor_1bde47e6c27c581f, []int{5} } func (m *MsgSetWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -333,7 +333,7 @@ func (m *MsgWithdrawDelegatorReward) Reset() { *m = MsgWithdrawDelegator func (m *MsgWithdrawDelegatorReward) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawDelegatorReward) ProtoMessage() {} func (*MsgWithdrawDelegatorReward) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{6} + return fileDescriptor_1bde47e6c27c581f, []int{6} } func (m *MsgWithdrawDelegatorReward) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -372,7 +372,7 @@ func (m *MsgWithdrawDelegatorRewardResponse) Reset() { *m = MsgWithdrawD func (m *MsgWithdrawDelegatorRewardResponse) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawDelegatorRewardResponse) ProtoMessage() {} func (*MsgWithdrawDelegatorRewardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{7} + return fileDescriptor_1bde47e6c27c581f, []int{7} } func (m *MsgWithdrawDelegatorRewardResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -418,7 +418,7 @@ func (m *MsgWithdrawOperatorCommission) Reset() { *m = MsgWithdrawOperat func (m *MsgWithdrawOperatorCommission) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawOperatorCommission) ProtoMessage() {} func (*MsgWithdrawOperatorCommission) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{8} + return fileDescriptor_1bde47e6c27c581f, []int{8} } func (m *MsgWithdrawOperatorCommission) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -458,7 +458,7 @@ func (m *MsgWithdrawOperatorCommissionResponse) Reset() { *m = MsgWithdr func (m *MsgWithdrawOperatorCommissionResponse) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawOperatorCommissionResponse) ProtoMessage() {} func (*MsgWithdrawOperatorCommissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{9} + return fileDescriptor_1bde47e6c27c581f, []int{9} } func (m *MsgWithdrawOperatorCommissionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -510,7 +510,7 @@ func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParams) ProtoMessage() {} func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{10} + return fileDescriptor_1bde47e6c27c581f, []int{10} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -547,7 +547,7 @@ func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParamsResponse) ProtoMessage() {} func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_076d4033c3192aed, []int{11} + return fileDescriptor_1bde47e6c27c581f, []int{11} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -577,101 +577,101 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgCreateRewardsPlan)(nil), "milkyway.rewards.v2.MsgCreateRewardsPlan") - proto.RegisterType((*MsgCreateRewardsPlanResponse)(nil), "milkyway.rewards.v2.MsgCreateRewardsPlanResponse") - proto.RegisterType((*MsgEditRewardsPlan)(nil), "milkyway.rewards.v2.MsgEditRewardsPlan") - proto.RegisterType((*MsgEditRewardsPlanResponse)(nil), "milkyway.rewards.v2.MsgEditRewardsPlanResponse") - proto.RegisterType((*MsgSetWithdrawAddress)(nil), "milkyway.rewards.v2.MsgSetWithdrawAddress") - proto.RegisterType((*MsgSetWithdrawAddressResponse)(nil), "milkyway.rewards.v2.MsgSetWithdrawAddressResponse") - proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "milkyway.rewards.v2.MsgWithdrawDelegatorReward") - proto.RegisterType((*MsgWithdrawDelegatorRewardResponse)(nil), "milkyway.rewards.v2.MsgWithdrawDelegatorRewardResponse") - proto.RegisterType((*MsgWithdrawOperatorCommission)(nil), "milkyway.rewards.v2.MsgWithdrawOperatorCommission") - proto.RegisterType((*MsgWithdrawOperatorCommissionResponse)(nil), "milkyway.rewards.v2.MsgWithdrawOperatorCommissionResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "milkyway.rewards.v2.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "milkyway.rewards.v2.MsgUpdateParamsResponse") + proto.RegisterType((*MsgCreateRewardsPlan)(nil), "milkyway.rewards.v1.MsgCreateRewardsPlan") + proto.RegisterType((*MsgCreateRewardsPlanResponse)(nil), "milkyway.rewards.v1.MsgCreateRewardsPlanResponse") + proto.RegisterType((*MsgEditRewardsPlan)(nil), "milkyway.rewards.v1.MsgEditRewardsPlan") + proto.RegisterType((*MsgEditRewardsPlanResponse)(nil), "milkyway.rewards.v1.MsgEditRewardsPlanResponse") + proto.RegisterType((*MsgSetWithdrawAddress)(nil), "milkyway.rewards.v1.MsgSetWithdrawAddress") + proto.RegisterType((*MsgSetWithdrawAddressResponse)(nil), "milkyway.rewards.v1.MsgSetWithdrawAddressResponse") + proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "milkyway.rewards.v1.MsgWithdrawDelegatorReward") + proto.RegisterType((*MsgWithdrawDelegatorRewardResponse)(nil), "milkyway.rewards.v1.MsgWithdrawDelegatorRewardResponse") + proto.RegisterType((*MsgWithdrawOperatorCommission)(nil), "milkyway.rewards.v1.MsgWithdrawOperatorCommission") + proto.RegisterType((*MsgWithdrawOperatorCommissionResponse)(nil), "milkyway.rewards.v1.MsgWithdrawOperatorCommissionResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "milkyway.rewards.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "milkyway.rewards.v1.MsgUpdateParamsResponse") } func init() { - proto.RegisterFile("milkyway/rewards/v2/messages.proto", fileDescriptor_076d4033c3192aed) + proto.RegisterFile("milkyway/rewards/v1/messages.proto", fileDescriptor_1bde47e6c27c581f) } -var fileDescriptor_076d4033c3192aed = []byte{ - // 1193 bytes of a gzipped FileDescriptorProto +var fileDescriptor_1bde47e6c27c581f = []byte{ + // 1190 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xe6, 0x87, 0x5b, 0x4f, 0x9a, 0x5f, 0xdb, 0x34, 0x71, 0xb6, 0xad, 0xd7, 0x2c, 0xb4, - 0x84, 0xa8, 0xd9, 0x6d, 0x5c, 0x68, 0x84, 0x91, 0x40, 0xb5, 0xdd, 0x0a, 0x1f, 0x12, 0xaa, 0x4d, - 0x0b, 0x12, 0x48, 0x58, 0x63, 0xcf, 0x64, 0xb3, 0xc4, 0xbb, 0x63, 0x76, 0xc6, 0x36, 0xbe, 0x21, - 0xb8, 0x00, 0x42, 0xa2, 0x67, 0x2e, 0x54, 0x9c, 0x10, 0xa7, 0x1c, 0xf8, 0x07, 0x40, 0x02, 0xf5, - 0x58, 0x71, 0x42, 0x42, 0x72, 0x91, 0x73, 0x08, 0x7f, 0x06, 0xda, 0xdd, 0xd9, 0xcd, 0xc6, 0x5e, - 0x27, 0x31, 0x5c, 0x10, 0xe2, 0x12, 0x67, 0xdf, 0xfb, 0xde, 0x37, 0xf3, 0xbe, 0x79, 0xef, 0xcd, - 0x00, 0xc5, 0x32, 0xeb, 0x7b, 0x9d, 0x36, 0xec, 0x68, 0x0e, 0x6e, 0x43, 0x07, 0x51, 0xad, 0x95, - 0xd3, 0x2c, 0x4c, 0x29, 0x34, 0x30, 0x55, 0x1b, 0x0e, 0x61, 0x44, 0xbc, 0x18, 0x60, 0x54, 0x8e, - 0x51, 0x5b, 0x39, 0x69, 0x1e, 0x5a, 0xa6, 0x4d, 0x34, 0xef, 0xaf, 0x8f, 0x93, 0x32, 0x35, 0x42, - 0x2d, 0x42, 0xb5, 0x2a, 0xa4, 0x58, 0x6b, 0xad, 0x57, 0x31, 0x83, 0xeb, 0x5a, 0x8d, 0x98, 0x36, - 0xf7, 0x2f, 0x71, 0xbf, 0x45, 0x0d, 0xad, 0xb5, 0xee, 0xfe, 0x70, 0xc7, 0xb2, 0xef, 0xa8, 0x78, - 0x5f, 0x9a, 0xff, 0xc1, 0x5d, 0x0b, 0x06, 0x31, 0x88, 0x6f, 0x77, 0xff, 0xe3, 0x56, 0xd9, 0x20, - 0xc4, 0xa8, 0x63, 0xcd, 0xfb, 0xaa, 0x36, 0x77, 0x34, 0x66, 0x5a, 0x98, 0x32, 0x68, 0x35, 0x38, - 0x20, 0x9a, 0x16, 0x65, 0x70, 0xcf, 0xb4, 0xfd, 0x25, 0x09, 0xc2, 0xf5, 0x80, 0x3a, 0x1b, 0x9b, - 0xfa, 0xa9, 0x88, 0x06, 0x74, 0xa0, 0xc5, 0x11, 0xca, 0x57, 0x49, 0xb0, 0xb0, 0x49, 0x8d, 0xa2, - 0x83, 0x21, 0xc3, 0xba, 0x0f, 0xba, 0x5f, 0x87, 0xb6, 0x78, 0x13, 0x24, 0x29, 0xb6, 0x11, 0x76, - 0xd2, 0x42, 0x56, 0x58, 0x49, 0x15, 0xd2, 0xbf, 0xfe, 0xb0, 0xb6, 0xc0, 0x33, 0xbb, 0x83, 0x90, - 0x83, 0x29, 0xdd, 0x66, 0x8e, 0x69, 0x1b, 0x3a, 0xc7, 0x89, 0x59, 0x30, 0x85, 0x30, 0xad, 0x39, - 0x66, 0x83, 0x99, 0xc4, 0x4e, 0x8f, 0xb9, 0x61, 0x7a, 0xd4, 0x24, 0xde, 0x00, 0x80, 0x62, 0xa7, - 0x65, 0xd6, 0x70, 0xc5, 0x44, 0xe9, 0xf1, 0xac, 0xb0, 0x32, 0x5d, 0x98, 0xee, 0x75, 0xe5, 0xd4, - 0xb6, 0x6f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x83, 0x58, 0x29, 0x77, 0x76, 0x6c, 0xb8, 0xea, 0xa7, - 0x02, 0x58, 0x1a, 0x36, 0x8d, 0x87, 0xa6, 0x30, 0x24, 0x40, 0xda, 0x18, 0x31, 0x20, 0xdc, 0xc5, - 0x97, 0x02, 0x90, 0x4e, 0x98, 0x14, 0xb9, 0xd3, 0x78, 0x07, 0x63, 0xa4, 0xfc, 0xe8, 0x31, 0xe1, - 0x76, 0xaa, 0xe0, 0xc2, 0xb1, 0x6e, 0x7a, 0x61, 0x18, 0x57, 0x14, 0x25, 0xdd, 0x38, 0x0b, 0x2a, - 0x58, 0x43, 0x9a, 0xfc, 0xd8, 0x6d, 0xe2, 0xc2, 0xd6, 0x93, 0x5e, 0x46, 0x78, 0xda, 0xcb, 0x08, - 0x7f, 0xf4, 0x32, 0xc2, 0xa3, 0x83, 0x4c, 0xe2, 0xe9, 0x41, 0x26, 0xf1, 0xdb, 0x41, 0x26, 0xf1, - 0xee, 0xcb, 0x91, 0xf1, 0x10, 0x10, 0xaf, 0xd5, 0x61, 0x95, 0x86, 0x5f, 0x5a, 0x6b, 0x43, 0xfb, - 0x28, 0x6c, 0x29, 0x6f, 0x60, 0x54, 0x93, 0xde, 0xcb, 0xee, 0xd6, 0x5f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x4c, 0x7f, 0xed, 0x5c, 0xb3, 0x0f, 0x00, 0x00, + 0x14, 0xf6, 0xe6, 0x87, 0x5b, 0x4f, 0xda, 0x26, 0xd9, 0xa6, 0x89, 0xb3, 0x6d, 0xbd, 0x66, 0xa1, + 0x25, 0x44, 0xcd, 0x6e, 0xe3, 0x42, 0x23, 0x8c, 0x04, 0xaa, 0xed, 0x56, 0xf8, 0x90, 0x50, 0x6d, + 0x5a, 0x90, 0x40, 0xc2, 0x5a, 0x7b, 0x26, 0x9b, 0x25, 0xde, 0x1d, 0xb3, 0x33, 0x8e, 0xf1, 0x0d, + 0xc1, 0x05, 0x10, 0x12, 0x3d, 0x73, 0xa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0xa6, 0x7d, 0x14, 0xb6, + 0x14, 0x1b, 0x18, 0xf5, 0x34, 0x7b, 0xd9, 0xdd, 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x30, 0x50, + 0xc8, 0x93, 0xb3, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -717,7 +717,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) CreateRewardsPlan(ctx context.Context, in *MsgCreateRewardsPlan, opts ...grpc.CallOption) (*MsgCreateRewardsPlanResponse, error) { out := new(MsgCreateRewardsPlanResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Msg/CreateRewardsPlan", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Msg/CreateRewardsPlan", in, out, opts...) if err != nil { return nil, err } @@ -726,7 +726,7 @@ func (c *msgClient) CreateRewardsPlan(ctx context.Context, in *MsgCreateRewardsP func (c *msgClient) EditRewardsPlan(ctx context.Context, in *MsgEditRewardsPlan, opts ...grpc.CallOption) (*MsgEditRewardsPlanResponse, error) { out := new(MsgEditRewardsPlanResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Msg/EditRewardsPlan", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Msg/EditRewardsPlan", in, out, opts...) if err != nil { return nil, err } @@ -735,7 +735,7 @@ func (c *msgClient) EditRewardsPlan(ctx context.Context, in *MsgEditRewardsPlan, func (c *msgClient) SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) { out := new(MsgSetWithdrawAddressResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Msg/SetWithdrawAddress", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Msg/SetWithdrawAddress", in, out, opts...) if err != nil { return nil, err } @@ -744,7 +744,7 @@ func (c *msgClient) SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAd func (c *msgClient) WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) { out := new(MsgWithdrawDelegatorRewardResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Msg/WithdrawDelegatorReward", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Msg/WithdrawDelegatorReward", in, out, opts...) if err != nil { return nil, err } @@ -753,7 +753,7 @@ func (c *msgClient) WithdrawDelegatorReward(ctx context.Context, in *MsgWithdraw func (c *msgClient) WithdrawOperatorCommission(ctx context.Context, in *MsgWithdrawOperatorCommission, opts ...grpc.CallOption) (*MsgWithdrawOperatorCommissionResponse, error) { out := new(MsgWithdrawOperatorCommissionResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Msg/WithdrawOperatorCommission", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Msg/WithdrawOperatorCommission", in, out, opts...) if err != nil { return nil, err } @@ -762,7 +762,7 @@ func (c *msgClient) WithdrawOperatorCommission(ctx context.Context, in *MsgWithd func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Msg/UpdateParams", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Msg/UpdateParams", in, out, opts...) if err != nil { return nil, err } @@ -829,7 +829,7 @@ func _Msg_CreateRewardsPlan_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Msg/CreateRewardsPlan", + FullMethod: "/milkyway.rewards.v1.Msg/CreateRewardsPlan", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CreateRewardsPlan(ctx, req.(*MsgCreateRewardsPlan)) @@ -847,7 +847,7 @@ func _Msg_EditRewardsPlan_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Msg/EditRewardsPlan", + FullMethod: "/milkyway.rewards.v1.Msg/EditRewardsPlan", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).EditRewardsPlan(ctx, req.(*MsgEditRewardsPlan)) @@ -865,7 +865,7 @@ func _Msg_SetWithdrawAddress_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Msg/SetWithdrawAddress", + FullMethod: "/milkyway.rewards.v1.Msg/SetWithdrawAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).SetWithdrawAddress(ctx, req.(*MsgSetWithdrawAddress)) @@ -883,7 +883,7 @@ func _Msg_WithdrawDelegatorReward_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Msg/WithdrawDelegatorReward", + FullMethod: "/milkyway.rewards.v1.Msg/WithdrawDelegatorReward", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).WithdrawDelegatorReward(ctx, req.(*MsgWithdrawDelegatorReward)) @@ -901,7 +901,7 @@ func _Msg_WithdrawOperatorCommission_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Msg/WithdrawOperatorCommission", + FullMethod: "/milkyway.rewards.v1.Msg/WithdrawOperatorCommission", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).WithdrawOperatorCommission(ctx, req.(*MsgWithdrawOperatorCommission)) @@ -919,7 +919,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Msg/UpdateParams", + FullMethod: "/milkyway.rewards.v1.Msg/UpdateParams", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) @@ -929,7 +929,7 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in var Msg_serviceDesc = _Msg_serviceDesc var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "milkyway.rewards.v2.Msg", + ServiceName: "milkyway.rewards.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -958,7 +958,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "milkyway/rewards/v2/messages.proto", + Metadata: "milkyway/rewards/v1/messages.proto", } func (m *MsgCreateRewardsPlan) Marshal() (dAtA []byte, err error) { diff --git a/x/rewards/types/models.pb.go b/x/rewards/types/models.pb.go index 4dad7d148..67c0d291d 100644 --- a/x/rewards/types/models.pb.go +++ b/x/rewards/types/models.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: milkyway/rewards/v2/models.proto +// source: milkyway/rewards/v1/models.proto package types @@ -43,7 +43,7 @@ type RewardsPlan struct { ServiceID uint32 `protobuf:"varint,3,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` // AmountPerDay is the amount of rewards to be distributed, per day. // The rewards amount for every block will be calculated based on this. - AmountPerDay types.Coin `protobuf:"bytes,4,opt,name=amount_per_day,json=amountPerDay,proto3" json:"amount_per_day"` + AmountPerDay types.Coin `protobuf:"bytes,11,opt,name=amount_per_day,json=amountPerDay,proto3" json:"amount_per_day"` // StartTime is the starting time of the plan. StartTime time.Time `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` // EndTime is the ending time of the plan. @@ -64,7 +64,7 @@ func (m *RewardsPlan) Reset() { *m = RewardsPlan{} } func (m *RewardsPlan) String() string { return proto.CompactTextString(m) } func (*RewardsPlan) ProtoMessage() {} func (*RewardsPlan) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{0} + return fileDescriptor_fcf66d1f3415f5b6, []int{0} } func (m *RewardsPlan) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -111,7 +111,7 @@ func (m *Distribution) Reset() { *m = Distribution{} } func (m *Distribution) String() string { return proto.CompactTextString(m) } func (*Distribution) ProtoMessage() {} func (*Distribution) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{1} + return fileDescriptor_fcf66d1f3415f5b6, []int{1} } func (m *Distribution) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -152,7 +152,7 @@ func (m *DistributionTypeBasic) Reset() { *m = DistributionTypeBasic{} } func (m *DistributionTypeBasic) String() string { return proto.CompactTextString(m) } func (*DistributionTypeBasic) ProtoMessage() {} func (*DistributionTypeBasic) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{2} + return fileDescriptor_fcf66d1f3415f5b6, []int{2} } func (m *DistributionTypeBasic) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -192,7 +192,7 @@ func (m *DistributionTypeWeighted) Reset() { *m = DistributionTypeWeight func (m *DistributionTypeWeighted) String() string { return proto.CompactTextString(m) } func (*DistributionTypeWeighted) ProtoMessage() {} func (*DistributionTypeWeighted) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{3} + return fileDescriptor_fcf66d1f3415f5b6, []int{3} } func (m *DistributionTypeWeighted) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -231,7 +231,7 @@ func (m *DistributionWeight) Reset() { *m = DistributionWeight{} } func (m *DistributionWeight) String() string { return proto.CompactTextString(m) } func (*DistributionWeight) ProtoMessage() {} func (*DistributionWeight) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{4} + return fileDescriptor_fcf66d1f3415f5b6, []int{4} } func (m *DistributionWeight) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -269,7 +269,7 @@ func (m *DistributionTypeEgalitarian) Reset() { *m = DistributionTypeEga func (m *DistributionTypeEgalitarian) String() string { return proto.CompactTextString(m) } func (*DistributionTypeEgalitarian) ProtoMessage() {} func (*DistributionTypeEgalitarian) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{5} + return fileDescriptor_fcf66d1f3415f5b6, []int{5} } func (m *DistributionTypeEgalitarian) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,7 +313,7 @@ func (m *UsersDistribution) Reset() { *m = UsersDistribution{} } func (m *UsersDistribution) String() string { return proto.CompactTextString(m) } func (*UsersDistribution) ProtoMessage() {} func (*UsersDistribution) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{6} + return fileDescriptor_fcf66d1f3415f5b6, []int{6} } func (m *UsersDistribution) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -354,7 +354,7 @@ func (m *UsersDistributionTypeBasic) Reset() { *m = UsersDistributionTyp func (m *UsersDistributionTypeBasic) String() string { return proto.CompactTextString(m) } func (*UsersDistributionTypeBasic) ProtoMessage() {} func (*UsersDistributionTypeBasic) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{7} + return fileDescriptor_fcf66d1f3415f5b6, []int{7} } func (m *UsersDistributionTypeBasic) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -405,7 +405,7 @@ func (m *HistoricalRewards) Reset() { *m = HistoricalRewards{} } func (m *HistoricalRewards) String() string { return proto.CompactTextString(m) } func (*HistoricalRewards) ProtoMessage() {} func (*HistoricalRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{8} + return fileDescriptor_fcf66d1f3415f5b6, []int{8} } func (m *HistoricalRewards) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -446,7 +446,7 @@ func (m *CurrentRewards) Reset() { *m = CurrentRewards{} } func (m *CurrentRewards) String() string { return proto.CompactTextString(m) } func (*CurrentRewards) ProtoMessage() {} func (*CurrentRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{9} + return fileDescriptor_fcf66d1f3415f5b6, []int{9} } func (m *CurrentRewards) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -485,7 +485,7 @@ func (m *OutstandingRewards) Reset() { *m = OutstandingRewards{} } func (m *OutstandingRewards) String() string { return proto.CompactTextString(m) } func (*OutstandingRewards) ProtoMessage() {} func (*OutstandingRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{10} + return fileDescriptor_fcf66d1f3415f5b6, []int{10} } func (m *OutstandingRewards) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -525,7 +525,7 @@ func (m *AccumulatedCommission) Reset() { *m = AccumulatedCommission{} } func (m *AccumulatedCommission) String() string { return proto.CompactTextString(m) } func (*AccumulatedCommission) ProtoMessage() {} func (*AccumulatedCommission) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{11} + return fileDescriptor_fcf66d1f3415f5b6, []int{11} } func (m *AccumulatedCommission) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -570,7 +570,7 @@ func (m *DelegatorStartingInfo) Reset() { *m = DelegatorStartingInfo{} } func (m *DelegatorStartingInfo) String() string { return proto.CompactTextString(m) } func (*DelegatorStartingInfo) ProtoMessage() {} func (*DelegatorStartingInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{12} + return fileDescriptor_fcf66d1f3415f5b6, []int{12} } func (m *DelegatorStartingInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -612,7 +612,7 @@ func (m *DelegationDelegatorReward) Reset() { *m = DelegationDelegatorRe func (m *DelegationDelegatorReward) String() string { return proto.CompactTextString(m) } func (*DelegationDelegatorReward) ProtoMessage() {} func (*DelegationDelegatorReward) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{13} + return fileDescriptor_fcf66d1f3415f5b6, []int{13} } func (m *DelegationDelegatorReward) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -653,7 +653,7 @@ func (m *PoolServiceTotalDelegatorShares) Reset() { *m = PoolServiceTota func (m *PoolServiceTotalDelegatorShares) String() string { return proto.CompactTextString(m) } func (*PoolServiceTotalDelegatorShares) ProtoMessage() {} func (*PoolServiceTotalDelegatorShares) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{14} + return fileDescriptor_fcf66d1f3415f5b6, []int{14} } func (m *PoolServiceTotalDelegatorShares) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -693,7 +693,7 @@ func (m *Pool) Reset() { *m = Pool{} } func (m *Pool) String() string { return proto.CompactTextString(m) } func (*Pool) ProtoMessage() {} func (*Pool) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{15} + return fileDescriptor_fcf66d1f3415f5b6, []int{15} } func (m *Pool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -734,7 +734,7 @@ func (m *DecPool) Reset() { *m = DecPool{} } func (m *DecPool) String() string { return proto.CompactTextString(m) } func (*DecPool) ProtoMessage() {} func (*DecPool) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{16} + return fileDescriptor_fcf66d1f3415f5b6, []int{16} } func (m *DecPool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -773,7 +773,7 @@ func (m *ServicePool) Reset() { *m = ServicePool{} } func (m *ServicePool) String() string { return proto.CompactTextString(m) } func (*ServicePool) ProtoMessage() {} func (*ServicePool) Descriptor() ([]byte, []int) { - return fileDescriptor_450f7623ed2e0351, []int{17} + return fileDescriptor_fcf66d1f3415f5b6, []int{17} } func (m *ServicePool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -803,115 +803,115 @@ func (m *ServicePool) XXX_DiscardUnknown() { var xxx_messageInfo_ServicePool proto.InternalMessageInfo func init() { - proto.RegisterType((*RewardsPlan)(nil), "milkyway.rewards.v2.RewardsPlan") - proto.RegisterType((*Distribution)(nil), "milkyway.rewards.v2.Distribution") - proto.RegisterType((*DistributionTypeBasic)(nil), "milkyway.rewards.v2.DistributionTypeBasic") - proto.RegisterType((*DistributionTypeWeighted)(nil), "milkyway.rewards.v2.DistributionTypeWeighted") - proto.RegisterType((*DistributionWeight)(nil), "milkyway.rewards.v2.DistributionWeight") - proto.RegisterType((*DistributionTypeEgalitarian)(nil), "milkyway.rewards.v2.DistributionTypeEgalitarian") - proto.RegisterType((*UsersDistribution)(nil), "milkyway.rewards.v2.UsersDistribution") - proto.RegisterType((*UsersDistributionTypeBasic)(nil), "milkyway.rewards.v2.UsersDistributionTypeBasic") - proto.RegisterType((*HistoricalRewards)(nil), "milkyway.rewards.v2.HistoricalRewards") - proto.RegisterType((*CurrentRewards)(nil), "milkyway.rewards.v2.CurrentRewards") - proto.RegisterType((*OutstandingRewards)(nil), "milkyway.rewards.v2.OutstandingRewards") - proto.RegisterType((*AccumulatedCommission)(nil), "milkyway.rewards.v2.AccumulatedCommission") - proto.RegisterType((*DelegatorStartingInfo)(nil), "milkyway.rewards.v2.DelegatorStartingInfo") - proto.RegisterType((*DelegationDelegatorReward)(nil), "milkyway.rewards.v2.DelegationDelegatorReward") - proto.RegisterType((*PoolServiceTotalDelegatorShares)(nil), "milkyway.rewards.v2.PoolServiceTotalDelegatorShares") - proto.RegisterType((*Pool)(nil), "milkyway.rewards.v2.Pool") - proto.RegisterType((*DecPool)(nil), "milkyway.rewards.v2.DecPool") - proto.RegisterType((*ServicePool)(nil), "milkyway.rewards.v2.ServicePool") -} - -func init() { proto.RegisterFile("milkyway/rewards/v2/models.proto", fileDescriptor_450f7623ed2e0351) } - -var fileDescriptor_450f7623ed2e0351 = []byte{ - // 1359 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,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xdc, 0xe7, - 0x4f, 0x71, 0x40, 0x9b, 0x90, 0x76, 0x07, 0xd9, 0x62, 0xd5, 0xea, 0xdd, 0xb1, 0x61, 0x38, 0x50, - 0x26, 0x23, 0x6d, 0x8a, 0x70, 0x80, 0x58, 0x04, 0x83, 0xae, 0x72, 0x30, 0x13, 0xb4, 0x58, 0x04, - 0xef, 0xe2, 0xb0, 0x6d, 0xf7, 0xb7, 0x0e, 0x11, 0x33, 0xbf, 0x5d, 0x00, 0x05, 0x47, 0x52, 0xda, - 0xeb, 0xc0, 0x50, 0xdf, 0x00, 0x19, 0xec, 0x97, 0xb4, 0x8a, 0x56, 0xcd, 0xd6, 0x73, 0xa3, 0xa1, - 0x91, 0x69, 0x36, 0x9c, 0x0c, 0xf6, 0xf5, 0x0a, 0x28, 0xf8, 0x88, 0x79, 0x14, 0x77, 0x23, 0x4c, - 0xc2, 0x52, 0xa6, 0xa2, 0x55, 0xf3, 0x4e, 0x72, 0x4b, 0x7f, 0x1b, 0x00, 0x86, 0x68, 0x1f, 0x7b, - 0xc8, 0xc5, 0x7e, 0x69, 0xbe, 0xa2, 0x55, 0x57, 0xea, 0x2b, 0xa3, 0xa1, 0x91, 0xbf, 0x2e, 0x77, - 0x9b, 0x0d, 0x27, 0xaf, 0x1c, 0x9a, 0xbe, 0x7e, 0x19, 0x14, 0x61, 0x40, 0x7a, 0x61, 0xe4, 0x76, - 0x11, 0x75, 0x7d, 0x38, 0x28, 0x65, 0x2b, 0x5a, 0xb5, 0xb0, 0x7d, 0xce, 0x52, 0x4d, 0xe1, 0x1d, - 0xb4, 0x54, 0x07, 0xad, 0x5d, 0x82, 0xc3, 0x7a, 0xf6, 0xd1, 0xd0, 0x98, 0x73, 0x96, 0x65, 0xd8, - 0x1e, 0xa2, 0x0d, 0x38, 0xd0, 0x77, 0x01, 0x60, 0x11, 0xa4, 0x91, 0xcb, 0xb9, 0x97, 0x16, 0x04, - 0xc4, 0xa6, 0x25, 0x1b, 0x63, 0xc5, 0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4, 0x98, 0x45, 0x29, 0xe2, 0xa9, 0xee, 0x3c, 0xfa, 0xa3, 0x3c, 0xf7, 0x68, - 0x54, 0xd6, 0x9e, 0x8c, 0xca, 0xda, 0xef, 0xa3, 0xb2, 0xf6, 0xe0, 0x59, 0x79, 0xee, 0xc9, 0xb3, - 0xf2, 0xdc, 0x6f, 0xcf, 0xca, 0x73, 0xb7, 0xdf, 0x49, 0xf0, 0x8b, 0x33, 0xd4, 0x3a, 0xb0, 0xc5, - 0xc6, 0x2b, 0xbb, 0x7f, 0xd1, 0xfe, 0x6c, 0xfc, 0x3b, 0x53, 0x30, 0x6e, 0xe5, 0xc4, 0xe5, 0xe1, - 0xc2, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x63, 0x33, 0x3f, 0xa3, 0x88, 0x0e, 0x00, 0x00, + proto.RegisterType((*RewardsPlan)(nil), "milkyway.rewards.v1.RewardsPlan") + proto.RegisterType((*Distribution)(nil), "milkyway.rewards.v1.Distribution") + proto.RegisterType((*DistributionTypeBasic)(nil), "milkyway.rewards.v1.DistributionTypeBasic") + proto.RegisterType((*DistributionTypeWeighted)(nil), "milkyway.rewards.v1.DistributionTypeWeighted") + proto.RegisterType((*DistributionWeight)(nil), "milkyway.rewards.v1.DistributionWeight") + proto.RegisterType((*DistributionTypeEgalitarian)(nil), "milkyway.rewards.v1.DistributionTypeEgalitarian") + proto.RegisterType((*UsersDistribution)(nil), "milkyway.rewards.v1.UsersDistribution") + proto.RegisterType((*UsersDistributionTypeBasic)(nil), "milkyway.rewards.v1.UsersDistributionTypeBasic") + proto.RegisterType((*HistoricalRewards)(nil), "milkyway.rewards.v1.HistoricalRewards") + proto.RegisterType((*CurrentRewards)(nil), "milkyway.rewards.v1.CurrentRewards") + proto.RegisterType((*OutstandingRewards)(nil), "milkyway.rewards.v1.OutstandingRewards") + proto.RegisterType((*AccumulatedCommission)(nil), "milkyway.rewards.v1.AccumulatedCommission") + proto.RegisterType((*DelegatorStartingInfo)(nil), "milkyway.rewards.v1.DelegatorStartingInfo") + proto.RegisterType((*DelegationDelegatorReward)(nil), "milkyway.rewards.v1.DelegationDelegatorReward") + proto.RegisterType((*PoolServiceTotalDelegatorShares)(nil), "milkyway.rewards.v1.PoolServiceTotalDelegatorShares") + proto.RegisterType((*Pool)(nil), "milkyway.rewards.v1.Pool") + proto.RegisterType((*DecPool)(nil), "milkyway.rewards.v1.DecPool") + proto.RegisterType((*ServicePool)(nil), "milkyway.rewards.v1.ServicePool") +} + +func init() { proto.RegisterFile("milkyway/rewards/v1/models.proto", fileDescriptor_fcf66d1f3415f5b6) } + +var fileDescriptor_fcf66d1f3415f5b6 = []byte{ + // 1357 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0x3a, 0x8e, 0x93, 0x8c, 0x13, 0x37, 0xd9, 0x6f, 0x12, 0xb9, 0xf9, 0x22, 0xaf, 0x59, + 0xa0, 0x98, 0x1f, 0xb6, 0x95, 0x16, 0xa9, 0x52, 0x39, 0x40, 0x1c, 0x57, 0xad, 0xa9, 0x04, 0xd1, + 0xb6, 0xa5, 0x52, 0x91, 0x58, 0x8d, 0x77, 0xa6, 0xce, 0xa8, 0xbb, 0x3b, 0x66, 0x66, 0xed, 0x62, + 0x8e, 0x3d, 0x21, 0x04, 0x52, 0x25, 0xfe, 0x00, 0xca, 0x0d, 0x71, 0xe2, 0x50, 0xf1, 0x37, 0x54, + 0x3d, 0x55, 0x9c, 0x38, 0xb9, 0xe0, 0x1e, 0x40, 0x1c, 0x38, 0xf4, 0x2f, 0x40, 0xf3, 0x63, 0x9d, + 0xcd, 0xc6, 0xf9, 0x61, 0xc4, 0x25, 0xf1, 0xcc, 0x7b, 0xef, 0xf3, 0xde, 0xe7, 0xcd, 0x67, 0x9e, + 0xc7, 0xa0, 0x1c, 0x10, 0xff, 0xee, 0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, 0x50, + 0xd8, 0xe9, 0x31, 0x86, 0xc3, 0x28, 0x66, 0xdb, 0x06, 0xf3, 0x9a, 0xc2, 0xa9, 0xb9, 0x9d, 0xd3, + 0xdc, 0x0a, 0x71, 0x56, 0xe9, 0x75, 0x98, 0x4a, 0x0c, 0x2c, 0xb4, 0xd2, 0xc5, 0x8c, 0x50, 0x24, + 0x4b, 0xce, 0x3a, 0x7a, 0x65, 0x77, 0x81, 0xf9, 0x51, 0x2f, 0xe2, 0x11, 0x0c, 0x91, 0x98, 0xfe, + 0xda, 0xfb, 0x76, 0xba, 0xa2, 0x97, 0x26, 0xdf, 0x51, 0xec, 0xc9, 0x6a, 0xec, 0x23, 0xab, 0x59, + 0xd0, 0x2e, 0xfb, 0x95, 0xd8, 0x21, 0x58, 0xdf, 0xf6, 0x74, 0x87, 0x31, 0xda, 0xa1, 0x41, 0x40, + 0x38, 0x17, 0x72, 0xbe, 0x09, 0xf2, 0xde, 0x78, 0x75, 0xba, 0xc4, 0xeb, 0x22, 0x71, 0x32, 0xcd, + 0x0f, 0x7f, 0xfc, 0xf4, 0xa6, 0xe1, 0x24, 0x71, 0xec, 0xef, 0x32, 0x60, 0x5d, 0xdf, 0x63, 0xca, + 0xae, 0x8b, 0x2f, 0x56, 0x12, 0x76, 0x5a, 0xe1, 0x1d, 0x2a, 0xce, 0xb3, 0xcb, 0x70, 0x9f, 0xd0, + 0x1e, 0x77, 0x75, 0x73, 0xd4, 0xe3, 0x22, 0x71, 0x9e, 0x29, 0x07, 0xdb, 0x29, 0xc4, 0x3b, 0xbb, + 0x72, 0xc3, 0xfc, 0x02, 0xe4, 0xc4, 0x34, 0xc7, 0xbc, 0x98, 0xd1, 0x05, 0x4f, 0x7a, 0x24, 0x34, + 0xb1, 0x27, 0xdf, 0x09, 0x4d, 0xdd, 0xa9, 0x65, 0x85, 0xae, 0x22, 0x45, 0xa3, 0xde, 0xea, 0x90, + 0x68, 0xaf, 0xd7, 0xae, 0x79, 0x34, 0xd0, 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46, 0x09, 0x55, + 0x57, 0x4e, 0x51, 0xa7, 0x2a, 0x52, 0x65, 0xb2, 0x7f, 0x36, 0xc0, 0xbc, 0x3e, 0x9f, 0x53, 0x97, + 0x79, 0xdf, 0x00, 0x8b, 0x08, 0x7b, 0x6e, 0xb2, 0xd6, 0xe3, 0xdb, 0x78, 0x45, 0x97, 0xbb, 0x12, + 0xc3, 0xe9, 0xe0, 0xa9, 0x2f, 0xe2, 0x02, 0xd2, 0x9f, 0xec, 0x2f, 0x0d, 0x90, 0x4f, 0x4c, 0xde, + 0x94, 0x0a, 0x8c, 0x13, 0x54, 0x70, 0x4d, 0x31, 0x90, 0x0f, 0xe5, 0x31, 0x83, 0xe3, 0xc4, 0xbc, + 0x92, 0x16, 0xb3, 0x2c, 0x45, 0x7e, 0x6a, 0x38, 0x8f, 0x7f, 0x2f, 0xcd, 0x3c, 0x1e, 0x95, 0x8c, + 0xa7, 0xa3, 0x92, 0xf1, 0xdb, 0xa8, 0x64, 0x3c, 0x78, 0x5e, 0x9a, 0x79, 0xfa, 0xbc, 0x34, 0xf3, + 0xeb, 0xf3, 0xd2, 0xcc, 0xed, 0x77, 0x12, 0xfc, 0xe2, 0x0c, 0x55, 0x1f, 0xb6, 0xf9, 0x78, 0x55, + 0xef, 0x5f, 0xac, 0x7f, 0x3e, 0xfe, 0xb5, 0x29, 0x19, 0xb7, 0x73, 0xf2, 0xf1, 0x70, 0xe1, 0x9f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x95, 0x78, 0xac, 0xbe, 0x8e, 0x0e, 0x00, 0x00, } func (this *RewardsPlan) Equal(that interface{}) bool { @@ -1042,6 +1042,16 @@ func (m *RewardsPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.AmountPerDay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintModels(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a { size, err := m.UsersDistribution.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1079,32 +1089,22 @@ func (m *RewardsPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a } - n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintModels(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x32 - n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + n5, err5 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime):]) if err5 != nil { return 0, err5 } i -= n5 i = encodeVarintModels(dAtA, i, uint64(n5)) i-- - dAtA[i] = 0x2a - { - size, err := m.AmountPerDay.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModels(dAtA, i, uint64(size)) + dAtA[i] = 0x32 + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + if err6 != nil { + return 0, err6 } + i -= n6 + i = encodeVarintModels(dAtA, i, uint64(n6)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a if m.ServiceID != 0 { i = encodeVarintModels(dAtA, i, uint64(m.ServiceID)) i-- @@ -1805,8 +1805,6 @@ func (m *RewardsPlan) Size() (n int) { if m.ServiceID != 0 { n += 1 + sovModels(uint64(m.ServiceID)) } - l = m.AmountPerDay.Size() - n += 1 + l + sovModels(uint64(l)) l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) n += 1 + l + sovModels(uint64(l)) l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.EndTime) @@ -1821,6 +1819,8 @@ func (m *RewardsPlan) Size() (n int) { n += 1 + l + sovModels(uint64(l)) l = m.UsersDistribution.Size() n += 1 + l + sovModels(uint64(l)) + l = m.AmountPerDay.Size() + n += 1 + l + sovModels(uint64(l)) return n } @@ -2206,9 +2206,9 @@ func (m *RewardsPlan) Unmarshal(dAtA []byte) error { break } } - case 4: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AmountPerDay", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2235,13 +2235,13 @@ func (m *RewardsPlan) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.AmountPerDay.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2268,15 +2268,15 @@ func (m *RewardsPlan) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardsPool", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowModels @@ -2286,30 +2286,29 @@ func (m *RewardsPlan) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthModels } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthModels } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.RewardsPool = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardsPool", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolsDistribution", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowModels @@ -2319,27 +2318,28 @@ func (m *RewardsPlan) 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 ErrInvalidLengthModels } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthModels } if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardsPool = string(dAtA[iNdEx:postIndex]) + if err := m.PoolsDistribution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 8: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolsDistribution", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OperatorsDistribution", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2366,13 +2366,13 @@ func (m *RewardsPlan) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.PoolsDistribution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.OperatorsDistribution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 9: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorsDistribution", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UsersDistribution", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2399,13 +2399,13 @@ func (m *RewardsPlan) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.OperatorsDistribution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.UsersDistribution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 10: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UsersDistribution", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AmountPerDay", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2432,7 +2432,7 @@ func (m *RewardsPlan) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.UsersDistribution.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AmountPerDay.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/rewards/types/params.pb.go b/x/rewards/types/params.pb.go index 0abcdea15..f2532ecf8 100644 --- a/x/rewards/types/params.pb.go +++ b/x/rewards/types/params.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: milkyway/rewards/v2/params.proto +// source: milkyway/rewards/v1/params.proto package types @@ -38,7 +38,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_0158645dc5712f38, []int{0} + return fileDescriptor_d0e2cca7ddea4eaf, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -68,30 +68,30 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo func init() { - proto.RegisterType((*Params)(nil), "milkyway.rewards.v2.Params") + proto.RegisterType((*Params)(nil), "milkyway.rewards.v1.Params") } -func init() { proto.RegisterFile("milkyway/rewards/v2/params.proto", fileDescriptor_0158645dc5712f38) } +func init() { proto.RegisterFile("milkyway/rewards/v1/params.proto", fileDescriptor_d0e2cca7ddea4eaf) } -var fileDescriptor_0158645dc5712f38 = []byte{ +var fileDescriptor_d0e2cca7ddea4eaf = []byte{ // 276 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xbd, 0x4e, 0xc3, 0x30, - 0x14, 0x85, 0x63, 0x21, 0x75, 0x08, 0x5b, 0x41, 0x88, 0x76, 0x70, 0x2b, 0xa6, 0x2e, 0xf5, 0xa5, - 0x01, 0x89, 0xbd, 0x95, 0x98, 0xab, 0x8e, 0x2c, 0xd1, 0x4d, 0x6a, 0x42, 0xd4, 0x24, 0x37, 0x8a, - 0x4d, 0x4a, 0x5e, 0x80, 0x19, 0x5e, 0x83, 0x27, 0xc9, 0xd8, 0x91, 0x89, 0x9f, 0xe4, 0x45, 0x50, - 0x1d, 0xb7, 0x62, 0xf2, 0xb5, 0x75, 0xce, 0xf9, 0x7c, 0x8f, 0x3b, 0x4e, 0xe3, 0x64, 0x53, 0x6d, - 0xb1, 0x82, 0x42, 0x6e, 0xb1, 0x58, 0x2b, 0x28, 0x3d, 0xc8, 0xb1, 0xc0, 0x54, 0x89, 0xbc, 0x20, - 0x4d, 0xfd, 0xb3, 0x83, 0x42, 0x58, 0x85, 0x28, 0xbd, 0x21, 0x0f, 0x49, 0xa5, 0xa4, 0x20, 0x40, - 0x25, 0xa1, 0x9c, 0x05, 0x52, 0xe3, 0x0c, 0x42, 0x8a, 0xb3, 0xce, 0x34, 0x3c, 0x8f, 0x28, 0x22, - 0x33, 0xc2, 0x7e, 0xea, 0x5e, 0xaf,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 0x87, 0x69, 0x82, 0x81, 0x3a, 0xdc, 0xa0, 0xbc, 0x87, 0xd7, 0x43, 0x79, + 0x86, 0x18, 0xf4, 0xcc, 0xba, 0xb7, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd0, 0xb2, 0x7a, 0x3f, 0x5d, 0x01, 0x00, 0x00, } diff --git a/x/rewards/types/query.pb.go b/x/rewards/types/query.pb.go index 23ddfa4ca..4e1ab389e 100644 --- a/x/rewards/types/query.pb.go +++ b/x/rewards/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: milkyway/rewards/v2/query.proto +// source: milkyway/rewards/v1/query.proto package types @@ -40,7 +40,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{0} + return fileDescriptor_f900c2389df7beb1, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -78,7 +78,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{1} + return fileDescriptor_f900c2389df7beb1, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -118,7 +118,7 @@ func (m *QueryRewardsPlansRequest) Reset() { *m = QueryRewardsPlansReque func (m *QueryRewardsPlansRequest) String() string { return proto.CompactTextString(m) } func (*QueryRewardsPlansRequest) ProtoMessage() {} func (*QueryRewardsPlansRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{2} + return fileDescriptor_f900c2389df7beb1, []int{2} } func (m *QueryRewardsPlansRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -159,7 +159,7 @@ func (m *QueryRewardsPlansResponse) Reset() { *m = QueryRewardsPlansResp func (m *QueryRewardsPlansResponse) String() string { return proto.CompactTextString(m) } func (*QueryRewardsPlansResponse) ProtoMessage() {} func (*QueryRewardsPlansResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{3} + return fileDescriptor_f900c2389df7beb1, []int{3} } func (m *QueryRewardsPlansResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -198,7 +198,7 @@ func (m *QueryRewardsPlanRequest) Reset() { *m = QueryRewardsPlanRequest func (m *QueryRewardsPlanRequest) String() string { return proto.CompactTextString(m) } func (*QueryRewardsPlanRequest) ProtoMessage() {} func (*QueryRewardsPlanRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{4} + return fileDescriptor_f900c2389df7beb1, []int{4} } func (m *QueryRewardsPlanRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -237,7 +237,7 @@ func (m *QueryRewardsPlanResponse) Reset() { *m = QueryRewardsPlanRespon func (m *QueryRewardsPlanResponse) String() string { return proto.CompactTextString(m) } func (*QueryRewardsPlanResponse) ProtoMessage() {} func (*QueryRewardsPlanResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{5} + return fileDescriptor_f900c2389df7beb1, []int{5} } func (m *QueryRewardsPlanResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -277,7 +277,7 @@ func (m *QueryPoolOutstandingRewardsRequest) Reset() { *m = QueryPoolOut func (m *QueryPoolOutstandingRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryPoolOutstandingRewardsRequest) ProtoMessage() {} func (*QueryPoolOutstandingRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{6} + return fileDescriptor_f900c2389df7beb1, []int{6} } func (m *QueryPoolOutstandingRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -316,7 +316,7 @@ func (m *QueryPoolOutstandingRewardsResponse) Reset() { *m = QueryPoolOu func (m *QueryPoolOutstandingRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryPoolOutstandingRewardsResponse) ProtoMessage() {} func (*QueryPoolOutstandingRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{7} + return fileDescriptor_f900c2389df7beb1, []int{7} } func (m *QueryPoolOutstandingRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -358,7 +358,7 @@ func (m *QueryOperatorOutstandingRewardsRequest) Reset() { func (m *QueryOperatorOutstandingRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorOutstandingRewardsRequest) ProtoMessage() {} func (*QueryOperatorOutstandingRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{8} + return fileDescriptor_f900c2389df7beb1, []int{8} } func (m *QueryOperatorOutstandingRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -399,7 +399,7 @@ func (m *QueryOperatorOutstandingRewardsResponse) Reset() { func (m *QueryOperatorOutstandingRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorOutstandingRewardsResponse) ProtoMessage() {} func (*QueryOperatorOutstandingRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{9} + return fileDescriptor_f900c2389df7beb1, []int{9} } func (m *QueryOperatorOutstandingRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -439,7 +439,7 @@ func (m *QueryServiceOutstandingRewardsRequest) Reset() { *m = QueryServ func (m *QueryServiceOutstandingRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryServiceOutstandingRewardsRequest) ProtoMessage() {} func (*QueryServiceOutstandingRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{10} + return fileDescriptor_f900c2389df7beb1, []int{10} } func (m *QueryServiceOutstandingRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -480,7 +480,7 @@ func (m *QueryServiceOutstandingRewardsResponse) Reset() { func (m *QueryServiceOutstandingRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryServiceOutstandingRewardsResponse) ProtoMessage() {} func (*QueryServiceOutstandingRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{11} + return fileDescriptor_f900c2389df7beb1, []int{11} } func (m *QueryServiceOutstandingRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -520,7 +520,7 @@ func (m *QueryOperatorCommissionRequest) Reset() { *m = QueryOperatorCom func (m *QueryOperatorCommissionRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorCommissionRequest) ProtoMessage() {} func (*QueryOperatorCommissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{12} + return fileDescriptor_f900c2389df7beb1, []int{12} } func (m *QueryOperatorCommissionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -560,7 +560,7 @@ func (m *QueryOperatorCommissionResponse) Reset() { *m = QueryOperatorCo func (m *QueryOperatorCommissionResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorCommissionResponse) ProtoMessage() {} func (*QueryOperatorCommissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{13} + return fileDescriptor_f900c2389df7beb1, []int{13} } func (m *QueryOperatorCommissionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -602,7 +602,7 @@ func (m *QueryPoolDelegationRewardsRequest) Reset() { *m = QueryPoolDele func (m *QueryPoolDelegationRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryPoolDelegationRewardsRequest) ProtoMessage() {} func (*QueryPoolDelegationRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{14} + return fileDescriptor_f900c2389df7beb1, []int{14} } func (m *QueryPoolDelegationRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -642,7 +642,7 @@ func (m *QueryPoolDelegationRewardsResponse) Reset() { *m = QueryPoolDel func (m *QueryPoolDelegationRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryPoolDelegationRewardsResponse) ProtoMessage() {} func (*QueryPoolDelegationRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{15} + return fileDescriptor_f900c2389df7beb1, []int{15} } func (m *QueryPoolDelegationRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -684,7 +684,7 @@ func (m *QueryOperatorDelegationRewardsRequest) Reset() { *m = QueryOper func (m *QueryOperatorDelegationRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorDelegationRewardsRequest) ProtoMessage() {} func (*QueryOperatorDelegationRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{16} + return fileDescriptor_f900c2389df7beb1, []int{16} } func (m *QueryOperatorDelegationRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -726,7 +726,7 @@ func (m *QueryOperatorDelegationRewardsResponse) Reset() { func (m *QueryOperatorDelegationRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorDelegationRewardsResponse) ProtoMessage() {} func (*QueryOperatorDelegationRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{17} + return fileDescriptor_f900c2389df7beb1, []int{17} } func (m *QueryOperatorDelegationRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -768,7 +768,7 @@ func (m *QueryServiceDelegationRewardsRequest) Reset() { *m = QueryServi func (m *QueryServiceDelegationRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryServiceDelegationRewardsRequest) ProtoMessage() {} func (*QueryServiceDelegationRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{18} + return fileDescriptor_f900c2389df7beb1, []int{18} } func (m *QueryServiceDelegationRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -808,7 +808,7 @@ func (m *QueryServiceDelegationRewardsResponse) Reset() { *m = QueryServ func (m *QueryServiceDelegationRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryServiceDelegationRewardsResponse) ProtoMessage() {} func (*QueryServiceDelegationRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{19} + return fileDescriptor_f900c2389df7beb1, []int{19} } func (m *QueryServiceDelegationRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -848,7 +848,7 @@ func (m *QueryDelegatorTotalRewardsRequest) Reset() { *m = QueryDelegato func (m *QueryDelegatorTotalRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorTotalRewardsRequest) ProtoMessage() {} func (*QueryDelegatorTotalRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{20} + return fileDescriptor_f900c2389df7beb1, []int{20} } func (m *QueryDelegatorTotalRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -890,7 +890,7 @@ func (m *QueryDelegatorTotalRewardsResponse) Reset() { *m = QueryDelegat func (m *QueryDelegatorTotalRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorTotalRewardsResponse) ProtoMessage() {} func (*QueryDelegatorTotalRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{21} + return fileDescriptor_f900c2389df7beb1, []int{21} } func (m *QueryDelegatorTotalRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -930,7 +930,7 @@ func (m *QueryDelegatorWithdrawAddressRequest) Reset() { *m = QueryDeleg func (m *QueryDelegatorWithdrawAddressRequest) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorWithdrawAddressRequest) ProtoMessage() {} func (*QueryDelegatorWithdrawAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{22} + return fileDescriptor_f900c2389df7beb1, []int{22} } func (m *QueryDelegatorWithdrawAddressRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -970,7 +970,7 @@ func (m *QueryDelegatorWithdrawAddressResponse) Reset() { *m = QueryDele func (m *QueryDelegatorWithdrawAddressResponse) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorWithdrawAddressResponse) ProtoMessage() {} func (*QueryDelegatorWithdrawAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7dc2ab3030ae117b, []int{23} + return fileDescriptor_f900c2389df7beb1, []int{23} } func (m *QueryDelegatorWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1000,116 +1000,115 @@ func (m *QueryDelegatorWithdrawAddressResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryDelegatorWithdrawAddressResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "milkyway.rewards.v2.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "milkyway.rewards.v2.QueryParamsResponse") - proto.RegisterType((*QueryRewardsPlansRequest)(nil), "milkyway.rewards.v2.QueryRewardsPlansRequest") - proto.RegisterType((*QueryRewardsPlansResponse)(nil), "milkyway.rewards.v2.QueryRewardsPlansResponse") - proto.RegisterType((*QueryRewardsPlanRequest)(nil), "milkyway.rewards.v2.QueryRewardsPlanRequest") - proto.RegisterType((*QueryRewardsPlanResponse)(nil), "milkyway.rewards.v2.QueryRewardsPlanResponse") - proto.RegisterType((*QueryPoolOutstandingRewardsRequest)(nil), "milkyway.rewards.v2.QueryPoolOutstandingRewardsRequest") - proto.RegisterType((*QueryPoolOutstandingRewardsResponse)(nil), "milkyway.rewards.v2.QueryPoolOutstandingRewardsResponse") - proto.RegisterType((*QueryOperatorOutstandingRewardsRequest)(nil), "milkyway.rewards.v2.QueryOperatorOutstandingRewardsRequest") - proto.RegisterType((*QueryOperatorOutstandingRewardsResponse)(nil), "milkyway.rewards.v2.QueryOperatorOutstandingRewardsResponse") - proto.RegisterType((*QueryServiceOutstandingRewardsRequest)(nil), "milkyway.rewards.v2.QueryServiceOutstandingRewardsRequest") - proto.RegisterType((*QueryServiceOutstandingRewardsResponse)(nil), "milkyway.rewards.v2.QueryServiceOutstandingRewardsResponse") - proto.RegisterType((*QueryOperatorCommissionRequest)(nil), "milkyway.rewards.v2.QueryOperatorCommissionRequest") - proto.RegisterType((*QueryOperatorCommissionResponse)(nil), "milkyway.rewards.v2.QueryOperatorCommissionResponse") - proto.RegisterType((*QueryPoolDelegationRewardsRequest)(nil), "milkyway.rewards.v2.QueryPoolDelegationRewardsRequest") - proto.RegisterType((*QueryPoolDelegationRewardsResponse)(nil), "milkyway.rewards.v2.QueryPoolDelegationRewardsResponse") - proto.RegisterType((*QueryOperatorDelegationRewardsRequest)(nil), "milkyway.rewards.v2.QueryOperatorDelegationRewardsRequest") - proto.RegisterType((*QueryOperatorDelegationRewardsResponse)(nil), "milkyway.rewards.v2.QueryOperatorDelegationRewardsResponse") - proto.RegisterType((*QueryServiceDelegationRewardsRequest)(nil), "milkyway.rewards.v2.QueryServiceDelegationRewardsRequest") - proto.RegisterType((*QueryServiceDelegationRewardsResponse)(nil), "milkyway.rewards.v2.QueryServiceDelegationRewardsResponse") - proto.RegisterType((*QueryDelegatorTotalRewardsRequest)(nil), "milkyway.rewards.v2.QueryDelegatorTotalRewardsRequest") - proto.RegisterType((*QueryDelegatorTotalRewardsResponse)(nil), "milkyway.rewards.v2.QueryDelegatorTotalRewardsResponse") - proto.RegisterType((*QueryDelegatorWithdrawAddressRequest)(nil), "milkyway.rewards.v2.QueryDelegatorWithdrawAddressRequest") - proto.RegisterType((*QueryDelegatorWithdrawAddressResponse)(nil), "milkyway.rewards.v2.QueryDelegatorWithdrawAddressResponse") -} - -func init() { proto.RegisterFile("milkyway/rewards/v2/query.proto", fileDescriptor_7dc2ab3030ae117b) } - -var fileDescriptor_7dc2ab3030ae117b = []byte{ - // 1267 bytes of a gzipped FileDescriptorProto + proto.RegisterType((*QueryParamsRequest)(nil), "milkyway.rewards.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "milkyway.rewards.v1.QueryParamsResponse") + proto.RegisterType((*QueryRewardsPlansRequest)(nil), "milkyway.rewards.v1.QueryRewardsPlansRequest") + proto.RegisterType((*QueryRewardsPlansResponse)(nil), "milkyway.rewards.v1.QueryRewardsPlansResponse") + proto.RegisterType((*QueryRewardsPlanRequest)(nil), "milkyway.rewards.v1.QueryRewardsPlanRequest") + proto.RegisterType((*QueryRewardsPlanResponse)(nil), "milkyway.rewards.v1.QueryRewardsPlanResponse") + proto.RegisterType((*QueryPoolOutstandingRewardsRequest)(nil), "milkyway.rewards.v1.QueryPoolOutstandingRewardsRequest") + proto.RegisterType((*QueryPoolOutstandingRewardsResponse)(nil), "milkyway.rewards.v1.QueryPoolOutstandingRewardsResponse") + proto.RegisterType((*QueryOperatorOutstandingRewardsRequest)(nil), "milkyway.rewards.v1.QueryOperatorOutstandingRewardsRequest") + proto.RegisterType((*QueryOperatorOutstandingRewardsResponse)(nil), "milkyway.rewards.v1.QueryOperatorOutstandingRewardsResponse") + proto.RegisterType((*QueryServiceOutstandingRewardsRequest)(nil), "milkyway.rewards.v1.QueryServiceOutstandingRewardsRequest") + proto.RegisterType((*QueryServiceOutstandingRewardsResponse)(nil), "milkyway.rewards.v1.QueryServiceOutstandingRewardsResponse") + proto.RegisterType((*QueryOperatorCommissionRequest)(nil), "milkyway.rewards.v1.QueryOperatorCommissionRequest") + proto.RegisterType((*QueryOperatorCommissionResponse)(nil), "milkyway.rewards.v1.QueryOperatorCommissionResponse") + proto.RegisterType((*QueryPoolDelegationRewardsRequest)(nil), "milkyway.rewards.v1.QueryPoolDelegationRewardsRequest") + proto.RegisterType((*QueryPoolDelegationRewardsResponse)(nil), "milkyway.rewards.v1.QueryPoolDelegationRewardsResponse") + proto.RegisterType((*QueryOperatorDelegationRewardsRequest)(nil), "milkyway.rewards.v1.QueryOperatorDelegationRewardsRequest") + proto.RegisterType((*QueryOperatorDelegationRewardsResponse)(nil), "milkyway.rewards.v1.QueryOperatorDelegationRewardsResponse") + proto.RegisterType((*QueryServiceDelegationRewardsRequest)(nil), "milkyway.rewards.v1.QueryServiceDelegationRewardsRequest") + proto.RegisterType((*QueryServiceDelegationRewardsResponse)(nil), "milkyway.rewards.v1.QueryServiceDelegationRewardsResponse") + proto.RegisterType((*QueryDelegatorTotalRewardsRequest)(nil), "milkyway.rewards.v1.QueryDelegatorTotalRewardsRequest") + proto.RegisterType((*QueryDelegatorTotalRewardsResponse)(nil), "milkyway.rewards.v1.QueryDelegatorTotalRewardsResponse") + proto.RegisterType((*QueryDelegatorWithdrawAddressRequest)(nil), "milkyway.rewards.v1.QueryDelegatorWithdrawAddressRequest") + proto.RegisterType((*QueryDelegatorWithdrawAddressResponse)(nil), "milkyway.rewards.v1.QueryDelegatorWithdrawAddressResponse") +} + +func init() { proto.RegisterFile("milkyway/rewards/v1/query.proto", fileDescriptor_f900c2389df7beb1) } + +var fileDescriptor_f900c2389df7beb1 = []byte{ + // 1262 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, - 0x1b, 0xce, 0xf8, 0x6b, 0xd3, 0xaf, 0x6f, 0x52, 0xd1, 0x4e, 0x12, 0xea, 0xb8, 0xad, 0x13, 0xb6, - 0x6d, 0x12, 0x45, 0xcd, 0xae, 0xe2, 0x46, 0xa4, 0x49, 0x28, 0x24, 0x4e, 0x08, 0x58, 0xb4, 0x6a, - 0x6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0xb0, 0x23, 0x1c, 0xe6, 0x10, 0xc3, 0x8e, 0x70, 0xa8, 0xd9, - 0x93, 0xd6, 0x39, 0xcb, 0xdb, 0x74, 0xe5, 0x04, 0x2c, 0xe9, 0x53, 0x02, 0xf1, 0x20, 0x7b, 0x14, - 0xb6, 0x7d, 0x11, 0x0e, 0x2e, 0x6c, 0xfb, 0xa2, 0xdc, 0x98, 0x74, 0x87, 0x13, 0xdb, 0xa4, 0x1b, - 0xbd, 0x10, 0xeb, 0xf4, 0x71, 0xe9, 0xec, 0xfe, 0xb3, 0xe4, 0xc0, 0xfe, 0x41, 0x92, 0x3c, 0x39, - 0x48, 0x92, 0x3f, 0x0e, 0x92, 0xe4, 0xd3, 0xc3, 0xe4, 0xc0, 0x93, 0xc3, 0xe4, 0xc0, 0x2f, 0x87, - 0xc9, 0x81, 0x77, 0x16, 0x8a, 0x86, 0xfd, 0xb0, 0x96, 0x97, 0x0b, 0xac, 0xdc, 0xec, 0x36, 0x57, - 0x52, 0xf3, 0x56, 0xab, 0x77, 0x7d, 0x51, 0x79, 0xdc, 0x04, 0x60, 0xef, 0x54, 0x75, 0x2b, 0x3f, - 0xc8, 0x7f, 0x23, 0xbc, 0xf9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xca, 0xbd, 0xe3, 0x90, 0x2d, - 0x15, 0x00, 0x00, + 0x14, 0xce, 0x98, 0x36, 0x25, 0x2f, 0xa9, 0x68, 0x27, 0x09, 0x75, 0xdc, 0xd6, 0x09, 0xdb, 0x36, + 0x89, 0xa2, 0x66, 0x57, 0x49, 0x23, 0xd2, 0x24, 0x14, 0x12, 0x27, 0x04, 0x2c, 0x5a, 0x35, 0xb5, + 0xa9, 0x10, 0x70, 0x88, 0xd6, 0xde, 0x95, 0xbb, 0x60, 0x7b, 0xdc, 0xdd, 0xb5, 0xdd, 0x28, 0x8a, + 0x84, 0xe0, 0x8a, 0x04, 0x12, 0x5c, 0xb8, 0x71, 0x44, 0x9c, 0x38, 0x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 0xb6, 0x2f, 0xca, 0x8d, 0x49, 0xb7, 0x39, 0xb1, 0x4d, 0xba, 0xd1, 0x0d, 0xb1, 0x76, 0x1f, + 0x97, 0xca, 0xec, 0x3f, 0x4d, 0xf6, 0xed, 0x1f, 0x24, 0xc9, 0xe3, 0x83, 0x24, 0xf9, 0xeb, 0x20, + 0x49, 0x3e, 0x3f, 0x4c, 0xf6, 0x3d, 0x3e, 0x4c, 0xf6, 0xfd, 0x76, 0x98, 0xec, 0x7b, 0x6f, 0xa1, + 0x60, 0xd8, 0x0f, 0xaa, 0x39, 0x39, 0xcf, 0x4a, 0x8d, 0x6e, 0xb3, 0x45, 0x35, 0x67, 0x35, 0x7b, + 0xd7, 0x16, 0x95, 0x47, 0x0d, 0x00, 0xf6, 0x4e, 0x45, 0xb7, 0x72, 0xfd, 0xfc, 0x37, 0xc2, 0x1b, + 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x12, 0x9f, 0x92, 0xf8, 0x2d, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1165,7 +1164,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -1174,7 +1173,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . func (c *queryClient) RewardsPlans(ctx context.Context, in *QueryRewardsPlansRequest, opts ...grpc.CallOption) (*QueryRewardsPlansResponse, error) { out := new(QueryRewardsPlansResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/RewardsPlans", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/RewardsPlans", in, out, opts...) if err != nil { return nil, err } @@ -1183,7 +1182,7 @@ func (c *queryClient) RewardsPlans(ctx context.Context, in *QueryRewardsPlansReq func (c *queryClient) RewardsPlan(ctx context.Context, in *QueryRewardsPlanRequest, opts ...grpc.CallOption) (*QueryRewardsPlanResponse, error) { out := new(QueryRewardsPlanResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/RewardsPlan", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/RewardsPlan", in, out, opts...) if err != nil { return nil, err } @@ -1192,7 +1191,7 @@ func (c *queryClient) RewardsPlan(ctx context.Context, in *QueryRewardsPlanReque func (c *queryClient) PoolOutstandingRewards(ctx context.Context, in *QueryPoolOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryPoolOutstandingRewardsResponse, error) { out := new(QueryPoolOutstandingRewardsResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/PoolOutstandingRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/PoolOutstandingRewards", in, out, opts...) if err != nil { return nil, err } @@ -1201,7 +1200,7 @@ func (c *queryClient) PoolOutstandingRewards(ctx context.Context, in *QueryPoolO func (c *queryClient) OperatorOutstandingRewards(ctx context.Context, in *QueryOperatorOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryOperatorOutstandingRewardsResponse, error) { out := new(QueryOperatorOutstandingRewardsResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/OperatorOutstandingRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/OperatorOutstandingRewards", in, out, opts...) if err != nil { return nil, err } @@ -1210,7 +1209,7 @@ func (c *queryClient) OperatorOutstandingRewards(ctx context.Context, in *QueryO func (c *queryClient) ServiceOutstandingRewards(ctx context.Context, in *QueryServiceOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryServiceOutstandingRewardsResponse, error) { out := new(QueryServiceOutstandingRewardsResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/ServiceOutstandingRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/ServiceOutstandingRewards", in, out, opts...) if err != nil { return nil, err } @@ -1219,7 +1218,7 @@ func (c *queryClient) ServiceOutstandingRewards(ctx context.Context, in *QuerySe func (c *queryClient) OperatorCommission(ctx context.Context, in *QueryOperatorCommissionRequest, opts ...grpc.CallOption) (*QueryOperatorCommissionResponse, error) { out := new(QueryOperatorCommissionResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/OperatorCommission", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/OperatorCommission", in, out, opts...) if err != nil { return nil, err } @@ -1228,7 +1227,7 @@ func (c *queryClient) OperatorCommission(ctx context.Context, in *QueryOperatorC func (c *queryClient) PoolDelegationRewards(ctx context.Context, in *QueryPoolDelegationRewardsRequest, opts ...grpc.CallOption) (*QueryPoolDelegationRewardsResponse, error) { out := new(QueryPoolDelegationRewardsResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/PoolDelegationRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/PoolDelegationRewards", in, out, opts...) if err != nil { return nil, err } @@ -1237,7 +1236,7 @@ func (c *queryClient) PoolDelegationRewards(ctx context.Context, in *QueryPoolDe func (c *queryClient) OperatorDelegationRewards(ctx context.Context, in *QueryOperatorDelegationRewardsRequest, opts ...grpc.CallOption) (*QueryOperatorDelegationRewardsResponse, error) { out := new(QueryOperatorDelegationRewardsResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/OperatorDelegationRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/OperatorDelegationRewards", in, out, opts...) if err != nil { return nil, err } @@ -1246,7 +1245,7 @@ func (c *queryClient) OperatorDelegationRewards(ctx context.Context, in *QueryOp func (c *queryClient) ServiceDelegationRewards(ctx context.Context, in *QueryServiceDelegationRewardsRequest, opts ...grpc.CallOption) (*QueryServiceDelegationRewardsResponse, error) { out := new(QueryServiceDelegationRewardsResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/ServiceDelegationRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/ServiceDelegationRewards", in, out, opts...) if err != nil { return nil, err } @@ -1255,7 +1254,7 @@ func (c *queryClient) ServiceDelegationRewards(ctx context.Context, in *QuerySer func (c *queryClient) DelegatorTotalRewards(ctx context.Context, in *QueryDelegatorTotalRewardsRequest, opts ...grpc.CallOption) (*QueryDelegatorTotalRewardsResponse, error) { out := new(QueryDelegatorTotalRewardsResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/DelegatorTotalRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/DelegatorTotalRewards", in, out, opts...) if err != nil { return nil, err } @@ -1264,7 +1263,7 @@ func (c *queryClient) DelegatorTotalRewards(ctx context.Context, in *QueryDelega func (c *queryClient) DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) { out := new(QueryDelegatorWithdrawAddressResponse) - err := c.cc.Invoke(ctx, "/milkyway.rewards.v2.Query/DelegatorWithdrawAddress", in, out, opts...) + err := c.cc.Invoke(ctx, "/milkyway.rewards.v1.Query/DelegatorWithdrawAddress", in, out, opts...) if err != nil { return nil, err } @@ -1359,7 +1358,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/Params", + FullMethod: "/milkyway.rewards.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -1377,7 +1376,7 @@ func _Query_RewardsPlans_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/RewardsPlans", + FullMethod: "/milkyway.rewards.v1.Query/RewardsPlans", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).RewardsPlans(ctx, req.(*QueryRewardsPlansRequest)) @@ -1395,7 +1394,7 @@ func _Query_RewardsPlan_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/RewardsPlan", + FullMethod: "/milkyway.rewards.v1.Query/RewardsPlan", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).RewardsPlan(ctx, req.(*QueryRewardsPlanRequest)) @@ -1413,7 +1412,7 @@ func _Query_PoolOutstandingRewards_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/PoolOutstandingRewards", + FullMethod: "/milkyway.rewards.v1.Query/PoolOutstandingRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).PoolOutstandingRewards(ctx, req.(*QueryPoolOutstandingRewardsRequest)) @@ -1431,7 +1430,7 @@ func _Query_OperatorOutstandingRewards_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/OperatorOutstandingRewards", + FullMethod: "/milkyway.rewards.v1.Query/OperatorOutstandingRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).OperatorOutstandingRewards(ctx, req.(*QueryOperatorOutstandingRewardsRequest)) @@ -1449,7 +1448,7 @@ func _Query_ServiceOutstandingRewards_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/ServiceOutstandingRewards", + FullMethod: "/milkyway.rewards.v1.Query/ServiceOutstandingRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ServiceOutstandingRewards(ctx, req.(*QueryServiceOutstandingRewardsRequest)) @@ -1467,7 +1466,7 @@ func _Query_OperatorCommission_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/OperatorCommission", + FullMethod: "/milkyway.rewards.v1.Query/OperatorCommission", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).OperatorCommission(ctx, req.(*QueryOperatorCommissionRequest)) @@ -1485,7 +1484,7 @@ func _Query_PoolDelegationRewards_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/PoolDelegationRewards", + FullMethod: "/milkyway.rewards.v1.Query/PoolDelegationRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).PoolDelegationRewards(ctx, req.(*QueryPoolDelegationRewardsRequest)) @@ -1503,7 +1502,7 @@ func _Query_OperatorDelegationRewards_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/OperatorDelegationRewards", + FullMethod: "/milkyway.rewards.v1.Query/OperatorDelegationRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).OperatorDelegationRewards(ctx, req.(*QueryOperatorDelegationRewardsRequest)) @@ -1521,7 +1520,7 @@ func _Query_ServiceDelegationRewards_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/ServiceDelegationRewards", + FullMethod: "/milkyway.rewards.v1.Query/ServiceDelegationRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ServiceDelegationRewards(ctx, req.(*QueryServiceDelegationRewardsRequest)) @@ -1539,7 +1538,7 @@ func _Query_DelegatorTotalRewards_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/DelegatorTotalRewards", + FullMethod: "/milkyway.rewards.v1.Query/DelegatorTotalRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DelegatorTotalRewards(ctx, req.(*QueryDelegatorTotalRewardsRequest)) @@ -1557,7 +1556,7 @@ func _Query_DelegatorWithdrawAddress_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/milkyway.rewards.v2.Query/DelegatorWithdrawAddress", + FullMethod: "/milkyway.rewards.v1.Query/DelegatorWithdrawAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DelegatorWithdrawAddress(ctx, req.(*QueryDelegatorWithdrawAddressRequest)) @@ -1567,7 +1566,7 @@ func _Query_DelegatorWithdrawAddress_Handler(srv interface{}, ctx context.Contex var Query_serviceDesc = _Query_serviceDesc var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "milkyway.rewards.v2.Query", + ServiceName: "milkyway.rewards.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1620,7 +1619,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "milkyway/rewards/v2/query.proto", + Metadata: "milkyway/rewards/v1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { diff --git a/x/rewards/types/query.pb.gw.go b/x/rewards/types/query.pb.gw.go index 23cd02c0a..ffbc3405e 100644 --- a/x/rewards/types/query.pb.gw.go +++ b/x/rewards/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: milkyway/rewards/v2/query.proto +// source: milkyway/rewards/v1/query.proto /* Package types is a reverse proxy.