From 5534acdf32e1e4d936d2a1047740523e4044d1c5 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 12 Aug 2022 17:37:47 +0200 Subject: [PATCH 1/4] upstream liquid staking changes to sdk to evaluate --- proto/cosmos/app/module/v1alpha1/module.proto | 4 +- x/distribution/abci_test.go | 107 - x/distribution/client/cli/query.go | 46 + x/distribution/client/cli/tx.go | 83 +- x/distribution/client/testutil/suite.go | 142 +- x/distribution/handler.go | 21 - x/distribution/keeper/allocation.go | 4 +- x/distribution/keeper/allocation_test.go | 8 +- x/distribution/keeper/common_test.go | 2 +- x/distribution/keeper/delegation.go | 11 +- x/distribution/keeper/delegation_test.go | 121 +- x/distribution/keeper/fee_pool.go | 3 +- x/distribution/keeper/grpc_query.go | 89 +- x/distribution/keeper/grpc_query_test.go | 79 +- x/distribution/keeper/hooks.go | 8 + x/distribution/keeper/invariants.go | 9 +- x/distribution/keeper/keeper.go | 162 +- x/distribution/keeper/keeper_test.go | 2 +- x/distribution/keeper/migrations.go | 20 - x/distribution/keeper/msg_server.go | 80 +- x/distribution/keeper/querier.go | 11 +- x/distribution/keeper/querier_test.go | 2 +- x/distribution/keeper/validator.go | 6 +- x/distribution/migrations/v042/types.go | 185 - x/distribution/migrations/v043/helpers.go | 70 - x/distribution/migrations/v043/store.go | 23 - x/distribution/migrations/v043/store_test.go | 98 - x/distribution/module.go | 20 +- x/distribution/module_test.go | 2 +- x/distribution/proposal_handler_test.go | 2 +- x/distribution/simulation/decoder_test.go | 2 +- x/distribution/simulation/genesis_test.go | 3 +- x/distribution/simulation/operations.go | 71 +- x/distribution/simulation/operations_test.go | 17 +- x/distribution/simulation/proposals_test.go | 2 +- x/distribution/spec/02_state.md | 8 +- x/distribution/spec/04_messages.md | 12 +- x/distribution/spec/05_hooks.md | 30 +- x/distribution/spec/README.md | 50 +- x/distribution/types/codec.go | 29 +- x/distribution/types/distribution.pb.go | 529 +- x/distribution/types/errors.go | 25 +- x/distribution/types/events.go | 13 +- x/distribution/types/expected_keepers.go | 44 +- x/distribution/types/fee_pool_test.go | 1 + x/distribution/types/genesis.go | 1 + x/distribution/types/genesis.pb.go | 258 +- x/distribution/types/msg.go | 105 +- x/distribution/types/proposal.go | 9 +- x/distribution/types/query.go | 6 +- x/distribution/types/query.pb.go | 723 +- x/distribution/types/query.pb.gw.go | 149 +- x/distribution/types/tx.pb.go | 1049 ++- x/slashing/abci_test.go | 6 +- x/slashing/app_test.go | 10 +- x/slashing/client/cli/query.go | 1 + x/slashing/client/cli/tx.go | 1 - x/slashing/init_test.go | 6 +- x/slashing/keeper/common_test.go | 6 +- x/slashing/keeper/genesis.go | 4 +- x/slashing/keeper/genesis_test.go | 2 +- x/slashing/keeper/grpc_query_test.go | 4 +- x/slashing/keeper/hooks.go | 5 + x/slashing/keeper/keeper.go | 2 +- x/slashing/keeper/keeper_test.go | 87 +- x/slashing/keeper/migrations.go | 3 +- x/slashing/keeper/querier.go | 3 +- x/slashing/keeper/querier_test.go | 2 +- x/slashing/keeper/signing_info_test.go | 2 +- x/slashing/keeper/unjail.go | 21 +- x/slashing/migrations/v042/types.go | 69 - x/slashing/migrations/v043/store.go | 7 - x/slashing/migrations/v043/store_test.go | 67 - x/slashing/module.go | 22 +- x/slashing/simulation/decoder_test.go | 2 +- x/slashing/simulation/genesis_test.go | 4 +- x/slashing/simulation/operations.go | 6 +- x/slashing/simulation/operations_test.go | 8 +- x/slashing/spec/01_concepts.md | 6 +- x/slashing/spec/02_state.md | 2 +- x/slashing/spec/05_hooks.md | 5 - x/slashing/types/codec.go | 17 +- x/slashing/types/errors.go | 26 +- x/slashing/types/expected_keepers.go | 10 +- x/slashing/types/genesis.go | 1 + x/slashing/types/genesis.pb.go | 73 +- x/slashing/types/msg.go | 5 +- x/slashing/types/msg_test.go | 3 +- x/slashing/types/params.go | 1 + x/slashing/types/query.pb.go | 83 +- x/slashing/types/query.pb.gw.go | 13 +- x/slashing/types/signing_info.go | 1 + x/slashing/types/slashing.pb.go | 101 +- x/slashing/types/tx.pb.go | 38 +- x/staking/app_test.go | 10 +- x/staking/client/cli/flags.go | 9 - x/staking/client/cli/query.go | 238 + x/staking/client/cli/tx.go | 296 +- x/staking/client/cli/tx_test.go | 32 +- x/staking/client/testutil/grpc.go | 6 +- x/staking/client/testutil/suite.go | 216 +- x/staking/client/testutil/test_helpers.go | 8 +- x/staking/common_test.go | 2 +- x/staking/genesis.go | 3 +- x/staking/genesis_test.go | 13 +- x/staking/keeper/alias_functions.go | 16 +- x/staking/keeper/common_test.go | 16 +- x/staking/keeper/delegation.go | 57 +- x/staking/keeper/delegation_test.go | 549 +- x/staking/keeper/genesis.go | 5 +- x/staking/keeper/genesis_test.go | 17 +- x/staking/keeper/grpc_query.go | 175 +- x/staking/keeper/grpc_query_test.go | 59 +- x/staking/keeper/historical_info_test.go | 7 +- x/staking/keeper/hooks.go | 7 + x/staking/keeper/invariants.go | 7 +- x/staking/keeper/keeper.go | 2 +- x/staking/keeper/keeper_test.go | 10 +- x/staking/keeper/migrations.go | 28 - x/staking/keeper/msg_server.go | 419 +- x/staking/keeper/msg_server_test.go | 410 +- x/staking/keeper/params.go | 7 + x/staking/keeper/querier.go | 16 +- x/staking/keeper/querier_test.go | 16 +- x/staking/keeper/query_utils.go | 7 +- x/staking/keeper/slash.go | 5 +- x/staking/keeper/slash_test.go | 24 +- x/staking/keeper/tokenize_share_record.go | 150 + .../keeper/tokenize_share_record_test.go | 58 + x/staking/keeper/val_state_change.go | 9 +- x/staking/keeper/validator_bench_test.go | 4 +- x/staking/keeper/validator_test.go | 61 +- x/staking/migrations/v042/types.go | 306 - x/staking/migrations/v043/keys.go | 6 - x/staking/migrations/v043/store.go | 78 - x/staking/migrations/v043/store_test.go | 137 - x/staking/migrations/v046/json.go | 13 - x/staking/migrations/v046/json_test.go | 57 - x/staking/migrations/v046/keys.go | 6 - x/staking/migrations/v046/store.go | 10 +- x/staking/migrations/v046/store_test.go | 31 - x/staking/module.go | 10 +- x/staking/module_test.go | 2 +- x/staking/simulation/decoder_test.go | 4 +- x/staking/simulation/genesis.go | 5 +- x/staking/simulation/genesis_test.go | 10 +- x/staking/simulation/operations.go | 294 +- x/staking/simulation/operations_test.go | 512 +- x/staking/spec/01_state.md | 91 +- x/staking/spec/02_state_transitions.md | 135 +- x/staking/spec/03_messages.md | 152 +- x/staking/spec/05_end_block.md | 20 +- x/staking/spec/06_hooks.md | 34 +- x/staking/spec/07_events.md | 31 +- x/staking/spec/08_params.md | 3 +- x/staking/spec/09_client.md | 53 +- x/staking/spec/README.md | 64 +- x/staking/teststaking/helper.go | 55 +- x/staking/types/authz.go | 37 +- x/staking/types/authz.pb.go | 107 +- x/staking/types/authz_test.go | 48 +- x/staking/types/codec.go | 42 +- x/staking/types/commission.go | 21 +- x/staking/types/delegation.go | 20 +- x/staking/types/delegation_test.go | 8 +- x/staking/types/errors.go | 86 +- x/staking/types/events.go | 40 +- x/staking/types/expected_keepers.go | 24 +- x/staking/types/exported.go | 4 +- x/staking/types/genesis.pb.go | 204 +- x/staking/types/historical_info.go | 5 +- x/staking/types/hooks.go | 17 +- x/staking/types/keys.go | 24 + x/staking/types/keys_test.go | 36 +- x/staking/types/msg.go | 229 +- x/staking/types/msg_test.go | 35 +- x/staking/types/params.go | 31 +- x/staking/types/query.pb.go | 6358 +++++++++++------ x/staking/types/query.pb.gw.go | 76 +- x/staking/types/staking.pb.go | 2011 ++++-- x/staking/types/tokenize_share_record.go | 18 + x/staking/types/tx.pb.go | 2543 +++++-- x/staking/types/validator.go | 63 +- x/staking/types/validator_test.go | 40 +- 184 files changed, 14596 insertions(+), 7915 deletions(-) delete mode 100644 x/distribution/abci_test.go delete mode 100644 x/distribution/handler.go delete mode 100644 x/distribution/migrations/v042/types.go delete mode 100644 x/slashing/migrations/v042/types.go create mode 100644 x/staking/keeper/tokenize_share_record.go create mode 100644 x/staking/keeper/tokenize_share_record_test.go delete mode 100644 x/staking/migrations/v042/types.go delete mode 100644 x/staking/migrations/v043/keys.go delete mode 100644 x/staking/migrations/v046/json.go delete mode 100644 x/staking/migrations/v046/json_test.go delete mode 100644 x/staking/migrations/v046/keys.go create mode 100644 x/staking/types/tokenize_share_record.go diff --git a/proto/cosmos/app/module/v1alpha1/module.proto b/proto/cosmos/app/module/v1alpha1/module.proto index 487e195c3263..62de11df812b 100644 --- a/proto/cosmos/app/module/v1alpha1/module.proto +++ b/proto/cosmos/app/module/v1alpha1/module.proto @@ -7,7 +7,7 @@ import "cosmos/app/v1alpha1/module.proto"; // Module is the module config object for the cosmos.app v1 app module. message Module { option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/cosmos/cosmos-sdk/app" - use_package: {name: "cosmos.app.v1alpha1"} + go_import: "github.com/cosmos/cosmos-sdk/simapp" + use_package: { name: "cosmos.app.v1alpha1" } }; } diff --git a/x/distribution/abci_test.go b/x/distribution/abci_test.go deleted file mode 100644 index ea31b564bd63..000000000000 --- a/x/distribution/abci_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package distribution_test - -import ( - "testing" - - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/staking/teststaking" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -) - -const ( - totalValidators = 6 - lazyValidatorIdx = 2 - power = 100 / totalValidators -) - -var ( - valTokens = sdk.TokensFromConsensusPower(50, sdk.DefaultPowerReduction) - validatorCommissionRates = stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()) -) - -type validator struct { - addr sdk.ValAddress - pubkey cryptotypes.PubKey - votes []abci.VoteInfo -} - -// Context in https://github.com/cosmos/cosmos-sdk/issues/9161 -func TestVerifyProposerRewardAssignement(t *testing.T) { - app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - addrs := simapp.AddTestAddrsIncremental(app, ctx, totalValidators, valTokens) - tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) - tstaking.Commission = validatorCommissionRates - - // create validators - validators := make([]validator, totalValidators-1) - for i := range validators { - validators[i].addr = sdk.ValAddress(addrs[i]) - validators[i].pubkey = ed25519.GenPrivKey().PubKey() - validators[i].votes = make([]abci.VoteInfo, totalValidators) - tstaking.CreateValidatorWithValPower(validators[i].addr, validators[i].pubkey, power, true) - } - app.EndBlock(abci.RequestEndBlock{}) - require.NotEmpty(t, app.Commit()) - - // verify validators lists - require.Len(t, app.StakingKeeper.GetAllValidators(ctx), totalValidators) - for i, val := range validators { - // verify all validator exists - require.NotNil(t, app.StakingKeeper.ValidatorByConsAddr(ctx, sdk.GetConsAddress(val.pubkey))) - - // populate last commit info - voteInfos := []abci.VoteInfo{} - for _, val2 := range validators { - voteInfos = append(voteInfos, abci.VoteInfo{ - Validator: abci.Validator{ - Address: sdk.GetConsAddress(val2.pubkey), - Power: power, - }, - SignedLastBlock: true, - }) - } - - // have this validator only submit the minimum amount of pre-commits - if i == lazyValidatorIdx { - for j := totalValidators * 2 / 3; j < len(voteInfos); j++ { - voteInfos[j].SignedLastBlock = false - } - } - - validators[i].votes = voteInfos - } - - // previous block submitted by validator n-1 (with 100% previous commits) and proposed by lazy validator - app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{Height: app.LastBlockHeight() + 1, ProposerAddress: sdk.GetConsAddress(validators[lazyValidatorIdx].pubkey)}, - LastCommitInfo: abci.LastCommitInfo{Votes: validators[lazyValidatorIdx-1].votes}, - }) - require.NotEmpty(t, app.Commit()) - - // previous block submitted by lazy validator (with 67% previous commits) and proposed by validator n+1 - app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{Height: app.LastBlockHeight() + 1, ProposerAddress: sdk.GetConsAddress(validators[lazyValidatorIdx+1].pubkey)}, - LastCommitInfo: abci.LastCommitInfo{Votes: validators[lazyValidatorIdx].votes}, - }) - require.NotEmpty(t, app.Commit()) - - // previous block submitted by validator n+1 (with 100% previous commits) and proposed by validator n+2 - app.BeginBlock(abci.RequestBeginBlock{ - Header: tmproto.Header{Height: app.LastBlockHeight() + 1, ProposerAddress: sdk.GetConsAddress(validators[lazyValidatorIdx+2].pubkey)}, - LastCommitInfo: abci.LastCommitInfo{Votes: validators[lazyValidatorIdx+1].votes}, - }) - require.NotEmpty(t, app.Commit()) - - rewardsValidatorBeforeLazyValidator := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, validators[lazyValidatorIdx+1].addr) - rewardsLazyValidator := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, validators[lazyValidatorIdx].addr) - rewardsValidatorAfterLazyValidator := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, validators[lazyValidatorIdx+1].addr) - require.True(t, rewardsLazyValidator[0].Amount.LT(rewardsValidatorAfterLazyValidator[0].Amount)) - require.Equal(t, rewardsValidatorBeforeLazyValidator, rewardsValidatorAfterLazyValidator) -} diff --git a/x/distribution/client/cli/query.go b/x/distribution/client/cli/query.go index aa087f5f8b27..3f7a6f48d66a 100644 --- a/x/distribution/client/cli/query.go +++ b/x/distribution/client/cli/query.go @@ -31,6 +31,7 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryValidatorSlashes(), GetCmdQueryDelegatorRewards(), GetCmdQueryCommunityPool(), + GetCmdQueryTokenizeShareRecordReward(), ) return distQueryCmd @@ -319,3 +320,48 @@ $ %s query distribution community-pool flags.AddQueryFlagsToCmd(cmd) return cmd } + +// GetCmdQueryTokenizeShareRecordReward implements the query tokenize share record rewards +func GetCmdQueryTokenizeShareRecordReward() *cobra.Command { + bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() + + cmd := &cobra.Command{ + Use: "tokenize-share-record-rewards [owner]", + Args: cobra.ExactArgs(1), + Short: "Query distribution tokenize share record rewards", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the query tokenize share record rewards. + +Example: +$ %s query distribution tokenize-share-record-rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj +`, + version.AppName, bech32PrefixAccAddr, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + ownerAddr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + res, err := queryClient.TokenizeShareRecordReward( + cmd.Context(), + &types.QueryTokenizeShareRecordRewardRequest{OwnerAddress: ownerAddr.String()}, + ) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index 24174d9d080c..af46be7bb7f9 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -2,6 +2,7 @@ package cli import ( "fmt" + "strconv" "strings" "github.com/spf13/cobra" @@ -41,6 +42,8 @@ func NewTxCmd() *cobra.Command { NewWithdrawAllRewardsCmd(), NewSetWithdrawAddrCmd(), NewFundCommunityPoolCmd(), + NewWithdrawTokenizeShareRecordRewardCmd(), + NewWithdrawAllTokenizeShareRecordRewardCmd(), ) return distTxCmd @@ -52,6 +55,7 @@ func newSplitAndApply( genOrBroadcastFn newGenerateOrBroadcastFunc, clientCtx client.Context, fs *pflag.FlagSet, msgs []sdk.Msg, chunkSize int, ) error { + if chunkSize == 0 { return genOrBroadcastFn(clientCtx, fs, msgs...) } @@ -74,7 +78,6 @@ func newSplitAndApply( return nil } -// NewWithdrawRewardsCmd returns a CLI command handler for creating a MsgWithdrawDelegatorReward transaction. func NewWithdrawRewardsCmd() *cobra.Command { bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() @@ -110,6 +113,12 @@ $ %s tx distribution withdraw-rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj msgs = append(msgs, types.NewMsgWithdrawValidatorCommission(valAddr)) } + for _, msg := range msgs { + if err := msg.ValidateBasic(); err != nil { + return err + } + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msgs...) }, } @@ -120,7 +129,6 @@ $ %s tx distribution withdraw-rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj return cmd } -// NewWithdrawAllRewardsCmd returns a CLI command handler for creating a MsgWithdrawDelegatorReward transaction. func NewWithdrawAllRewardsCmd() *cobra.Command { cmd := &cobra.Command{ Use: "withdraw-all-rewards", @@ -184,7 +192,6 @@ $ %[1]s tx distribution withdraw-all-rewards --from mykey return cmd } -// NewSetWithdrawAddrCmd returns a CLI command handler for creating a MsgSetWithdrawAddress transaction. func NewSetWithdrawAddrCmd() *cobra.Command { bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() @@ -223,7 +230,6 @@ $ %s tx distribution set-withdraw-addr %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p return cmd } -// NewFundCommunityPoolCmd returns a CLI command handler for creating a MsgFundCommunityPool transaction. func NewFundCommunityPoolCmd() *cobra.Command { cmd := &cobra.Command{ Use: "fund-community-pool [amount]", @@ -326,3 +332,72 @@ Where proposal.json contains: return cmd } + +// WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for all owning TokenizeShareRecord +func NewWithdrawAllTokenizeShareRecordRewardCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "withdraw-all-tokenize-share-rewards", + Args: cobra.ExactArgs(0), + Short: "Withdraw reward for all owning TokenizeShareRecord", + Long: strings.TrimSpace( + fmt.Sprintf(`Withdraw reward for all owned TokenizeShareRecord + +Example: +$ %s tx distribution withdraw-tokenize-share-rewards --from mykey +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgWithdrawAllTokenizeShareRecordReward(clientCtx.GetFromAddress()) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// WithdrawTokenizeShareRecordReward defines a method to withdraw reward for an owning TokenizeShareRecord +func NewWithdrawTokenizeShareRecordRewardCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "withdraw-tokenize-share-rewards", + Args: cobra.ExactArgs(1), + Short: "Withdraw reward for an owning TokenizeShareRecord", + Long: strings.TrimSpace( + fmt.Sprintf(`Withdraw reward for an owned TokenizeShareRecord + +Example: +$ %s tx distribution withdraw-tokenize-share-rewards 1 --from mykey +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + recordId, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + + msg := types.NewMsgWithdrawTokenizeShareRecordReward(clientCtx.GetFromAddress(), uint64(recordId)) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/distribution/client/testutil/suite.go b/x/distribution/client/testutil/suite.go index fdf9648b659e..e9af3c9d1de6 100644 --- a/x/distribution/client/testutil/suite.go +++ b/x/distribution/client/testutil/suite.go @@ -1,7 +1,6 @@ package testutil import ( - "encoding/hex" "fmt" "strings" "time" @@ -16,7 +15,6 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/client/cli" - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -455,13 +453,12 @@ func (s *IntegrationTestSuite) TestNewWithdrawRewardsCmd() { val := s.network.Validators[0] testCases := []struct { - name string - valAddr fmt.Stringer - args []string - expectErr bool - expectedCode uint32 - respType proto.Message - expectedResponseType []string + name string + valAddr fmt.Stringer + args []string + expectErr bool + expectedCode uint32 + respType proto.Message }{ { "invalid validator address", @@ -473,7 +470,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, true, 0, nil, - []string{}, }, { "valid transaction", @@ -485,9 +481,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, - []string{ - "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", - }, }, { "valid transaction (with commission)", @@ -500,10 +493,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, - []string{ - "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", - "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", - }, }, } @@ -513,7 +502,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawRewardsCmd() { s.Run(tc.name, func() { clientCtx := val.ClientCtx - _, _ = s.network.WaitForHeightWithTimeout(10, time.Minute) bz, err := MsgWithdrawDelegatorRewardExec(clientCtx, tc.valAddr, tc.args...) if tc.expectErr { s.Require().Error(err) @@ -523,32 +511,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawRewardsCmd() { txResp := tc.respType.(*sdk.TxResponse) s.Require().Equal(tc.expectedCode, txResp.Code) - - data, err := hex.DecodeString(txResp.Data) - s.Require().NoError(err) - - txMsgData := sdk.TxMsgData{} - err = s.cfg.Codec.Unmarshal(data, &txMsgData) - s.Require().NoError(err) - for responseIdx, msgResponse := range txMsgData.MsgResponses { - s.Require().Equal(tc.expectedResponseType[responseIdx], msgResponse.TypeUrl) - switch msgResponse.TypeUrl { - case "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse": - var resp distrtypes.MsgWithdrawDelegatorRewardResponse - // can't use unpackAny as response types are not registered. - err = s.cfg.Codec.Unmarshal(msgResponse.Value, &resp) - s.Require().NoError(err) - s.Require().True(resp.Amount.IsAllGT(sdk.NewCoins(sdk.NewCoin("stake", sdk.OneInt()))), - fmt.Sprintf("expected a positive coin value, got %v", resp.Amount)) - case "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse": - var resp distrtypes.MsgWithdrawValidatorCommissionResponse - // can't use unpackAny as response types are not registered. - err = s.cfg.Codec.Unmarshal(msgResponse.Value, &resp) - s.Require().NoError(err) - s.Require().True(resp.Amount.IsAllGT(sdk.NewCoins(sdk.NewCoin("stake", sdk.OneInt()))), - fmt.Sprintf("expected a positive coin value, got %v", resp.Amount)) - } - } } }) } @@ -558,12 +520,11 @@ func (s *IntegrationTestSuite) TestNewWithdrawAllRewardsCmd() { val := s.network.Validators[0] testCases := []struct { - name string - args []string - expectErr bool - expectedCode uint32 - respType proto.Message - expectedResponseType []string + name string + args []string + expectErr bool + expectedCode uint32 + respType proto.Message }{ { "valid transaction (offline)", @@ -574,7 +535,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawAllRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, true, 0, nil, - []string{}, }, { "valid transaction", @@ -585,9 +545,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawAllRewardsCmd() { fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, false, 0, &sdk.TxResponse{}, - []string{ - "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", - }, }, } @@ -598,8 +555,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawAllRewardsCmd() { cmd := cli.NewWithdrawAllRewardsCmd() clientCtx := val.ClientCtx - _, _ = s.network.WaitForHeightWithTimeout(10, time.Minute) - out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) if tc.expectErr { s.Require().Error(err) @@ -609,32 +564,6 @@ func (s *IntegrationTestSuite) TestNewWithdrawAllRewardsCmd() { txResp := tc.respType.(*sdk.TxResponse) s.Require().Equal(tc.expectedCode, txResp.Code) - - data, err := hex.DecodeString(txResp.Data) - s.Require().NoError(err) - - txMsgData := sdk.TxMsgData{} - err = s.cfg.Codec.Unmarshal(data, &txMsgData) - s.Require().NoError(err) - for responseIdx, msgResponse := range txMsgData.MsgResponses { - s.Require().Equal(tc.expectedResponseType[responseIdx], msgResponse.TypeUrl) - switch msgResponse.TypeUrl { - case "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse": - var resp distrtypes.MsgWithdrawDelegatorRewardResponse - // can't use unpackAny as response types are not registered. - err = s.cfg.Codec.Unmarshal(msgResponse.Value, &resp) - s.Require().NoError(err) - s.Require().True(resp.Amount.IsAllGT(sdk.NewCoins(sdk.NewCoin("stake", sdk.OneInt()))), - fmt.Sprintf("expected a positive coin value, got %v", resp.Amount)) - case "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse": - var resp distrtypes.MsgWithdrawValidatorCommissionResponse - // can't use unpackAny as response types are not registered. - err = s.cfg.Codec.Unmarshal(msgResponse.Value, &resp) - s.Require().NoError(err) - s.Require().True(resp.Amount.IsAllGT(sdk.NewCoins(sdk.NewCoin("stake", sdk.OneInt()))), - fmt.Sprintf("expected a positive coin value, got %v", resp.Amount)) - } - } } }) } @@ -761,13 +690,11 @@ func (s *IntegrationTestSuite) TestGetCmdSubmitProposal() { }` // fund some tokens to the community pool - args := []string{ - sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431))).String(), + args := []string{sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5431))).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - } + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String())} invalidPropFile := testutil.WriteToNewTempFile(s.T(), invalidProp) cmd := cli.NewFundCommunityPoolCmd() @@ -839,3 +766,46 @@ func (s *IntegrationTestSuite) TestGetCmdSubmitProposal() { }) } } + +func (s *IntegrationTestSuite) TestNewWithdrawAllTokenizeShareRecordRewardCmd() { + val := s.network.Validators[0] + + testCases := []struct { + name string + args []string + expectErr bool + expectedCode uint32 + respType proto.Message + }{ + { + "valid transaction of withdraw tokenize share record reward", + []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + false, 0, &sdk.TxResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.NewWithdrawAllTokenizeShareRecordRewardCmd() + clientCtx := val.ClientCtx + + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err, out.String()) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + + txResp := tc.respType.(*sdk.TxResponse) + s.Require().Equal(tc.expectedCode, txResp.Code, out.String()) + } + }) + } +} diff --git a/x/distribution/handler.go b/x/distribution/handler.go deleted file mode 100644 index a8aa8eb3e58f..000000000000 --- a/x/distribution/handler.go +++ /dev/null @@ -1,21 +0,0 @@ -package distribution - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" -) - -func NewCommunityPoolSpendProposalHandler(k keeper.Keeper) govtypes.Handler { - return func(ctx sdk.Context, content govtypes.Content) error { - switch c := content.(type) { - case *types.CommunityPoolSpendProposal: - return keeper.HandleCommunityPoolSpendProposal(ctx, k, c) - - default: - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized distr proposal content type: %T", c) - } - } -} diff --git a/x/distribution/keeper/allocation.go b/x/distribution/keeper/allocation.go index 273db1314eb8..5d5d7262d95e 100644 --- a/x/distribution/keeper/allocation.go +++ b/x/distribution/keeper/allocation.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // AllocateTokens handles distribution of the collected fees @@ -101,7 +101,7 @@ func (k Keeper) AllocateTokens( } // AllocateTokensToValidator allocate tokens to a particular validator, splitting according to commission -func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) { +func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val sdkstaking.ValidatorI, tokens sdk.DecCoins) { // split tokens between validator and delegators according to commission commission := tokens.MulDec(val.GetCommission()) shared := tokens.Sub(commission) diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go index d32b43690cac..abda924aa69d 100644 --- a/x/distribution/keeper/allocation_test.go +++ b/x/distribution/keeper/allocation_test.go @@ -7,11 +7,11 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" - disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -50,7 +50,7 @@ func TestAllocateTokensToManyValidators(t *testing.T) { ctx := app.BaseApp.NewContext(false, tmproto.Header{}) // reset fee pool - app.DistrKeeper.SetFeePool(ctx, disttypes.InitialFeePool()) + app.DistrKeeper.SetFeePool(ctx, distrtypes.InitialFeePool()) addrs := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1234)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) @@ -124,7 +124,7 @@ func TestAllocateTokensTruncation(t *testing.T) { ctx := app.BaseApp.NewContext(false, tmproto.Header{}) // reset fee pool - app.DistrKeeper.SetFeePool(ctx, disttypes.InitialFeePool()) + app.DistrKeeper.SetFeePool(ctx, distrtypes.InitialFeePool()) addrs := simapp.AddTestAddrs(app, ctx, 3, sdk.NewInt(1234)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) diff --git a/x/distribution/keeper/common_test.go b/x/distribution/keeper/common_test.go index 807fd45c2520..ffe1f0511bbc 100644 --- a/x/distribution/keeper/common_test.go +++ b/x/distribution/keeper/common_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" diff --git a/x/distribution/keeper/delegation.go b/x/distribution/keeper/delegation.go index 3b158c15585e..a7b7ade14e58 100644 --- a/x/distribution/keeper/delegation.go +++ b/x/distribution/keeper/delegation.go @@ -6,7 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // initialize starting info for a new delegation @@ -28,7 +29,7 @@ func (k Keeper) initializeDelegation(ctx sdk.Context, val sdk.ValAddress, del sd } // calculate the rewards accrued by a delegation between two periods -func (k Keeper) calculateDelegationRewardsBetween(ctx sdk.Context, val stakingtypes.ValidatorI, +func (k Keeper) calculateDelegationRewardsBetween(ctx sdk.Context, val sdkstaking.ValidatorI, startingPeriod, endingPeriod uint64, stake sdk.Dec, ) (rewards sdk.DecCoins) { // sanity check @@ -54,7 +55,7 @@ func (k Keeper) calculateDelegationRewardsBetween(ctx sdk.Context, val stakingty } // calculate the total rewards accrued by a delegation -func (k Keeper) CalculateDelegationRewards(ctx sdk.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI, endingPeriod uint64) (rewards sdk.DecCoins) { +func (k Keeper) CalculateDelegationRewards(ctx sdk.Context, val sdkstaking.ValidatorI, del sdkstaking.DelegationI, endingPeriod uint64) (rewards sdk.DecCoins) { // fetch starting info for delegation startingInfo := k.GetDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) @@ -137,10 +138,10 @@ func (k Keeper) CalculateDelegationRewards(ctx sdk.Context, val stakingtypes.Val return rewards } -func (k Keeper) withdrawDelegationRewards(ctx sdk.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI) (sdk.Coins, error) { +func (k Keeper) withdrawDelegationRewards(ctx sdk.Context, val sdkstaking.ValidatorI, del sdkstaking.DelegationI) (sdk.Coins, error) { // check existence of delegator starting info if !k.HasDelegatorStartingInfo(ctx, del.GetValidatorAddr(), del.GetDelegatorAddr()) { - return nil, types.ErrEmptyDelegationDistInfo + return nil, sdkdistr.ErrEmptyDelegationDistInfo } // end current period and calculate rewards diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index 7b18c0241f3b..0c6cd64eeb9e 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -6,10 +6,13 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" + "github.com/cosmos/cosmos-sdk/x/distribution/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -71,6 +74,122 @@ func TestCalculateRewardsBasic(t *testing.T) { require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: sdk.NewDec(initial / 2)}}, app.DistrKeeper.GetValidatorAccumulatedCommission(ctx, valAddrs[0]).Commission) } +func TestWithdrawTokenizeShareRecordReward(t *testing.T) { + app := simapp.Setup(t, false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + addr := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(100000000)) + valAddrs := simapp.ConvertAddrsToValAddrs(addr) + tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) + + // create validator with 50% commission + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + valPower := int64(100) + tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, true) + + // end block to bond validator + staking.EndBlocker(ctx, app.StakingKeeper) + + // next block + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + + // fetch validator and delegation + val := app.StakingKeeper.Validator(ctx, valAddrs[0]) + del := app.StakingKeeper.Delegation(ctx, sdk.AccAddress(valAddrs[0]), valAddrs[0]) + + // end period + endingPeriod := app.DistrKeeper.IncrementValidatorPeriod(ctx, val) + + // calculate delegation rewards + rewards := app.DistrKeeper.CalculateDelegationRewards(ctx, val, del, endingPeriod) + + // rewards should be zero + require.True(t, rewards.IsZero()) + + // start out block height + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) + + // retrieve validator + val = app.StakingKeeper.Validator(ctx, valAddrs[0]) + + // increase block height + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) + + // allocate some rewards + initial := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) + tokens := sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: sdk.NewDecFromInt(initial)}} + app.DistrKeeper.AllocateTokensToValidator(ctx, val, tokens) + + // end period + app.DistrKeeper.IncrementValidatorPeriod(ctx, val) + + coins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, initial)} + err := app.MintKeeper.MintCoins(ctx, coins) + require.NoError(t, err) + err = app.BankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.ModuleName, coins) + require.NoError(t, err) + + // tokenize share amount + delTokens := sdk.NewInt(1000000) + msgServer := stakingkeeper.NewMsgServerImpl(app.StakingKeeper) + resp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &stakingtypes.MsgTokenizeShares{ + DelegatorAddress: sdk.AccAddress(valAddrs[0]).String(), + ValidatorAddress: valAddrs[0].String(), + TokenizedShareOwner: sdk.AccAddress(valAddrs[1]).String(), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, delTokens), + }) + + // try withdrawing rewards before no reward is allocated + coins, err = app.DistrKeeper.WithdrawAllTokenizeShareRecordReward(ctx, sdk.AccAddress(valAddrs[1])) + require.Nil(t, err) + require.Equal(t, coins, sdk.Coins{}) + + // assert tokenize share response + require.NoError(t, err) + require.Equal(t, resp.Amount.Amount, delTokens) + + // end block to bond validator + staking.EndBlocker(ctx, app.StakingKeeper) + // next block + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + // allocate some rewards + app.DistrKeeper.AllocateTokensToValidator(ctx, val, tokens) + // end period + app.DistrKeeper.IncrementValidatorPeriod(ctx, val) + + beforeBalance := app.BankKeeper.GetBalance(ctx, sdk.AccAddress(valAddrs[1]), sdk.DefaultBondDenom) + + // withdraw rewards + coins, err = app.DistrKeeper.WithdrawAllTokenizeShareRecordReward(ctx, sdk.AccAddress(valAddrs[1])) + require.Nil(t, err) + + // check return value + require.Equal(t, coins.String(), "50000stake") + // check balance changes + midBalance := app.BankKeeper.GetBalance(ctx, sdk.AccAddress(valAddrs[1]), sdk.DefaultBondDenom) + require.Equal(t, beforeBalance.Amount.Add(coins.AmountOf(sdk.DefaultBondDenom)), midBalance.Amount) + + // allocate more rewards manually on module account and try full redeem + record, err := app.StakingKeeper.GetTokenizeShareRecord(ctx, 1) + require.NoError(t, err) + + err = app.MintKeeper.MintCoins(ctx, coins) + require.NoError(t, err) + err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, record.GetModuleAddress(), coins) + require.NoError(t, err) + + shareTokenBalance := app.BankKeeper.GetBalance(ctx, sdk.AccAddress(valAddrs[0]), record.GetShareTokenDenom()) + + _, err = msgServer.RedeemTokens(sdk.WrapSDKContext(ctx), &stakingtypes.MsgRedeemTokensforShares{ + DelegatorAddress: sdk.AccAddress(valAddrs[0]).String(), + Amount: shareTokenBalance, + }) + require.NoError(t, err) + + finalBalance := app.BankKeeper.GetBalance(ctx, sdk.AccAddress(valAddrs[1]), sdk.DefaultBondDenom) + require.Equal(t, midBalance.Amount.Add(coins.AmountOf(sdk.DefaultBondDenom)), finalBalance.Amount) +} + func TestCalculateRewardsAfterSlash(t *testing.T) { app := simapp.Setup(t, false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) diff --git a/x/distribution/keeper/fee_pool.go b/x/distribution/keeper/fee_pool.go index a6047501355c..58c982bcd7c3 100644 --- a/x/distribution/keeper/fee_pool.go +++ b/x/distribution/keeper/fee_pool.go @@ -3,6 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" + sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" ) // DistributeFromFeePool distributes funds from the distribution module account to @@ -15,7 +16,7 @@ func (k Keeper) DistributeFromFeePool(ctx sdk.Context, amount sdk.Coins, receive // must be reduced separately from the SendCoinsFromModuleToAccount call newPool, negative := feePool.CommunityPool.SafeSub(sdk.NewDecCoinsFromCoins(amount...)) if negative { - return types.ErrBadDistribution + return sdkdistr.ErrBadDistribution } feePool.CommunityPool = newPool diff --git a/x/distribution/keeper/grpc_query.go b/x/distribution/keeper/grpc_query.go index bbc884276a06..b979dc42d549 100644 --- a/x/distribution/keeper/grpc_query.go +++ b/x/distribution/keeper/grpc_query.go @@ -11,7 +11,8 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/distribution/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) var _ types.QueryServer = Keeper{} @@ -82,6 +83,7 @@ func (k Keeper) ValidatorSlashes(c context.Context, req *types.QueryValidatorSla } ctx := sdk.UnwrapSDKContext(c) + events := make([]types.ValidatorSlashEvent, 0) store := ctx.KVStore(k.storeKey) valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddress) if err != nil { @@ -89,25 +91,29 @@ func (k Keeper) ValidatorSlashes(c context.Context, req *types.QueryValidatorSla } slashesStore := prefix.NewStore(store, types.GetValidatorSlashEventPrefix(valAddr)) - events, pageRes, err := query.GenericFilteredPaginate(k.cdc, slashesStore, req.Pagination, func(key []byte, result *types.ValidatorSlashEvent) (*types.ValidatorSlashEvent, error) { + pageRes, err := query.FilteredPaginate(slashesStore, req.Pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { + var result types.ValidatorSlashEvent + err := k.cdc.Unmarshal(value, &result) + + if err != nil { + return false, err + } + if result.ValidatorPeriod < req.StartingHeight || result.ValidatorPeriod > req.EndingHeight { - return nil, nil + return false, nil } - return result, nil - }, func() *types.ValidatorSlashEvent { - return &types.ValidatorSlashEvent{} + if accumulate { + events = append(events, result) + } + return true, nil }) + if err != nil { return nil, err } - slashes := []types.ValidatorSlashEvent{} - for _, event := range events { - slashes = append(slashes, *event) - } - - return &types.QueryValidatorSlashesResponse{Slashes: slashes, Pagination: pageRes}, nil + return &types.QueryValidatorSlashesResponse{Slashes: events, Pagination: pageRes}, nil } // DelegationRewards the total rewards accrued by a delegation @@ -133,7 +139,7 @@ func (k Keeper) DelegationRewards(c context.Context, req *types.QueryDelegationR val := k.stakingKeeper.Validator(ctx, valAdr) if val == nil { - return nil, sdkerrors.Wrap(types.ErrNoValidatorExists, req.ValidatorAddress) + return nil, sdkerrors.Wrap(sdkdistr.ErrNoValidatorExists, req.ValidatorAddress) } delAdr, err := sdk.AccAddressFromBech32(req.DelegatorAddress) @@ -142,7 +148,7 @@ func (k Keeper) DelegationRewards(c context.Context, req *types.QueryDelegationR } del := k.stakingKeeper.Delegation(ctx, delAdr, valAdr) if del == nil { - return nil, types.ErrNoDelegationExists + return nil, sdkdistr.ErrNoDelegationExists } endingPeriod := k.IncrementValidatorPeriod(ctx, val) @@ -173,7 +179,7 @@ func (k Keeper) DelegationTotalRewards(c context.Context, req *types.QueryDelega k.stakingKeeper.IterateDelegations( ctx, delAdr, - func(_ int64, del stakingtypes.DelegationI) (stop bool) { + func(_ int64, del sdkstaking.DelegationI) (stop bool) { valAddr := del.GetValidatorAddr() val := k.stakingKeeper.Validator(ctx, valAddr) endingPeriod := k.IncrementValidatorPeriod(ctx, val) @@ -207,7 +213,7 @@ func (k Keeper) DelegatorValidators(c context.Context, req *types.QueryDelegator k.stakingKeeper.IterateDelegations( ctx, delAdr, - func(_ int64, del stakingtypes.DelegationI) (stop bool) { + func(_ int64, del sdkstaking.DelegationI) (stop bool) { validators = append(validators, del.GetValidatorAddr().String()) return false }, @@ -243,3 +249,54 @@ func (k Keeper) CommunityPool(c context.Context, req *types.QueryCommunityPoolRe return &types.QueryCommunityPoolResponse{Pool: pool}, nil } + +// TokenizeShareRecordReward returns estimated amount of reward from tokenize share record ownership +func (k Keeper) TokenizeShareRecordReward(c context.Context, req *types.QueryTokenizeShareRecordRewardRequest) (*types.QueryTokenizeShareRecordRewardResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + totalRewards := sdk.DecCoins{} + rewards := []types.TokenizeShareRecordReward{} + + ownerAddr, err := sdk.AccAddressFromBech32(req.OwnerAddress) + if err != nil { + return nil, err + } + records := k.stakingKeeper.GetTokenizeShareRecordsByOwner(ctx, ownerAddr) + for _, record := range records { + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return nil, err + } + + moduleAddr := record.GetModuleAddress() + moduleBalance := k.bankKeeper.GetAllBalances(ctx, moduleAddr) + moduleBalanceDecCoins := sdk.NewDecCoinsFromCoins(moduleBalance...) + + val := k.stakingKeeper.Validator(ctx, valAddr) + del := k.stakingKeeper.Delegation(ctx, moduleAddr, valAddr) + if val != nil && del != nil { + // withdraw rewards + endingPeriod := k.IncrementValidatorPeriod(ctx, val) + recordReward := k.CalculateDelegationRewards(ctx, val, del, endingPeriod) + + rewards = append(rewards, types.TokenizeShareRecordReward{ + RecordId: record.Id, + Reward: recordReward.Add(moduleBalanceDecCoins...), + }) + totalRewards = totalRewards.Add(recordReward...) + } + + if !moduleBalance.IsZero() { + rewards = append(rewards, types.TokenizeShareRecordReward{ + RecordId: record.Id, + Reward: moduleBalanceDecCoins, + }) + totalRewards = totalRewards.Add(moduleBalanceDecCoins...) + } + } + + return &types.QueryTokenizeShareRecordRewardResponse{ + Rewards: rewards, + Total: totalRewards, + }, nil +} diff --git a/x/distribution/keeper/grpc_query_test.go b/x/distribution/keeper/grpc_query_test.go index d51f4a28a0ba..9813434732fa 100644 --- a/x/distribution/keeper/grpc_query_test.go +++ b/x/distribution/keeper/grpc_query_test.go @@ -9,12 +9,14 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -655,6 +657,81 @@ func (suite *KeeperTestSuite) TestGRPCCommunityPool() { } } +func (suite *KeeperTestSuite) TestGRPCTokenizeShareRecordReward() { + app, ctx, queryClient, _ := suite.app, suite.ctx, suite.queryClient, suite.addrs + + addr := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(100000000)) + valAddrs := simapp.ConvertAddrsToValAddrs(addr) + tstaking := teststaking.NewHelper(suite.T(), ctx, app.StakingKeeper) + + // create validator with 50% commission + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + valPower := int64(100) + tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, true) + + // end block to bond validator + staking.EndBlocker(ctx, app.StakingKeeper) + + // next block + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + + // fetch validator and delegation + val := app.StakingKeeper.Validator(ctx, valAddrs[0]) + del := app.StakingKeeper.Delegation(ctx, sdk.AccAddress(valAddrs[0]), valAddrs[0]) + + // end period + endingPeriod := app.DistrKeeper.IncrementValidatorPeriod(ctx, val) + + // calculate delegation rewards + app.DistrKeeper.CalculateDelegationRewards(ctx, val, del, endingPeriod) + + // start out block height + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) + val = app.StakingKeeper.Validator(ctx, valAddrs[0]) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) + + // allocate some rewards + initial := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) + tokens := sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: sdk.NewDecFromInt(initial)}} + app.DistrKeeper.AllocateTokensToValidator(ctx, val, tokens) + + // end period + app.DistrKeeper.IncrementValidatorPeriod(ctx, val) + + coins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, initial)} + app.MintKeeper.MintCoins(ctx, coins) + app.BankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.ModuleName, coins) + + // tokenize share amount + delTokens := sdk.NewInt(1000000) + msgServer := stakingkeeper.NewMsgServerImpl(app.StakingKeeper) + _, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &stakingtypes.MsgTokenizeShares{ + DelegatorAddress: sdk.AccAddress(valAddrs[0]).String(), + ValidatorAddress: valAddrs[0].String(), + TokenizedShareOwner: sdk.AccAddress(valAddrs[0]).String(), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, delTokens), + }) + + staking.EndBlocker(ctx, app.StakingKeeper) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + app.DistrKeeper.AllocateTokensToValidator(ctx, val, tokens) + app.DistrKeeper.IncrementValidatorPeriod(ctx, val) + + rewards, err := queryClient.TokenizeShareRecordReward(gocontext.Background(), &types.QueryTokenizeShareRecordRewardRequest{ + OwnerAddress: sdk.AccAddress(valAddrs[0]).String(), + }) + suite.Require().NoError(err) + suite.Require().Equal(&types.QueryTokenizeShareRecordRewardResponse{ + Rewards: []types.TokenizeShareRecordReward{ + { + RecordId: 1, + Reward: sdk.DecCoins{sdk.NewInt64DecCoin("stake", 50000)}, + }, + }, + Total: sdk.DecCoins{sdk.NewInt64DecCoin("stake", 50000)}, + }, rewards) +} + func TestDistributionTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } diff --git a/x/distribution/keeper/hooks.go b/x/distribution/keeper/hooks.go index bfae8482da5e..9f8f69b72a0d 100644 --- a/x/distribution/keeper/hooks.go +++ b/x/distribution/keeper/hooks.go @@ -78,6 +78,14 @@ func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr return nil } +func (h Hooks) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordId uint64) error { + err := h.k.WithdrawSingleShareRecordReward(ctx, recordId) + if err != nil { + h.k.Logger(ctx).Error(err.Error()) + } + return err +} + // increment period func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { val := h.k.stakingKeeper.Validator(ctx, valAddr) diff --git a/x/distribution/keeper/invariants.go b/x/distribution/keeper/invariants.go index 50300b977379..d31bf673080b 100644 --- a/x/distribution/keeper/invariants.go +++ b/x/distribution/keeper/invariants.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // register all distribution invariants @@ -64,6 +64,7 @@ func NonNegativeOutstandingInvariant(k Keeper) sdk.Invariant { // CanWithdrawInvariant checks that current rewards can be completely withdrawn func CanWithdrawInvariant(k Keeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { + // cache, we don't want to write changes ctx, _ = ctx.CacheContext() @@ -76,7 +77,7 @@ func CanWithdrawInvariant(k Keeper) sdk.Invariant { } // iterate over all validators - k.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + k.stakingKeeper.IterateValidators(ctx, func(_ int64, val sdkstaking.ValidatorI) (stop bool) { _, _ = k.WithdrawValidatorCommission(ctx, val.GetOperator()) delegationAddrs, ok := valDelegationAddrs[val.GetOperator().String()] @@ -105,8 +106,9 @@ func CanWithdrawInvariant(k Keeper) sdk.Invariant { // ReferenceCountInvariant checks that the number of historical rewards records is correct func ReferenceCountInvariant(k Keeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { + valCount := uint64(0) - k.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + k.stakingKeeper.IterateValidators(ctx, func(_ int64, val sdkstaking.ValidatorI) (stop bool) { valCount++ return false }) @@ -135,6 +137,7 @@ func ReferenceCountInvariant(k Keeper) sdk.Invariant { // is consistent with the sum of validator outstanding rewards func ModuleAccountInvariant(k Keeper) sdk.Invariant { return func(ctx sdk.Context) (string, bool) { + var expectedCoins sdk.DecCoins k.IterateValidatorOutstandingRewards(ctx, func(_ sdk.ValAddress, rewards types.ValidatorOutstandingRewards) (stop bool) { expectedCoins = expectedCoins.Add(rewards.Rewards...) diff --git a/x/distribution/keeper/keeper.go b/x/distribution/keeper/keeper.go index 6af1ede7e5cd..fa7955c2184d 100644 --- a/x/distribution/keeper/keeper.go +++ b/x/distribution/keeper/keeper.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/distribution/types" + sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -64,7 +65,7 @@ func (k Keeper) SetWithdrawAddr(ctx sdk.Context, delegatorAddr sdk.AccAddress, w } if !k.GetWithdrawAddrEnabled(ctx) { - return types.ErrSetWithdrawAddrDisabled + return sdkdistr.ErrSetWithdrawAddrDisabled } ctx.EventManager().EmitEvent( @@ -82,12 +83,12 @@ func (k Keeper) SetWithdrawAddr(ctx sdk.Context, delegatorAddr sdk.AccAddress, w func (k Keeper) WithdrawDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error) { val := k.stakingKeeper.Validator(ctx, valAddr) if val == nil { - return nil, types.ErrNoValidatorDistInfo + return nil, sdkdistr.ErrNoValidatorDistInfo } del := k.stakingKeeper.Delegation(ctx, delAddr, valAddr) if del == nil { - return nil, types.ErrEmptyDelegationDistInfo + return nil, sdkdistr.ErrEmptyDelegationDistInfo } // withdraw rewards @@ -122,7 +123,7 @@ func (k Keeper) WithdrawValidatorCommission(ctx sdk.Context, valAddr sdk.ValAddr // fetch validator accumulated commission accumCommission := k.GetValidatorAccumulatedCommission(ctx, valAddr) if accumCommission.Commission.IsZero() { - return nil, types.ErrNoValidatorCommission + return nil, sdkdistr.ErrNoValidatorCommission } commission, remainder := accumCommission.Commission.TruncateDecimal() @@ -178,3 +179,156 @@ func (k Keeper) FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk. return nil } + +func (k Keeper) WithdrawSingleShareRecordReward(ctx sdk.Context, recordId uint64) error { + record, err := k.stakingKeeper.GetTokenizeShareRecord(ctx, recordId) + if err != nil { + return err + } + + owner, err := sdk.AccAddressFromBech32(record.Owner) + if err != nil { + return err + } + + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return err + } + + val := k.stakingKeeper.Validator(ctx, valAddr) + del := k.stakingKeeper.Delegation(ctx, record.GetModuleAddress(), valAddr) + if val != nil && del != nil { + // withdraw rewards into reward module account and send it to reward owner + cacheCtx, write := ctx.CacheContext() + _, err = k.WithdrawDelegationRewards(cacheCtx, record.GetModuleAddress(), valAddr) + if err != nil { + return err + } + write() + } + + // apply changes when the module account has positive balance + balances := k.bankKeeper.GetAllBalances(ctx, record.GetModuleAddress()) + if !balances.Empty() { + err = k.bankKeeper.SendCoins(ctx, record.GetModuleAddress(), owner, balances) + if err != nil { + return err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeWithdrawTokenizeShareReward, + sdk.NewAttribute(types.AttributeKeyWithdrawAddress, owner.String()), + sdk.NewAttribute(sdk.AttributeKeyAmount, balances.String()), + ), + ) + } + return nil +} + +// withdraw reward for owning TokenizeShareRecord +func (k Keeper) WithdrawTokenizeShareRecordReward(ctx sdk.Context, ownerAddr sdk.AccAddress, recordId uint64) (sdk.Coins, error) { + record, err := k.stakingKeeper.GetTokenizeShareRecord(ctx, recordId) + if err != nil { + return nil, err + } + + if record.Owner != ownerAddr.String() { + return nil, types.ErrNotTokenizeShareRecordOwner + } + + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return nil, err + } + + val := k.stakingKeeper.Validator(ctx, valAddr) + if val == nil { + return nil, err + } + + del := k.stakingKeeper.Delegation(ctx, record.GetModuleAddress(), valAddr) + if del == nil { + return nil, err + } + + // withdraw rewards into reward module account and send it to reward owner + _, err = k.WithdrawDelegationRewards(ctx, record.GetModuleAddress(), valAddr) + if err != nil { + return nil, err + } + + // apply changes when the module account has positive balance + rewards := k.bankKeeper.GetAllBalances(ctx, record.GetModuleAddress()) + if !rewards.Empty() { + err = k.bankKeeper.SendCoins(ctx, record.GetModuleAddress(), ownerAddr, rewards) + if err != nil { + return nil, err + } + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeWithdrawTokenizeShareReward, + sdk.NewAttribute(types.AttributeKeyWithdrawAddress, ownerAddr.String()), + sdk.NewAttribute(sdk.AttributeKeyAmount, rewards.String()), + ), + ) + + return rewards, nil +} + +// withdraw reward for all owning TokenizeShareRecord +func (k Keeper) WithdrawAllTokenizeShareRecordReward(ctx sdk.Context, ownerAddr sdk.AccAddress) (sdk.Coins, error) { + totalRewards := sdk.Coins{} + + records := k.stakingKeeper.GetTokenizeShareRecordsByOwner(ctx, ownerAddr) + + for _, record := range records { + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return nil, err + } + + val := k.stakingKeeper.Validator(ctx, valAddr) + if val == nil { + continue + } + + del := k.stakingKeeper.Delegation(ctx, record.GetModuleAddress(), valAddr) + if del == nil { + continue + } + + // withdraw rewards into reward module account and send it to reward owner + cacheCtx, write := ctx.CacheContext() + _, err = k.WithdrawDelegationRewards(cacheCtx, record.GetModuleAddress(), valAddr) + if err != nil { + k.Logger(ctx).Error(err.Error()) + continue + } + + // apply changes when the module account has positive balance + balances := k.bankKeeper.GetAllBalances(cacheCtx, record.GetModuleAddress()) + if !balances.Empty() { + err = k.bankKeeper.SendCoins(cacheCtx, record.GetModuleAddress(), ownerAddr, balances) + if err != nil { + k.Logger(ctx).Error(err.Error()) + continue + } + write() + totalRewards = totalRewards.Add(balances...) + } + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeWithdrawTokenizeShareReward, + sdk.NewAttribute(types.AttributeKeyWithdrawAddress, ownerAddr.String()), + sdk.NewAttribute(sdk.AttributeKeyAmount, totalRewards.String()), + ), + ) + + return totalRewards, nil +} diff --git a/x/distribution/keeper/keeper_test.go b/x/distribution/keeper/keeper_test.go index 9895e420bf80..04a64006a68d 100644 --- a/x/distribution/keeper/keeper_test.go +++ b/x/distribution/keeper/keeper_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution/types" diff --git a/x/distribution/keeper/migrations.go b/x/distribution/keeper/migrations.go index 7439dfbee4ef..b55569d4a442 100644 --- a/x/distribution/keeper/migrations.go +++ b/x/distribution/keeper/migrations.go @@ -1,21 +1 @@ package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - v043 "github.com/cosmos/cosmos-sdk/x/distribution/migrations/v043" -) - -// Migrator is a struct for handling in-place store migrations. -type Migrator struct { - keeper Keeper -} - -// NewMigrator returns a new Migrator. -func NewMigrator(keeper Keeper) Migrator { - return Migrator{keeper: keeper} -} - -// Migrate1to2 migrates from version 1 to 2. -func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return v043.MigrateStore(ctx, m.keeper.storeKey) -} diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go index 40ba0ce25727..cfcd5d4d706e 100644 --- a/x/distribution/keeper/msg_server.go +++ b/x/distribution/keeper/msg_server.go @@ -84,7 +84,7 @@ func (k msgServer) WithdrawDelegatorReward(goCtx context.Context, msg *types.Msg sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), ), ) - return &types.MsgWithdrawDelegatorRewardResponse{Amount: amount}, nil + return &types.MsgWithdrawDelegatorRewardResponse{}, nil } func (k msgServer) WithdrawValidatorCommission(goCtx context.Context, msg *types.MsgWithdrawValidatorCommission) (*types.MsgWithdrawValidatorCommissionResponse, error) { @@ -119,17 +119,89 @@ func (k msgServer) WithdrawValidatorCommission(goCtx context.Context, msg *types ), ) - return &types.MsgWithdrawValidatorCommissionResponse{Amount: amount}, nil + return &types.MsgWithdrawValidatorCommissionResponse{}, nil +} + +// WithdrawTokenizeShareRecordReward defines a method to withdraw reward for owning TokenizeShareRecord +func (k msgServer) WithdrawTokenizeShareRecordReward(goCtx context.Context, msg *types.MsgWithdrawTokenizeShareRecordReward) (*types.MsgWithdrawTokenizeShareRecordRewardResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ownerAddr, err := sdk.AccAddressFromBech32(msg.OwnerAddress) + if err != nil { + return nil, err + } + amount, err := k.Keeper.WithdrawTokenizeShareRecordReward(ctx, ownerAddr, msg.RecordId) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range amount { + if a.Amount.IsInt64() { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "withdraw_tokenize_share_reward"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + } + }() + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.OwnerAddress), + ), + ) + + return &types.MsgWithdrawTokenizeShareRecordRewardResponse{}, nil +} + +// WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for owning TokenizeShareRecord +func (k msgServer) WithdrawAllTokenizeShareRecordReward(goCtx context.Context, msg *types.MsgWithdrawAllTokenizeShareRecordReward) (*types.MsgWithdrawAllTokenizeShareRecordRewardResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ownerAddr, err := sdk.AccAddressFromBech32(msg.OwnerAddress) + if err != nil { + return nil, err + } + amount, err := k.Keeper.WithdrawAllTokenizeShareRecordReward(ctx, ownerAddr) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range amount { + if a.Amount.IsInt64() { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "withdraw_all_tokenize_share_reward"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + } + }() + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.OwnerAddress), + ), + ) + + return &types.MsgWithdrawAllTokenizeShareRecordRewardResponse{}, nil } func (k msgServer) FundCommunityPool(goCtx context.Context, msg *types.MsgFundCommunityPool) (*types.MsgFundCommunityPoolResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - depositer, err := sdk.AccAddressFromBech32(msg.Depositor) + depositor, err := sdk.AccAddressFromBech32(msg.Depositor) if err != nil { return nil, err } - if err := k.Keeper.FundCommunityPool(ctx, msg.Amount, depositer); err != nil { + if err := k.Keeper.FundCommunityPool(ctx, msg.Amount, depositor); err != nil { return nil, err } diff --git a/x/distribution/keeper/querier.go b/x/distribution/keeper/querier.go index 71370e24ba51..75ceef6108cc 100644 --- a/x/distribution/keeper/querier.go +++ b/x/distribution/keeper/querier.go @@ -9,7 +9,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/distribution/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { @@ -134,12 +135,12 @@ func queryDelegationRewards(ctx sdk.Context, _ []string, req abci.RequestQuery, val := k.stakingKeeper.Validator(ctx, params.ValidatorAddress) if val == nil { - return nil, sdkerrors.Wrap(types.ErrNoValidatorExists, params.ValidatorAddress.String()) + return nil, sdkerrors.Wrap(sdkdistr.ErrNoValidatorExists, params.ValidatorAddress.String()) } del := k.stakingKeeper.Delegation(ctx, params.DelegatorAddress, params.ValidatorAddress) if del == nil { - return nil, types.ErrNoDelegationExists + return nil, sdkdistr.ErrNoDelegationExists } endingPeriod := k.IncrementValidatorPeriod(ctx, val) @@ -172,7 +173,7 @@ func queryDelegatorTotalRewards(ctx sdk.Context, _ []string, req abci.RequestQue k.stakingKeeper.IterateDelegations( ctx, params.DelegatorAddress, - func(_ int64, del stakingtypes.DelegationI) (stop bool) { + func(_ int64, del sdkstaking.DelegationI) (stop bool) { valAddr := del.GetValidatorAddr() val := k.stakingKeeper.Validator(ctx, valAddr) endingPeriod := k.IncrementValidatorPeriod(ctx, val) @@ -208,7 +209,7 @@ func queryDelegatorValidators(ctx sdk.Context, _ []string, req abci.RequestQuery k.stakingKeeper.IterateDelegations( ctx, params.DelegatorAddress, - func(_ int64, del stakingtypes.DelegationI) (stop bool) { + func(_ int64, del sdkstaking.DelegationI) (stop bool) { validators = append(validators, del.GetValidatorAddr()) return false }, diff --git a/x/distribution/keeper/querier_test.go b/x/distribution/keeper/querier_test.go index 9e1fe7cccce5..f9293d3009f0 100644 --- a/x/distribution/keeper/querier_test.go +++ b/x/distribution/keeper/querier_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/distribution/keeper" diff --git a/x/distribution/keeper/validator.go b/x/distribution/keeper/validator.go index 38654e771a0b..42026192835b 100644 --- a/x/distribution/keeper/validator.go +++ b/x/distribution/keeper/validator.go @@ -6,11 +6,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // initialize rewards for a new validator -func (k Keeper) initializeValidator(ctx sdk.Context, val stakingtypes.ValidatorI) { +func (k Keeper) initializeValidator(ctx sdk.Context, val sdkstaking.ValidatorI) { // set initial historical rewards (period 0) with reference count of 1 k.SetValidatorHistoricalRewards(ctx, val.GetOperator(), 0, types.NewValidatorHistoricalRewards(sdk.DecCoins{}, 1)) @@ -25,7 +25,7 @@ func (k Keeper) initializeValidator(ctx sdk.Context, val stakingtypes.ValidatorI } // increment validator period, returning the period just ended -func (k Keeper) IncrementValidatorPeriod(ctx sdk.Context, val stakingtypes.ValidatorI) uint64 { +func (k Keeper) IncrementValidatorPeriod(ctx sdk.Context, val sdkstaking.ValidatorI) uint64 { // fetch current rewards rewards := k.GetValidatorCurrentRewards(ctx, val.GetOperator()) diff --git a/x/distribution/migrations/v042/types.go b/x/distribution/migrations/v042/types.go deleted file mode 100644 index dc5cc6c746d0..000000000000 --- a/x/distribution/migrations/v042/types.go +++ /dev/null @@ -1,185 +0,0 @@ -package legacy - -import ( - "encoding/binary" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/kv" - v042auth "github.com/cosmos/cosmos-sdk/x/auth/migrations/v042" -) - -const ( - // ModuleName is the module name constant used in many places - ModuleName = "distribution" - - // StoreKey is the store key string for distribution - StoreKey = ModuleName - - // RouterKey is the message route for distribution - RouterKey = ModuleName - - // QuerierRoute is the querier route for distribution - QuerierRoute = ModuleName -) - -// Keys for distribution store -// Items are stored with the following key: values -// -// - 0x00: FeePol -// -// - 0x01: sdk.ConsAddress -// -// - 0x02: ValidatorOutstandingRewards -// -// - 0x03: sdk.AccAddress -// -// - 0x04: DelegatorStartingInfo -// -// - 0x05: ValidatorHistoricalRewards -// -// - 0x06: ValidatorCurrentRewards -// -// - 0x07: ValidatorCurrentRewards -// -// - 0x08: ValidatorSlashEvent -var ( - FeePoolKey = []byte{0x00} // key for global distribution state - ProposerKey = []byte{0x01} // key for the proposer operator address - ValidatorOutstandingRewardsPrefix = []byte{0x02} // key for outstanding rewards - - DelegatorWithdrawAddrPrefix = []byte{0x03} // key for delegator withdraw address - DelegatorStartingInfoPrefix = []byte{0x04} // key for delegator starting info - ValidatorHistoricalRewardsPrefix = []byte{0x05} // key for historical validators rewards / stake - ValidatorCurrentRewardsPrefix = []byte{0x06} // key for current validator rewards - ValidatorAccumulatedCommissionPrefix = []byte{0x07} // key for accumulated validator commission - ValidatorSlashEventPrefix = []byte{0x08} // key for validator slash fraction -) - -// gets an address from a validator's outstanding rewards key -func GetValidatorOutstandingRewardsAddress(key []byte) (valAddr sdk.ValAddress) { - kv.AssertKeyAtLeastLength(key, 2) - addr := key[1:] - kv.AssertKeyLength(addr, v042auth.AddrLen) - return sdk.ValAddress(addr) -} - -// gets an address from a delegator's withdraw info key -func GetDelegatorWithdrawInfoAddress(key []byte) (delAddr sdk.AccAddress) { - kv.AssertKeyAtLeastLength(key, 2) - addr := key[1:] - kv.AssertKeyLength(addr, v042auth.AddrLen) - return sdk.AccAddress(addr) -} - -// gets the addresses from a delegator starting info key -func GetDelegatorStartingInfoAddresses(key []byte) (valAddr sdk.ValAddress, delAddr sdk.AccAddress) { - kv.AssertKeyAtLeastLength(key, 2+v042auth.AddrLen) - addr := key[1 : 1+v042auth.AddrLen] - kv.AssertKeyLength(addr, v042auth.AddrLen) - valAddr = sdk.ValAddress(addr) - addr = key[1+v042auth.AddrLen:] - kv.AssertKeyLength(addr, v042auth.AddrLen) - delAddr = sdk.AccAddress(addr) - return -} - -// gets the address & period from a validator's historical rewards key -func GetValidatorHistoricalRewardsAddressPeriod(key []byte) (valAddr sdk.ValAddress, period uint64) { - kv.AssertKeyAtLeastLength(key, 2+v042auth.AddrLen) - addr := key[1 : 1+v042auth.AddrLen] - kv.AssertKeyLength(addr, v042auth.AddrLen) - valAddr = sdk.ValAddress(addr) - b := key[1+v042auth.AddrLen:] - kv.AssertKeyLength(addr, 8) - period = binary.LittleEndian.Uint64(b) - return -} - -// gets the address from a validator's current rewards key -func GetValidatorCurrentRewardsAddress(key []byte) (valAddr sdk.ValAddress) { - kv.AssertKeyAtLeastLength(key, 2) - addr := key[1:] - kv.AssertKeyLength(addr, v042auth.AddrLen) - return sdk.ValAddress(addr) -} - -// gets the address from a validator's accumulated commission key -func GetValidatorAccumulatedCommissionAddress(key []byte) (valAddr sdk.ValAddress) { - kv.AssertKeyAtLeastLength(key, 2) - addr := key[1:] - kv.AssertKeyLength(addr, v042auth.AddrLen) - return sdk.ValAddress(addr) -} - -// gets the height from a validator's slash event key -func GetValidatorSlashEventAddressHeight(key []byte) (valAddr sdk.ValAddress, height uint64) { - kv.AssertKeyAtLeastLength(key, 2+v042auth.AddrLen) - addr := key[1 : 1+v042auth.AddrLen] - kv.AssertKeyLength(addr, v042auth.AddrLen) - valAddr = sdk.ValAddress(addr) - startB := 1 + v042auth.AddrLen - kv.AssertKeyAtLeastLength(key, startB+9) - b := key[startB : startB+8] // the next 8 bytes represent the height - height = binary.BigEndian.Uint64(b) - return -} - -// gets the outstanding rewards key for a validator -func GetValidatorOutstandingRewardsKey(valAddr sdk.ValAddress) []byte { - return append(ValidatorOutstandingRewardsPrefix, valAddr.Bytes()...) -} - -// gets the key for a delegator's withdraw addr -func GetDelegatorWithdrawAddrKey(delAddr sdk.AccAddress) []byte { - return append(DelegatorWithdrawAddrPrefix, delAddr.Bytes()...) -} - -// gets the key for a delegator's starting info -func GetDelegatorStartingInfoKey(v sdk.ValAddress, d sdk.AccAddress) []byte { - return append(append(DelegatorStartingInfoPrefix, v.Bytes()...), d.Bytes()...) -} - -// gets the prefix key for a validator's historical rewards -func GetValidatorHistoricalRewardsPrefix(v sdk.ValAddress) []byte { - return append(ValidatorHistoricalRewardsPrefix, v.Bytes()...) -} - -// gets the key for a validator's historical rewards -func GetValidatorHistoricalRewardsKey(v sdk.ValAddress, k uint64) []byte { - b := make([]byte, 8) - binary.LittleEndian.PutUint64(b, k) - return append(append(ValidatorHistoricalRewardsPrefix, v.Bytes()...), b...) -} - -// gets the key for a validator's current rewards -func GetValidatorCurrentRewardsKey(v sdk.ValAddress) []byte { - return append(ValidatorCurrentRewardsPrefix, v.Bytes()...) -} - -// gets the key for a validator's current commission -func GetValidatorAccumulatedCommissionKey(v sdk.ValAddress) []byte { - return append(ValidatorAccumulatedCommissionPrefix, v.Bytes()...) -} - -// gets the prefix key for a validator's slash fractions -func GetValidatorSlashEventPrefix(v sdk.ValAddress) []byte { - return append(ValidatorSlashEventPrefix, v.Bytes()...) -} - -// gets the prefix key for a validator's slash fraction (ValidatorSlashEventPrefix + height) -func GetValidatorSlashEventKeyPrefix(v sdk.ValAddress, height uint64) []byte { - heightBz := make([]byte, 8) - binary.BigEndian.PutUint64(heightBz, height) - return append( - ValidatorSlashEventPrefix, - append(v.Bytes(), heightBz...)..., - ) -} - -// gets the key for a validator's slash fraction -func GetValidatorSlashEventKey(v sdk.ValAddress, height, period uint64) []byte { - periodBz := make([]byte, 8) - binary.BigEndian.PutUint64(periodBz, period) - prefix := GetValidatorSlashEventKeyPrefix(v, height) - return append(prefix, periodBz...) -} diff --git a/x/distribution/migrations/v043/helpers.go b/x/distribution/migrations/v043/helpers.go index 0e846a72ffae..73ef0c9c7770 100644 --- a/x/distribution/migrations/v043/helpers.go +++ b/x/distribution/migrations/v043/helpers.go @@ -1,71 +1 @@ package v043 - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" - v042auth "github.com/cosmos/cosmos-sdk/x/auth/migrations/v042" -) - -// MigratePrefixAddress is a helper function that migrates all keys of format: -// prefix_bytes | address_bytes -// into format: -// prefix_bytes | address_len (1 byte) | address_bytes -func MigratePrefixAddress(store sdk.KVStore, prefixBz []byte) { - oldStore := prefix.NewStore(store, prefixBz) - - oldStoreIter := oldStore.Iterator(nil, nil) - defer oldStoreIter.Close() - - for ; oldStoreIter.Valid(); oldStoreIter.Next() { - addr := oldStoreIter.Key() - newStoreKey := prefixBz - newStoreKey = append(newStoreKey, address.MustLengthPrefix(addr)...) - - // Set new key on store. Values don't change. - store.Set(newStoreKey, oldStoreIter.Value()) - oldStore.Delete(oldStoreIter.Key()) - } -} - -// MigratePrefixAddressBytes is a helper function that migrates all keys of format: -// prefix_bytes | address_bytes | arbitrary_bytes -// into format: -// prefix_bytes | address_len (1 byte) | address_bytes | arbitrary_bytes -func MigratePrefixAddressBytes(store sdk.KVStore, prefixBz []byte) { - oldStore := prefix.NewStore(store, prefixBz) - - oldStoreIter := oldStore.Iterator(nil, nil) - defer oldStoreIter.Close() - - for ; oldStoreIter.Valid(); oldStoreIter.Next() { - addr := oldStoreIter.Key()[:v042auth.AddrLen] - endBz := oldStoreIter.Key()[v042auth.AddrLen:] - newStoreKey := append(append(prefixBz, address.MustLengthPrefix(addr)...), endBz...) - - // Set new key on store. Values don't change. - store.Set(newStoreKey, oldStoreIter.Value()) - oldStore.Delete(oldStoreIter.Key()) - } -} - -// MigratePrefixAddressAddress is a helper function that migrates all keys of format: -// prefix_bytes | address_1_bytes | address_2_bytes -// into format: -// prefix_bytes | address_1_len (1 byte) | address_1_bytes | address_2_len (1 byte) | address_2_bytes -func MigratePrefixAddressAddress(store sdk.KVStore, prefixBz []byte) { - oldStore := prefix.NewStore(store, prefixBz) - - oldStoreIter := oldStore.Iterator(nil, nil) - defer oldStoreIter.Close() - - for ; oldStoreIter.Valid(); oldStoreIter.Next() { - addr1 := oldStoreIter.Key()[:v042auth.AddrLen] - addr2 := oldStoreIter.Key()[v042auth.AddrLen:] - newStoreKey := append(append(prefixBz, address.MustLengthPrefix(addr1)...), address.MustLengthPrefix(addr2)...) - - // Set new key on store. Values don't change. - store.Set(newStoreKey, oldStoreIter.Value()) - oldStore.Delete(oldStoreIter.Key()) - } -} diff --git a/x/distribution/migrations/v043/store.go b/x/distribution/migrations/v043/store.go index 12fa534f9bf4..73ef0c9c7770 100644 --- a/x/distribution/migrations/v043/store.go +++ b/x/distribution/migrations/v043/store.go @@ -1,24 +1 @@ package v043 - -import ( - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - v042distribution "github.com/cosmos/cosmos-sdk/x/distribution/migrations/v042" -) - -// MigrateStore performs in-place store migrations from v0.40 to v0.43. The -// migration includes: -// -// - Change addresses to be length-prefixed. -func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey) error { - store := ctx.KVStore(storeKey) - MigratePrefixAddress(store, v042distribution.ValidatorOutstandingRewardsPrefix) - MigratePrefixAddress(store, v042distribution.DelegatorWithdrawAddrPrefix) - MigratePrefixAddressAddress(store, v042distribution.DelegatorStartingInfoPrefix) - MigratePrefixAddressBytes(store, v042distribution.ValidatorHistoricalRewardsPrefix) - MigratePrefixAddress(store, v042distribution.ValidatorCurrentRewardsPrefix) - MigratePrefixAddress(store, v042distribution.ValidatorAccumulatedCommissionPrefix) - MigratePrefixAddressBytes(store, v042distribution.ValidatorSlashEventPrefix) - - return nil -} diff --git a/x/distribution/migrations/v043/store_test.go b/x/distribution/migrations/v043/store_test.go index 9c055f72e553..596b211a8336 100644 --- a/x/distribution/migrations/v043/store_test.go +++ b/x/distribution/migrations/v043/store_test.go @@ -1,99 +1 @@ package v043_test - -import ( - "bytes" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" - v042distribution "github.com/cosmos/cosmos-sdk/x/distribution/migrations/v042" - v043distribution "github.com/cosmos/cosmos-sdk/x/distribution/migrations/v043" - "github.com/cosmos/cosmos-sdk/x/distribution/types" -) - -func TestStoreMigration(t *testing.T) { - distributionKey := sdk.NewKVStoreKey("distribution") - ctx := testutil.DefaultContext(distributionKey, sdk.NewTransientStoreKey("transient_test")) - store := ctx.KVStore(distributionKey) - - _, _, addr1 := testdata.KeyTestPubAddr() - valAddr := sdk.ValAddress(addr1) - _, _, addr2 := testdata.KeyTestPubAddr() - // Use dummy value for all keys. - value := []byte("foo") - - testCases := []struct { - name string - oldKey []byte - newKey []byte - }{ - { - "FeePoolKey", - v042distribution.FeePoolKey, - types.FeePoolKey, - }, - { - "ProposerKey", - v042distribution.ProposerKey, - types.ProposerKey, - }, - { - "ValidatorOutstandingRewards", - v042distribution.GetValidatorOutstandingRewardsKey(valAddr), - types.GetValidatorOutstandingRewardsKey(valAddr), - }, - { - "DelegatorWithdrawAddr", - v042distribution.GetDelegatorWithdrawAddrKey(addr2), - types.GetDelegatorWithdrawAddrKey(addr2), - }, - { - "DelegatorStartingInfo", - v042distribution.GetDelegatorStartingInfoKey(valAddr, addr2), - types.GetDelegatorStartingInfoKey(valAddr, addr2), - }, - { - "ValidatorHistoricalRewards", - v042distribution.GetValidatorHistoricalRewardsKey(valAddr, 6), - types.GetValidatorHistoricalRewardsKey(valAddr, 6), - }, - { - "ValidatorCurrentRewards", - v042distribution.GetValidatorCurrentRewardsKey(valAddr), - types.GetValidatorCurrentRewardsKey(valAddr), - }, - { - "ValidatorAccumulatedCommission", - v042distribution.GetValidatorAccumulatedCommissionKey(valAddr), - types.GetValidatorAccumulatedCommissionKey(valAddr), - }, - { - "ValidatorSlashEvent", - v042distribution.GetValidatorSlashEventKey(valAddr, 6, 8), - types.GetValidatorSlashEventKey(valAddr, 6, 8), - }, - } - - // Set all the old keys to the store - for _, tc := range testCases { - store.Set(tc.oldKey, value) - } - - // Run migrations. - err := v043distribution.MigrateStore(ctx, distributionKey) - require.NoError(t, err) - - // Make sure the new keys are set and old keys are deleted. - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - if !bytes.Equal(tc.oldKey, tc.newKey) { - require.Nil(t, store.Get(tc.oldKey)) - } - require.Equal(t, value, store.Get(tc.newKey)) - }) - } -} diff --git a/x/distribution/module.go b/x/distribution/module.go index 8a663f2ffcb8..1094d380ecdb 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -6,6 +6,7 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" @@ -20,6 +21,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/distribution/keeper" "github.com/cosmos/cosmos-sdk/x/distribution/simulation" "github.com/cosmos/cosmos-sdk/x/distribution/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) var ( @@ -59,6 +61,11 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config sdkclient.TxEn return types.ValidateGenesis(&data) } +// RegisterRESTRoutes registers the REST routes for the distribution module. +// Deprecated: RegisterRESTRoutes is deprecated. `x/distribution` legacy REST implementation +// has been removed from the SDK. +func (AppModuleBasic) RegisterRESTRoutes(_ sdkclient.Context, _ *mux.Router) {} + // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the distribution module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux *runtime.ServeMux) { if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { @@ -88,13 +95,13 @@ type AppModule struct { keeper keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper - stakingKeeper types.StakingKeeper + stakingKeeper stakingkeeper.Keeper } // NewAppModule creates a new AppModule object func NewAppModule( cdc codec.Codec, keeper keeper.Keeper, accountKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, stakingKeeper types.StakingKeeper, + bankKeeper types.BankKeeper, stakingKeeper stakingkeeper.Keeper, ) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, @@ -134,9 +141,6 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - - m := keeper.NewMigrator(am.keeper) - cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2) } // InitGenesis performs genesis initialization for the distribution module. It returns @@ -163,6 +167,12 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { BeginBlocker(ctx, req, am.keeper) } +// EndBlock returns the end blocker for the distribution module. It returns no validator +// updates. +func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} + // AppModuleSimulation functions // GenerateGenesisState creates a randomized GenState of the distribution module. diff --git a/x/distribution/module_test.go b/x/distribution/module_test.go index 70e2e50ea8b0..64c2b720220a 100644 --- a/x/distribution/module_test.go +++ b/x/distribution/module_test.go @@ -10,7 +10,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" ) diff --git a/x/distribution/proposal_handler_test.go b/x/distribution/proposal_handler_test.go index 24be6c98e5ae..a91debbffed5 100644 --- a/x/distribution/proposal_handler_test.go +++ b/x/distribution/proposal_handler_test.go @@ -7,7 +7,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution" diff --git a/x/distribution/simulation/decoder_test.go b/x/distribution/simulation/decoder_test.go index 01e986fe53eb..d4386779816c 100644 --- a/x/distribution/simulation/decoder_test.go +++ b/x/distribution/simulation/decoder_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/x/distribution/simulation" diff --git a/x/distribution/simulation/genesis_test.go b/x/distribution/simulation/genesis_test.go index 259f0512d7a0..275dae463f35 100644 --- a/x/distribution/simulation/genesis_test.go +++ b/x/distribution/simulation/genesis_test.go @@ -7,7 +7,6 @@ import ( "github.com/stretchr/testify/require" - sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -31,7 +30,7 @@ func TestRandomizedGenState(t *testing.T) { Rand: r, NumBonded: 3, Accounts: simtypes.RandomAccounts(r, 3), - InitialStake: sdkmath.NewInt(1000), + InitialStake: sdk.NewInt(1000), GenState: make(map[string]json.RawMessage), } diff --git a/x/distribution/simulation/operations.go b/x/distribution/simulation/operations.go index edd0aef1ff12..71ee91056c61 100644 --- a/x/distribution/simulation/operations.go +++ b/x/distribution/simulation/operations.go @@ -15,12 +15,15 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) +const DefaultWeightMsgWithdrawAllTokenizeShareRecordReward int = 50 + // Simulation operation weights constants const ( - OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" - OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" - OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" - OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" + OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" + OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" + OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" + OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" + OpWeightMsgWithdrawTokenizeShareRecordReward = "op_weight_msg_withdraw_tokenize_share_record_reward" ) // WeightedOperations returns all the operations from the module with their respective weights @@ -53,6 +56,13 @@ func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak ty }, ) + var weightMsgWithdrawTokenizeShareRecordReward int + appParams.GetOrGenerate(cdc, OpWeightMsgWithdrawTokenizeShareRecordReward, &weightMsgWithdrawTokenizeShareRecordReward, nil, + func(_ *rand.Rand) { + weightMsgWithdrawTokenizeShareRecordReward = DefaultWeightMsgWithdrawAllTokenizeShareRecordReward + }, + ) + stakeKeeper := sk.(stakingkeeper.Keeper) return simulation.WeightedOperations{ @@ -72,6 +82,10 @@ func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak ty weightMsgFundCommunityPool, SimulateMsgFundCommunityPool(ak, bk, k, stakeKeeper), ), + simulation.NewWeightedOperation( + weightMsgWithdrawTokenizeShareRecordReward, + SimulateMsgWithdrawTokenizeShareRecordReward(ak, bk, k, stakeKeeper), + ), } } @@ -244,3 +258,52 @@ func SimulateMsgFundCommunityPool(ak types.AccountKeeper, bk types.BankKeeper, k return simulation.GenAndDeliverTx(txCtx, fees) } } + +// SimulateMsgWithdrawTokenizeShareRecordReward simulates MsgWithdrawTokenizeShareRecordReward execution where +// a random account claim tokenize share record rewards. +func SimulateMsgWithdrawTokenizeShareRecordReward(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, sk stakingkeeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + + rewardOwner, _ := simtypes.RandomAcc(r, accs) + + records := sk.GetAllTokenizeShareRecords(ctx) + if len(records) > 0 { + record := records[r.Intn(len(records))] + for _, acc := range accs { + if acc.Address.String() == record.Owner { + rewardOwner = acc + break + } + } + } + + // if simaccount.PrivKey == nil, delegation address does not exist in accs. Return error + if rewardOwner.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgWithdrawTokenizeShareRecordReward, "account private key is nil"), nil, nil + } + + msg := types.NewMsgWithdrawAllTokenizeShareRecordReward(rewardOwner.Address) + + account := ak.GetAccount(ctx, rewardOwner.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: simappparams.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: rewardOwner, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/distribution/simulation/operations_test.go b/x/distribution/simulation/operations_test.go index fdde63e43caa..833dec88965b 100644 --- a/x/distribution/simulation/operations_test.go +++ b/x/distribution/simulation/operations_test.go @@ -4,11 +4,13 @@ import ( "math/rand" "testing" + "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -42,6 +44,7 @@ func (suite *SimTestSuite) TestWeightedOperations() { {simappparams.DefaultWeightMsgWithdrawDelegationReward, types.ModuleName, types.TypeMsgWithdrawDelegatorReward}, {simappparams.DefaultWeightMsgWithdrawValidatorCommission, types.ModuleName, types.TypeMsgWithdrawValidatorCommission}, {simappparams.DefaultWeightMsgFundCommunityPool, types.ModuleName, types.TypeMsgFundCommunityPool}, + {simulation.DefaultWeightMsgWithdrawAllTokenizeShareRecordReward, types.ModuleName, types.TypeMsgWithdrawAllTokenizeShareRecordReward}, } for i, w := range weightesOps { @@ -58,6 +61,7 @@ func (suite *SimTestSuite) TestWeightedOperations() { // TestSimulateMsgSetWithdrawAddress tests the normal scenario of a valid message of type TypeMsgSetWithdrawAddress. // Abonormal scenarios, where the message is created by an errors, are not tested here. func (suite *SimTestSuite) TestSimulateMsgSetWithdrawAddress() { + // setup 3 accounts s := rand.NewSource(1) r := rand.New(s) @@ -72,7 +76,7 @@ func (suite *SimTestSuite) TestSimulateMsgSetWithdrawAddress() { suite.Require().NoError(err) var msg types.MsgSetWithdrawAddress - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) @@ -98,7 +102,7 @@ func (suite *SimTestSuite) TestSimulateMsgWithdrawDelegatorReward() { delTokens := suite.app.StakingKeeper.TokensFromConsensusPower(suite.ctx, 2) validator0, issuedShares := validator0.AddTokensFromDel(delTokens) delegator := accounts[1] - delegation := stakingtypes.NewDelegation(delegator.Address, validator0.GetOperator(), issuedShares) + delegation := stakingtypes.NewDelegation(delegator.Address, validator0.GetOperator(), issuedShares, false) suite.app.StakingKeeper.SetDelegation(suite.ctx, delegation) suite.app.DistrKeeper.SetDelegatorStartingInfo(suite.ctx, validator0.GetOperator(), delegator.Address, distrtypes.NewDelegatorStartingInfo(2, sdk.OneDec(), 200)) @@ -113,7 +117,7 @@ func (suite *SimTestSuite) TestSimulateMsgWithdrawDelegatorReward() { suite.Require().NoError(err) var msg types.MsgWithdrawDelegatorReward - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmosvaloper1l4s054098kk9hmr5753c6k3m2kw65h686d3mhr", msg.ValidatorAddress) @@ -174,7 +178,7 @@ func (suite *SimTestSuite) testSimulateMsgWithdrawValidatorCommission(tokenName suite.Require().NoError(err) var msg types.MsgWithdrawValidatorCommission - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", msg.ValidatorAddress) @@ -201,7 +205,7 @@ func (suite *SimTestSuite) TestSimulateMsgFundCommunityPool() { suite.Require().NoError(err) var msg types.MsgFundCommunityPool - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) suite.Require().True(operationMsg.OK) suite.Require().Equal("4896096stake", msg.Amount.String()) @@ -275,6 +279,7 @@ func (suite *SimTestSuite) setupValidatorRewards(valAddress sdk.ValAddress) { // setup current revards currentRewards := distrtypes.NewValidatorCurrentRewards(decCoins, 3) suite.app.DistrKeeper.SetValidatorCurrentRewards(suite.ctx, valAddress, currentRewards) + } func TestSimTestSuite(t *testing.T) { diff --git a/x/distribution/simulation/proposals_test.go b/x/distribution/simulation/proposals_test.go index aec70fd832c4..44f685735576 100644 --- a/x/distribution/simulation/proposals_test.go +++ b/x/distribution/simulation/proposals_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/distribution/spec/02_state.md b/x/distribution/spec/02_state.md index e914ce25364d..df85f3f7eda2 100644 --- a/x/distribution/spec/02_state.md +++ b/x/distribution/spec/02_state.md @@ -15,7 +15,7 @@ for fractions of coins to be received from operations like inflation. When coins are distributed from the pool they are truncated back to `sdk.Coins` which are non-decimal. -* FeePool: `0x00 -> ProtocolBuffer(FeePool)` +- FeePool: `0x00 -> ProtocolBuffer(FeePool)` ```go // coins with decimal @@ -27,7 +27,7 @@ type DecCoin struct { } ``` -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/distribution/v1beta1/distribution.proto#L92-L96 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/distribution/v1beta1/distribution.proto#L94-L101 ## Validator Distribution @@ -38,7 +38,7 @@ Validator distribution information for the relevant validator is updated each ti 3. any delegator withdraws from a validator, or 4. the validator withdraws its commission. -* ValidatorDistInfo: `0x02 | ValOperatorAddrLen (1 byte) | ValOperatorAddr -> ProtocolBuffer(validatorDistribution)` +- ValidatorDistInfo: `0x02 | ValOperatorAddrLen (1 byte) | ValOperatorAddr -> ProtocolBuffer(validatorDistribution)` ```go type ValidatorDistInfo struct { @@ -56,7 +56,7 @@ properties change (aka bonded tokens etc.) its properties will remain constant and the delegator's _accumulation_ factor can be calculated passively knowing only the height of the last withdrawal and its current properties. -* DelegationDistInfo: `0x02 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValOperatorAddrLen (1 byte) | ValOperatorAddr -> ProtocolBuffer(delegatorDist)` +- DelegationDistInfo: `0x02 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValOperatorAddrLen (1 byte) | ValOperatorAddr -> ProtocolBuffer(delegatorDist)` ```go type DelegationDistInfo struct { diff --git a/x/distribution/spec/04_messages.md b/x/distribution/spec/04_messages.md index 87d608842e5b..2017a570018e 100644 --- a/x/distribution/spec/04_messages.md +++ b/x/distribution/spec/04_messages.md @@ -13,7 +13,7 @@ The withdraw address cannot be any of the module accounts. These accounts are bl Response: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/distribution/v1beta1/tx.proto#L31-L41 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37 ```go func (k Keeper) SetWithdrawAddr(ctx sdk.Context, delegatorAddr sdk.AccAddress, withdrawAddr sdk.AccAddress) error @@ -63,7 +63,7 @@ The final calculated stake is equivalent to the actual staked coins in the deleg Response: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/distribution/v1beta1/tx.proto#L46-L56 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50 ## WithdrawValidatorCommission @@ -72,6 +72,14 @@ The commission is calculated in every block during `BeginBlock`, so no iteration The amount withdrawn is deducted from the `ValidatorOutstandingRewards` variable for the validator. Only integer amounts can be sent. If the accumulated awards have decimals, the amount is truncated before the withdrawal is sent, and the remainder is left to be withdrawn later. +## MsgWithdrawTokenizeShareRecordReward + +A `TokenizeShareRecords` owner can send the MsgWithdrawTokenizeShareRecordReward message to withraw their rewards allocated for tokenized amount of staking tokens. + +The middle account (1:1 assigned per tokenize share record) takes the role of a delegator. + +While executing the message, handler iterates all the tokenize share records, withdraw delegation reward from each record account and send the rewards to the record owner. + ## FundCommunityPool This message sends coins directly from the sender to the community pool. diff --git a/x/distribution/spec/05_hooks.md b/x/distribution/spec/05_hooks.md index a1702ef73b0b..417a0cc08ff1 100644 --- a/x/distribution/spec/05_hooks.md +++ b/x/distribution/spec/05_hooks.md @@ -8,15 +8,15 @@ Available hooks that can be called by and from this module. ## Create or modify delegation distribution -* triggered-by: `staking.MsgDelegate`, `staking.MsgBeginRedelegate`, `staking.MsgUndelegate` +- triggered-by: `staking.MsgDelegate`, `staking.MsgBeginRedelegate`, `staking.MsgUndelegate` ### Before -* The delegation rewards are withdrawn to the withdraw address of the delegator. +- The delegation rewards are withdrawn to the withdraw address of the delegator. The rewards include the current period and exclude the starting period. -* The validator period is incremented. +- The validator period is incremented. The validator period is incremented because the validator's power and share distribution might have changed. -* The reference count for the delegator's starting period is decremented. +- The reference count for the delegator's starting period is decremented. ### After @@ -25,21 +25,21 @@ Because of the `Before`-hook, this period is the last period for which the deleg ## Validator created -* triggered-by: `staking.MsgCreateValidator` +- triggered-by: `staking.MsgCreateValidator` When a validator is created, the following validator variables are initialized: -* Historical rewards -* Current accumulated rewards -* Accumulated commission -* Total outstanding rewards -* Period +- Historical rewards +- Current accumulated rewards +- Accumulated commission +- Total outstanding rewards +- Period By default, all values are set to a `0`, except period, which is set to `1`. ## Validator removed -* triggered-by: `staking.RemoveValidator` +- triggered-by: `staking.RemoveValidator` Outstanding commission is sent to the validator's self-delegation withdrawal address. Remaining delegator rewards get sent to the community fee pool. @@ -50,10 +50,10 @@ Any remaining rewards are dust amounts. ## Validator is slashed -* triggered-by: `staking.Slash` +- triggered-by: `staking.Slash` -* The current validator period reference count is incremented. +- The current validator period reference count is incremented. The reference count is incremented because the slash event has created a reference to it. -* The validator period is incremented. -* The slash event is stored for later use. +- The validator period is incremented. +- The slash event is stored for later use. The slash event will be referenced when calculating delegator rewards. diff --git a/x/distribution/spec/README.md b/x/distribution/spec/README.md index c5a841ceb7c3..4a9565da92ed 100644 --- a/x/distribution/spec/README.md +++ b/x/distribution/spec/README.md @@ -22,27 +22,27 @@ and validator proposer-reward pool. Due to the nature of passive accounting, whenever changes to parameters which affect the rate of reward distribution occurs, withdrawal of rewards must also occur. -* Whenever withdrawing, one must withdraw the maximum amount they are entitled - to, leaving nothing in the pool. -* Whenever bonding, unbonding, or re-delegating tokens to an existing account, a - full withdrawal of the rewards must occur (as the rules for lazy accounting - change). -* Whenever a validator chooses to change the commission on rewards, all accumulated - commission rewards must be simultaneously withdrawn. +- Whenever withdrawing, one must withdraw the maximum amount they are entitled + to, leaving nothing in the pool. +- Whenever bonding, unbonding, or re-delegating tokens to an existing account, a + full withdrawal of the rewards must occur (as the rules for lazy accounting + change). +- Whenever a validator chooses to change the commission on rewards, all accumulated + commission rewards must be simultaneously withdrawn. The above scenarios are covered in `hooks.md`. The distribution mechanism outlined herein is used to lazily distribute the following rewards between validators and associated delegators: -* multi-token fees to be socially distributed -* proposer reward pool -* inflated atom provisions -* validator commission on all rewards earned by their delegators stake +- multi-token fees to be socially distributed +- proposer reward pool +- inflated atom provisions +- validator commission on all rewards earned by their delegators stake Fees are pooled within a global pool, as well as validator specific proposer-reward pools. The mechanisms used allow for validators and delegators -to independently and lazily withdraw their rewards. +to independently and lazily withdraw their rewards. ## Shortcomings @@ -50,7 +50,7 @@ As a part of the lazy computations, each delegator holds an accumulation term specific to each validator which is used to estimate what their approximate fair portion of tokens held in the global fee pool is owed to them. -```text +``` entitlement = delegator-accumulation / all-delegators-accumulation ``` @@ -85,22 +85,20 @@ to set up a script to periodically withdraw and rebond rewards. ## Contents 1. **[Concepts](01_concepts.md)** - * [Reference Counting in F1 Fee Distribution](01_concepts.md#reference-counting-in-f1-fee-distribution) + - [Reference Counting in F1 Fee Distribution](01_concepts.md#reference-counting-in-f1-fee-distribution) 2. **[State](02_state.md)** 3. **[Begin Block](03_begin_block.md)** 4. **[Messages](04_messages.md)** - * [MsgSetWithdrawAddress](04_messages.md#msgsetwithdrawaddress) - * [MsgWithdrawDelegatorReward](04_messages.md#msgwithdrawdelegatorreward) - * [Withdraw Validator Rewards All](04_messages.md#withdraw-validator-rewards-all) - * [Common calculations](04_messages.md#common-calculations-) + - [MsgSetWithdrawAddress](04_messages.md#msgsetwithdrawaddress) + - [MsgWithdrawDelegatorReward](04_messages.md#msgwithdrawdelegatorreward) + - [Withdraw Validator Rewards All](04_messages.md#withdraw-validator-rewards-all) + - [MsgWithdrawTokenizeShareRecordReward](04_messages.md#msgwithdrawtokenizesharerecordreward) + - [Common calculations](04_messages.md#common-calculations-) 5. **[Hooks](05_hooks.md)** - * [Create or modify delegation distribution](05_hooks.md#create-or-modify-delegation-distribution) - * [Commission rate change](05_hooks.md#commission-rate-change) - * [Change in Validator State](05_hooks.md#change-in-validator-state) + - [Create or modify delegation distribution](05_hooks.md#create-or-modify-delegation-distribution) + - [Commission rate change](05_hooks.md#commission-rate-change) + - [Change in Validator State](05_hooks.md#change-in-validator-state) 6. **[Events](06_events.md)** - * [BeginBlocker](06_events.md#beginblocker) - * [Handlers](06_events.md#handlers) + - [BeginBlocker](06_events.md#beginblocker) + - [Handlers](06_events.md#handlers) 7. **[Parameters](07_params.md)** -8. **[Parameters](07_params.md)** - * [CLI](08_client.md#cli) - * [gRPC](08_client.md#grpc) diff --git a/x/distribution/types/codec.go b/x/distribution/types/codec.go index 0bff07d87340..41073b5a9eef 100644 --- a/x/distribution/types/codec.go +++ b/x/distribution/types/codec.go @@ -4,21 +4,21 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // RegisterLegacyAminoCodec registers the necessary x/distribution interfaces and concrete types // on the provided LegacyAmino codec. These types are used for Amino JSON serialization. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - legacy.RegisterAminoMsg(cdc, &MsgWithdrawDelegatorReward{}, "cosmos-sdk/MsgWithdrawDelegationReward") - legacy.RegisterAminoMsg(cdc, &MsgWithdrawValidatorCommission{}, "cosmos-sdk/MsgWithdrawValCommission") - legacy.RegisterAminoMsg(cdc, &MsgSetWithdrawAddress{}, "cosmos-sdk/MsgModifyWithdrawAddress") - legacy.RegisterAminoMsg(cdc, &MsgFundCommunityPool{}, "cosmos-sdk/MsgFundCommunityPool") - cdc.RegisterConcrete(&CommunityPoolSpendProposal{}, "cosmos-sdk/CommunityPoolSpendProposal", nil) + // cdc.RegisterConcrete(&MsgWithdrawDelegatorReward{}, "cosmos-sdk/MsgWithdrawDelegationReward", nil) + // cdc.RegisterConcrete(&MsgWithdrawValidatorCommission{}, "cosmos-sdk/MsgWithdrawValidatorCommission", nil) + // cdc.RegisterConcrete(&MsgSetWithdrawAddress{}, "cosmos-sdk/MsgModifyWithdrawAddress", nil) + // cdc.RegisterConcrete(&MsgFundCommunityPool{}, "cosmos-sdk/MsgFundCommunityPool", nil) + // cdc.RegisterConcrete(&CommunityPoolSpendProposal{}, "cosmos-sdk/CommunityPoolSpendProposal", nil) + cdc.RegisterConcrete(&MsgWithdrawTokenizeShareRecordReward{}, "cosmos-sdk/MsgWithdrawTokenizeShareRecordReward", nil) + cdc.RegisterConcrete(&MsgWithdrawAllTokenizeShareRecordReward{}, "cosmos-sdk/MsgWithdrawAllTokenizeShareRecordReward", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -28,6 +28,8 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgWithdrawValidatorCommission{}, &MsgSetWithdrawAddress{}, &MsgFundCommunityPool{}, + &MsgWithdrawTokenizeShareRecordReward{}, + &MsgWithdrawAllTokenizeShareRecordReward{}, ) registry.RegisterImplementations( (*govtypes.Content)(nil), @@ -37,17 +39,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } -var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewAminoCodec(amino) -) - func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - sdk.RegisterLegacyAminoCodec(amino) - - // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be - // used to properly serialize MsgGrant and MsgExec instances - RegisterLegacyAminoCodec(authzcodec.Amino) + RegisterLegacyAminoCodec(legacy.Cdc) } diff --git a/x/distribution/types/distribution.pb.go b/x/distribution/types/distribution.pb.go index 714525f71f09..25e9fba38dbf 100644 --- a/x/distribution/types/distribution.pb.go +++ b/x/distribution/types/distribution.pb.go @@ -1,11 +1,10 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/distribution/v1beta1/distribution.proto +// source: distribution/v1beta1/distribution.proto package types 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/gogo/protobuf/gogoproto" @@ -28,16 +27,16 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the set of params for the distribution module. type Params struct { - CommunityTax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=community_tax,json=communityTax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"community_tax"` - BaseProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=base_proposer_reward,json=baseProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_proposer_reward"` - BonusProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=bonus_proposer_reward,json=bonusProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bonus_proposer_reward"` - WithdrawAddrEnabled bool `protobuf:"varint,4,opt,name=withdraw_addr_enabled,json=withdrawAddrEnabled,proto3" json:"withdraw_addr_enabled,omitempty"` + CommunityTax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=community_tax,json=communityTax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"community_tax" yaml:"community_tax"` + BaseProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=base_proposer_reward,json=baseProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_proposer_reward" yaml:"base_proposer_reward"` + BonusProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=bonus_proposer_reward,json=bonusProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bonus_proposer_reward" yaml:"bonus_proposer_reward"` + WithdrawAddrEnabled bool `protobuf:"varint,4,opt,name=withdraw_addr_enabled,json=withdrawAddrEnabled,proto3" json:"withdraw_addr_enabled,omitempty" yaml:"withdraw_addr_enabled"` } func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{0} + return fileDescriptor_c3e6168184371676, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -86,15 +85,15 @@ func (m *Params) GetWithdrawAddrEnabled() bool { // read that record) // + one per validator for the zeroeth period, set on initialization type ValidatorHistoricalRewards struct { - CumulativeRewardRatio github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=cumulative_reward_ratio,json=cumulativeRewardRatio,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"cumulative_reward_ratio"` - ReferenceCount uint32 `protobuf:"varint,2,opt,name=reference_count,json=referenceCount,proto3" json:"reference_count,omitempty"` + CumulativeRewardRatio github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=cumulative_reward_ratio,json=cumulativeRewardRatio,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"cumulative_reward_ratio" yaml:"cumulative_reward_ratio"` + ReferenceCount uint32 `protobuf:"varint,2,opt,name=reference_count,json=referenceCount,proto3" json:"reference_count,omitempty" yaml:"reference_count"` } func (m *ValidatorHistoricalRewards) Reset() { *m = ValidatorHistoricalRewards{} } func (m *ValidatorHistoricalRewards) String() string { return proto.CompactTextString(m) } func (*ValidatorHistoricalRewards) ProtoMessage() {} func (*ValidatorHistoricalRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{1} + return fileDescriptor_c3e6168184371676, []int{1} } func (m *ValidatorHistoricalRewards) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -149,7 +148,7 @@ func (m *ValidatorCurrentRewards) Reset() { *m = ValidatorCurrentRewards func (m *ValidatorCurrentRewards) String() string { return proto.CompactTextString(m) } func (*ValidatorCurrentRewards) ProtoMessage() {} func (*ValidatorCurrentRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{2} + return fileDescriptor_c3e6168184371676, []int{2} } func (m *ValidatorCurrentRewards) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -202,7 +201,7 @@ func (m *ValidatorAccumulatedCommission) Reset() { *m = ValidatorAccumul func (m *ValidatorAccumulatedCommission) String() string { return proto.CompactTextString(m) } func (*ValidatorAccumulatedCommission) ProtoMessage() {} func (*ValidatorAccumulatedCommission) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{3} + return fileDescriptor_c3e6168184371676, []int{3} } func (m *ValidatorAccumulatedCommission) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -241,14 +240,14 @@ func (m *ValidatorAccumulatedCommission) GetCommission() github_com_cosmos_cosmo // ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards // for a validator inexpensive to track, allows simple sanity checks. type ValidatorOutstandingRewards struct { - Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"rewards"` + Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"rewards" yaml:"rewards"` } func (m *ValidatorOutstandingRewards) Reset() { *m = ValidatorOutstandingRewards{} } func (m *ValidatorOutstandingRewards) String() string { return proto.CompactTextString(m) } func (*ValidatorOutstandingRewards) ProtoMessage() {} func (*ValidatorOutstandingRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{4} + return fileDescriptor_c3e6168184371676, []int{4} } func (m *ValidatorOutstandingRewards) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -289,7 +288,7 @@ func (m *ValidatorOutstandingRewards) GetRewards() github_com_cosmos_cosmos_sdk_ // This is needed to calculate appropriate amount of staking tokens // for delegations which are withdrawn after a slash has occurred. type ValidatorSlashEvent struct { - ValidatorPeriod uint64 `protobuf:"varint,1,opt,name=validator_period,json=validatorPeriod,proto3" json:"validator_period,omitempty"` + ValidatorPeriod uint64 `protobuf:"varint,1,opt,name=validator_period,json=validatorPeriod,proto3" json:"validator_period,omitempty" yaml:"validator_period"` Fraction github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fraction"` } @@ -297,7 +296,7 @@ func (m *ValidatorSlashEvent) Reset() { *m = ValidatorSlashEvent{} } func (m *ValidatorSlashEvent) String() string { return proto.CompactTextString(m) } func (*ValidatorSlashEvent) ProtoMessage() {} func (*ValidatorSlashEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{5} + return fileDescriptor_c3e6168184371676, []int{5} } func (m *ValidatorSlashEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -335,13 +334,13 @@ func (m *ValidatorSlashEvent) GetValidatorPeriod() uint64 { // ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. type ValidatorSlashEvents struct { - ValidatorSlashEvents []ValidatorSlashEvent `protobuf:"bytes,1,rep,name=validator_slash_events,json=validatorSlashEvents,proto3" json:"validator_slash_events"` + ValidatorSlashEvents []ValidatorSlashEvent `protobuf:"bytes,1,rep,name=validator_slash_events,json=validatorSlashEvents,proto3" json:"validator_slash_events" yaml:"validator_slash_events"` } func (m *ValidatorSlashEvents) Reset() { *m = ValidatorSlashEvents{} } func (*ValidatorSlashEvents) ProtoMessage() {} func (*ValidatorSlashEvents) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{6} + return fileDescriptor_c3e6168184371676, []int{6} } func (m *ValidatorSlashEvents) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -379,14 +378,14 @@ func (m *ValidatorSlashEvents) GetValidatorSlashEvents() []ValidatorSlashEvent { // FeePool is the global fee pool for distribution. type FeePool struct { - CommunityPool github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=community_pool,json=communityPool,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"community_pool"` + CommunityPool github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=community_pool,json=communityPool,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"community_pool" yaml:"community_pool"` } func (m *FeePool) Reset() { *m = FeePool{} } func (m *FeePool) String() string { return proto.CompactTextString(m) } func (*FeePool) ProtoMessage() {} func (*FeePool) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{7} + return fileDescriptor_c3e6168184371676, []int{7} } func (m *FeePool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -435,7 +434,7 @@ type CommunityPoolSpendProposal struct { func (m *CommunityPoolSpendProposal) Reset() { *m = CommunityPoolSpendProposal{} } func (*CommunityPoolSpendProposal) ProtoMessage() {} func (*CommunityPoolSpendProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{8} + return fileDescriptor_c3e6168184371676, []int{8} } func (m *CommunityPoolSpendProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -471,16 +470,16 @@ var xxx_messageInfo_CommunityPoolSpendProposal proto.InternalMessageInfo // the delegators within the validator may be left with less than a full token, // thus sdk.Dec is used. type DelegatorStartingInfo struct { - PreviousPeriod uint64 `protobuf:"varint,1,opt,name=previous_period,json=previousPeriod,proto3" json:"previous_period,omitempty"` - Stake github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=stake,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake"` - Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"creation_height"` + PreviousPeriod uint64 `protobuf:"varint,1,opt,name=previous_period,json=previousPeriod,proto3" json:"previous_period,omitempty" yaml:"previous_period"` + Stake github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=stake,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake" yaml:"stake"` + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"creation_height" yaml:"creation_height"` } 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_cd78a31ea281a992, []int{9} + return fileDescriptor_c3e6168184371676, []int{9} } func (m *DelegatorStartingInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -526,7 +525,7 @@ func (m *DelegatorStartingInfo) GetHeight() uint64 { // DelegationDelegatorReward represents the properties // of a delegator's delegation reward. type DelegationDelegatorReward struct { - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` Reward github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=reward,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"reward"` } @@ -534,7 +533,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_cd78a31ea281a992, []int{10} + return fileDescriptor_c3e6168184371676, []int{10} } func (m *DelegationDelegatorReward) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -563,21 +562,60 @@ func (m *DelegationDelegatorReward) XXX_DiscardUnknown() { var xxx_messageInfo_DelegationDelegatorReward proto.InternalMessageInfo +// TokenizeShareRecordReward represents the properties of tokenize share +type TokenizeShareRecordReward struct { + RecordId uint64 `protobuf:"varint,1,opt,name=recordId,proto3" json:"recordId,omitempty"` + Reward github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=reward,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"reward"` +} + +func (m *TokenizeShareRecordReward) Reset() { *m = TokenizeShareRecordReward{} } +func (m *TokenizeShareRecordReward) String() string { return proto.CompactTextString(m) } +func (*TokenizeShareRecordReward) ProtoMessage() {} +func (*TokenizeShareRecordReward) Descriptor() ([]byte, []int) { + return fileDescriptor_c3e6168184371676, []int{11} +} +func (m *TokenizeShareRecordReward) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokenizeShareRecordReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokenizeShareRecordReward.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 *TokenizeShareRecordReward) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenizeShareRecordReward.Merge(m, src) +} +func (m *TokenizeShareRecordReward) XXX_Size() int { + return m.Size() +} +func (m *TokenizeShareRecordReward) XXX_DiscardUnknown() { + xxx_messageInfo_TokenizeShareRecordReward.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenizeShareRecordReward proto.InternalMessageInfo + // CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal // with a deposit type CommunityPoolSpendProposalWithDeposit struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` - Deposit string `protobuf:"bytes,5,opt,name=deposit,proto3" json:"deposit,omitempty"` + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` + Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty" yaml:"amount"` + Deposit string `protobuf:"bytes,5,opt,name=deposit,proto3" json:"deposit,omitempty" yaml:"deposit"` } func (m *CommunityPoolSpendProposalWithDeposit) Reset() { *m = CommunityPoolSpendProposalWithDeposit{} } func (m *CommunityPoolSpendProposalWithDeposit) String() string { return proto.CompactTextString(m) } func (*CommunityPoolSpendProposalWithDeposit) ProtoMessage() {} func (*CommunityPoolSpendProposalWithDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{11} + return fileDescriptor_c3e6168184371676, []int{12} } func (m *CommunityPoolSpendProposalWithDeposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -607,85 +645,100 @@ func (m *CommunityPoolSpendProposalWithDeposit) XXX_DiscardUnknown() { var xxx_messageInfo_CommunityPoolSpendProposalWithDeposit proto.InternalMessageInfo func init() { - proto.RegisterType((*Params)(nil), "cosmos.distribution.v1beta1.Params") - proto.RegisterType((*ValidatorHistoricalRewards)(nil), "cosmos.distribution.v1beta1.ValidatorHistoricalRewards") - proto.RegisterType((*ValidatorCurrentRewards)(nil), "cosmos.distribution.v1beta1.ValidatorCurrentRewards") - proto.RegisterType((*ValidatorAccumulatedCommission)(nil), "cosmos.distribution.v1beta1.ValidatorAccumulatedCommission") - proto.RegisterType((*ValidatorOutstandingRewards)(nil), "cosmos.distribution.v1beta1.ValidatorOutstandingRewards") - proto.RegisterType((*ValidatorSlashEvent)(nil), "cosmos.distribution.v1beta1.ValidatorSlashEvent") - proto.RegisterType((*ValidatorSlashEvents)(nil), "cosmos.distribution.v1beta1.ValidatorSlashEvents") - proto.RegisterType((*FeePool)(nil), "cosmos.distribution.v1beta1.FeePool") - proto.RegisterType((*CommunityPoolSpendProposal)(nil), "cosmos.distribution.v1beta1.CommunityPoolSpendProposal") - proto.RegisterType((*DelegatorStartingInfo)(nil), "cosmos.distribution.v1beta1.DelegatorStartingInfo") - proto.RegisterType((*DelegationDelegatorReward)(nil), "cosmos.distribution.v1beta1.DelegationDelegatorReward") - proto.RegisterType((*CommunityPoolSpendProposalWithDeposit)(nil), "cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit") + proto.RegisterType((*Params)(nil), "liquidstaking.distribution.v1beta1.Params") + proto.RegisterType((*ValidatorHistoricalRewards)(nil), "liquidstaking.distribution.v1beta1.ValidatorHistoricalRewards") + proto.RegisterType((*ValidatorCurrentRewards)(nil), "liquidstaking.distribution.v1beta1.ValidatorCurrentRewards") + proto.RegisterType((*ValidatorAccumulatedCommission)(nil), "liquidstaking.distribution.v1beta1.ValidatorAccumulatedCommission") + proto.RegisterType((*ValidatorOutstandingRewards)(nil), "liquidstaking.distribution.v1beta1.ValidatorOutstandingRewards") + proto.RegisterType((*ValidatorSlashEvent)(nil), "liquidstaking.distribution.v1beta1.ValidatorSlashEvent") + proto.RegisterType((*ValidatorSlashEvents)(nil), "liquidstaking.distribution.v1beta1.ValidatorSlashEvents") + proto.RegisterType((*FeePool)(nil), "liquidstaking.distribution.v1beta1.FeePool") + proto.RegisterType((*CommunityPoolSpendProposal)(nil), "liquidstaking.distribution.v1beta1.CommunityPoolSpendProposal") + proto.RegisterType((*DelegatorStartingInfo)(nil), "liquidstaking.distribution.v1beta1.DelegatorStartingInfo") + proto.RegisterType((*DelegationDelegatorReward)(nil), "liquidstaking.distribution.v1beta1.DelegationDelegatorReward") + proto.RegisterType((*TokenizeShareRecordReward)(nil), "liquidstaking.distribution.v1beta1.TokenizeShareRecordReward") + proto.RegisterType((*CommunityPoolSpendProposalWithDeposit)(nil), "liquidstaking.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit") } func init() { - proto.RegisterFile("cosmos/distribution/v1beta1/distribution.proto", fileDescriptor_cd78a31ea281a992) -} - -var fileDescriptor_cd78a31ea281a992 = []byte{ - // 941 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xf7, 0x34, 0x8e, 0x93, 0x4e, 0xbf, 0x4d, 0xbe, 0x4c, 0x9c, 0xd4, 0x71, 0x2b, 0x3b, 0x5a, - 0x89, 0x12, 0xa8, 0xe2, 0x34, 0xed, 0x2d, 0xe2, 0x12, 0x3b, 0x41, 0x70, 0x6a, 0xb4, 0x41, 0x80, - 0xb8, 0xac, 0xc6, 0xbb, 0x2f, 0xf6, 0x28, 0xbb, 0x33, 0xcb, 0xcc, 0xac, 0x93, 0x9e, 0x7b, 0xe0, - 0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 0x04, 0x2f, 0xdc, 0xb8, 0x9b, 0x66, 0x07, 0xbf, 0x36, - 0xea, 0x70, 0x73, 0xd5, 0x80, 0x52, 0xee, 0xca, 0xae, 0xbd, 0x3c, 0x59, 0xab, 0x3a, 0xf2, 0x2d, - 0x9b, 0xd9, 0xd3, 0xd2, 0x0c, 0x90, 0xd1, 0x2b, 0xeb, 0xe2, 0x84, 0xe1, 0x4a, 0x71, 0x09, 0x4f, - 0xa8, 0x41, 0x1d, 0xc1, 0xe6, 0xac, 0x3b, 0x3f, 0x64, 0x9c, 0xbd, 0xfe, 0xef, 0x3d, 0xfa, 0x21, - 0xd3, 0xfd, 0x6d, 0x48, 0x85, 0x62, 0x7a, 0x42, 0xed, 0xba, 0x34, 0xd6, 0xae, 0x26, 0xe5, 0x56, - 0xa4, 0x86, 0x67, 0x22, 0x4b, 0x5c, 0x9b, 0xce, 0x13, 0xc3, 0xe5, 0xe6, 0xfd, 0xa1, 0xf6, 0xab, - 0xfb, 0xae, 0xfd, 0xe4, 0xbb, 0xb3, 0x06, 0x7a, 0x7e, 0xd6, 0x40, 0x2f, 0xce, 0x1a, 0xe8, 0xf7, - 0xb3, 0x06, 0xfa, 0xf2, 0xbc, 0x51, 0x7a, 0x71, 0xde, 0x28, 0xfd, 0x72, 0xde, 0x28, 0x7d, 0xbc, - 0x71, 0x65, 0xd9, 0x8e, 0x2e, 0x7e, 0x23, 0xe6, 0x55, 0xec, 0x56, 0xf2, 0xef, 0xb4, 0xc7, 0x7f, - 0x05, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x8d, 0xa6, 0x48, 0x47, 0x0a, 0x00, 0x00, + proto.RegisterFile("distribution/v1beta1/distribution.proto", fileDescriptor_c3e6168184371676) +} + +var fileDescriptor_c3e6168184371676 = []byte{ + // 1167 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xb4, 0xae, 0x9b, 0x4e, 0xdb, 0x34, 0x9d, 0x38, 0x89, 0xe3, 0x04, 0x6f, 0x34, 0x52, + 0x4b, 0x10, 0xc4, 0xa6, 0xed, 0x01, 0x94, 0x03, 0x52, 0xec, 0x24, 0x22, 0x88, 0x8f, 0x68, 0x13, + 0x40, 0xe2, 0x62, 0x8d, 0x77, 0x27, 0xf6, 0x28, 0xeb, 0x1d, 0x67, 0x66, 0xd6, 0x49, 0x90, 0x10, + 0x12, 0x27, 0x6e, 0x80, 0xe0, 0xc0, 0x01, 0x50, 0x8e, 0x7c, 0xdd, 0xf8, 0x27, 0x7a, 0xec, 0x0d, + 0x04, 0x92, 0x41, 0x89, 0x90, 0x10, 0x47, 0xdf, 0xb8, 0xa1, 0xdd, 0x99, 0xdd, 0x75, 0x5c, 0x23, + 0x62, 0xa4, 0x8a, 0x53, 0x32, 0xbf, 0x79, 0xf3, 0xde, 0xef, 0x7d, 0xaf, 0xe1, 0xd3, 0x2e, 0x93, + 0x4a, 0xb0, 0x46, 0xa0, 0x18, 0xf7, 0x2b, 0xdd, 0x7b, 0x0d, 0xaa, 0xc8, 0xbd, 0xca, 0x20, 0x58, + 0xee, 0x08, 0xae, 0x38, 0xc2, 0x1e, 0x3b, 0x08, 0x98, 0x2b, 0x15, 0xd9, 0x67, 0x7e, 0xb3, 0x7c, + 0x4e, 0xc2, 0x3c, 0x2b, 0xe6, 0x9b, 0xbc, 0xc9, 0x23, 0xf1, 0x4a, 0xf8, 0x9f, 0x7e, 0x59, 0x2c, + 0x39, 0x5c, 0xb6, 0xb9, 0xac, 0x34, 0x88, 0xa4, 0x89, 0x05, 0x87, 0x33, 0xa3, 0x19, 0xff, 0x78, + 0x19, 0xe6, 0xb6, 0x89, 0x20, 0x6d, 0x89, 0xf6, 0xe1, 0x4d, 0x87, 0xb7, 0xdb, 0x81, 0xcf, 0xd4, + 0x71, 0x5d, 0x91, 0xa3, 0x02, 0x58, 0x02, 0x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0x67, 0xa5, 0xcc, 0x4f, 0x67, 0xa5, 0xcc, 0x3b, 0xeb, 0x03, 0xf1, 0x67, 0x07, + 0x5e, 0x10, 0xee, 0x59, 0xe6, 0x3b, 0x15, 0x3d, 0xe3, 0x99, 0x3a, 0x5e, 0x31, 0x73, 0x7e, 0xa5, + 0xcd, 0xdd, 0xc0, 0xa3, 0x95, 0xa3, 0x73, 0xbf, 0x0a, 0x74, 0x86, 0x1a, 0xb9, 0xe8, 0x13, 0xfe, + 0xc1, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x93, 0x00, 0xbd, 0xdd, 0x47, 0x0c, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -990,6 +1043,38 @@ func (this *DelegationDelegatorReward) Equal(that interface{}) bool { } return true } +func (this *TokenizeShareRecordReward) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TokenizeShareRecordReward) + if !ok { + that2, ok := that.(TokenizeShareRecordReward) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.RecordId != that1.RecordId { + return false + } + if len(this.Reward) != len(that1.Reward) { + return false + } + for i := range this.Reward { + if !this.Reward[i].Equal(&that1.Reward[i]) { + return false + } + } + return true +} func (this *CommunityPoolSpendProposalWithDeposit) Equal(that interface{}) bool { if that == nil { return this == nil @@ -1504,6 +1589,48 @@ func (m *DelegationDelegatorReward) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *TokenizeShareRecordReward) 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 *TokenizeShareRecordReward) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokenizeShareRecordReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Reward) > 0 { + for iNdEx := len(m.Reward) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Reward[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.RecordId != 0 { + i = encodeVarintDistribution(dAtA, i, uint64(m.RecordId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *CommunityPoolSpendProposalWithDeposit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1764,6 +1891,24 @@ func (m *DelegationDelegatorReward) Size() (n int) { return n } +func (m *TokenizeShareRecordReward) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RecordId != 0 { + n += 1 + sovDistribution(uint64(m.RecordId)) + } + if len(m.Reward) > 0 { + for _, e := range m.Reward { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + return n +} + func (m *CommunityPoolSpendProposalWithDeposit) Size() (n int) { if m == nil { return 0 @@ -1956,7 +2101,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -2059,7 +2207,10 @@ func (m *ValidatorHistoricalRewards) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -2162,7 +2313,10 @@ func (m *ValidatorCurrentRewards) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -2246,7 +2400,10 @@ func (m *ValidatorAccumulatedCommission) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -2330,7 +2487,10 @@ func (m *ValidatorOutstandingRewards) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -2433,7 +2593,10 @@ func (m *ValidatorSlashEvent) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -2517,7 +2680,10 @@ func (m *ValidatorSlashEvents) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -2601,7 +2767,10 @@ func (m *FeePool) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -2781,7 +2950,10 @@ func (m *CommunityPoolSpendProposal) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -2903,7 +3075,10 @@ func (m *DelegatorStartingInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -3019,7 +3194,116 @@ func (m *DelegationDelegatorReward) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TokenizeShareRecordReward) 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 ErrIntOverflowDistribution + } + 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: TokenizeShareRecordReward: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenizeShareRecordReward: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordId", wireType) + } + m.RecordId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RecordId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reward", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reward = append(m.Reward, types.DecCoin{}) + if err := m.Reward[len(m.Reward)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { @@ -3229,7 +3513,10 @@ func (m *CommunityPoolSpendProposalWithDeposit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthDistribution } if (iNdEx + skippy) > l { diff --git a/x/distribution/types/errors.go b/x/distribution/types/errors.go index 147cfd320341..5f96eec59d97 100644 --- a/x/distribution/types/errors.go +++ b/x/distribution/types/errors.go @@ -6,16 +6,17 @@ import ( // x/distribution module sentinel errors var ( - ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 2, "delegator address is empty") - ErrEmptyWithdrawAddr = sdkerrors.Register(ModuleName, 3, "withdraw address is empty") - ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 4, "validator address is empty") - ErrEmptyDelegationDistInfo = sdkerrors.Register(ModuleName, 5, "no delegation distribution info") - ErrNoValidatorDistInfo = sdkerrors.Register(ModuleName, 6, "no validator distribution info") - ErrNoValidatorCommission = sdkerrors.Register(ModuleName, 7, "no validator commission to withdraw") - ErrSetWithdrawAddrDisabled = sdkerrors.Register(ModuleName, 8, "set withdraw address disabled") - ErrBadDistribution = sdkerrors.Register(ModuleName, 9, "community pool does not have sufficient coins to distribute") - ErrInvalidProposalAmount = sdkerrors.Register(ModuleName, 10, "invalid community pool spend proposal amount") - ErrEmptyProposalRecipient = sdkerrors.Register(ModuleName, 11, "invalid community pool spend proposal recipient") - ErrNoValidatorExists = sdkerrors.Register(ModuleName, 12, "validator does not exist") - ErrNoDelegationExists = sdkerrors.Register(ModuleName, 13, "delegation does not exist") + // ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 2, "delegator address is empty") + // ErrEmptyWithdrawAddr = sdkerrors.Register(ModuleName, 3, "withdraw address is empty") + // ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 4, "validator address is empty") + // ErrEmptyDelegationDistInfo = sdkerrors.Register(ModuleName, 5, "no delegation distribution info") + // ErrNoValidatorDistInfo = sdkerrors.Register(ModuleName, 6, "no validator distribution info") + // ErrNoValidatorCommission = sdkerrors.Register(ModuleName, 7, "no validator commission to withdraw") + // ErrSetWithdrawAddrDisabled = sdkerrors.Register(ModuleName, 8, "set withdraw address disabled") + // ErrBadDistribution = sdkerrors.Register(ModuleName, 9, "community pool does not have sufficient coins to distribute") + // ErrInvalidProposalAmount = sdkerrors.Register(ModuleName, 10, "invalid community pool spend proposal amount") + // ErrEmptyProposalRecipient = sdkerrors.Register(ModuleName, 11, "invalid community pool spend proposal recipient") + // ErrNoValidatorExists = sdkerrors.Register(ModuleName, 12, "validator does not exist") + // ErrNoDelegationExists = sdkerrors.Register(ModuleName, 13, "delegation does not exist") + ErrNotTokenizeShareRecordOwner = sdkerrors.Register(ModuleName, 44, "not tokenize share record owner") ) diff --git a/x/distribution/types/events.go b/x/distribution/types/events.go index ce4c0ef62e3c..a45d931c9b33 100644 --- a/x/distribution/types/events.go +++ b/x/distribution/types/events.go @@ -2,12 +2,13 @@ package types // distribution module event types const ( - EventTypeSetWithdrawAddress = "set_withdraw_address" - EventTypeRewards = "rewards" - EventTypeCommission = "commission" - EventTypeWithdrawRewards = "withdraw_rewards" - EventTypeWithdrawCommission = "withdraw_commission" - EventTypeProposerReward = "proposer_reward" + EventTypeSetWithdrawAddress = "set_withdraw_address" + EventTypeRewards = "rewards" + EventTypeCommission = "commission" + EventTypeWithdrawRewards = "withdraw_rewards" + EventTypeWithdrawCommission = "withdraw_commission" + EventTypeWithdrawTokenizeShareReward = "withdraw_tokenize_share_reward" + EventTypeProposerReward = "proposer_reward" AttributeKeyWithdrawAddress = "withdraw_address" AttributeKeyValidator = "validator" diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index 82eee3eabef4..db3e0c11478c 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -3,6 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -20,12 +21,14 @@ type AccountKeeper interface { // BankKeeper defines the expected interface needed to retrieve account balances. type BankKeeper interface { GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - + GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error BlockedAddr(addr sdk.AccAddress) bool } @@ -34,23 +37,50 @@ type BankKeeper interface { type StakingKeeper interface { // iterate through validators by operator address, execute func for each validator IterateValidators(sdk.Context, - func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + func(index int64, validator sdkstaking.ValidatorI) (stop bool)) + + // iterate through bonded validators by operator address, execute func for each validator + IterateBondedValidatorsByPower(sdk.Context, + func(index int64, validator sdkstaking.ValidatorI) (stop bool)) + + // iterate through the consensus validator set of the last block by operator address, execute func for each validator + IterateLastValidators(sdk.Context, + func(index int64, validator sdkstaking.ValidatorI) (stop bool)) + + Validator(sdk.Context, sdk.ValAddress) sdkstaking.ValidatorI // get a particular validator by operator address + ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) sdkstaking.ValidatorI // get a particular validator by consensus address - Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI // get a particular validator by consensus address + // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction + Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdk.Int + Jail(sdk.Context, sdk.ConsAddress) // jail a validator + Unjail(sdk.Context, sdk.ConsAddress) // unjail a validator // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI + Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) sdkstaking.DelegationI + + // MaxValidators returns the maximum amount of bonded validators + MaxValidators(sdk.Context) uint32 IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, - fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) + fn func(index int64, delegation sdkstaking.DelegationI) (stop bool)) + + GetLastTotalPower(ctx sdk.Context) sdk.Int + GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) int64 GetAllSDKDelegations(ctx sdk.Context) []stakingtypes.Delegation + + GetTokenizeShareRecordsByOwner(ctx sdk.Context, owner sdk.AccAddress) (tokenizeShareRecords []stakingtypes.TokenizeShareRecord) + GetTokenizeShareRecord(ctx sdk.Context, id uint64) (tokenizeShareRecord stakingtypes.TokenizeShareRecord, err error) } // StakingHooks event hooks for staking validator object (noalias) type StakingHooks interface { - AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) // Must be called when a validator is created + AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) // Must be called when a validator is created + AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is deleted + + BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation is created + BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation's shares are modified AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) + BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) } diff --git a/x/distribution/types/fee_pool_test.go b/x/distribution/types/fee_pool_test.go index 7eabc04d0bfa..de774ca3cc0f 100644 --- a/x/distribution/types/fee_pool_test.go +++ b/x/distribution/types/fee_pool_test.go @@ -10,6 +10,7 @@ import ( ) func TestValidateGenesis(t *testing.T) { + fp := types.InitialFeePool() require.Nil(t, fp.ValidateGenesis()) diff --git a/x/distribution/types/genesis.go b/x/distribution/types/genesis.go index 9ceb0737a13e..3aa251bba997 100644 --- a/x/distribution/types/genesis.go +++ b/x/distribution/types/genesis.go @@ -10,6 +10,7 @@ func NewGenesisState( acc []ValidatorAccumulatedCommissionRecord, historical []ValidatorHistoricalRewardsRecord, cur []ValidatorCurrentRewardsRecord, dels []DelegatorStartingInfoRecord, slashes []ValidatorSlashEventRecord, ) *GenesisState { + return &GenesisState{ Params: params, FeePool: fp, diff --git a/x/distribution/types/genesis.pb.go b/x/distribution/types/genesis.pb.go index a1f2d7ba7b70..68e33e4d00a8 100644 --- a/x/distribution/types/genesis.pb.go +++ b/x/distribution/types/genesis.pb.go @@ -1,11 +1,10 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/distribution/v1beta1/genesis.proto +// source: distribution/v1beta1/genesis.proto package types 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/gogo/protobuf/gogoproto" @@ -31,16 +30,16 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // default withdraw addresses. type DelegatorWithdrawInfo struct { // delegator_address is the address of the delegator. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` // withdraw_address is the address to withdraw the delegation rewards to. - WithdrawAddress string `protobuf:"bytes,2,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty"` + WithdrawAddress string `protobuf:"bytes,2,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty" yaml:"withdraw_address"` } 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_76eed0f9489db580, []int{0} + return fileDescriptor_02ffc8100ab19bc0, []int{0} } func (m *DelegatorWithdrawInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -72,16 +71,16 @@ var xxx_messageInfo_DelegatorWithdrawInfo proto.InternalMessageInfo // ValidatorOutstandingRewardsRecord is used for import/export via genesis json. type ValidatorOutstandingRewardsRecord struct { // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` // outstanding_rewards represents the oustanding rewards of a validator. - OutstandingRewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=outstanding_rewards,json=outstandingRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"outstanding_rewards"` + OutstandingRewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=outstanding_rewards,json=outstandingRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"outstanding_rewards" yaml:"outstanding_rewards"` } func (m *ValidatorOutstandingRewardsRecord) Reset() { *m = ValidatorOutstandingRewardsRecord{} } func (m *ValidatorOutstandingRewardsRecord) String() string { return proto.CompactTextString(m) } func (*ValidatorOutstandingRewardsRecord) ProtoMessage() {} func (*ValidatorOutstandingRewardsRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{1} + return fileDescriptor_02ffc8100ab19bc0, []int{1} } func (m *ValidatorOutstandingRewardsRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -114,16 +113,16 @@ var xxx_messageInfo_ValidatorOutstandingRewardsRecord proto.InternalMessageInfo // json. type ValidatorAccumulatedCommissionRecord struct { // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` // accumulated is the accumulated commission of a validator. - Accumulated ValidatorAccumulatedCommission `protobuf:"bytes,2,opt,name=accumulated,proto3" json:"accumulated"` + Accumulated ValidatorAccumulatedCommission `protobuf:"bytes,2,opt,name=accumulated,proto3" json:"accumulated" yaml:"accumulated"` } func (m *ValidatorAccumulatedCommissionRecord) Reset() { *m = ValidatorAccumulatedCommissionRecord{} } func (m *ValidatorAccumulatedCommissionRecord) String() string { return proto.CompactTextString(m) } func (*ValidatorAccumulatedCommissionRecord) ProtoMessage() {} func (*ValidatorAccumulatedCommissionRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{2} + return fileDescriptor_02ffc8100ab19bc0, []int{2} } func (m *ValidatorAccumulatedCommissionRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -156,18 +155,18 @@ var xxx_messageInfo_ValidatorAccumulatedCommissionRecord proto.InternalMessageIn // json. type ValidatorHistoricalRewardsRecord struct { // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` // period defines the period the historical rewards apply to. Period uint64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"` // rewards defines the historical rewards of a validator. - Rewards ValidatorHistoricalRewards `protobuf:"bytes,3,opt,name=rewards,proto3" json:"rewards"` + Rewards ValidatorHistoricalRewards `protobuf:"bytes,3,opt,name=rewards,proto3" json:"rewards" yaml:"rewards"` } func (m *ValidatorHistoricalRewardsRecord) Reset() { *m = ValidatorHistoricalRewardsRecord{} } func (m *ValidatorHistoricalRewardsRecord) String() string { return proto.CompactTextString(m) } func (*ValidatorHistoricalRewardsRecord) ProtoMessage() {} func (*ValidatorHistoricalRewardsRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{3} + return fileDescriptor_02ffc8100ab19bc0, []int{3} } func (m *ValidatorHistoricalRewardsRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -199,16 +198,16 @@ var xxx_messageInfo_ValidatorHistoricalRewardsRecord proto.InternalMessageInfo // ValidatorCurrentRewardsRecord is used for import / export via genesis json. type ValidatorCurrentRewardsRecord struct { // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` // rewards defines the current rewards of a validator. - Rewards ValidatorCurrentRewards `protobuf:"bytes,2,opt,name=rewards,proto3" json:"rewards"` + Rewards ValidatorCurrentRewards `protobuf:"bytes,2,opt,name=rewards,proto3" json:"rewards" yaml:"rewards"` } func (m *ValidatorCurrentRewardsRecord) Reset() { *m = ValidatorCurrentRewardsRecord{} } func (m *ValidatorCurrentRewardsRecord) String() string { return proto.CompactTextString(m) } func (*ValidatorCurrentRewardsRecord) ProtoMessage() {} func (*ValidatorCurrentRewardsRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{4} + return fileDescriptor_02ffc8100ab19bc0, []int{4} } func (m *ValidatorCurrentRewardsRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,18 +239,18 @@ var xxx_messageInfo_ValidatorCurrentRewardsRecord proto.InternalMessageInfo // DelegatorStartingInfoRecord used for import / export via genesis json. type DelegatorStartingInfoRecord struct { // delegator_address is the address of the delegator. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` // starting_info defines the starting info of a delegator. - StartingInfo DelegatorStartingInfo `protobuf:"bytes,3,opt,name=starting_info,json=startingInfo,proto3" json:"starting_info"` + StartingInfo DelegatorStartingInfo `protobuf:"bytes,3,opt,name=starting_info,json=startingInfo,proto3" json:"starting_info" yaml:"starting_info"` } func (m *DelegatorStartingInfoRecord) Reset() { *m = DelegatorStartingInfoRecord{} } func (m *DelegatorStartingInfoRecord) String() string { return proto.CompactTextString(m) } func (*DelegatorStartingInfoRecord) ProtoMessage() {} func (*DelegatorStartingInfoRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{5} + return fileDescriptor_02ffc8100ab19bc0, []int{5} } func (m *DelegatorStartingInfoRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -283,20 +282,20 @@ var xxx_messageInfo_DelegatorStartingInfoRecord proto.InternalMessageInfo // ValidatorSlashEventRecord is used for import / export via genesis json. type ValidatorSlashEventRecord struct { // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` // height defines the block height at which the slash event occured. Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // period is the period of the slash event. Period uint64 `protobuf:"varint,3,opt,name=period,proto3" json:"period,omitempty"` // validator_slash_event describes the slash event. - ValidatorSlashEvent ValidatorSlashEvent `protobuf:"bytes,4,opt,name=validator_slash_event,json=validatorSlashEvent,proto3" json:"validator_slash_event"` + ValidatorSlashEvent ValidatorSlashEvent `protobuf:"bytes,4,opt,name=validator_slash_event,json=validatorSlashEvent,proto3" json:"validator_slash_event" yaml:"event"` } func (m *ValidatorSlashEventRecord) Reset() { *m = ValidatorSlashEventRecord{} } func (m *ValidatorSlashEventRecord) String() string { return proto.CompactTextString(m) } func (*ValidatorSlashEventRecord) ProtoMessage() {} func (*ValidatorSlashEventRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{6} + return fileDescriptor_02ffc8100ab19bc0, []int{6} } func (m *ValidatorSlashEventRecord) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -328,32 +327,32 @@ var xxx_messageInfo_ValidatorSlashEventRecord proto.InternalMessageInfo // GenesisState defines the distribution module's genesis state. type GenesisState struct { // params defines all the paramaters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params" yaml:"params"` // fee_pool defines the fee pool at genesis. - FeePool FeePool `protobuf:"bytes,2,opt,name=fee_pool,json=feePool,proto3" json:"fee_pool"` + FeePool FeePool `protobuf:"bytes,2,opt,name=fee_pool,json=feePool,proto3" json:"fee_pool" yaml:"fee_pool"` // fee_pool defines the delegator withdraw infos at genesis. - DelegatorWithdrawInfos []DelegatorWithdrawInfo `protobuf:"bytes,3,rep,name=delegator_withdraw_infos,json=delegatorWithdrawInfos,proto3" json:"delegator_withdraw_infos"` + DelegatorWithdrawInfos []DelegatorWithdrawInfo `protobuf:"bytes,3,rep,name=delegator_withdraw_infos,json=delegatorWithdrawInfos,proto3" json:"delegator_withdraw_infos" yaml:"delegator_withdraw_infos"` // fee_pool defines the previous proposer at genesis. - PreviousProposer string `protobuf:"bytes,4,opt,name=previous_proposer,json=previousProposer,proto3" json:"previous_proposer,omitempty"` + PreviousProposer string `protobuf:"bytes,4,opt,name=previous_proposer,json=previousProposer,proto3" json:"previous_proposer,omitempty" yaml:"previous_proposer"` // fee_pool defines the outstanding rewards of all validators at genesis. - OutstandingRewards []ValidatorOutstandingRewardsRecord `protobuf:"bytes,5,rep,name=outstanding_rewards,json=outstandingRewards,proto3" json:"outstanding_rewards"` + OutstandingRewards []ValidatorOutstandingRewardsRecord `protobuf:"bytes,5,rep,name=outstanding_rewards,json=outstandingRewards,proto3" json:"outstanding_rewards" yaml:"outstanding_rewards"` // fee_pool defines the accumulated commisions of all validators at genesis. - ValidatorAccumulatedCommissions []ValidatorAccumulatedCommissionRecord `protobuf:"bytes,6,rep,name=validator_accumulated_commissions,json=validatorAccumulatedCommissions,proto3" json:"validator_accumulated_commissions"` + ValidatorAccumulatedCommissions []ValidatorAccumulatedCommissionRecord `protobuf:"bytes,6,rep,name=validator_accumulated_commissions,json=validatorAccumulatedCommissions,proto3" json:"validator_accumulated_commissions" yaml:"validator_accumulated_commissions"` // fee_pool defines the historical rewards of all validators at genesis. - ValidatorHistoricalRewards []ValidatorHistoricalRewardsRecord `protobuf:"bytes,7,rep,name=validator_historical_rewards,json=validatorHistoricalRewards,proto3" json:"validator_historical_rewards"` + ValidatorHistoricalRewards []ValidatorHistoricalRewardsRecord `protobuf:"bytes,7,rep,name=validator_historical_rewards,json=validatorHistoricalRewards,proto3" json:"validator_historical_rewards" yaml:"validator_historical_rewards"` // fee_pool defines the current rewards of all validators at genesis. - ValidatorCurrentRewards []ValidatorCurrentRewardsRecord `protobuf:"bytes,8,rep,name=validator_current_rewards,json=validatorCurrentRewards,proto3" json:"validator_current_rewards"` + ValidatorCurrentRewards []ValidatorCurrentRewardsRecord `protobuf:"bytes,8,rep,name=validator_current_rewards,json=validatorCurrentRewards,proto3" json:"validator_current_rewards" yaml:"validator_current_rewards"` // fee_pool defines the delegator starting infos at genesis. - DelegatorStartingInfos []DelegatorStartingInfoRecord `protobuf:"bytes,9,rep,name=delegator_starting_infos,json=delegatorStartingInfos,proto3" json:"delegator_starting_infos"` + DelegatorStartingInfos []DelegatorStartingInfoRecord `protobuf:"bytes,9,rep,name=delegator_starting_infos,json=delegatorStartingInfos,proto3" json:"delegator_starting_infos" yaml:"delegator_starting_infos"` // fee_pool defines the validator slash events at genesis. - ValidatorSlashEvents []ValidatorSlashEventRecord `protobuf:"bytes,10,rep,name=validator_slash_events,json=validatorSlashEvents,proto3" json:"validator_slash_events"` + ValidatorSlashEvents []ValidatorSlashEventRecord `protobuf:"bytes,10,rep,name=validator_slash_events,json=validatorSlashEvents,proto3" json:"validator_slash_events" yaml:"validator_slash_events"` } 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_76eed0f9489db580, []int{7} + return fileDescriptor_02ffc8100ab19bc0, []int{7} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -383,78 +382,89 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo func init() { - proto.RegisterType((*DelegatorWithdrawInfo)(nil), "cosmos.distribution.v1beta1.DelegatorWithdrawInfo") - proto.RegisterType((*ValidatorOutstandingRewardsRecord)(nil), "cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord") - proto.RegisterType((*ValidatorAccumulatedCommissionRecord)(nil), "cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord") - proto.RegisterType((*ValidatorHistoricalRewardsRecord)(nil), "cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord") - proto.RegisterType((*ValidatorCurrentRewardsRecord)(nil), "cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord") - proto.RegisterType((*DelegatorStartingInfoRecord)(nil), "cosmos.distribution.v1beta1.DelegatorStartingInfoRecord") - proto.RegisterType((*ValidatorSlashEventRecord)(nil), "cosmos.distribution.v1beta1.ValidatorSlashEventRecord") - proto.RegisterType((*GenesisState)(nil), "cosmos.distribution.v1beta1.GenesisState") + proto.RegisterType((*DelegatorWithdrawInfo)(nil), "liquidstaking.distribution.v1beta1.DelegatorWithdrawInfo") + proto.RegisterType((*ValidatorOutstandingRewardsRecord)(nil), "liquidstaking.distribution.v1beta1.ValidatorOutstandingRewardsRecord") + proto.RegisterType((*ValidatorAccumulatedCommissionRecord)(nil), "liquidstaking.distribution.v1beta1.ValidatorAccumulatedCommissionRecord") + proto.RegisterType((*ValidatorHistoricalRewardsRecord)(nil), "liquidstaking.distribution.v1beta1.ValidatorHistoricalRewardsRecord") + proto.RegisterType((*ValidatorCurrentRewardsRecord)(nil), "liquidstaking.distribution.v1beta1.ValidatorCurrentRewardsRecord") + proto.RegisterType((*DelegatorStartingInfoRecord)(nil), "liquidstaking.distribution.v1beta1.DelegatorStartingInfoRecord") + proto.RegisterType((*ValidatorSlashEventRecord)(nil), "liquidstaking.distribution.v1beta1.ValidatorSlashEventRecord") + proto.RegisterType((*GenesisState)(nil), "liquidstaking.distribution.v1beta1.GenesisState") } func init() { - proto.RegisterFile("cosmos/distribution/v1beta1/genesis.proto", fileDescriptor_76eed0f9489db580) -} - -var fileDescriptor_76eed0f9489db580 = []byte{ - // 896 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xeb, 0x44, - 0x14, 0x8e, 0x93, 0x92, 0x9b, 0x3b, 0xb9, 0x88, 0x8b, 0x6f, 0x6f, 0x71, 0x7b, 0x8b, 0xd3, 0x96, - 0x2e, 0x8a, 0x50, 0x1d, 0x9a, 0x22, 0x40, 0x45, 0x20, 0x25, 0x69, 0xf9, 0x59, 0xb5, 0x4a, 0x10, - 0x95, 0x90, 0x50, 0x34, 0xb1, 0x27, 0xce, 0x40, 0xe2, 0x89, 0x66, 0xc6, 0x6e, 0x91, 0x58, 0x21, - 0x21, 0x75, 0x89, 0x04, 0x0f, 0xd0, 0x25, 0x42, 0x62, 0xc7, 0x33, 0xa0, 0x2e, 0x2b, 0x56, 0x2c, - 0x50, 0x41, 0x29, 0x0b, 0x5e, 0x81, 0x1d, 0xf2, 0x78, 0xfc, 0xa7, 0xba, 0x26, 0x2d, 0xed, 0xaa, - 0x1d, 0xcf, 0xf9, 0xf9, 0xbe, 0x73, 0xbe, 0x9c, 0x33, 0xe0, 0x55, 0x93, 0xb0, 0x31, 0x61, 0x75, - 0x0b, 0x33, 0x4e, 0x71, 0xdf, 0xe5, 0x98, 0x38, 0x75, 0x6f, 0xab, 0x8f, 0x38, 0xdc, 0xaa, 0xdb, - 0xc8, 0x41, 0x0c, 0x33, 0x63, 0x42, 0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74, 0x74, 0x39, 0xa4, 0x1c, 0x3b, 0xb6, 0x3f, 0x3a, 0x62, 0x1a, 0x77, 0x31, - 0x40, 0x32, 0xab, 0x51, 0xbc, 0x71, 0x35, 0x3e, 0x03, 0xcf, 0x33, 0x89, 0xb1, 0x87, 0x9d, 0x01, - 0x91, 0xfd, 0x6d, 0xe4, 0xd6, 0x24, 0x93, 0x9e, 0xac, 0xc8, 0x23, 0x96, 0xf8, 0x96, 0x28, 0xcb, - 0x49, 0x11, 0x2c, 0x46, 0xb5, 0xec, 0x8e, 0x20, 0x1b, 0xee, 0x79, 0xa2, 0x9c, 0x77, 0xac, 0xdf, - 0x21, 0xc2, 0xf6, 0x90, 0x87, 0xfa, 0x0d, 0x4e, 0x09, 0x5d, 0x97, 0x52, 0xba, 0xfe, 0x1c, 0x3c, - 0x8d, 0xd3, 0x32, 0x1f, 0x54, 0x0f, 0xf9, 0xa8, 0xb4, 0x39, 0x51, 0x85, 0xd7, 0x67, 0x53, 0x46, - 0xcc, 0x46, 0xd6, 0xe0, 0x89, 0x77, 0xf5, 0x2a, 0x51, 0x8a, 0x8b, 0x0a, 0x78, 0xf4, 0x41, 0xb0, - 0x0c, 0xbb, 0x1c, 0x72, 0xa4, 0x36, 0x41, 0x79, 0x02, 0x29, 0x1c, 0x07, 0x94, 0xab, 0x8d, 0x57, - 0x72, 0xf3, 0x1e, 0x08, 0x53, 0x99, 0x4a, 0x3a, 0xaa, 0x7b, 0xa0, 0x32, 0x40, 0xa8, 0x37, 0x21, - 0x64, 0x24, 0x65, 0xbd, 0x9e, 0x1b, 0xe4, 0x7d, 0x84, 0x0e, 0x08, 0x19, 0x85, 0x32, 0x1e, 0x04, - 0x47, 0x95, 0x02, 0x2d, 0x16, 0x67, 0xb4, 0xa0, 0x7c, 0x61, 0xf8, 0xbf, 0xfc, 0xd2, 0xec, 0xca, - 0x48, 0xee, 0x4c, 0x99, 0x64, 0xc1, 0xca, 0xba, 0x14, 0x4a, 0x9e, 0x50, 0xe4, 0x61, 0xe2, 0x8a, - 0x55, 0x3c, 0x21, 0x0c, 0x51, 0xd1, 0x80, 0xdc, 0xde, 0x87, 0x2e, 0x07, 0xd2, 0x43, 0x75, 0xb3, - 0x97, 0xd2, 0x73, 0x02, 0xf5, 0x7b, 0xb3, 0x75, 0xf2, 0xba, 0xcd, 0x29, 0x19, 0x64, 0xec, 0x21, - 0xf5, 0x3b, 0x05, 0xac, 0x26, 0xa4, 0x1b, 0x8f, 0xf0, 0x9e, 0x19, 0x0d, 0x78, 0xa6, 0x95, 0x05, - 0x8a, 0xe6, 0xff, 0x58, 0x12, 0x29, 0x20, 0x35, 0x2f, 0xd7, 0x96, 0xa9, 0xdf, 0x28, 0x60, 0x39, - 0x46, 0x35, 0x8c, 0xc6, 0x70, 0x54, 0x96, 0x07, 0x02, 0xd0, 0xbb, 0xb7, 0x1c, 0xe3, 0x29, 0x30, - 0x4b, 0xde, 0xb5, 0x76, 0xea, 0x57, 0x60, 0x31, 0x86, 0x61, 0x06, 0x13, 0x34, 0xc2, 0x50, 0x11, - 0x18, 0x76, 0x6e, 0x33, 0x7e, 0x53, 0x00, 0x5e, 0xf2, 0xb2, 0x8d, 0xd4, 0xe3, 0xa4, 0x9a, 0x53, - 0x63, 0x8e, 0x69, 0x0f, 0x45, 0xf2, 0xb7, 0x6f, 0x3e, 0xe7, 0x52, 0xa9, 0x63, 0x4d, 0x27, 0x4d, - 0x98, 0x4a, 0xc1, 0x42, 0xe6, 0x60, 0x61, 0x1a, 0x10, 0x79, 0xdf, 0xbc, 0xe9, 0x64, 0x49, 0x65, - 0x9d, 0xcf, 0x98, 0x2f, 0x89, 0x15, 0xd4, 0xda, 0xff, 0x61, 0xaa, 0x2b, 0x67, 0x53, 0x5d, 0x39, - 0x9f, 0xea, 0xca, 0x9f, 0x53, 0x5d, 0xf9, 0xf6, 0x52, 0x2f, 0x9c, 0x5f, 0xea, 0x85, 0xdf, 0x2e, - 0xf5, 0xc2, 0xa7, 0x5b, 0xb9, 0x4f, 0xaf, 0xe3, 0xf4, 0xf3, 0x59, 0xbc, 0xc4, 0xfa, 0x65, 0xf1, - 0x2a, 0xde, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0x18, 0xd7, 0x00, 0x14, 0xe0, 0x0b, 0x00, 0x00, + proto.RegisterFile("distribution/v1beta1/genesis.proto", fileDescriptor_02ffc8100ab19bc0) +} + +var fileDescriptor_02ffc8100ab19bc0 = []byte{ + // 1058 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x3a, 0x25, 0x4d, 0xc7, 0x29, 0x0d, 0xdb, 0x7c, 0xb8, 0x6e, 0x6a, 0xa7, 0x03, 0xa8, + 0x11, 0x51, 0x6c, 0x1a, 0x0e, 0x88, 0x22, 0x40, 0xd9, 0xa4, 0xa5, 0x3d, 0x11, 0x26, 0x12, 0x08, + 0x2e, 0xd6, 0x78, 0x77, 0x62, 0x8f, 0xba, 0xde, 0x71, 0x77, 0x66, 0x1d, 0x22, 0x71, 0xa0, 0x37, + 0x8e, 0x9c, 0x81, 0x43, 0x84, 0x90, 0x40, 0x5c, 0xe1, 0xc6, 0xbd, 0xea, 0xb1, 0x47, 0x4e, 0x01, + 0x25, 0x17, 0xce, 0xf9, 0x03, 0x10, 0xda, 0x99, 0xd9, 0x2f, 0x7b, 0xdd, 0xc6, 0x49, 0x73, 0x4a, + 0x3c, 0x7e, 0xf3, 0x7b, 0xbf, 0xf7, 0x7b, 0x5f, 0x63, 0x00, 0x1d, 0xca, 0x85, 0x4f, 0x5b, 0x81, + 0xa0, 0xcc, 0x6b, 0xf4, 0x6f, 0xb7, 0x88, 0xc0, 0xb7, 0x1b, 0x6d, 0xe2, 0x11, 0x4e, 0x79, 0xbd, + 0xe7, 0x33, 0xc1, 0x4c, 0xe8, 0xd2, 0x47, 0x01, 0x75, 0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e, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x24, 0xeb, 0x29, 0x01, 0x0e, + 0x00, 0x00, } func (m *DelegatorWithdrawInfo) Marshal() (dAtA []byte, err error) { @@ -1207,7 +1217,10 @@ func (m *DelegatorWithdrawInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { @@ -1323,7 +1336,10 @@ func (m *ValidatorOutstandingRewardsRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { @@ -1438,7 +1454,10 @@ func (m *ValidatorAccumulatedCommissionRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { @@ -1572,7 +1591,10 @@ func (m *ValidatorHistoricalRewardsRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { @@ -1687,7 +1709,10 @@ func (m *ValidatorCurrentRewardsRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { @@ -1834,7 +1859,10 @@ func (m *DelegatorStartingInfoRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { @@ -1987,7 +2015,10 @@ func (m *ValidatorSlashEventRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { @@ -2373,7 +2404,10 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { diff --git a/x/distribution/types/msg.go b/x/distribution/types/msg.go index 2071ca0282e8..4cfbe2e55a4b 100644 --- a/x/distribution/types/msg.go +++ b/x/distribution/types/msg.go @@ -1,20 +1,25 @@ package types import ( + "github.com/cosmos/cosmos-sdk/codec/legacy" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // distribution message types const ( - TypeMsgSetWithdrawAddress = "set_withdraw_address" - TypeMsgWithdrawDelegatorReward = "withdraw_delegator_reward" - TypeMsgWithdrawValidatorCommission = "withdraw_validator_commission" - TypeMsgFundCommunityPool = "fund_community_pool" + TypeMsgSetWithdrawAddress = "set_withdraw_address" + TypeMsgWithdrawDelegatorReward = "withdraw_delegator_reward" + TypeMsgWithdrawValidatorCommission = "withdraw_validator_commission" + TypeMsgFundCommunityPool = "fund_community_pool" + TypeMsgWithdrawTokenizeShareRecordReward = "withdraw_tokenize_share_record_reward" + TypeMsgWithdrawAllTokenizeShareRecordReward = "withdraw_all_tokenize_share_record_reward" ) // Verify interface at compile time var _, _, _ sdk.Msg = &MsgSetWithdrawAddress{}, &MsgWithdrawDelegatorReward{}, &MsgWithdrawValidatorCommission{} +var _ sdk.Msg = &MsgWithdrawTokenizeShareRecordReward{} +var _ sdk.Msg = &MsgWithdrawAllTokenizeShareRecordReward{} func NewMsgSetWithdrawAddress(delAddr, withdrawAddr sdk.AccAddress) *MsgSetWithdrawAddress { return &MsgSetWithdrawAddress{ @@ -28,13 +33,16 @@ func (msg MsgSetWithdrawAddress) Type() string { return TypeMsgSetWithdrawAddre // Return address that must sign over msg.GetSignBytes() func (msg MsgSetWithdrawAddress) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } return []sdk.AccAddress{delegator} } // get the bytes for the message signer to sign on func (msg MsgSetWithdrawAddress) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -62,13 +70,16 @@ func (msg MsgWithdrawDelegatorReward) Type() string { return TypeMsgWithdrawDel // Return address that must sign over msg.GetSignBytes() func (msg MsgWithdrawDelegatorReward) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } return []sdk.AccAddress{delegator} } // get the bytes for the message signer to sign on func (msg MsgWithdrawDelegatorReward) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -100,7 +111,7 @@ func (msg MsgWithdrawValidatorCommission) GetSigners() []sdk.AccAddress { // get the bytes for the message signer to sign on func (msg MsgWithdrawValidatorCommission) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -130,14 +141,17 @@ func (msg MsgFundCommunityPool) Type() string { return TypeMsgFundCommunityPool // GetSigners returns the signer addresses that are expected to sign the result // of GetSignBytes. func (msg MsgFundCommunityPool) GetSigners() []sdk.AccAddress { - depositor, _ := sdk.AccAddressFromBech32(msg.Depositor) + depositor, err := sdk.AccAddressFromBech32(msg.Depositor) + if err != nil { + panic(err) + } return []sdk.AccAddress{depositor} } // GetSignBytes returns the raw bytes for a MsgFundCommunityPool message that // the expected signer needs to sign. func (msg MsgFundCommunityPool) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -151,3 +165,72 @@ func (msg MsgFundCommunityPool) ValidateBasic() error { } return nil } + +func NewMsgWithdrawTokenizeShareRecordReward(ownerAddr sdk.AccAddress, recordId uint64) *MsgWithdrawTokenizeShareRecordReward { + return &MsgWithdrawTokenizeShareRecordReward{ + OwnerAddress: ownerAddr.String(), + RecordId: recordId, + } +} + +func (msg MsgWithdrawTokenizeShareRecordReward) Route() string { return ModuleName } +func (msg MsgWithdrawTokenizeShareRecordReward) Type() string { + return TypeMsgWithdrawTokenizeShareRecordReward +} + +// Return address that must sign over msg.GetSignBytes() +func (msg MsgWithdrawTokenizeShareRecordReward) GetSigners() []sdk.AccAddress { + owner, err := sdk.AccAddressFromBech32(msg.OwnerAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{owner} +} + +// get the bytes for the message signer to sign on +func (msg MsgWithdrawTokenizeShareRecordReward) GetSignBytes() []byte { + bz := legacy.Cdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// quick validity check +func (msg MsgWithdrawTokenizeShareRecordReward) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.OwnerAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid owner address: %s", err) + } + return nil +} + +func NewMsgWithdrawAllTokenizeShareRecordReward(ownerAddr sdk.AccAddress) *MsgWithdrawAllTokenizeShareRecordReward { + return &MsgWithdrawAllTokenizeShareRecordReward{ + OwnerAddress: ownerAddr.String(), + } +} + +func (msg MsgWithdrawAllTokenizeShareRecordReward) Route() string { return ModuleName } +func (msg MsgWithdrawAllTokenizeShareRecordReward) Type() string { + return TypeMsgWithdrawAllTokenizeShareRecordReward +} + +// Return address that must sign over msg.GetSignBytes() +func (msg MsgWithdrawAllTokenizeShareRecordReward) GetSigners() []sdk.AccAddress { + owner, err := sdk.AccAddressFromBech32(msg.OwnerAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{owner} +} + +// get the bytes for the message signer to sign on +func (msg MsgWithdrawAllTokenizeShareRecordReward) GetSignBytes() []byte { + bz := legacy.Cdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// quick validity check +func (msg MsgWithdrawAllTokenizeShareRecordReward) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.OwnerAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid owner address: %s", err) + } + return nil +} diff --git a/x/distribution/types/proposal.go b/x/distribution/types/proposal.go index a60291b9eb24..2829df257c96 100644 --- a/x/distribution/types/proposal.go +++ b/x/distribution/types/proposal.go @@ -5,6 +5,7 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" + sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -17,7 +18,9 @@ const ( var _ govtypes.Content = &CommunityPoolSpendProposal{} func init() { - govtypes.RegisterProposalType(ProposalTypeCommunityPoolSpend) + // already registered in cosmos + // govtypes.RegisterProposalType(ProposalTypeCommunityPoolSpend) + // govtypes.RegisterProposalTypeCodec(&CommunityPoolSpendProposal{}, "cosmos-sdk/CommunityPoolSpendProposal") } // NewCommunityPoolSpendProposal creates a new community pool spend proposal. @@ -45,10 +48,10 @@ func (csp *CommunityPoolSpendProposal) ValidateBasic() error { return err } if !csp.Amount.IsValid() { - return ErrInvalidProposalAmount + return sdkdistr.ErrInvalidProposalAmount } if csp.Recipient == "" { - return ErrEmptyProposalRecipient + return sdkdistr.ErrEmptyProposalRecipient } return nil diff --git a/x/distribution/types/query.go b/x/distribution/types/query.go index ef3d34ceae5a..caaf2b7860be 100644 --- a/x/distribution/types/query.go +++ b/x/distribution/types/query.go @@ -15,7 +15,8 @@ type QueryDelegatorTotalRewardsResponse struct { } // NewQueryDelegatorTotalRewardsResponse constructs a QueryDelegatorTotalRewardsResponse -func NewQueryDelegatorTotalRewardsResponse(rewards []DelegationDelegatorReward, total sdk.DecCoins) QueryDelegatorTotalRewardsResponse { +func NewQueryDelegatorTotalRewardsResponse(rewards []DelegationDelegatorReward, + total sdk.DecCoins) QueryDelegatorTotalRewardsResponse { return QueryDelegatorTotalRewardsResponse{Rewards: rewards, Total: total} } @@ -33,6 +34,7 @@ func (res QueryDelegatorTotalRewardsResponse) String() string { // NewDelegationDelegatorReward constructs a DelegationDelegatorReward. //nolint:interfacer -func NewDelegationDelegatorReward(valAddr sdk.ValAddress, reward sdk.DecCoins) DelegationDelegatorReward { +func NewDelegationDelegatorReward(valAddr sdk.ValAddress, + reward sdk.DecCoins) DelegationDelegatorReward { return DelegationDelegatorReward{ValidatorAddress: valAddr.String(), Reward: reward} } diff --git a/x/distribution/types/query.pb.go b/x/distribution/types/query.pb.go index b6a794bfbf45..994972547c91 100644 --- a/x/distribution/types/query.pb.go +++ b/x/distribution/types/query.pb.go @@ -1,12 +1,11 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/distribution/v1beta1/query.proto +// source: distribution/v1beta1/query.proto package types import ( context "context" 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" query "github.com/cosmos/cosmos-sdk/types/query" @@ -41,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_5efd02cbc06efdc9, []int{0} + return fileDescriptor_bee02899ef89b167, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -80,7 +79,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_5efd02cbc06efdc9, []int{1} + return fileDescriptor_bee02899ef89b167, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -129,7 +128,7 @@ func (m *QueryValidatorOutstandingRewardsRequest) Reset() { func (m *QueryValidatorOutstandingRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryValidatorOutstandingRewardsRequest) ProtoMessage() {} func (*QueryValidatorOutstandingRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{2} + return fileDescriptor_bee02899ef89b167, []int{2} } func (m *QueryValidatorOutstandingRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -177,7 +176,7 @@ func (m *QueryValidatorOutstandingRewardsResponse) Reset() { func (m *QueryValidatorOutstandingRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryValidatorOutstandingRewardsResponse) ProtoMessage() {} func (*QueryValidatorOutstandingRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{3} + return fileDescriptor_bee02899ef89b167, []int{3} } func (m *QueryValidatorOutstandingRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -224,7 +223,7 @@ func (m *QueryValidatorCommissionRequest) Reset() { *m = QueryValidatorC func (m *QueryValidatorCommissionRequest) String() string { return proto.CompactTextString(m) } func (*QueryValidatorCommissionRequest) ProtoMessage() {} func (*QueryValidatorCommissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{4} + return fileDescriptor_bee02899ef89b167, []int{4} } func (m *QueryValidatorCommissionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -271,7 +270,7 @@ func (m *QueryValidatorCommissionResponse) Reset() { *m = QueryValidator func (m *QueryValidatorCommissionResponse) String() string { return proto.CompactTextString(m) } func (*QueryValidatorCommissionResponse) ProtoMessage() {} func (*QueryValidatorCommissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{5} + return fileDescriptor_bee02899ef89b167, []int{5} } func (m *QueryValidatorCommissionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -324,7 +323,7 @@ func (m *QueryValidatorSlashesRequest) Reset() { *m = QueryValidatorSlas func (m *QueryValidatorSlashesRequest) String() string { return proto.CompactTextString(m) } func (*QueryValidatorSlashesRequest) ProtoMessage() {} func (*QueryValidatorSlashesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{6} + return fileDescriptor_bee02899ef89b167, []int{6} } func (m *QueryValidatorSlashesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -366,7 +365,7 @@ func (m *QueryValidatorSlashesResponse) Reset() { *m = QueryValidatorSla func (m *QueryValidatorSlashesResponse) String() string { return proto.CompactTextString(m) } func (*QueryValidatorSlashesResponse) ProtoMessage() {} func (*QueryValidatorSlashesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{7} + return fileDescriptor_bee02899ef89b167, []int{7} } func (m *QueryValidatorSlashesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -422,7 +421,7 @@ func (m *QueryDelegationRewardsRequest) Reset() { *m = QueryDelegationRe func (m *QueryDelegationRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDelegationRewardsRequest) ProtoMessage() {} func (*QueryDelegationRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{8} + return fileDescriptor_bee02899ef89b167, []int{8} } func (m *QueryDelegationRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -462,7 +461,7 @@ func (m *QueryDelegationRewardsResponse) Reset() { *m = QueryDelegationR func (m *QueryDelegationRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDelegationRewardsResponse) ProtoMessage() {} func (*QueryDelegationRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{9} + return fileDescriptor_bee02899ef89b167, []int{9} } func (m *QueryDelegationRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -509,7 +508,7 @@ func (m *QueryDelegationTotalRewardsRequest) Reset() { *m = QueryDelegat func (m *QueryDelegationTotalRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDelegationTotalRewardsRequest) ProtoMessage() {} func (*QueryDelegationTotalRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{10} + return fileDescriptor_bee02899ef89b167, []int{10} } func (m *QueryDelegationTotalRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -551,7 +550,7 @@ func (m *QueryDelegationTotalRewardsResponse) Reset() { *m = QueryDelega func (m *QueryDelegationTotalRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDelegationTotalRewardsResponse) ProtoMessage() {} func (*QueryDelegationTotalRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{11} + return fileDescriptor_bee02899ef89b167, []int{11} } func (m *QueryDelegationTotalRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -605,7 +604,7 @@ func (m *QueryDelegatorValidatorsRequest) Reset() { *m = QueryDelegatorV func (m *QueryDelegatorValidatorsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorValidatorsRequest) ProtoMessage() {} func (*QueryDelegatorValidatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{12} + return fileDescriptor_bee02899ef89b167, []int{12} } func (m *QueryDelegatorValidatorsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -645,7 +644,7 @@ func (m *QueryDelegatorValidatorsResponse) Reset() { *m = QueryDelegator func (m *QueryDelegatorValidatorsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorValidatorsResponse) ProtoMessage() {} func (*QueryDelegatorValidatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{13} + return fileDescriptor_bee02899ef89b167, []int{13} } func (m *QueryDelegatorValidatorsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -685,7 +684,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_5efd02cbc06efdc9, []int{14} + return fileDescriptor_bee02899ef89b167, []int{14} } func (m *QueryDelegatorWithdrawAddressRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -725,7 +724,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_5efd02cbc06efdc9, []int{15} + return fileDescriptor_bee02899ef89b167, []int{15} } func (m *QueryDelegatorWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -763,7 +762,7 @@ func (m *QueryCommunityPoolRequest) Reset() { *m = QueryCommunityPoolReq func (m *QueryCommunityPoolRequest) String() string { return proto.CompactTextString(m) } func (*QueryCommunityPoolRequest) ProtoMessage() {} func (*QueryCommunityPoolRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{16} + return fileDescriptor_bee02899ef89b167, []int{16} } func (m *QueryCommunityPoolRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -803,7 +802,7 @@ func (m *QueryCommunityPoolResponse) Reset() { *m = QueryCommunityPoolRe func (m *QueryCommunityPoolResponse) String() string { return proto.CompactTextString(m) } func (*QueryCommunityPoolResponse) ProtoMessage() {} func (*QueryCommunityPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{17} + return fileDescriptor_bee02899ef89b167, []int{17} } func (m *QueryCommunityPoolResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -839,104 +838,205 @@ func (m *QueryCommunityPoolResponse) GetPool() github_com_cosmos_cosmos_sdk_type return nil } -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.distribution.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.distribution.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryValidatorOutstandingRewardsRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest") - proto.RegisterType((*QueryValidatorOutstandingRewardsResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse") - proto.RegisterType((*QueryValidatorCommissionRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorCommissionRequest") - proto.RegisterType((*QueryValidatorCommissionResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorCommissionResponse") - proto.RegisterType((*QueryValidatorSlashesRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorSlashesRequest") - proto.RegisterType((*QueryValidatorSlashesResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorSlashesResponse") - proto.RegisterType((*QueryDelegationRewardsRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegationRewardsRequest") - proto.RegisterType((*QueryDelegationRewardsResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegationRewardsResponse") - proto.RegisterType((*QueryDelegationTotalRewardsRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest") - proto.RegisterType((*QueryDelegationTotalRewardsResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse") - proto.RegisterType((*QueryDelegatorValidatorsRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest") - proto.RegisterType((*QueryDelegatorValidatorsResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse") - proto.RegisterType((*QueryDelegatorWithdrawAddressRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest") - proto.RegisterType((*QueryDelegatorWithdrawAddressResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse") - proto.RegisterType((*QueryCommunityPoolRequest)(nil), "cosmos.distribution.v1beta1.QueryCommunityPoolRequest") - proto.RegisterType((*QueryCommunityPoolResponse)(nil), "cosmos.distribution.v1beta1.QueryCommunityPoolResponse") +type QueryTokenizeShareRecordRewardRequest struct { + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" yaml:"owner_address"` +} + +func (m *QueryTokenizeShareRecordRewardRequest) Reset() { *m = QueryTokenizeShareRecordRewardRequest{} } +func (m *QueryTokenizeShareRecordRewardRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordRewardRequest) ProtoMessage() {} +func (*QueryTokenizeShareRecordRewardRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_bee02899ef89b167, []int{18} +} +func (m *QueryTokenizeShareRecordRewardRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordRewardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordRewardRequest.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 *QueryTokenizeShareRecordRewardRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordRewardRequest.Merge(m, src) +} +func (m *QueryTokenizeShareRecordRewardRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordRewardRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordRewardRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTokenizeShareRecordRewardRequest proto.InternalMessageInfo + +type QueryTokenizeShareRecordRewardResponse struct { + // rewards defines all the rewards accrued by a delegator. + Rewards []TokenizeShareRecordReward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards"` + // total defines the sum of all the rewards. + Total github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"total"` +} + +func (m *QueryTokenizeShareRecordRewardResponse) Reset() { + *m = QueryTokenizeShareRecordRewardResponse{} +} +func (m *QueryTokenizeShareRecordRewardResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordRewardResponse) ProtoMessage() {} +func (*QueryTokenizeShareRecordRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bee02899ef89b167, []int{19} +} +func (m *QueryTokenizeShareRecordRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordRewardResponse.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 *QueryTokenizeShareRecordRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordRewardResponse.Merge(m, src) +} +func (m *QueryTokenizeShareRecordRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordRewardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTokenizeShareRecordRewardResponse proto.InternalMessageInfo + +func (m *QueryTokenizeShareRecordRewardResponse) GetRewards() []TokenizeShareRecordReward { + if m != nil { + return m.Rewards + } + return nil +} + +func (m *QueryTokenizeShareRecordRewardResponse) GetTotal() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Total + } + return nil } func init() { - proto.RegisterFile("cosmos/distribution/v1beta1/query.proto", fileDescriptor_5efd02cbc06efdc9) -} - -var fileDescriptor_5efd02cbc06efdc9 = []byte{ - // 1129 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0x3d, 0x6e, 0x9a, 0xd2, 0x57, 0x4a, 0xd2, 0x69, 0x84, 0xdc, 0x4d, 0xb0, 0xa3, 0x0d, - 0x25, 0x11, 0x51, 0xbc, 0x4d, 0x22, 0x15, 0x68, 0x41, 0x90, 0x5f, 0xa5, 0x52, 0xab, 0x36, 0x75, - 0xab, 0xa6, 0x70, 0xb1, 0xd6, 0xde, 0xd1, 0x7a, 0x55, 0x7b, 0xc7, 0xdd, 0x19, 0xc7, 0x44, 0x55, - 0x2f, 0x94, 0x4a, 0x5c, 0x90, 0x90, 0xb8, 0xf4, 0x98, 0x33, 0x67, 0x10, 0x12, 0x7f, 0x41, 0x8f, - 0x15, 0x48, 0xa8, 0x27, 0x40, 0x09, 0x42, 0xbd, 0x70, 0xe6, 0x5a, 0x79, 0x66, 0xd6, 0xde, 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0x98, 0x31, 0x6d, 0xb9, 0xcf, 0xc2, 0xec, - 0x41, 0xd8, 0xba, 0xdb, 0xf8, 0x7f, 0x04, 0xa9, 0x6e, 0xfd, 0x13, 0xaf, 0x0d, 0x10, 0x6b, 0x74, - 0xd3, 0xd7, 0xd6, 0x87, 0x91, 0x50, 0xcc, 0x77, 0x04, 0xf3, 0x0d, 0x7c, 0x7d, 0x18, 0xe6, 0xf6, - 0x01, 0x00, 0xff, 0x8c, 0xe0, 0x74, 0xa8, 0x47, 0xe3, 0x8b, 0xbd, 0x63, 0x8d, 0x6a, 0xf9, 0xda, - 0x07, 0x03, 0xdb, 0x29, 0xb0, 0x55, 0x01, 0xb6, 0x84, 0x17, 0x63, 0xc1, 0x8a, 0xbe, 0x6d, 0xbe, - 0xd1, 0xda, 0xd7, 0xaf, 0x3d, 0x3b, 0x48, 0xa3, 0xe7, 0x07, 0x69, 0xf4, 0xf7, 0x41, 0x1a, 0x7d, - 0x7f, 0x98, 0x4e, 0x3c, 0x3f, 0x4c, 0x27, 0x5e, 0x1c, 0xa6, 0x13, 0x5f, 0x2e, 0xc7, 0xce, 0x09, - 0x5f, 0x85, 0xd5, 0xc5, 0xd8, 0x50, 0x18, 0x17, 0x7f, 0x4e, 0x59, 0x7d, 0x15, 0x00, 0x00, 0xff, - 0xff, 0xc6, 0xc9, 0xca, 0xd1, 0x61, 0x12, 0x00, 0x00, + proto.RegisterType((*QueryParamsRequest)(nil), "liquidstaking.distribution.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "liquidstaking.distribution.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryValidatorOutstandingRewardsRequest)(nil), "liquidstaking.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest") + proto.RegisterType((*QueryValidatorOutstandingRewardsResponse)(nil), "liquidstaking.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse") + proto.RegisterType((*QueryValidatorCommissionRequest)(nil), "liquidstaking.distribution.v1beta1.QueryValidatorCommissionRequest") + proto.RegisterType((*QueryValidatorCommissionResponse)(nil), "liquidstaking.distribution.v1beta1.QueryValidatorCommissionResponse") + proto.RegisterType((*QueryValidatorSlashesRequest)(nil), "liquidstaking.distribution.v1beta1.QueryValidatorSlashesRequest") + proto.RegisterType((*QueryValidatorSlashesResponse)(nil), "liquidstaking.distribution.v1beta1.QueryValidatorSlashesResponse") + proto.RegisterType((*QueryDelegationRewardsRequest)(nil), "liquidstaking.distribution.v1beta1.QueryDelegationRewardsRequest") + proto.RegisterType((*QueryDelegationRewardsResponse)(nil), "liquidstaking.distribution.v1beta1.QueryDelegationRewardsResponse") + proto.RegisterType((*QueryDelegationTotalRewardsRequest)(nil), "liquidstaking.distribution.v1beta1.QueryDelegationTotalRewardsRequest") + proto.RegisterType((*QueryDelegationTotalRewardsResponse)(nil), "liquidstaking.distribution.v1beta1.QueryDelegationTotalRewardsResponse") + proto.RegisterType((*QueryDelegatorValidatorsRequest)(nil), "liquidstaking.distribution.v1beta1.QueryDelegatorValidatorsRequest") + proto.RegisterType((*QueryDelegatorValidatorsResponse)(nil), "liquidstaking.distribution.v1beta1.QueryDelegatorValidatorsResponse") + proto.RegisterType((*QueryDelegatorWithdrawAddressRequest)(nil), "liquidstaking.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest") + proto.RegisterType((*QueryDelegatorWithdrawAddressResponse)(nil), "liquidstaking.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse") + proto.RegisterType((*QueryCommunityPoolRequest)(nil), "liquidstaking.distribution.v1beta1.QueryCommunityPoolRequest") + proto.RegisterType((*QueryCommunityPoolResponse)(nil), "liquidstaking.distribution.v1beta1.QueryCommunityPoolResponse") + proto.RegisterType((*QueryTokenizeShareRecordRewardRequest)(nil), "liquidstaking.distribution.v1beta1.QueryTokenizeShareRecordRewardRequest") + proto.RegisterType((*QueryTokenizeShareRecordRewardResponse)(nil), "liquidstaking.distribution.v1beta1.QueryTokenizeShareRecordRewardResponse") +} + +func init() { proto.RegisterFile("distribution/v1beta1/query.proto", fileDescriptor_bee02899ef89b167) } + +var fileDescriptor_bee02899ef89b167 = []byte{ + // 1250 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcd, 0x6f, 0x1b, 0x45, + 0x1c, 0xf5, 0xb8, 0x69, 0x4a, 0xa7, 0x0d, 0x4d, 0xa7, 0x11, 0x72, 0xb7, 0xc1, 0x8e, 0x36, 0xb4, + 0x09, 0x8d, 0xe2, 0x55, 0x13, 0x89, 0x4a, 0x95, 0x02, 0xc4, 0x49, 0xd3, 0xd0, 0x46, 0x69, 0xeb, + 0x46, 0x0d, 0x5f, 0xc5, 0xda, 0x78, 0x47, 0xeb, 0x51, 0xd6, 0x3b, 0xce, 0xce, 0x6c, 0x42, 0x88, + 0x72, 0xa1, 0x02, 0x21, 0x01, 0x12, 0x88, 0x0b, 0xc7, 0x9c, 0x38, 0xf0, 0x5f, 0x20, 0x2e, 0x3d, + 0x56, 0xe2, 0xc2, 0xa9, 0x45, 0x49, 0x0f, 0x48, 0x08, 0xa9, 0xe2, 0xc0, 0x85, 0x0b, 0xf2, 0xec, + 0xac, 0xbd, 0x6b, 0xaf, 0xbf, 0xb2, 0xa9, 0x7a, 0xaa, 0xfb, 0x9b, 0x99, 0xb7, 0xef, 0xbd, 0x99, + 0xdf, 0xcc, 0x53, 0xe0, 0x88, 0x41, 0x18, 0x77, 0xc8, 0x9a, 0xcb, 0x09, 0xb5, 0xb5, 0xcd, 0x2b, + 0x6b, 0x98, 0xeb, 0x57, 0xb4, 0x0d, 0x17, 0x3b, 0xdb, 0xd9, 0x8a, 0x43, 0x39, 0x45, 0xaa, 0x45, + 0x36, 0x5c, 0x62, 0x30, 0xae, 0xaf, 0x13, 0xdb, 0xcc, 0x06, 0xe7, 0x67, 0xe5, 0x7c, 0xe5, 0x72, + 0x91, 0xb2, 0x32, 0x65, 0xda, 0x9a, 0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c, 0x1d, 0xc7, 0x94, 0xf7, 0x8e, 0x00, 0x49, 0x3a, 0xb0, 0x22, 0x1c, + 0x58, 0x46, 0x4b, 0x71, 0x1c, 0x68, 0xcc, 0x6e, 0xe8, 0x57, 0x00, 0x07, 0x42, 0xc1, 0x0b, 0xcd, + 0x74, 0x4d, 0x39, 0x2a, 0xce, 0x29, 0x6f, 0x1f, 0x76, 0xb9, 0x94, 0x39, 0x2d, 0x64, 0x4e, 0xa2, + 0x89, 0xb6, 0x32, 0x8b, 0xfe, 0xda, 0x42, 0x35, 0xbd, 0xa1, 0x2f, 0x93, 0xf0, 0x7c, 0xcb, 0xb8, + 0x83, 0xba, 0xdf, 0x84, 0x4e, 0xe9, 0x4f, 0xb9, 0x79, 0x14, 0x50, 0x52, 0x69, 0x5e, 0x28, 0x5d, + 0x42, 0x37, 0xdb, 0x2a, 0xdd, 0x09, 0xc5, 0xc9, 0x5d, 0x8d, 0x4b, 0xdc, 0x02, 0xab, 0x02, 0x17, + 0x1c, 0x81, 0xec, 0x3f, 0xcd, 0xb9, 0x4f, 0x1e, 0xed, 0xa7, 0xc1, 0xe3, 0xfd, 0x34, 0xf8, 0x63, + 0x3f, 0x0d, 0xbe, 0x3b, 0x48, 0x27, 0x1e, 0x1f, 0xa4, 0x13, 0xbf, 0x1f, 0xa4, 0x13, 0x1f, 0xce, + 0x07, 0xf2, 0x1a, 0xd9, 0xb0, 0xdc, 0xea, 0xb3, 0x46, 0xec, 0xa2, 0xe6, 0xe9, 0x21, 0x7c, 0x7b, + 0x52, 0x6a, 0x9a, 0x2c, 0x53, 0xc3, 0xb5, 0xb0, 0xf6, 0x69, 0x98, 0x8f, 0x48, 0x74, 0x6b, 0xfd, + 0xe2, 0xcf, 0x70, 0xd3, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x19, 0x75, 0x64, 0x77, 0x14, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -970,6 +1070,8 @@ type QueryClient interface { DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) // CommunityPool queries the community pool coins. CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) + // TokenizeShareRecordReward queries the tokenize share record rewards + TokenizeShareRecordReward(ctx context.Context, in *QueryTokenizeShareRecordRewardRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordRewardResponse, error) } type queryClient struct { @@ -982,7 +1084,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, "/cosmos.distribution.v1beta1.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -991,7 +1093,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . func (c *queryClient) ValidatorOutstandingRewards(ctx context.Context, in *QueryValidatorOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryValidatorOutstandingRewardsResponse, error) { out := new(QueryValidatorOutstandingRewardsResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/ValidatorOutstandingRewards", in, out, opts...) if err != nil { return nil, err } @@ -1000,7 +1102,7 @@ func (c *queryClient) ValidatorOutstandingRewards(ctx context.Context, in *Query func (c *queryClient) ValidatorCommission(ctx context.Context, in *QueryValidatorCommissionRequest, opts ...grpc.CallOption) (*QueryValidatorCommissionResponse, error) { out := new(QueryValidatorCommissionResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorCommission", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/ValidatorCommission", in, out, opts...) if err != nil { return nil, err } @@ -1009,7 +1111,7 @@ func (c *queryClient) ValidatorCommission(ctx context.Context, in *QueryValidato func (c *queryClient) ValidatorSlashes(ctx context.Context, in *QueryValidatorSlashesRequest, opts ...grpc.CallOption) (*QueryValidatorSlashesResponse, error) { out := new(QueryValidatorSlashesResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorSlashes", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/ValidatorSlashes", in, out, opts...) if err != nil { return nil, err } @@ -1018,7 +1120,7 @@ func (c *queryClient) ValidatorSlashes(ctx context.Context, in *QueryValidatorSl func (c *queryClient) DelegationRewards(ctx context.Context, in *QueryDelegationRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationRewardsResponse, error) { out := new(QueryDelegationRewardsResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegationRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/DelegationRewards", in, out, opts...) if err != nil { return nil, err } @@ -1027,7 +1129,7 @@ func (c *queryClient) DelegationRewards(ctx context.Context, in *QueryDelegation func (c *queryClient) DelegationTotalRewards(ctx context.Context, in *QueryDelegationTotalRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationTotalRewardsResponse, error) { out := new(QueryDelegationTotalRewardsResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegationTotalRewards", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/DelegationTotalRewards", in, out, opts...) if err != nil { return nil, err } @@ -1036,7 +1138,7 @@ func (c *queryClient) DelegationTotalRewards(ctx context.Context, in *QueryDeleg func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) { out := new(QueryDelegatorValidatorsResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegatorValidators", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/DelegatorValidators", in, out, opts...) if err != nil { return nil, err } @@ -1045,7 +1147,7 @@ func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegato func (c *queryClient) DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) { out := new(QueryDelegatorWithdrawAddressResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegatorWithdrawAddress", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/DelegatorWithdrawAddress", in, out, opts...) if err != nil { return nil, err } @@ -1054,7 +1156,16 @@ func (c *queryClient) DelegatorWithdrawAddress(ctx context.Context, in *QueryDel func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) { out := new(QueryCommunityPoolResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/CommunityPool", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/CommunityPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TokenizeShareRecordReward(ctx context.Context, in *QueryTokenizeShareRecordRewardRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordRewardResponse, error) { + out := new(QueryTokenizeShareRecordRewardResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Query/TokenizeShareRecordReward", in, out, opts...) if err != nil { return nil, err } @@ -1082,6 +1193,8 @@ type QueryServer interface { DelegatorWithdrawAddress(context.Context, *QueryDelegatorWithdrawAddressRequest) (*QueryDelegatorWithdrawAddressResponse, error) // CommunityPool queries the community pool coins. CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) + // TokenizeShareRecordReward queries the tokenize share record rewards + TokenizeShareRecordReward(context.Context, *QueryTokenizeShareRecordRewardRequest) (*QueryTokenizeShareRecordRewardResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1115,6 +1228,9 @@ func (*UnimplementedQueryServer) DelegatorWithdrawAddress(ctx context.Context, r func (*UnimplementedQueryServer) CommunityPool(ctx context.Context, req *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CommunityPool not implemented") } +func (*UnimplementedQueryServer) TokenizeShareRecordReward(ctx context.Context, req *QueryTokenizeShareRecordRewardRequest) (*QueryTokenizeShareRecordRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenizeShareRecordReward not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1130,7 +1246,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/Params", + FullMethod: "/liquidstaking.distribution.v1beta1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -1148,7 +1264,7 @@ func _Query_ValidatorOutstandingRewards_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards", + FullMethod: "/liquidstaking.distribution.v1beta1.Query/ValidatorOutstandingRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ValidatorOutstandingRewards(ctx, req.(*QueryValidatorOutstandingRewardsRequest)) @@ -1166,7 +1282,7 @@ func _Query_ValidatorCommission_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorCommission", + FullMethod: "/liquidstaking.distribution.v1beta1.Query/ValidatorCommission", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ValidatorCommission(ctx, req.(*QueryValidatorCommissionRequest)) @@ -1184,7 +1300,7 @@ func _Query_ValidatorSlashes_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorSlashes", + FullMethod: "/liquidstaking.distribution.v1beta1.Query/ValidatorSlashes", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).ValidatorSlashes(ctx, req.(*QueryValidatorSlashesRequest)) @@ -1202,7 +1318,7 @@ func _Query_DelegationRewards_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/DelegationRewards", + FullMethod: "/liquidstaking.distribution.v1beta1.Query/DelegationRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DelegationRewards(ctx, req.(*QueryDelegationRewardsRequest)) @@ -1220,7 +1336,7 @@ func _Query_DelegationTotalRewards_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/DelegationTotalRewards", + FullMethod: "/liquidstaking.distribution.v1beta1.Query/DelegationTotalRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DelegationTotalRewards(ctx, req.(*QueryDelegationTotalRewardsRequest)) @@ -1238,7 +1354,7 @@ func _Query_DelegatorValidators_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/DelegatorValidators", + FullMethod: "/liquidstaking.distribution.v1beta1.Query/DelegatorValidators", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DelegatorValidators(ctx, req.(*QueryDelegatorValidatorsRequest)) @@ -1256,7 +1372,7 @@ func _Query_DelegatorWithdrawAddress_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/DelegatorWithdrawAddress", + FullMethod: "/liquidstaking.distribution.v1beta1.Query/DelegatorWithdrawAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).DelegatorWithdrawAddress(ctx, req.(*QueryDelegatorWithdrawAddressRequest)) @@ -1274,7 +1390,7 @@ func _Query_CommunityPool_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/CommunityPool", + FullMethod: "/liquidstaking.distribution.v1beta1.Query/CommunityPool", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).CommunityPool(ctx, req.(*QueryCommunityPoolRequest)) @@ -1282,8 +1398,26 @@ func _Query_CommunityPool_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Query_TokenizeShareRecordReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenizeShareRecordRewardRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TokenizeShareRecordReward(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.distribution.v1beta1.Query/TokenizeShareRecordReward", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TokenizeShareRecordReward(ctx, req.(*QueryTokenizeShareRecordRewardRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.distribution.v1beta1.Query", + ServiceName: "liquidstaking.distribution.v1beta1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1322,9 +1456,13 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "CommunityPool", Handler: _Query_CommunityPool_Handler, }, + { + MethodName: "TokenizeShareRecordReward", + Handler: _Query_TokenizeShareRecordReward_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/distribution/v1beta1/query.proto", + Metadata: "distribution/v1beta1/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { @@ -1947,6 +2085,87 @@ func (m *QueryCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *QueryTokenizeShareRecordRewardRequest) 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 *QueryTokenizeShareRecordRewardRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordRewardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryTokenizeShareRecordRewardResponse) 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 *QueryTokenizeShareRecordRewardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Total) > 0 { + for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Total[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Rewards) > 0 { + for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2212,6 +2431,40 @@ func (m *QueryCommunityPoolResponse) Size() (n int) { return n } +func (m *QueryTokenizeShareRecordRewardRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTokenizeShareRecordRewardResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.Total) > 0 { + for _, e := range m.Total { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3817,6 +4070,206 @@ func (m *QueryCommunityPoolResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryTokenizeShareRecordRewardRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTokenizeShareRecordRewardRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTokenizeShareRecordRewardRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTokenizeShareRecordRewardResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTokenizeShareRecordRewardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTokenizeShareRecordRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rewards = append(m.Rewards, TokenizeShareRecordReward{}) + if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Total = append(m.Total, types.DecCoin{}) + if err := m.Total[len(m.Total)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/distribution/types/query.pb.gw.go b/x/distribution/types/query.pb.gw.go index 2b4ce81b8b81..84735a7d9412 100644 --- a/x/distribution/types/query.pb.gw.go +++ b/x/distribution/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/distribution/v1beta1/query.proto +// source: distribution/v1beta1/query.proto /* Package types is a reverse proxy. @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest @@ -487,17 +485,69 @@ func local_request_Query_CommunityPool_0(ctx context.Context, marshaler runtime. } +func request_Query_TokenizeShareRecordReward_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTokenizeShareRecordRewardRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["owner_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner_address") + } + + protoReq.OwnerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner_address", err) + } + + msg, err := client.TokenizeShareRecordReward(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TokenizeShareRecordReward_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTokenizeShareRecordRewardRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["owner_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner_address") + } + + protoReq.OwnerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner_address", err) + } + + msg, err := server.TokenizeShareRecordReward(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -505,7 +555,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -519,8 +568,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ValidatorOutstandingRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -528,7 +575,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ValidatorOutstandingRewards_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -542,8 +588,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ValidatorCommission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -551,7 +595,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ValidatorCommission_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -565,8 +608,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ValidatorSlashes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -574,7 +615,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ValidatorSlashes_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -588,8 +628,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DelegationRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -597,7 +635,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DelegationRewards_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -611,8 +648,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DelegationTotalRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -620,7 +655,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DelegationTotalRewards_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -634,8 +668,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DelegatorValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -643,7 +675,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DelegatorValidators_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -657,8 +688,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DelegatorWithdrawAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -666,7 +695,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DelegatorWithdrawAddress_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -680,8 +708,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_CommunityPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -689,7 +715,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_CommunityPool_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -700,6 +725,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TokenizeShareRecordReward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TokenizeShareRecordReward_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TokenizeShareRecordReward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -921,27 +966,49 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TokenizeShareRecordReward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TokenizeShareRecordReward_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TokenizeShareRecordReward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "distribution", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "distribution", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ValidatorOutstandingRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "outstanding_rewards"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ValidatorOutstandingRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "outstanding_rewards"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ValidatorCommission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "commission"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ValidatorCommission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "commission"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ValidatorSlashes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "slashes"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ValidatorSlashes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "slashes"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DelegationRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "rewards", "validator_address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DelegationRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "rewards", "validator_address"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DelegationTotalRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "rewards"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DelegationTotalRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "rewards"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DelegatorValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "validators"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DelegatorValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "validators"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DelegatorWithdrawAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "withdraw_address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DelegatorWithdrawAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "withdraw_address"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_CommunityPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "distribution", "v1beta1", "community_pool"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_CommunityPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "distribution", "v1beta1", "community_pool"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_TokenizeShareRecordReward_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"cosmos", "distribution", "v1beta1", "owner_address", "tokenize_share_record_rewards"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -962,4 +1029,6 @@ var ( forward_Query_DelegatorWithdrawAddress_0 = runtime.ForwardResponseMessage forward_Query_CommunityPool_0 = runtime.ForwardResponseMessage + + forward_Query_TokenizeShareRecordReward_0 = runtime.ForwardResponseMessage ) diff --git a/x/distribution/types/tx.pb.go b/x/distribution/types/tx.pb.go index 0eaca3be21c9..a38ea59f5c7b 100644 --- a/x/distribution/types/tx.pb.go +++ b/x/distribution/types/tx.pb.go @@ -1,15 +1,13 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/distribution/v1beta1/tx.proto +// source: distribution/v1beta1/tx.proto package types import ( context "context" 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/msgservice" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -35,15 +33,15 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgSetWithdrawAddress sets the withdraw address for // a delegator (or validator self-delegation). type MsgSetWithdrawAddress struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - WithdrawAddress string `protobuf:"bytes,2,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + WithdrawAddress string `protobuf:"bytes,2,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty" yaml:"withdraw_address"` } 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_ed4f433d965e58ca, []int{0} + return fileDescriptor_f0452d52deb0ca76, []int{0} } func (m *MsgSetWithdrawAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -80,7 +78,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_ed4f433d965e58ca, []int{1} + return fileDescriptor_f0452d52deb0ca76, []int{1} } func (m *MsgSetWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -112,15 +110,15 @@ var xxx_messageInfo_MsgSetWithdrawAddressResponse proto.InternalMessageInfo // MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator // from a single validator. type MsgWithdrawDelegatorReward struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` } func (m *MsgWithdrawDelegatorReward) Reset() { *m = MsgWithdrawDelegatorReward{} } func (m *MsgWithdrawDelegatorReward) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawDelegatorReward) ProtoMessage() {} func (*MsgWithdrawDelegatorReward) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{2} + return fileDescriptor_f0452d52deb0ca76, []int{2} } func (m *MsgWithdrawDelegatorReward) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -151,15 +149,13 @@ var xxx_messageInfo_MsgWithdrawDelegatorReward proto.InternalMessageInfo // MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. type MsgWithdrawDelegatorRewardResponse struct { - // Since: cosmos-sdk 0.46 - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` } func (m *MsgWithdrawDelegatorRewardResponse) Reset() { *m = MsgWithdrawDelegatorRewardResponse{} } func (m *MsgWithdrawDelegatorRewardResponse) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawDelegatorRewardResponse) ProtoMessage() {} func (*MsgWithdrawDelegatorRewardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{3} + return fileDescriptor_f0452d52deb0ca76, []int{3} } func (m *MsgWithdrawDelegatorRewardResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -188,24 +184,17 @@ func (m *MsgWithdrawDelegatorRewardResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawDelegatorRewardResponse proto.InternalMessageInfo -func (m *MsgWithdrawDelegatorRewardResponse) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Amount - } - return nil -} - // MsgWithdrawValidatorCommission withdraws the full commission to the validator // address. type MsgWithdrawValidatorCommission struct { - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` } func (m *MsgWithdrawValidatorCommission) Reset() { *m = MsgWithdrawValidatorCommission{} } func (m *MsgWithdrawValidatorCommission) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawValidatorCommission) ProtoMessage() {} func (*MsgWithdrawValidatorCommission) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{4} + return fileDescriptor_f0452d52deb0ca76, []int{4} } func (m *MsgWithdrawValidatorCommission) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -236,8 +225,6 @@ var xxx_messageInfo_MsgWithdrawValidatorCommission proto.InternalMessageInfo // MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. type MsgWithdrawValidatorCommissionResponse struct { - // Since: cosmos-sdk 0.46 - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` } func (m *MsgWithdrawValidatorCommissionResponse) Reset() { @@ -246,7 +233,7 @@ func (m *MsgWithdrawValidatorCommissionResponse) Reset() { func (m *MsgWithdrawValidatorCommissionResponse) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawValidatorCommissionResponse) ProtoMessage() {} func (*MsgWithdrawValidatorCommissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{5} + return fileDescriptor_f0452d52deb0ca76, []int{5} } func (m *MsgWithdrawValidatorCommissionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -275,13 +262,163 @@ func (m *MsgWithdrawValidatorCommissionResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawValidatorCommissionResponse proto.InternalMessageInfo -func (m *MsgWithdrawValidatorCommissionResponse) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Amount +type MsgWithdrawTokenizeShareRecordReward struct { + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" yaml:"owner_address"` + RecordId uint64 `protobuf:"varint,2,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty"` +} + +func (m *MsgWithdrawTokenizeShareRecordReward) Reset() { *m = MsgWithdrawTokenizeShareRecordReward{} } +func (m *MsgWithdrawTokenizeShareRecordReward) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawTokenizeShareRecordReward) ProtoMessage() {} +func (*MsgWithdrawTokenizeShareRecordReward) Descriptor() ([]byte, []int) { + return fileDescriptor_f0452d52deb0ca76, []int{6} +} +func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return nil +} +func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward.Merge(m, src) +} +func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawTokenizeShareRecordReward) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward proto.InternalMessageInfo + +type MsgWithdrawTokenizeShareRecordRewardResponse struct { +} + +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) Reset() { + *m = MsgWithdrawTokenizeShareRecordRewardResponse{} +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) String() string { + return proto.CompactTextString(m) +} +func (*MsgWithdrawTokenizeShareRecordRewardResponse) ProtoMessage() {} +func (*MsgWithdrawTokenizeShareRecordRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f0452d52deb0ca76, []int{7} +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse.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 *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse.Merge(m, src) +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse proto.InternalMessageInfo + +type MsgWithdrawAllTokenizeShareRecordReward struct { + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" yaml:"owner_address"` +} + +func (m *MsgWithdrawAllTokenizeShareRecordReward) Reset() { + *m = MsgWithdrawAllTokenizeShareRecordReward{} +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawAllTokenizeShareRecordReward) ProtoMessage() {} +func (*MsgWithdrawAllTokenizeShareRecordReward) Descriptor() ([]byte, []int) { + return fileDescriptor_f0452d52deb0ca76, []int{8} +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward.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 *MsgWithdrawAllTokenizeShareRecordReward) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward.Merge(m, src) +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward proto.InternalMessageInfo + +type MsgWithdrawAllTokenizeShareRecordRewardResponse struct { +} + +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) Reset() { + *m = MsgWithdrawAllTokenizeShareRecordRewardResponse{} +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) String() string { + return proto.CompactTextString(m) +} +func (*MsgWithdrawAllTokenizeShareRecordRewardResponse) ProtoMessage() {} +func (*MsgWithdrawAllTokenizeShareRecordRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f0452d52deb0ca76, []int{9} +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse.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 *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse.Merge(m, src) +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse.DiscardUnknown(m) } +var xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse proto.InternalMessageInfo + // MsgFundCommunityPool allows an account to directly // fund the community pool. type MsgFundCommunityPool struct { @@ -293,7 +430,7 @@ func (m *MsgFundCommunityPool) Reset() { *m = MsgFundCommunityPool{} } func (m *MsgFundCommunityPool) String() string { return proto.CompactTextString(m) } func (*MsgFundCommunityPool) ProtoMessage() {} func (*MsgFundCommunityPool) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{6} + return fileDescriptor_f0452d52deb0ca76, []int{10} } func (m *MsgFundCommunityPool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -330,7 +467,7 @@ func (m *MsgFundCommunityPoolResponse) Reset() { *m = MsgFundCommunityPo func (m *MsgFundCommunityPoolResponse) String() string { return proto.CompactTextString(m) } func (*MsgFundCommunityPoolResponse) ProtoMessage() {} func (*MsgFundCommunityPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{7} + return fileDescriptor_f0452d52deb0ca76, []int{11} } func (m *MsgFundCommunityPoolResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,59 +497,70 @@ func (m *MsgFundCommunityPoolResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgFundCommunityPoolResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgSetWithdrawAddress)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddress") - proto.RegisterType((*MsgSetWithdrawAddressResponse)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse") - proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward") - proto.RegisterType((*MsgWithdrawDelegatorRewardResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse") - proto.RegisterType((*MsgWithdrawValidatorCommission)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission") - proto.RegisterType((*MsgWithdrawValidatorCommissionResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse") - proto.RegisterType((*MsgFundCommunityPool)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPool") - proto.RegisterType((*MsgFundCommunityPoolResponse)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse") -} - -func init() { - proto.RegisterFile("cosmos/distribution/v1beta1/tx.proto", fileDescriptor_ed4f433d965e58ca) -} - -var fileDescriptor_ed4f433d965e58ca = []byte{ - // 589 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xde, 0xb1, 0x52, 0xe8, 0x78, 0x30, 0x59, 0xa2, 0x4d, 0xb7, 0x3a, 0x29, 0x8b, 0x48, 0x10, - 0xba, 0x6b, 0x22, 0x28, 0xc6, 0x83, 0x98, 0x58, 0x6f, 0x41, 0x49, 0x41, 0xc1, 0x4b, 0xd9, 0x64, - 0x86, 0xe9, 0x60, 0x76, 0x27, 0xec, 0x4c, 0x92, 0xf6, 0xa8, 0x08, 0xea, 0x41, 0x10, 0xfc, 0x01, - 0xf6, 0x28, 0x9e, 0x3c, 0xf8, 0x0f, 0xbc, 0x04, 0xbd, 0x14, 0x4f, 0x9e, 0x54, 0x92, 0x83, 0xfe, - 0x0c, 0x49, 0x76, 0x76, 0x9b, 0x90, 0x4d, 0xb6, 0xb5, 0xd2, 0xd3, 0x2c, 0xf3, 0xde, 0xf7, 0xcd, - 0xf7, 0xbd, 0x7d, 0x6f, 0x06, 0x5e, 0x6a, 0x70, 0xe1, 0x72, 0x61, 0x63, 0x26, 0xa4, 0xcf, 0xea, - 0x6d, 0xc9, 0xb8, 0x67, 0x77, 0x0a, 0x75, 0x22, 0x9d, 0x82, 0x2d, 0x77, 0xac, 0x96, 0xcf, 0x25, - 0xd7, 0x57, 0x83, 0x2c, 0x6b, 0x3c, 0xcb, 0x52, 0x59, 0x46, 0x86, 0x72, 0xca, 0x47, 0x79, 0xf6, - 0xf0, 0x2b, 0x80, 0x18, 0x48, 0x11, 0xd7, 0x1d, 0x41, 0x22, 0xc2, 0x06, 0x67, 0x9e, 0x8a, 0xaf, - 0x04, 0xf1, 0xad, 0x00, 0xa8, 0xf8, 0x83, 0xd0, 0xb2, 0x82, 0xba, 0x82, 0xda, 0x9d, 0xc2, 0x70, - 0x09, 0x02, 0xe6, 0x67, 0x00, 0xcf, 0x55, 0x05, 0xdd, 0x24, 0xf2, 0x11, 0x93, 0xdb, 0xd8, 0x77, - 0xba, 0x77, 0x30, 0xf6, 0x89, 0x10, 0xfa, 0x06, 0x4c, 0x63, 0xd2, 0x24, 0xd4, 0x91, 0xdc, 0xdf, - 0x72, 0x82, 0xcd, 0x2c, 0x58, 0x03, 0xf9, 0xa5, 0x72, 0xf6, 0xdb, 0xa7, 0xf5, 0x8c, 0xe2, 0x57, - 0xe9, 0x9b, 0xd2, 0x67, 0x1e, 0xad, 0xa5, 0x22, 0x48, 0x48, 0x53, 0x81, 0xa9, 0xae, 0x62, 0x8e, - 0x58, 0x4e, 0x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0xf3, 0x44, 0x4e, 0xd7, 0xaf, 0xc3, 0x25, - 0x4c, 0x5a, 0x5c, 0x30, 0xc9, 0xfd, 0xc4, 0x16, 0x3c, 0x48, 0x2d, 0x9d, 0x1f, 0xaf, 0xf2, 0xc1, - 0xbe, 0x89, 0xe0, 0x85, 0x38, 0x33, 0x61, 0x49, 0x8b, 0xbd, 0xd3, 0x70, 0xa1, 0x2a, 0xa8, 0xfe, - 0x1c, 0x40, 0x3d, 0xe6, 0x32, 0x29, 0x5a, 0x73, 0xae, 0x3b, 0x2b, 0x76, 0x76, 0x8d, 0xd2, 0xd1, - 0x31, 0xd1, 0x1f, 0x7e, 0x0b, 0xe0, 0xf2, 0xac, 0x61, 0xbf, 0x91, 0xc4, 0x3b, 0x03, 0x68, 0xdc, - 0xfe, 0x47, 0x60, 0xa4, 0xea, 0x1d, 0x80, 0xab, 0xf3, 0x26, 0xe5, 0xd6, 0x61, 0x0f, 0x88, 0x01, - 0x1b, 0x95, 0x63, 0x80, 0x23, 0x85, 0x4f, 0x01, 0x4c, 0x4f, 0x77, 0x6c, 0x21, 0x89, 0x7a, 0x0a, - 0x62, 0xdc, 0x3c, 0x32, 0x24, 0xd4, 0x50, 0xbe, 0xff, 0xbe, 0x8f, 0x40, 0xaf, 0x8f, 0xc0, 0x7e, - 0x1f, 0x81, 0x5f, 0x7d, 0x04, 0xde, 0x0c, 0x90, 0xb6, 0x3f, 0x40, 0xda, 0xf7, 0x01, 0xd2, 0x1e, - 0x17, 0xe6, 0x8e, 0xc2, 0xce, 0xe4, 0xab, 0x3b, 0x9a, 0x8c, 0xfa, 0xe2, 0xe8, 0xa9, 0xbb, 0xf6, - 0x37, 0x00, 0x00, 0xff, 0xff, 0x8b, 0x65, 0x3b, 0xae, 0x99, 0x07, 0x00, 0x00, + proto.RegisterType((*MsgSetWithdrawAddress)(nil), "liquidstaking.distribution.v1beta1.MsgSetWithdrawAddress") + proto.RegisterType((*MsgSetWithdrawAddressResponse)(nil), "liquidstaking.distribution.v1beta1.MsgSetWithdrawAddressResponse") + proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "liquidstaking.distribution.v1beta1.MsgWithdrawDelegatorReward") + proto.RegisterType((*MsgWithdrawDelegatorRewardResponse)(nil), "liquidstaking.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse") + proto.RegisterType((*MsgWithdrawValidatorCommission)(nil), "liquidstaking.distribution.v1beta1.MsgWithdrawValidatorCommission") + proto.RegisterType((*MsgWithdrawValidatorCommissionResponse)(nil), "liquidstaking.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse") + proto.RegisterType((*MsgWithdrawTokenizeShareRecordReward)(nil), "liquidstaking.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward") + proto.RegisterType((*MsgWithdrawTokenizeShareRecordRewardResponse)(nil), "liquidstaking.distribution.v1beta1.MsgWithdrawTokenizeShareRecordRewardResponse") + proto.RegisterType((*MsgWithdrawAllTokenizeShareRecordReward)(nil), "liquidstaking.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward") + proto.RegisterType((*MsgWithdrawAllTokenizeShareRecordRewardResponse)(nil), "liquidstaking.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordRewardResponse") + proto.RegisterType((*MsgFundCommunityPool)(nil), "liquidstaking.distribution.v1beta1.MsgFundCommunityPool") + proto.RegisterType((*MsgFundCommunityPoolResponse)(nil), "liquidstaking.distribution.v1beta1.MsgFundCommunityPoolResponse") +} + +func init() { proto.RegisterFile("distribution/v1beta1/tx.proto", fileDescriptor_f0452d52deb0ca76) } + +var fileDescriptor_f0452d52deb0ca76 = []byte{ + // 722 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0x4f, 0x4f, 0x13, 0x5d, + 0x14, 0xc6, 0x7b, 0xe1, 0x0d, 0x81, 0xf3, 0x6a, 0x84, 0x09, 0x86, 0x3a, 0xc0, 0x0c, 0x4e, 0x88, + 0x76, 0x21, 0x33, 0x82, 0x1b, 0x25, 0xd1, 0x48, 0x21, 0x44, 0x34, 0x4d, 0xc8, 0x60, 0x34, 0x71, + 0x43, 0xa6, 0xbd, 0x37, 0xc3, 0x0d, 0x33, 0x73, 0xcb, 0xdc, 0x3b, 0x94, 0xfa, 0x09, 0x5c, 0x68, + 0x34, 0x7e, 0x02, 0x8c, 0x1b, 0x63, 0xe2, 0xce, 0xa5, 0x89, 0x5b, 0x96, 0x2c, 0x5d, 0x55, 0x53, + 0x36, 0xae, 0xf9, 0x04, 0xa6, 0x33, 0x9d, 0x71, 0x4a, 0x5b, 0x28, 0x7f, 0x5c, 0xb5, 0x3d, 0xf7, + 0x9c, 0xe7, 0xfc, 0x9e, 0xde, 0xc9, 0x93, 0x81, 0x49, 0x4c, 0xb9, 0xf0, 0x69, 0x31, 0x10, 0x94, + 0x79, 0xc6, 0xf6, 0x6c, 0x91, 0x08, 0x6b, 0xd6, 0x10, 0x3b, 0x7a, 0xd9, 0x67, 0x82, 0x49, 0x9a, + 0x43, 0xb7, 0x02, 0x8a, 0xb9, 0xb0, 0x36, 0xa9, 0x67, 0xeb, 0xe9, 0x66, 0xbd, 0xd9, 0x2c, 0x8f, + 0xda, 0xcc, 0x66, 0x61, 0xbb, 0xd1, 0xf8, 0x16, 0x4d, 0xca, 0x4a, 0x89, 0x71, 0x97, 0x71, 0xa3, + 0x68, 0x71, 0x92, 0xe8, 0x96, 0x18, 0xf5, 0xa2, 0x73, 0xed, 0x2b, 0x82, 0xab, 0x05, 0x6e, 0xaf, + 0x11, 0xf1, 0x9c, 0x8a, 0x0d, 0xec, 0x5b, 0x95, 0x05, 0x8c, 0x7d, 0xc2, 0xb9, 0xb4, 0x02, 0x23, + 0x98, 0x38, 0xc4, 0xb6, 0x04, 0xf3, 0xd7, 0xad, 0xa8, 0x98, 0x45, 0x53, 0x28, 0x37, 0x94, 0x9f, + 0x38, 0xac, 0xa9, 0xd9, 0xaa, 0xe5,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, 0xe6, 0x60, 0x54, 0x58, 0xc1, 0x29, + 0x70, 0x1d, 0x6e, 0xf5, 0x42, 0x93, 0xe0, 0xfb, 0x70, 0x33, 0xd5, 0xbf, 0xe0, 0x38, 0xff, 0xca, + 0x40, 0x8a, 0x71, 0x16, 0x8c, 0x1e, 0x77, 0x26, 0x98, 0x1f, 0x11, 0x8c, 0x16, 0xb8, 0xbd, 0x1c, + 0x78, 0xb8, 0x71, 0x07, 0x81, 0x47, 0x45, 0x75, 0x95, 0x31, 0x47, 0x2a, 0xc1, 0x80, 0xe5, 0xb2, + 0xc0, 0x13, 0x59, 0x34, 0xd5, 0x9f, 0xfb, 0x7f, 0xee, 0x9a, 0x1e, 0xa5, 0x81, 0xde, 0x48, 0x83, + 0x38, 0x38, 0xf4, 0x45, 0x46, 0xbd, 0xfc, 0xed, 0xbd, 0x9a, 0x9a, 0xf9, 0xfc, 0x53, 0xcd, 0xd9, + 0x54, 0x6c, 0x04, 0x45, 0xbd, 0xc4, 0x5c, 0xa3, 0x19, 0x1d, 0xd1, 0xc7, 0x0c, 0xc7, 0x9b, 0x86, + 0xa8, 0x96, 0x09, 0x0f, 0x07, 0xb8, 0xd9, 0x94, 0x96, 0x26, 0x60, 0x08, 0x93, 0x32, 0xe3, 0x54, + 0x30, 0x3f, 0x7a, 0xee, 0xcd, 0xbf, 0x85, 0x94, 0x31, 0x05, 0x26, 0x3a, 0x41, 0xc6, 0x2e, 0xe6, + 0xde, 0x0c, 0x42, 0x7f, 0x81, 0xdb, 0xd2, 0x7b, 0x04, 0x52, 0x87, 0x38, 0xba, 0xa7, 0x9f, 0x9c, + 0x81, 0x7a, 0xc7, 0x4c, 0x90, 0x17, 0xce, 0x3c, 0x1a, 0xc3, 0x49, 0x1f, 0x10, 0x8c, 0x75, 0xcb, + 0x92, 0x07, 0x3d, 0xca, 0x77, 0x99, 0x97, 0x97, 0xcf, 0x37, 0x9f, 0x30, 0x7e, 0x41, 0x30, 0x7e, + 0x5c, 0x16, 0xe4, 0x4f, 0xb9, 0xa7, 0x83, 0x86, 0xfc, 0xf8, 0xfc, 0x1a, 0x09, 0xef, 0x77, 0x04, + 0xd7, 0x4f, 0x4e, 0x86, 0x47, 0xa7, 0xdc, 0xd8, 0x55, 0x49, 0x5e, 0xbd, 0x28, 0xa5, 0xc4, 0xc1, + 0x1e, 0x82, 0xe9, 0x9e, 0xd2, 0xe1, 0xc9, 0x29, 0x57, 0x1f, 0x27, 0x26, 0xaf, 0x5d, 0xa0, 0x58, + 0x62, 0xe5, 0x2d, 0x82, 0x91, 0xf6, 0x00, 0xb9, 0xdb, 0xe3, 0xaa, 0xb6, 0x49, 0xf9, 0xe1, 0x59, + 0x27, 0x63, 0xa2, 0x7c, 0xf1, 0x53, 0x5d, 0x41, 0x7b, 0x75, 0x05, 0xed, 0xd7, 0x15, 0xf4, 0xab, + 0xae, 0xa0, 0x77, 0x07, 0x4a, 0x66, 0xff, 0x40, 0xc9, 0xfc, 0x38, 0x50, 0x32, 0x2f, 0x96, 0x52, + 0x39, 0x45, 0xb7, 0x9c, 0xa0, 0xf1, 0x64, 0x51, 0xaf, 0x64, 0x44, 0x5b, 0xa9, 0xa8, 0xce, 0x34, + 0x37, 0xcf, 0xb8, 0x0c, 0x07, 0x0e, 0x31, 0x76, 0x8c, 0x96, 0x57, 0xac, 0x30, 0xc9, 0x8a, 0x03, + 0xe1, 0x4b, 0xd0, 0x9d, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x37, 0xe9, 0xea, 0x7f, 0x09, + 0x00, 0x00, } func (this *MsgSetWithdrawAddressResponse) Equal(that interface{}) bool { @@ -455,14 +603,6 @@ func (this *MsgWithdrawDelegatorRewardResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Amount) != len(that1.Amount) { - return false - } - for i := range this.Amount { - if !this.Amount[i].Equal(&that1.Amount[i]) { - return false - } - } return true } func (this *MsgWithdrawValidatorCommissionResponse) Equal(that interface{}) bool { @@ -484,14 +624,48 @@ func (this *MsgWithdrawValidatorCommissionResponse) Equal(that interface{}) bool } else if this == nil { return false } - if len(this.Amount) != len(that1.Amount) { + return true +} +func (this *MsgWithdrawTokenizeShareRecordRewardResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawTokenizeShareRecordRewardResponse) + if !ok { + that2, ok := that.(MsgWithdrawTokenizeShareRecordRewardResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { return false } - for i := range this.Amount { - if !this.Amount[i].Equal(&that1.Amount[i]) { + return true +} +func (this *MsgWithdrawAllTokenizeShareRecordRewardResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawAllTokenizeShareRecordRewardResponse) + if !ok { + that2, ok := that.(MsgWithdrawAllTokenizeShareRecordRewardResponse) + if ok { + that1 = &that2 + } else { return false } } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } return true } func (this *MsgFundCommunityPoolResponse) Equal(that interface{}) bool { @@ -537,6 +711,10 @@ type MsgClient interface { // WithdrawValidatorCommission defines a method to withdraw the // full commission to the validator address. WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) + // WithdrawTokenizeShareRecordReward defines a method to withdraw reward for an owning TokenizeShareRecord + WithdrawTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) + // WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for all owning TokenizeShareRecord + WithdrawAllTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawAllTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) @@ -552,7 +730,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) { out := new(MsgSetWithdrawAddressResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Msg/SetWithdrawAddress", in, out, opts...) if err != nil { return nil, err } @@ -561,7 +739,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, "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Msg/WithdrawDelegatorReward", in, out, opts...) if err != nil { return nil, err } @@ -570,7 +748,25 @@ func (c *msgClient) WithdrawDelegatorReward(ctx context.Context, in *MsgWithdraw func (c *msgClient) WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) { out := new(MsgWithdrawValidatorCommissionResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Msg/WithdrawValidatorCommission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) { + out := new(MsgWithdrawTokenizeShareRecordRewardResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Msg/WithdrawTokenizeShareRecordReward", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawAllTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawAllTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) { + out := new(MsgWithdrawAllTokenizeShareRecordRewardResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Msg/WithdrawAllTokenizeShareRecordReward", in, out, opts...) if err != nil { return nil, err } @@ -579,7 +775,7 @@ func (c *msgClient) WithdrawValidatorCommission(ctx context.Context, in *MsgWith func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) { out := new(MsgFundCommunityPoolResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.distribution.v1beta1.Msg/FundCommunityPool", in, out, opts...) if err != nil { return nil, err } @@ -597,6 +793,10 @@ type MsgServer interface { // WithdrawValidatorCommission defines a method to withdraw the // full commission to the validator address. WithdrawValidatorCommission(context.Context, *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) + // WithdrawTokenizeShareRecordReward defines a method to withdraw reward for an owning TokenizeShareRecord + WithdrawTokenizeShareRecordReward(context.Context, *MsgWithdrawTokenizeShareRecordReward) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) + // WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for all owning TokenizeShareRecord + WithdrawAllTokenizeShareRecordReward(context.Context, *MsgWithdrawAllTokenizeShareRecordReward) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) @@ -615,6 +815,12 @@ func (*UnimplementedMsgServer) WithdrawDelegatorReward(ctx context.Context, req func (*UnimplementedMsgServer) WithdrawValidatorCommission(ctx context.Context, req *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method WithdrawValidatorCommission not implemented") } +func (*UnimplementedMsgServer) WithdrawTokenizeShareRecordReward(ctx context.Context, req *MsgWithdrawTokenizeShareRecordReward) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawTokenizeShareRecordReward not implemented") +} +func (*UnimplementedMsgServer) WithdrawAllTokenizeShareRecordReward(ctx context.Context, req *MsgWithdrawAllTokenizeShareRecordReward) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawAllTokenizeShareRecordReward not implemented") +} func (*UnimplementedMsgServer) FundCommunityPool(ctx context.Context, req *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FundCommunityPool not implemented") } @@ -633,7 +839,7 @@ func _Msg_SetWithdrawAddress_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", + FullMethod: "/liquidstaking.distribution.v1beta1.Msg/SetWithdrawAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).SetWithdrawAddress(ctx, req.(*MsgSetWithdrawAddress)) @@ -651,7 +857,7 @@ func _Msg_WithdrawDelegatorReward_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", + FullMethod: "/liquidstaking.distribution.v1beta1.Msg/WithdrawDelegatorReward", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).WithdrawDelegatorReward(ctx, req.(*MsgWithdrawDelegatorReward)) @@ -669,7 +875,7 @@ func _Msg_WithdrawValidatorCommission_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", + FullMethod: "/liquidstaking.distribution.v1beta1.Msg/WithdrawValidatorCommission", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).WithdrawValidatorCommission(ctx, req.(*MsgWithdrawValidatorCommission)) @@ -677,6 +883,42 @@ func _Msg_WithdrawValidatorCommission_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _Msg_WithdrawTokenizeShareRecordReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawTokenizeShareRecordReward) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawTokenizeShareRecordReward(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.distribution.v1beta1.Msg/WithdrawTokenizeShareRecordReward", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawTokenizeShareRecordReward(ctx, req.(*MsgWithdrawTokenizeShareRecordReward)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawAllTokenizeShareRecordReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawAllTokenizeShareRecordReward) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawAllTokenizeShareRecordReward(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.distribution.v1beta1.Msg/WithdrawAllTokenizeShareRecordReward", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawAllTokenizeShareRecordReward(ctx, req.(*MsgWithdrawAllTokenizeShareRecordReward)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_FundCommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgFundCommunityPool) if err := dec(in); err != nil { @@ -687,7 +929,7 @@ func _Msg_FundCommunityPool_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", + FullMethod: "/liquidstaking.distribution.v1beta1.Msg/FundCommunityPool", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).FundCommunityPool(ctx, req.(*MsgFundCommunityPool)) @@ -696,7 +938,7 @@ func _Msg_FundCommunityPool_Handler(srv interface{}, ctx context.Context, dec fu } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.distribution.v1beta1.Msg", + ServiceName: "liquidstaking.distribution.v1beta1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -711,13 +953,21 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "WithdrawValidatorCommission", Handler: _Msg_WithdrawValidatorCommission_Handler, }, + { + MethodName: "WithdrawTokenizeShareRecordReward", + Handler: _Msg_WithdrawTokenizeShareRecordReward_Handler, + }, + { + MethodName: "WithdrawAllTokenizeShareRecordReward", + Handler: _Msg_WithdrawAllTokenizeShareRecordReward_Handler, + }, { MethodName: "FundCommunityPool", Handler: _Msg_FundCommunityPool_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/distribution/v1beta1/tx.proto", + Metadata: "distribution/v1beta1/tx.proto", } func (m *MsgSetWithdrawAddress) Marshal() (dAtA []byte, err error) { @@ -837,20 +1087,6 @@ func (m *MsgWithdrawDelegatorRewardResponse) MarshalToSizedBuffer(dAtA []byte) ( _ = i var l int _ = l - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } @@ -904,24 +1140,10 @@ func (m *MsgWithdrawValidatorCommissionResponse) MarshalToSizedBuffer(dAtA []byt _ = i var l int _ = l - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } -func (m *MsgFundCommunityPool) Marshal() (dAtA []byte, err error) { +func (m *MsgWithdrawTokenizeShareRecordReward) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -931,41 +1153,32 @@ func (m *MsgFundCommunityPool) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgFundCommunityPool) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgWithdrawTokenizeShareRecordReward) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgFundCommunityPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgWithdrawTokenizeShareRecordReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) + if m.RecordId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.RecordId)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgFundCommunityPoolResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -975,12 +1188,12 @@ func (m *MsgFundCommunityPoolResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgFundCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgFundCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -988,25 +1201,145 @@ func (m *MsgFundCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgWithdrawAllTokenizeShareRecordReward) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgSetWithdrawAddress) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgWithdrawAllTokenizeShareRecordReward) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawAllTokenizeShareRecordReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.DelegatorAddress) - if l > 0 { + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) 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 *MsgWithdrawAllTokenizeShareRecordRewardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgFundCommunityPool) 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 *MsgFundCommunityPool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundCommunityPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if len(m.Amount) > 0 { + for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgFundCommunityPoolResponse) 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 *MsgFundCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgSetWithdrawAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { n += 1 + l + sovTx(uint64(l)) } l = len(m.WithdrawAddress) @@ -1048,12 +1381,6 @@ func (m *MsgWithdrawDelegatorRewardResponse) Size() (n int) { } var l int _ = l - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } return n } @@ -1076,12 +1403,53 @@ func (m *MsgWithdrawValidatorCommissionResponse) Size() (n int) { } var l int _ = l - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } + return n +} + +func (m *MsgWithdrawTokenizeShareRecordReward) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.RecordId != 0 { + n += 1 + sovTx(uint64(m.RecordId)) + } + return n +} + +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdrawAllTokenizeShareRecordReward) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) Size() (n int) { + if m == nil { + return 0 } + var l int + _ = l return n } @@ -1218,7 +1586,10 @@ func (m *MsgSetWithdrawAddress) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1268,7 +1639,10 @@ func (m *MsgSetWithdrawAddressResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1382,7 +1756,10 @@ func (m *MsgWithdrawDelegatorReward) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1426,11 +1803,64 @@ func (m *MsgWithdrawDelegatorRewardResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgWithdrawDelegatorRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawValidatorCommission) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawValidatorCommission: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawValidatorCommission: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1440,33 +1870,87 @@ func (m *MsgWithdrawDelegatorRewardResponse) 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 ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawValidatorCommissionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawValidatorCommissionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawValidatorCommissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1481,7 +1965,7 @@ func (m *MsgWithdrawDelegatorRewardResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgWithdrawValidatorCommission) Unmarshal(dAtA []byte) error { +func (m *MsgWithdrawTokenizeShareRecordReward) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1504,15 +1988,15 @@ func (m *MsgWithdrawValidatorCommission) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgWithdrawValidatorCommission: wiretype end group for non-group") + return fmt.Errorf("proto: MsgWithdrawTokenizeShareRecordReward: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawValidatorCommission: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgWithdrawTokenizeShareRecordReward: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1540,15 +2024,37 @@ func (m *MsgWithdrawValidatorCommission) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordId", wireType) + } + m.RecordId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RecordId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1563,7 +2069,7 @@ func (m *MsgWithdrawValidatorCommission) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgWithdrawValidatorCommissionResponse) Unmarshal(dAtA []byte) error { +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1586,17 +2092,70 @@ func (m *MsgWithdrawValidatorCommissionResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgWithdrawValidatorCommissionResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgWithdrawTokenizeShareRecordRewardResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawValidatorCommissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgWithdrawTokenizeShareRecordRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawAllTokenizeShareRecordReward: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawAllTokenizeShareRecordReward: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1606,33 +2165,87 @@ func (m *MsgWithdrawValidatorCommissionResponse) 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 ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgWithdrawAllTokenizeShareRecordRewardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawAllTokenizeShareRecordRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1748,7 +2361,10 @@ func (m *MsgFundCommunityPool) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1798,7 +2414,10 @@ func (m *MsgFundCommunityPoolResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { diff --git a/x/slashing/abci_test.go b/x/slashing/abci_test.go index f2958d4d3b62..3aaf323bb253 100644 --- a/x/slashing/abci_test.go +++ b/x/slashing/abci_test.go @@ -8,12 +8,12 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestBeginBlocker(t *testing.T) { @@ -97,5 +97,5 @@ func TestBeginBlocker(t *testing.T) { // validator should be jailed validator, found := app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)) require.True(t, found) - require.Equal(t, stakingtypes.Unbonding, validator.GetStatus()) + require.Equal(t, sdkstaking.Unbonding, validator.GetStatus()) } diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index e9ece2c690a1..18c82232631b 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -10,11 +10,13 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" + sdkslashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -64,7 +66,7 @@ func TestSlashingMsgs(t *testing.T) { commission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) createValidatorMsg, err := stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(addr1), valKey.PubKey(), bondCoin, description, commission, sdk.OneInt(), + sdk.ValAddress(addr1), valKey.PubKey(), bondCoin, description, commission, ) require.NoError(t, err) @@ -79,7 +81,7 @@ func TestSlashingMsgs(t *testing.T) { validator := checkValidator(t, app, addr1, true) require.Equal(t, sdk.ValAddress(addr1).String(), validator.OperatorAddress) - require.Equal(t, stakingtypes.Bonded, validator.Status) + require.Equal(t, sdkstaking.Bonded, validator.Status) require.True(sdk.IntEq(t, bondTokens, validator.BondedTokens())) unjailMsg := &types.MsgUnjail{ValidatorAddr: sdk.ValAddress(addr1).String()} @@ -90,5 +92,5 @@ func TestSlashingMsgs(t *testing.T) { _, res, err := simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{unjailMsg}, "", []uint64{0}, []uint64{1}, false, false, priv1) require.Error(t, err) require.Nil(t, res) - require.True(t, errors.Is(types.ErrValidatorNotJailed, err)) + require.True(t, errors.Is(sdkslashingtypes.ErrValidatorNotJailed, err)) } diff --git a/x/slashing/client/cli/query.go b/x/slashing/client/cli/query.go index 500a490d64eb..08ae03301fbc 100644 --- a/x/slashing/client/cli/query.go +++ b/x/slashing/client/cli/query.go @@ -30,6 +30,7 @@ func GetQueryCmd() *cobra.Command { ) return slashingQueryCmd + } // GetCmdQuerySigningInfo implements the command to query signing info. diff --git a/x/slashing/client/cli/tx.go b/x/slashing/client/cli/tx.go index bcb7836e6d7d..6ef7f56c2925 100644 --- a/x/slashing/client/cli/tx.go +++ b/x/slashing/client/cli/tx.go @@ -24,7 +24,6 @@ func NewTxCmd() *cobra.Command { return slashingTxCmd } -// NewUnjailTxCmd returns a CLI command handler for creating a MsgUnjail transaction. func NewUnjailTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: "unjail", diff --git a/x/slashing/init_test.go b/x/slashing/init_test.go index b9bbfe694e26..a2217cfda7b0 100644 --- a/x/slashing/init_test.go +++ b/x/slashing/init_test.go @@ -4,5 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// The default power validators are initialized to have within tests -var InitTokens = sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction) +var ( + // The default power validators are initialized to have within tests + InitTokens = sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction) +) diff --git a/x/slashing/keeper/common_test.go b/x/slashing/keeper/common_test.go index 4e4be93b91e8..91a972ed1110 100644 --- a/x/slashing/keeper/common_test.go +++ b/x/slashing/keeper/common_test.go @@ -2,5 +2,7 @@ package keeper_test import sdk "github.com/cosmos/cosmos-sdk/types" -// The default power validators are initialized to have within tests -var InitTokens = sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction) +var ( + // The default power validators are initialized to have within tests + InitTokens = sdk.TokensFromConsensusPower(200, sdk.DefaultPowerReduction) +) diff --git a/x/slashing/keeper/genesis.go b/x/slashing/keeper/genesis.go index 469947ed38f1..ca5a983d3447 100644 --- a/x/slashing/keeper/genesis.go +++ b/x/slashing/keeper/genesis.go @@ -3,14 +3,14 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // InitGenesis initialize default parameters // and the keeper's address to pubkey map func (keeper Keeper) InitGenesis(ctx sdk.Context, stakingKeeper types.StakingKeeper, data *types.GenesisState) { stakingKeeper.IterateValidators(ctx, - func(index int64, validator stakingtypes.ValidatorI) bool { + func(index int64, validator sdkstaking.ValidatorI) bool { consPk, err := validator.ConsPubKey() if err != nil { panic(err) diff --git a/x/slashing/keeper/genesis_test.go b/x/slashing/keeper/genesis_test.go index 3cea49ea3863..d7f02eaaaf52 100644 --- a/x/slashing/keeper/genesis_test.go +++ b/x/slashing/keeper/genesis_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/slashing/types" diff --git a/x/slashing/keeper/grpc_query_test.go b/x/slashing/keeper/grpc_query_test.go index 5a8733babeef..7c07b7e99c7d 100644 --- a/x/slashing/keeper/grpc_query_test.go +++ b/x/slashing/keeper/grpc_query_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -91,7 +91,7 @@ func (suite *SlashingTestSuite) TestGRPCSigningInfos() { }) // verify all values are returned without pagination - infoResp, err := queryClient.SigningInfos(gocontext.Background(), + var infoResp, err = queryClient.SigningInfos(gocontext.Background(), &types.QuerySigningInfosRequest{Pagination: nil}) suite.NoError(err) suite.Equal(signingInfos, infoResp.Info) diff --git a/x/slashing/keeper/hooks.go b/x/slashing/keeper/hooks.go index a306f76c210d..48ad05e028f0 100644 --- a/x/slashing/keeper/hooks.go +++ b/x/slashing/keeper/hooks.go @@ -74,6 +74,11 @@ func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) er return h.k.AfterValidatorCreated(ctx, valAddr) } +// Implements sdk.ValidatorHooks - just addition to fulfill the staking hook interface +func (h Hooks) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordId uint64) error { + return nil +} + func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { return nil } diff --git a/x/slashing/keeper/keeper.go b/x/slashing/keeper/keeper.go index dbec306bfda1..e6790a764d63 100644 --- a/x/slashing/keeper/keeper.go +++ b/x/slashing/keeper/keeper.go @@ -3,11 +3,11 @@ package keeper import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/tendermint/tendermint/libs/log" "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index 03869e3a74c9..6077f72ba78b 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -7,77 +7,14 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) -func TestUnJailNotBonded(t *testing.T) { - app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - p := app.StakingKeeper.GetParams(ctx) - p.MaxValidators = 5 - app.StakingKeeper.SetParams(ctx, p) - - addrDels := simapp.AddTestAddrsIncremental(app, ctx, 6, app.StakingKeeper.TokensFromConsensusPower(ctx, 200)) - valAddrs := simapp.ConvertAddrsToValAddrs(addrDels) - pks := simapp.CreateTestPubKeys(6) - tstaking := teststaking.NewHelper(t, ctx, app.StakingKeeper) - - // create max (5) validators all with the same power - for i := uint32(0); i < p.MaxValidators; i++ { - addr, val := valAddrs[i], pks[i] - tstaking.CreateValidatorWithValPower(addr, val, 100, true) - } - - staking.EndBlocker(ctx, app.StakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - // create a 6th validator with less power than the cliff validator (won't be bonded) - addr, val := valAddrs[5], pks[5] - amt := app.StakingKeeper.TokensFromConsensusPower(ctx, 50) - msg := tstaking.CreateValidatorMsg(addr, val, amt) - msg.MinSelfDelegation = amt - res, err := tstaking.CreateValidatorWithMsg(sdk.WrapSDKContext(ctx), msg) - require.NoError(t, err) - require.NotNil(t, res) - - staking.EndBlocker(ctx, app.StakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - tstaking.CheckValidator(addr, stakingtypes.Unbonded, false) - - // unbond below minimum self-delegation - require.Equal(t, p.BondDenom, tstaking.Denom) - tstaking.Undelegate(sdk.AccAddress(addr), addr, app.StakingKeeper.TokensFromConsensusPower(ctx, 1), true) - - staking.EndBlocker(ctx, app.StakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - // verify that validator is jailed - tstaking.CheckValidator(addr, -1, true) - - // verify we cannot unjail (yet) - require.Error(t, app.SlashingKeeper.Unjail(ctx, addr)) - - staking.EndBlocker(ctx, app.StakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - // bond to meet minimum self-delegation - tstaking.DelegateWithPower(sdk.AccAddress(addr), addr, 1) - - staking.EndBlocker(ctx, app.StakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - // verify we can immediately unjail - require.NoError(t, app.SlashingKeeper.Unjail(ctx, addr)) - - tstaking.CheckValidator(addr, -1, false) -} - // Test a new validator entering the validator set // Ensure that SigningInfo.StartHeight is set correctly // and that they are not immediately jailed @@ -116,7 +53,7 @@ func TestHandleNewValidator(t *testing.T) { // validator should be bonded still, should not have been jailed or slashed validator, _ := app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(val)) - require.Equal(t, stakingtypes.Bonded, validator.GetStatus()) + require.Equal(t, sdkstaking.Bonded, validator.GetStatus()) bondPool := app.StakingKeeper.GetBondedPool(ctx) expTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 100) // adding genesis validator tokens @@ -160,7 +97,7 @@ func TestHandleAlreadyJailed(t *testing.T) { // validator should have been jailed and slashed validator, _ := app.StakingKeeper.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(val)) - require.Equal(t, stakingtypes.Unbonding, validator.GetStatus()) + require.Equal(t, sdkstaking.Unbonding, validator.GetStatus()) // validator should have been slashed resultingTokens := amt.Sub(app.StakingKeeper.TokensFromConsensusPower(ctx, 1)) @@ -201,7 +138,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { tstaking.CreateValidatorWithValPower(valAddr, val, power, true) validatorUpdates := staking.EndBlocker(ctx, app.StakingKeeper) require.Equal(t, 2, len(validatorUpdates)) - tstaking.CheckValidator(valAddr, stakingtypes.Bonded, false) + tstaking.CheckValidator(valAddr, sdkstaking.Bonded, false) // 100 first blocks OK height := int64(0) @@ -214,8 +151,8 @@ func TestValidatorDippingInAndOut(t *testing.T) { tstaking.CreateValidatorWithValPower(sdk.ValAddress(pks[1].Address()), pks[1], power+1, true) validatorUpdates = staking.EndBlocker(ctx, app.StakingKeeper) require.Equal(t, 2, len(validatorUpdates)) - tstaking.CheckValidator(sdk.ValAddress(pks[1].Address()), stakingtypes.Bonded, false) - tstaking.CheckValidator(valAddr, stakingtypes.Unbonding, false) + tstaking.CheckValidator(sdk.ValAddress(pks[1].Address()), sdkstaking.Bonded, false) + tstaking.CheckValidator(valAddr, sdkstaking.Unbonding, false) // 600 more blocks happened height = height + 600 @@ -226,7 +163,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { validatorUpdates = staking.EndBlocker(ctx, app.StakingKeeper) require.Equal(t, 2, len(validatorUpdates)) - tstaking.CheckValidator(valAddr, stakingtypes.Bonded, false) + tstaking.CheckValidator(valAddr, sdkstaking.Bonded, false) newPower := power + 50 // validator misses a block @@ -234,7 +171,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { height++ // shouldn't be jailed/kicked yet - tstaking.CheckValidator(valAddr, stakingtypes.Bonded, false) + tstaking.CheckValidator(valAddr, sdkstaking.Bonded, false) // validator misses an additional 500 more blocks, after the cooling off period of SignedBlockWindow (here 1000 blocks). latest := app.SlashingKeeper.SignedBlocksWindow(ctx) + height @@ -245,7 +182,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { // should now be jailed & kicked staking.EndBlocker(ctx, app.StakingKeeper) - tstaking.CheckValidator(valAddr, stakingtypes.Unbonding, true) + tstaking.CheckValidator(valAddr, sdkstaking.Unbonding, true) // check all the signing information signInfo, found := app.SlashingKeeper.GetValidatorSigningInfo(ctx, consAddr) @@ -265,7 +202,7 @@ func TestValidatorDippingInAndOut(t *testing.T) { // validator should not be kicked since we reset counter/array when it was jailed staking.EndBlocker(ctx, app.StakingKeeper) - tstaking.CheckValidator(valAddr, stakingtypes.Bonded, false) + tstaking.CheckValidator(valAddr, sdkstaking.Bonded, false) // check start height is correctly set signInfo, found = app.SlashingKeeper.GetValidatorSigningInfo(ctx, consAddr) @@ -281,5 +218,5 @@ func TestValidatorDippingInAndOut(t *testing.T) { // validator should now be jailed & kicked staking.EndBlocker(ctx, app.StakingKeeper) - tstaking.CheckValidator(valAddr, stakingtypes.Unbonding, true) + tstaking.CheckValidator(valAddr, sdkstaking.Unbonding, true) } diff --git a/x/slashing/keeper/migrations.go b/x/slashing/keeper/migrations.go index a9f74f6ace75..c0558cb48750 100644 --- a/x/slashing/keeper/migrations.go +++ b/x/slashing/keeper/migrations.go @@ -2,7 +2,6 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - v043 "github.com/cosmos/cosmos-sdk/x/slashing/migrations/v043" ) // Migrator is a struct for handling in-place store migrations. @@ -17,5 +16,5 @@ func NewMigrator(keeper Keeper) Migrator { // Migrate1to2 migrates from version 1 to 2. func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return v043.MigrateStore(ctx, m.keeper.storeKey) + return nil } diff --git a/x/slashing/keeper/querier.go b/x/slashing/keeper/querier.go index 036f3a16dde3..72faab2da76f 100644 --- a/x/slashing/keeper/querier.go +++ b/x/slashing/keeper/querier.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/slashing/types" + sdkslashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" ) // NewQuerier creates a new querier for slashing clients. @@ -50,7 +51,7 @@ func querySigningInfo(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQu signingInfo, found := k.GetValidatorSigningInfo(ctx, sdk.ConsAddress(params.ConsAddress)) if !found { - return nil, sdkerrors.Wrap(types.ErrNoSigningInfoFound, params.ConsAddress) + return nil, sdkerrors.Wrap(sdkslashingtypes.ErrNoSigningInfoFound, params.ConsAddress) } res, err := codec.MarshalJSONIndent(legacyQuerierCdc, signingInfo) diff --git a/x/slashing/keeper/querier_test.go b/x/slashing/keeper/querier_test.go index 0b9fb6b51a3c..e606c899de8c 100644 --- a/x/slashing/keeper/querier_test.go +++ b/x/slashing/keeper/querier_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/slashing/types" diff --git a/x/slashing/keeper/signing_info_test.go b/x/slashing/keeper/signing_info_test.go index cee32a0d54c4..5a2f8139310f 100644 --- a/x/slashing/keeper/signing_info_test.go +++ b/x/slashing/keeper/signing_info_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) diff --git a/x/slashing/keeper/unjail.go b/x/slashing/keeper/unjail.go index 23a9121e5472..b0930e73dd50 100644 --- a/x/slashing/keeper/unjail.go +++ b/x/slashing/keeper/unjail.go @@ -2,8 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/slashing/types" + sdkslashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" ) // Unjail calls the staking Unjail function to unjail a validator if the @@ -11,26 +10,18 @@ import ( func (k Keeper) Unjail(ctx sdk.Context, validatorAddr sdk.ValAddress) error { validator := k.sk.Validator(ctx, validatorAddr) if validator == nil { - return types.ErrNoValidatorForAddress + return sdkslashingtypes.ErrNoValidatorForAddress } // cannot be unjailed if no self-delegation exists selfDel := k.sk.Delegation(ctx, sdk.AccAddress(validatorAddr), validatorAddr) if selfDel == nil { - return types.ErrMissingSelfDelegation - } - - tokens := validator.TokensFromShares(selfDel.GetShares()).TruncateInt() - minSelfBond := validator.GetMinSelfDelegation() - if tokens.LT(minSelfBond) { - return sdkerrors.Wrapf( - types.ErrSelfDelegationTooLowToUnjail, "%s less than %s", tokens, minSelfBond, - ) + return sdkslashingtypes.ErrMissingSelfDelegation } // cannot be unjailed if not jailed if !validator.IsJailed() { - return types.ErrValidatorNotJailed + return sdkslashingtypes.ErrValidatorNotJailed } consAddr, err := validator.GetConsAddr() @@ -49,12 +40,12 @@ func (k Keeper) Unjail(ctx sdk.Context, validatorAddr sdk.ValAddress) error { if found { // cannot be unjailed if tombstoned if info.Tombstoned { - return types.ErrValidatorJailed + return sdkslashingtypes.ErrValidatorJailed } // cannot be unjailed until out of jail if ctx.BlockHeader().Time.Before(info.JailedUntil) { - return types.ErrValidatorJailed + return sdkslashingtypes.ErrValidatorJailed } } diff --git a/x/slashing/migrations/v042/types.go b/x/slashing/migrations/v042/types.go deleted file mode 100644 index 0089afe732fd..000000000000 --- a/x/slashing/migrations/v042/types.go +++ /dev/null @@ -1,69 +0,0 @@ -// Package v040 is copy-pasted from: -// https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/x/slashing/types/keys.go -package legacy - -import ( - "encoding/binary" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/kv" - v042auth "github.com/cosmos/cosmos-sdk/x/auth/migrations/v042" -) - -const ( - // ModuleName is the name of the module - ModuleName = "slashing" - - // StoreKey is the store key string for slashing - StoreKey = ModuleName - - // RouterKey is the message route for slashing - RouterKey = ModuleName - - // QuerierRoute is the querier route for slashing - QuerierRoute = ModuleName -) - -// Keys for slashing store -// Items are stored with the following key: values -// -// - 0x01: ValidatorSigningInfo -// -// - 0x02: bool -// -// - 0x03: crypto.PubKey -var ( - ValidatorSigningInfoKeyPrefix = []byte{0x01} // Prefix for signing info - ValidatorMissedBlockBitArrayKeyPrefix = []byte{0x02} // Prefix for missed block bit array - AddrPubkeyRelationKeyPrefix = []byte{0x03} // Prefix for address-pubkey relation -) - -// ValidatorSigningInfoKey - stored by *Consensus* address (not operator address) -func ValidatorSigningInfoKey(v sdk.ConsAddress) []byte { - return append(ValidatorSigningInfoKeyPrefix, v.Bytes()...) -} - -// ValidatorSigningInfoAddress - extract the address from a validator signing info key -func ValidatorSigningInfoAddress(key []byte) (v sdk.ConsAddress) { - kv.AssertKeyAtLeastLength(key, 2) - addr := key[1:] - kv.AssertKeyLength(addr, v042auth.AddrLen) - return sdk.ConsAddress(addr) -} - -// ValidatorMissedBlockBitArrayPrefixKey - stored by *Consensus* address (not operator address) -func ValidatorMissedBlockBitArrayPrefixKey(v sdk.ConsAddress) []byte { - return append(ValidatorMissedBlockBitArrayKeyPrefix, v.Bytes()...) -} - -// ValidatorMissedBlockBitArrayKey - stored by *Consensus* address (not operator address) -func ValidatorMissedBlockBitArrayKey(v sdk.ConsAddress, i int64) []byte { - b := make([]byte, 8) - binary.LittleEndian.PutUint64(b, uint64(i)) - return append(ValidatorMissedBlockBitArrayPrefixKey(v), b...) -} - -// AddrPubkeyRelationKey gets pubkey relation key used to get the pubkey from the address -func AddrPubkeyRelationKey(address []byte) []byte { - return append(AddrPubkeyRelationKeyPrefix, address...) -} diff --git a/x/slashing/migrations/v043/store.go b/x/slashing/migrations/v043/store.go index d9d44664c18f..268c174598fa 100644 --- a/x/slashing/migrations/v043/store.go +++ b/x/slashing/migrations/v043/store.go @@ -3,8 +3,6 @@ package v043 import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - v043distribution "github.com/cosmos/cosmos-sdk/x/distribution/migrations/v043" - v042slashing "github.com/cosmos/cosmos-sdk/x/slashing/migrations/v042" ) // MigrateStore performs in-place store migrations from v0.40 to v0.43. The @@ -12,10 +10,5 @@ import ( // // - Change addresses to be length-prefixed. func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey) error { - store := ctx.KVStore(storeKey) - v043distribution.MigratePrefixAddress(store, v042slashing.ValidatorSigningInfoKeyPrefix) - v043distribution.MigratePrefixAddressBytes(store, v042slashing.ValidatorMissedBlockBitArrayKeyPrefix) - v043distribution.MigratePrefixAddress(store, v042slashing.AddrPubkeyRelationKeyPrefix) - return nil } diff --git a/x/slashing/migrations/v043/store_test.go b/x/slashing/migrations/v043/store_test.go index 17aa3387c2c2..596b211a8336 100644 --- a/x/slashing/migrations/v043/store_test.go +++ b/x/slashing/migrations/v043/store_test.go @@ -1,68 +1 @@ package v043_test - -import ( - "bytes" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" - v040slashing "github.com/cosmos/cosmos-sdk/x/slashing/migrations/v042" - v043slashing "github.com/cosmos/cosmos-sdk/x/slashing/migrations/v043" - "github.com/cosmos/cosmos-sdk/x/slashing/types" -) - -func TestStoreMigration(t *testing.T) { - slashingKey := sdk.NewKVStoreKey("slashing") - ctx := testutil.DefaultContext(slashingKey, sdk.NewTransientStoreKey("transient_test")) - store := ctx.KVStore(slashingKey) - - _, _, addr1 := testdata.KeyTestPubAddr() - consAddr := sdk.ConsAddress(addr1) - // Use dummy value for all keys. - value := []byte("foo") - - testCases := []struct { - name string - oldKey []byte - newKey []byte - }{ - { - "ValidatorSigningInfoKey", - v040slashing.ValidatorSigningInfoKey(consAddr), - types.ValidatorSigningInfoKey(consAddr), - }, - { - "ValidatorMissedBlockBitArrayKey", - v040slashing.ValidatorMissedBlockBitArrayKey(consAddr, 2), - types.ValidatorMissedBlockBitArrayKey(consAddr, 2), - }, - { - "AddrPubkeyRelationKey", - v040slashing.AddrPubkeyRelationKey(consAddr), - types.AddrPubkeyRelationKey(consAddr), - }, - } - - // Set all the old keys to the store - for _, tc := range testCases { - store.Set(tc.oldKey, value) - } - - // Run migrations. - err := v043slashing.MigrateStore(ctx, slashingKey) - require.NoError(t, err) - - // Make sure the new keys are set and old keys are deleted. - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - if !bytes.Equal(tc.oldKey, tc.newKey) { - require.Nil(t, store.Get(tc.oldKey)) - } - require.Equal(t, value, store.Get(tc.newKey)) - }) - } -} diff --git a/x/slashing/module.go b/x/slashing/module.go index 06b5b3ef6223..5682e81603ce 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -6,6 +6,7 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" @@ -20,6 +21,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/slashing/simulation" "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) var ( @@ -66,6 +68,11 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod return types.ValidateGenesis(data) } +// RegisterRESTRoutes registers the REST routes for the slashing module. +// Deprecated: RegisterRESTRoutes is deprecated. `x/slashing` legacy REST implementation +// has been removed from the SDK. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {} + // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the slashig module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { @@ -90,11 +97,11 @@ type AppModule struct { keeper keeper.Keeper accountKeeper types.AccountKeeper bankKeeper types.BankKeeper - stakingKeeper types.StakingKeeper + stakingKeeper stakingkeeper.Keeper } // NewAppModule creates a new AppModule object -func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper) AppModule { +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper, sk stakingkeeper.Keeper) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, keeper: keeper, @@ -133,7 +140,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) m := keeper.NewMigrator(am.keeper) - cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2) + err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2) + if err != nil { + panic(err) + } } // InitGenesis performs genesis initialization for the slashing module. It returns @@ -160,6 +170,12 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { BeginBlocker(ctx, req, am.keeper) } +// EndBlock returns the end blocker for the slashing module. It returns no validator +// updates. +func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} + // AppModuleSimulation functions // GenerateGenesisState creates a randomized GenState of the slashing module. diff --git a/x/slashing/simulation/decoder_test.go b/x/slashing/simulation/decoder_test.go index 883b3874d2f7..f879f5a265e9 100644 --- a/x/slashing/simulation/decoder_test.go +++ b/x/slashing/simulation/decoder_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/x/slashing/simulation" diff --git a/x/slashing/simulation/genesis_test.go b/x/slashing/simulation/genesis_test.go index 55bce42a84a6..45c67b203ad1 100644 --- a/x/slashing/simulation/genesis_test.go +++ b/x/slashing/simulation/genesis_test.go @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/require" - sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -33,7 +32,7 @@ func TestRandomizedGenState(t *testing.T) { Rand: r, NumBonded: 3, Accounts: simtypes.RandomAccounts(r, 3), - InitialStake: sdkmath.NewInt(1000), + InitialStake: sdk.NewInt(1000), GenState: make(map[string]json.RawMessage), } @@ -53,6 +52,7 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, time.Duration(34800000000000), slashingGenesis.Params.DowntimeJailDuration) require.Len(t, slashingGenesis.MissedBlocks, 0) require.Len(t, slashingGenesis.SigningInfos, 0) + } // TestRandomizedGenState tests abnormal scenarios of applying RandomizedGenState. diff --git a/x/slashing/simulation/operations.go b/x/slashing/simulation/operations.go index 23be89b1b21f..0e37c038bacb 100644 --- a/x/slashing/simulation/operations.go +++ b/x/slashing/simulation/operations.go @@ -109,8 +109,7 @@ func SimulateMsgUnjail(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Kee // - validator is still in jailed period // - self delegation too low if info.Tombstoned || - ctx.BlockHeader().Time.Before(info.JailedUntil) || - validator.TokensFromShares(selfDel.GetShares()).TruncateInt().LT(validator.GetMinSelfDelegation()) { + ctx.BlockHeader().Time.Before(info.JailedUntil) { if res != nil && err == nil { if info.Tombstoned { return simtypes.NewOperationMsg(msg, true, "", nil), nil, errors.New("validator should not have been unjailed if validator tombstoned") @@ -118,9 +117,6 @@ func SimulateMsgUnjail(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Kee if ctx.BlockHeader().Time.Before(info.JailedUntil) { return simtypes.NewOperationMsg(msg, true, "", nil), nil, errors.New("validator unjailed while validator still in jail period") } - if validator.TokensFromShares(selfDel.GetShares()).TruncateInt().LT(validator.GetMinSelfDelegation()) { - return simtypes.NewOperationMsg(msg, true, "", nil), nil, errors.New("validator unjailed even though self-delegation too low") - } } // msg failed as expected return simtypes.NewOperationMsg(msg, false, "", nil), nil, nil diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index a0dbffb1f360..1a5016764554 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -12,7 +14,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -86,7 +88,7 @@ func TestSimulateMsgUnjail(t *testing.T) { validator0, issuedShares := validator0.AddTokensFromDel(delTokens) val0AccAddress, err := sdk.ValAddressFromBech32(validator0.OperatorAddress) require.NoError(t, err) - selfDelegation := stakingtypes.NewDelegation(val0AccAddress.Bytes(), validator0.GetOperator(), issuedShares) + selfDelegation := stakingtypes.NewDelegation(val0AccAddress.Bytes(), validator0.GetOperator(), issuedShares, false) app.StakingKeeper.SetDelegation(ctx, selfDelegation) app.DistrKeeper.SetDelegatorStartingInfo(ctx, validator0.GetOperator(), val0AccAddress.Bytes(), distrtypes.NewDelegatorStartingInfo(2, sdk.OneDec(), 200)) @@ -99,7 +101,7 @@ func TestSimulateMsgUnjail(t *testing.T) { require.NoError(t, err) var msg types.MsgUnjail - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) require.True(t, operationMsg.OK) require.Equal(t, types.TypeMsgUnjail, msg.Type()) diff --git a/x/slashing/spec/01_concepts.md b/x/slashing/spec/01_concepts.md index ea7c6b319bae..9505706f90d3 100644 --- a/x/slashing/spec/01_concepts.md +++ b/x/slashing/spec/01_concepts.md @@ -43,14 +43,16 @@ _Vu_ : validator unbonded ### Single Double Sign Infraction -\[----------C1----D1,Vu-----\] +<-----------------> +[----------C1----D1,Vu-----] A single infraction is committed then later discovered, at which point the validator is unbonded and slashed at the full amount for the infraction. ### Multiple Double Sign Infractions -\[----------C1--C2---C3---D1,D2,D3Vu-----\] +<---------------------------> +[----------C1--C2---C3---D1,D2,D3Vu-----] Multiple infractions are committed and then later discovered, at which point the validator is jailed and slashed for only one infraction. Because the validator diff --git a/x/slashing/spec/02_state.md b/x/slashing/spec/02_state.md index 50aa0e14100e..a0298b57499e 100644 --- a/x/slashing/spec/02_state.md +++ b/x/slashing/spec/02_state.md @@ -48,4 +48,4 @@ bonded validator. The `SignedBlocksWindow` parameter defines the size The information stored for tracking validator liveness is as follows: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/slashing/v1beta1/slashing.proto#L12-L33 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/slashing/v1beta1/slashing.proto#L11-L33 diff --git a/x/slashing/spec/05_hooks.md b/x/slashing/spec/05_hooks.md index a839689429a8..d1234e58ee05 100644 --- a/x/slashing/spec/05_hooks.md +++ b/x/slashing/spec/05_hooks.md @@ -21,8 +21,6 @@ The following hooks impact the slashing state: Upon successful first-time bonding of a new validator, we create a new `ValidatorSigningInfo` structure for the now-bonded validator, which `StartHeight` of the current block. -If the validator was out of the validator set and gets bonded again, its new bonded height is set. - ```go onValidatorBonded(address sdk.ValAddress) @@ -34,10 +32,7 @@ onValidatorBonded(address sdk.ValAddress) JailedUntil : time.Unix(0, 0), Tombstone : false, MissedBloskCounter : 0 - } else { - signingInfo.StartHeight = CurrentHeight } - setValidatorSigningInfo(signingInfo) } diff --git a/x/slashing/types/codec.go b/x/slashing/types/codec.go index d1b54a969ee1..d400687807b6 100644 --- a/x/slashing/types/codec.go +++ b/x/slashing/types/codec.go @@ -4,15 +4,13 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" ) // RegisterLegacyAminoCodec registers concrete types on LegacyAmino codec func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - legacy.RegisterAminoMsg(cdc, &MsgUnjail{}, "cosmos-sdk/MsgUnjail") + // cdc.RegisterConcrete(&MsgUnjail{}, "cosmos-sdk/MsgUnjail", nil) } func RegisterInterfaces(registry types.InterfaceRegistry) { @@ -23,17 +21,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } -var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewAminoCodec(amino) -) - func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - sdk.RegisterLegacyAminoCodec(amino) - - // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be - // used to properly serialize MsgGrant and MsgExec instances - RegisterLegacyAminoCodec(authzcodec.Amino) + RegisterLegacyAminoCodec(legacy.Cdc) } diff --git a/x/slashing/types/errors.go b/x/slashing/types/errors.go index daff6ecc04af..367071f3ea92 100644 --- a/x/slashing/types/errors.go +++ b/x/slashing/types/errors.go @@ -1,16 +1,16 @@ package types -import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) +// import ( +// sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +// ) -// x/slashing module sentinel errors -var ( - ErrNoValidatorForAddress = sdkerrors.Register(ModuleName, 2, "address is not associated with any known validator") - ErrBadValidatorAddr = sdkerrors.Register(ModuleName, 3, "validator does not exist for that address") - ErrValidatorJailed = sdkerrors.Register(ModuleName, 4, "validator still jailed; cannot be unjailed") - ErrValidatorNotJailed = sdkerrors.Register(ModuleName, 5, "validator not jailed; cannot be unjailed") - ErrMissingSelfDelegation = sdkerrors.Register(ModuleName, 6, "validator has no self-delegation; cannot be unjailed") - ErrSelfDelegationTooLowToUnjail = sdkerrors.Register(ModuleName, 7, "validator's self delegation less than minimum; cannot be unjailed") - ErrNoSigningInfoFound = sdkerrors.Register(ModuleName, 8, "no validator signing info found") -) +// // x/slashing module sentinel errors +// var ( +// ErrNoValidatorForAddress = sdkerrors.Register(ModuleName, 2, "address is not associated with any known validator") +// ErrBadValidatorAddr = sdkerrors.Register(ModuleName, 3, "validator does not exist for that address") +// ErrValidatorJailed = sdkerrors.Register(ModuleName, 4, "validator still jailed; cannot be unjailed") +// ErrValidatorNotJailed = sdkerrors.Register(ModuleName, 5, "validator not jailed; cannot be unjailed") +// ErrMissingSelfDelegation = sdkerrors.Register(ModuleName, 6, "validator has no self-delegation; cannot be unjailed") +// ErrSelfDelegationTooLowToUnjail = sdkerrors.Register(ModuleName, 7, "validator's self delegation less than minimum; cannot be unjailed") +// ErrNoSigningInfoFound = sdkerrors.Register(ModuleName, 8, "no validator signing info found") +// ) diff --git a/x/slashing/types/expected_keepers.go b/x/slashing/types/expected_keepers.go index 5f9a4fee8c72..2ed7911c485c 100644 --- a/x/slashing/types/expected_keepers.go +++ b/x/slashing/types/expected_keepers.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" auth "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // AccountKeeper expected account keeper @@ -36,10 +36,10 @@ type ParamSubspace interface { type StakingKeeper interface { // iterate through validators by operator address, execute func for each validator IterateValidators(sdk.Context, - func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + func(index int64, validator sdkstaking.ValidatorI) (stop bool)) - Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI // get a particular validator by consensus address + Validator(sdk.Context, sdk.ValAddress) sdkstaking.ValidatorI // get a particular validator by operator address + ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) sdkstaking.ValidatorI // get a particular validator by consensus address // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdk.Int @@ -48,7 +48,7 @@ type StakingKeeper interface { // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI + Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) sdkstaking.DelegationI // MaxValidators returns the maximum amount of bonded validators MaxValidators(sdk.Context) uint32 diff --git a/x/slashing/types/genesis.go b/x/slashing/types/genesis.go index b891dec80e8b..9b427e725ac3 100644 --- a/x/slashing/types/genesis.go +++ b/x/slashing/types/genesis.go @@ -11,6 +11,7 @@ import ( func NewGenesisState( params Params, signingInfos []SigningInfo, missedBlocks []ValidatorMissedBlocks, ) *GenesisState { + return &GenesisState{ Params: params, SigningInfos: signingInfos, diff --git a/x/slashing/types/genesis.pb.go b/x/slashing/types/genesis.pb.go index 43240e134db5..1ef3db8de192 100644 --- a/x/slashing/types/genesis.pb.go +++ b/x/slashing/types/genesis.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-proto" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" @@ -30,10 +29,10 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // signing_infos represents a map between validator addresses and their // signing infos. - SigningInfos []SigningInfo `protobuf:"bytes,2,rep,name=signing_infos,json=signingInfos,proto3" json:"signing_infos"` + SigningInfos []SigningInfo `protobuf:"bytes,2,rep,name=signing_infos,json=signingInfos,proto3" json:"signing_infos" yaml:"signing_infos"` // missed_blocks represents a map between validator addresses and their // missed blocks. - MissedBlocks []ValidatorMissedBlocks `protobuf:"bytes,3,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks"` + MissedBlocks []ValidatorMissedBlocks `protobuf:"bytes,3,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks" yaml:"missed_blocks"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -95,7 +94,7 @@ type SigningInfo struct { // address is the validator address. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // validator_signing_info represents the signing info of this validator. - ValidatorSigningInfo ValidatorSigningInfo `protobuf:"bytes,2,opt,name=validator_signing_info,json=validatorSigningInfo,proto3" json:"validator_signing_info"` + ValidatorSigningInfo ValidatorSigningInfo `protobuf:"bytes,2,opt,name=validator_signing_info,json=validatorSigningInfo,proto3" json:"validator_signing_info" yaml:"validator_signing_info"` } func (m *SigningInfo) Reset() { *m = SigningInfo{} } @@ -151,7 +150,7 @@ type ValidatorMissedBlocks struct { // address is the validator address. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // missed_blocks is an array of missed blocks by the validator. - MissedBlocks []MissedBlock `protobuf:"bytes,2,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks"` + MissedBlocks []MissedBlock `protobuf:"bytes,2,rep,name=missed_blocks,json=missedBlocks,proto3" json:"missed_blocks" yaml:"missed_blocks"` } func (m *ValidatorMissedBlocks) Reset() { *m = ValidatorMissedBlocks{} } @@ -257,10 +256,10 @@ func (m *MissedBlock) GetMissed() bool { } func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.slashing.v1beta1.GenesisState") - proto.RegisterType((*SigningInfo)(nil), "cosmos.slashing.v1beta1.SigningInfo") - proto.RegisterType((*ValidatorMissedBlocks)(nil), "cosmos.slashing.v1beta1.ValidatorMissedBlocks") - proto.RegisterType((*MissedBlock)(nil), "cosmos.slashing.v1beta1.MissedBlock") + proto.RegisterType((*GenesisState)(nil), "liquidstaking.slashing.v1beta1.GenesisState") + proto.RegisterType((*SigningInfo)(nil), "liquidstaking.slashing.v1beta1.SigningInfo") + proto.RegisterType((*ValidatorMissedBlocks)(nil), "liquidstaking.slashing.v1beta1.ValidatorMissedBlocks") + proto.RegisterType((*MissedBlock)(nil), "liquidstaking.slashing.v1beta1.MissedBlock") } func init() { @@ -268,34 +267,34 @@ func init() { } var fileDescriptor_1923b9188b635394 = []byte{ - // 420 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xc1, 0x6e, 0xd4, 0x30, - 0x10, 0x86, 0xe3, 0x2e, 0x2c, 0xe0, 0xb4, 0x17, 0x2b, 0x94, 0xd0, 0x43, 0x5a, 0xad, 0x00, 0xf5, - 0x92, 0x44, 0x5d, 0x8e, 0x88, 0x03, 0xb9, 0x54, 0x1c, 0x50, 0x51, 0x56, 0x42, 0x82, 0x4b, 0xe4, - 0x6c, 0x5c, 0xd7, 0xea, 0xc6, 0x5e, 0x65, 0xcc, 0xaa, 0xbc, 0x05, 0x0f, 0xc0, 0x23, 0x70, 0xe4, - 0x21, 0x7a, 0xac, 0x38, 0x71, 0x42, 0x68, 0xf7, 0x29, 0xb8, 0x21, 0x6c, 0x87, 0x8d, 0x60, 0xa3, - 0x95, 0x38, 0x25, 0x63, 0x7f, 0xf3, 0xcf, 0xcc, 0xef, 0xc1, 0x8f, 0xa7, 0x0a, 0x6a, 0x05, 0x29, - 0xcc, 0x28, 0x5c, 0x08, 0xc9, 0xd3, 0xc5, 0x49, 0xc9, 0x34, 0x3d, 0x49, 0x39, 0x93, 0x0c, 0x04, - 0x24, 0xf3, 0x46, 0x69, 0x45, 0x1e, 0x58, 0x2c, 0x69, 0xb1, 0xc4, 0x61, 0x07, 0x01, 0x57, 0x5c, - 0x19, 0x26, 0xfd, 0xfd, 0x67, 0xf1, 0x83, 0x27, 0x7d, 0xaa, 0x7f, 0xf2, 0x2d, 0xf7, 0xd0, 0x72, - 0x85, 0x15, 0x70, 0x35, 0x4c, 0x30, 0xfa, 0x89, 0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, 0x80, 0x6f, - 0x0b, 0x59, 0xb1, 0x2b, 0xd3, 0xd1, 0x20, 0xb7, 0x01, 0xd9, 0xc7, 0x43, 0x9b, 0x64, 0xec, 0xb9, - 0x9b, 0xbb, 0x28, 0x3b, 0xbd, 0x5e, 0x46, 0xe8, 0x66, 0x19, 0xa1, 0x1f, 0xcb, 0x08, 0x7d, 0x5c, - 0x45, 0xde, 0xcd, 0x2a, 0xf2, 0xbe, 0xad, 0x22, 0xef, 0x5d, 0xcc, 0x85, 0xbe, 0x78, 0x5f, 0x26, - 0x53, 0x55, 0xbb, 0xcd, 0x75, 0x9f, 0x18, 0xaa, 0xcb, 0xf4, 0x6a, 0xbd, 0xfb, 0xfa, 0xc3, 0x9c, - 0x41, 0x39, 0x34, 0x6b, 0xfd, 0xf4, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xac, 0xc1, 0x45, 0xfe, - 0x71, 0x03, 0x00, 0x00, + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x3d, 0x8e, 0xd3, 0x40, + 0x14, 0xf6, 0x24, 0x10, 0x60, 0x9c, 0x6d, 0x46, 0x66, 0xb1, 0x56, 0xe0, 0xac, 0x2c, 0x16, 0x6d, + 0x13, 0x5b, 0xbb, 0x74, 0x20, 0x1a, 0x37, 0x2b, 0x0a, 0x24, 0xe4, 0x95, 0x28, 0x68, 0xa2, 0x71, + 0x3c, 0x3b, 0x19, 0xc5, 0xf6, 0x04, 0x3f, 0x13, 0x25, 0x57, 0xa0, 0xa2, 0xe6, 0x06, 0xf4, 0x1c, + 0x22, 0x65, 0x4a, 0xaa, 0x08, 0x25, 0x37, 0xe0, 0x04, 0x28, 0x33, 0x0e, 0x71, 0xa2, 0x98, 0x88, + 0xca, 0x7e, 0xd2, 0xf7, 0xf7, 0xbe, 0xd1, 0xc3, 0x17, 0x7d, 0x09, 0xa9, 0x04, 0x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c7, 0x39, 0x03, 0xdd, 0xd5, 0xa3, 0x70, 0x33, 0x92, 0x2f, 0x08, 0x9f, 0x8e, 0x37, + 0x7e, 0xbd, 0xea, 0x1e, 0x76, 0x43, 0xb5, 0xda, 0x3d, 0x1e, 0xb3, 0x5a, 0xcc, 0x45, 0x99, 0xf2, + 0x99, 0x4e, 0x79, 0x58, 0xda, 0x0d, 0xad, 0xf1, 0x01, 0xb2, 0xfb, 0x0d, 0xe1, 0xc7, 0x07, 0x97, + 0xff, 0xc7, 0x02, 0x7c, 0xbf, 0xdd, 0x63, 0xcf, 0x58, 0xd1, 0xfd, 0xaf, 0x4e, 0x5f, 0x63, 0xb3, + 0x42, 0x25, 0x16, 0xbe, 0x2f, 0xb2, 0x98, 0x4d, 0x54, 0x9e, 0x66, 0xa8, 0x07, 0x72, 0x8a, 0x5b, + 0x9a, 0xa4, 0xda, 0x7b, 0x18, 0x96, 0x53, 0x70, 0x33, 0x5b, 0x3a, 0x68, 0xbe, 0x74, 0xd0, 0xaf, + 0xa5, 0x83, 0xbe, 0xae, 0x1c, 0x63, 0xbe, 0x72, 0x8c, 0x9f, 0x2b, 0xc7, 0xf8, 0xd8, 0xe5, 0xa2, + 0x18, 0x7c, 0x8e, 0xbc, 0xbe, 0x4c, 0xfd, 0xf2, 0x12, 0xf4, 0xa7, 0x0b, 0xf1, 0xd0, 0x9f, 0x6c, + 0xcf, 0xa2, 0x98, 0x8e, 0x18, 0x44, 0x2d, 0x75, 0x0c, 0x2f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x03, 0x3c, 0xa8, 0xf6, 0x8c, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/slashing/types/msg.go b/x/slashing/types/msg.go index e5e0ec0f24f2..374f0c3dd32c 100644 --- a/x/slashing/types/msg.go +++ b/x/slashing/types/msg.go @@ -1,6 +1,7 @@ package types import ( + "github.com/cosmos/cosmos-sdk/codec/legacy" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -30,11 +31,11 @@ func (msg MsgUnjail) GetSigners() []sdk.AccAddress { // GetSignBytes gets the bytes for the message signer to sign on func (msg MsgUnjail) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } -// ValidateBasic does a sanity check on the provided message +// ValidateBasic validity check for the AnteHandler func (msg MsgUnjail) ValidateBasic() error { if _, err := sdk.ValAddressFromBech32(msg.ValidatorAddr); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf("validator input address: %s", err) diff --git a/x/slashing/types/msg_test.go b/x/slashing/types/msg_test.go index 31f7a70e75db..b326c44c2572 100644 --- a/x/slashing/types/msg_test.go +++ b/x/slashing/types/msg_test.go @@ -6,11 +6,12 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" + sdkslashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" ) func TestMsgUnjailGetSignBytes(t *testing.T) { addr := sdk.AccAddress("abcd") - msg := NewMsgUnjail(sdk.ValAddress(addr)) + msg := sdkslashingtypes.NewMsgUnjail(sdk.ValAddress(addr)) bytes := msg.GetSignBytes() require.Equal( t, diff --git a/x/slashing/types/params.go b/x/slashing/types/params.go index ad1d98c37f15..aa9cd559e7db 100644 --- a/x/slashing/types/params.go +++ b/x/slashing/types/params.go @@ -39,6 +39,7 @@ func NewParams( signedBlocksWindow int64, minSignedPerWindow sdk.Dec, downtimeJailDuration time.Duration, slashFractionDoubleSign, slashFractionDowntime sdk.Dec, ) Params { + return Params{ SignedBlocksWindow: signedBlocksWindow, MinSignedPerWindow: minSignedPerWindow, diff --git a/x/slashing/types/query.pb.go b/x/slashing/types/query.pb.go index 76b0dbf79bd3..b774eb5b00cc 100644 --- a/x/slashing/types/query.pb.go +++ b/x/slashing/types/query.pb.go @@ -6,7 +6,6 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -309,12 +308,12 @@ func (m *QuerySigningInfosResponse) GetPagination() *query.PageResponse { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.slashing.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.slashing.v1beta1.QueryParamsResponse") - proto.RegisterType((*QuerySigningInfoRequest)(nil), "cosmos.slashing.v1beta1.QuerySigningInfoRequest") - proto.RegisterType((*QuerySigningInfoResponse)(nil), "cosmos.slashing.v1beta1.QuerySigningInfoResponse") - proto.RegisterType((*QuerySigningInfosRequest)(nil), "cosmos.slashing.v1beta1.QuerySigningInfosRequest") - proto.RegisterType((*QuerySigningInfosResponse)(nil), "cosmos.slashing.v1beta1.QuerySigningInfosResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "liquidstaking.slashing.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "liquidstaking.slashing.v1beta1.QueryParamsResponse") + proto.RegisterType((*QuerySigningInfoRequest)(nil), "liquidstaking.slashing.v1beta1.QuerySigningInfoRequest") + proto.RegisterType((*QuerySigningInfoResponse)(nil), "liquidstaking.slashing.v1beta1.QuerySigningInfoResponse") + proto.RegisterType((*QuerySigningInfosRequest)(nil), "liquidstaking.slashing.v1beta1.QuerySigningInfosRequest") + proto.RegisterType((*QuerySigningInfosResponse)(nil), "liquidstaking.slashing.v1beta1.QuerySigningInfosResponse") } func init() { @@ -322,42 +321,40 @@ func init() { } var fileDescriptor_791b11d41a861ed0 = []byte{ - // 552 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x6b, 0x13, 0x4f, - 0x14, 0xc7, 0xb3, 0x6d, 0x7f, 0x81, 0xdf, 0xa4, 0x88, 0x8c, 0x81, 0xa6, 0x41, 0x36, 0xba, 0x42, - 0x5a, 0xd4, 0xec, 0x9a, 0x88, 0x78, 0x90, 0x1e, 0xcc, 0xc1, 0xe0, 0x4d, 0x53, 0xe9, 0x41, 0x90, - 0x30, 0x9b, 0x4c, 0xa7, 0x83, 0x9b, 0x99, 0xed, 0xce, 0x24, 0x18, 0xc4, 0x8b, 0x67, 0x0f, 0x82, - 0x7f, 0x83, 0x47, 0x0f, 0x82, 0x7f, 0x44, 0x8f, 0x45, 0x2f, 0x9e, 0x44, 0x12, 0xff, 0x02, 0xff, - 0x02, 0xc9, 0xcc, 0x4b, 0xb2, 0x25, 0xae, 0xa6, 0x9e, 0x32, 0x79, 0xf3, 0xbe, 0xdf, 0xf7, 0x79, - 0x33, 0x6f, 0x16, 0x5d, 0xeb, 0x4a, 0xd5, 0x97, 0x2a, 0x50, 0x11, 0x51, 0x47, 0x5c, 0xb0, 0x60, - 0x58, 0x0f, 0xa9, 0x26, 0xf5, 0xe0, 0x78, 0x40, 0x93, 0x91, 0x1f, 0x27, 0x52, 0x4b, 0xbc, 0x65, - 0x93, 0xfc, 0x59, 0x92, 0x0f, 0x49, 0xe5, 0xeb, 0xa0, 0x0e, 0x89, 0xa2, 0x56, 0x31, 0xd7, 0xc7, - 0x84, 0x71, 0x41, 0x34, 0x97, 0xc2, 0x9a, 0x94, 0x8b, 0x4c, 0x32, 0x69, 0x96, 0xc1, 0x74, 0x05, - 0xd1, 0xcb, 0x4c, 0x4a, 0x16, 0xd1, 0x80, 0xc4, 0x3c, 0x20, 0x42, 0x48, 0x6d, 0x24, 0x0a, 0x76, - 0xab, 0x59, 0x74, 0x73, 0x12, 0x9b, 0xb7, 0x6d, 0xf3, 0x3a, 0xd6, 0x1e, 0x68, 0xcd, 0x1f, 0xaf, - 0x88, 0xf0, 0xe3, 0x29, 0xd8, 0x23, 0x92, 0x90, 0xbe, 0x6a, 0xd3, 0xe3, 0x01, 0x55, 0xda, 0x7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x6c, 0x71, 0xc9, 0xca, 0xb7, + 0x97, 0x4b, 0xb6, 0xde, 0xfe, 0xce, 0xfb, 0x6f, 0xbf, 0x3e, 0xad, 0x6c, 0x93, 0x0a, 0xcd, 0xdb, + 0x6c, 0xbb, 0x65, 0xe4, 0x2b, 0xc2, 0xa5, 0x4c, 0xf7, 0xe4, 0xce, 0xbf, 0x6d, 0x16, 0x97, 0xb1, + 0x5c, 0x3f, 0x83, 0xc2, 0xd1, 0xed, 0x19, 0xba, 0xfb, 0xe4, 0x5e, 0x2e, 0x5d, 0x76, 0x37, 0x81, + 0xbe, 0xcd, 0x6e, 0xfb, 0x3b, 0xf2, 0x19, 0xe1, 0xf5, 0xec, 0xdc, 0xc9, 0xf2, 0x08, 0xb3, 0xe7, + 0x6c, 0x9c, 0x45, 0xe2, 0xb0, 0x03, 0x83, 0xbd, 0x4b, 0xaa, 0xcb, 0x61, 0xef, 0x37, 0x8f, 0x47, + 0x1e, 0x3a, 0x19, 0x79, 0xe8, 0xe7, 0xc8, 0x43, 0x1f, 0xc7, 0x5e, 0xe1, 0x64, 0xec, 0x15, 0xbe, + 0x8f, 0xbd, 0xc2, 0xcb, 0x9a, 0x90, 0xe9, 0x61, 0x3f, 0x0c, 0x3a, 0xba, 0x37, 0xad, 0x65, 0x3f, + 0x35, 0xe8, 0xbe, 0xa6, 0x6f, 0xe6, 0x85, 0xd3, 0x61, 0xcc, 0x21, 0x2c, 0x9a, 0xbf, 0xcf, 0xdd, + 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x0f, 0xc0, 0xe6, 0x45, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/slashing/types/query.pb.gw.go b/x/slashing/types/query.pb.gw.go index 31fe8bb6f02c..95446797bfab 100644 --- a/x/slashing/types/query.pb.gw.go +++ b/x/slashing/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest @@ -144,14 +142,12 @@ func local_request_Query_SigningInfos_0(ctx context.Context, marshaler runtime.M // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -159,7 +155,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -173,8 +168,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SigningInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -182,7 +175,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SigningInfo_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -196,8 +188,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SigningInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -205,7 +195,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SigningInfos_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/x/slashing/types/signing_info.go b/x/slashing/types/signing_info.go index d9b00da199e6..43a052d22f7d 100644 --- a/x/slashing/types/signing_info.go +++ b/x/slashing/types/signing_info.go @@ -14,6 +14,7 @@ func NewValidatorSigningInfo( condAddr sdk.ConsAddress, startHeight, indexOffset int64, jailedUntil time.Time, tombstoned bool, missedBlocksCounter int64, ) ValidatorSigningInfo { + return ValidatorSigningInfo{ Address: condAddr.String(), StartHeight: startHeight, diff --git a/x/slashing/types/slashing.pb.go b/x/slashing/types/slashing.pb.go index 3a0e9448e37e..d3ec06474d3f 100644 --- a/x/slashing/types/slashing.pb.go +++ b/x/slashing/types/slashing.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -35,19 +34,19 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ValidatorSigningInfo struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // Height at which validator was first a candidate OR was unjailed - StartHeight int64 `protobuf:"varint,2,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty"` + StartHeight int64 `protobuf:"varint,2,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty" yaml:"start_height"` // Index which is incremented each time the validator was a bonded // in a block and may have signed a precommit or not. This in conjunction with the // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. - IndexOffset int64 `protobuf:"varint,3,opt,name=index_offset,json=indexOffset,proto3" json:"index_offset,omitempty"` + IndexOffset int64 `protobuf:"varint,3,opt,name=index_offset,json=indexOffset,proto3" json:"index_offset,omitempty" yaml:"index_offset"` // Timestamp until which the validator is jailed due to liveness downtime. - JailedUntil time.Time `protobuf:"bytes,4,opt,name=jailed_until,json=jailedUntil,proto3,stdtime" json:"jailed_until"` + JailedUntil time.Time `protobuf:"bytes,4,opt,name=jailed_until,json=jailedUntil,proto3,stdtime" json:"jailed_until" yaml:"jailed_until"` // Whether or not a validator has been tombstoned (killed out of validator set). It is set // once the validator commits an equivocation or for any other configured misbehiavor. Tombstoned bool `protobuf:"varint,5,opt,name=tombstoned,proto3" json:"tombstoned,omitempty"` // A counter kept to avoid unnecessary array reads. // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. - MissedBlocksCounter int64 `protobuf:"varint,6,opt,name=missed_blocks_counter,json=missedBlocksCounter,proto3" json:"missed_blocks_counter,omitempty"` + MissedBlocksCounter int64 `protobuf:"varint,6,opt,name=missed_blocks_counter,json=missedBlocksCounter,proto3" json:"missed_blocks_counter,omitempty" yaml:"missed_blocks_counter"` } func (m *ValidatorSigningInfo) Reset() { *m = ValidatorSigningInfo{} } @@ -126,11 +125,11 @@ func (m *ValidatorSigningInfo) GetMissedBlocksCounter() int64 { // Params represents the parameters used for by the slashing module. type Params struct { - SignedBlocksWindow int64 `protobuf:"varint,1,opt,name=signed_blocks_window,json=signedBlocksWindow,proto3" json:"signed_blocks_window,omitempty"` - MinSignedPerWindow github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=min_signed_per_window,json=minSignedPerWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_signed_per_window"` - DowntimeJailDuration time.Duration `protobuf:"bytes,3,opt,name=downtime_jail_duration,json=downtimeJailDuration,proto3,stdduration" json:"downtime_jail_duration"` - SlashFractionDoubleSign github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slash_fraction_double_sign,json=slashFractionDoubleSign,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_double_sign"` - SlashFractionDowntime github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slash_fraction_downtime,json=slashFractionDowntime,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_downtime"` + SignedBlocksWindow int64 `protobuf:"varint,1,opt,name=signed_blocks_window,json=signedBlocksWindow,proto3" json:"signed_blocks_window,omitempty" yaml:"signed_blocks_window"` + MinSignedPerWindow github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=min_signed_per_window,json=minSignedPerWindow,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_signed_per_window" yaml:"min_signed_per_window"` + DowntimeJailDuration time.Duration `protobuf:"bytes,3,opt,name=downtime_jail_duration,json=downtimeJailDuration,proto3,stdduration" json:"downtime_jail_duration" yaml:"downtime_jail_duration"` + SlashFractionDoubleSign github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=slash_fraction_double_sign,json=slashFractionDoubleSign,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_double_sign" yaml:"slash_fraction_double_sign"` + SlashFractionDowntime github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slash_fraction_downtime,json=slashFractionDowntime,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_fraction_downtime" yaml:"slash_fraction_downtime"` } func (m *Params) Reset() { *m = Params{} } @@ -181,8 +180,8 @@ func (m *Params) GetDowntimeJailDuration() time.Duration { } func init() { - proto.RegisterType((*ValidatorSigningInfo)(nil), "cosmos.slashing.v1beta1.ValidatorSigningInfo") - proto.RegisterType((*Params)(nil), "cosmos.slashing.v1beta1.Params") + proto.RegisterType((*ValidatorSigningInfo)(nil), "liquidstaking.slashing.v1beta1.ValidatorSigningInfo") + proto.RegisterType((*Params)(nil), "liquidstaking.slashing.v1beta1.Params") } func init() { @@ -190,43 +189,47 @@ func init() { } var fileDescriptor_1078e5d96a74cc52 = []byte{ - // 576 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x3f, 0x6f, 0xd3, 0x40, - 0x1c, 0x8d, 0x1b, 0x08, 0xe1, 0x92, 0xe9, 0x48, 0x89, 0x9b, 0xc1, 0x0e, 0x1d, 0xaa, 0x2c, 0xb1, - 0x69, 0xd8, 0xd8, 0x08, 0x11, 0x7f, 0x07, 0x2a, 0x87, 0x3f, 0x82, 0x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0xcb, 0x03, 0x27, 0xe4, 0x69, 0x79, 0x6c, 0xe5, - 0xcf, 0x50, 0xe0, 0xb9, 0x2b, 0x3f, 0x2f, 0x88, 0x70, 0x26, 0x24, 0xf4, 0x60, 0x4a, 0xd9, 0x54, - 0x79, 0xed, 0x91, 0xac, 0x8c, 0x78, 0x0f, 0xee, 0x62, 0xbe, 0x64, 0xc5, 0x5d, 0xf0, 0x8b, 0x56, - 0xfc, 0xea, 0xd6, 0xa8, 0xce, 0x5b, 0xa3, 0xad, 0x4b, 0x85, 0x4e, 0x4a, 0x81, 0xee, 0xf3, 0xb0, - 0xe8, 0xb3, 0x53, 0x59, 0xbc, 0x40, 0x34, 0xa9, 0x78, 0x38, 0x07, 0x3d, 0x75, 0x75, 0xfd, 0x28, - 0x43, 0x61, 0x81, 0xf8, 0x98, 0xe7, 0x41, 0x42, 0xd4, 0x3e, 0xea, 0xbc, 0xae, 0xbf, 0x42, 0x57, - 0x39, 0x3e, 0x29, 0x0d, 0x27, 0xca, 0xaf, 0x58, 0x09, 0x46, 0xa0, 0x7b, 0x29, 0x4c, 0xbf, 0x93, - 0x3a, 0xd2, 0xeb, 0x27, 0x6d, 0x5e, 0x48, 0xd2, 0x66, 0xe3, 0x97, 0x5f, 0x56, 0x96, 0x71, 0xbc, - 0xb2, 0x8c, 0x93, 0x95, 0x65, 0xfc, 0x59, 0x59, 0xc6, 0xc1, 0xda, 0xaa, 0x9d, 0xac, 0xad, 0xda, - 0xcf, 0xb5, 0x55, 0xfb, 0x30, 0xbc, 0xd2, 0x7c, 0xff, 0xfc, 0x93, 0x57, 0x39, 0x41, 0x43, 0x95, - 0xfa, 0xe0, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xbe, 0xf2, 0xba, 0x12, 0x04, 0x00, 0x00, + // 636 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xbd, 0x6f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c, 0x52, + 0xa8, 0xad, 0xab, 0xf3, 0xab, 0xfb, 0x9b, 0x37, 0xf6, 0x63, 0x5d, 0xe3, 0x47, 0xcb, 0x3a, 0xc1, + 0xd2, 0x94, 0x19, 0x8d, 0xfb, 0x2f, 0xbf, 0x8d, 0x2d, 0x70, 0x32, 0xb6, 0xc0, 0xe9, 0xd8, 0x02, + 0xbf, 0xc6, 0x16, 0x38, 0x3c, 0xb3, 0x2a, 0xa7, 0x67, 0x56, 0xe5, 0xfb, 0x99, 0x55, 0xf9, 0xb0, + 0xf2, 0xcf, 0xe7, 0xf7, 0x2e, 0xff, 0xd4, 0x94, 0x93, 0x68, 0x5e, 0xad, 0xef, 0xf1, 0xdf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x7b, 0x78, 0xfd, 0x40, 0xf4, 0x04, 0x00, 0x00, } func (this *ValidatorSigningInfo) Equal(that interface{}) bool { diff --git a/x/slashing/types/tx.pb.go b/x/slashing/types/tx.pb.go index 0ecb663dc21f..756ea9716f63 100644 --- a/x/slashing/types/tx.pb.go +++ b/x/slashing/types/tx.pb.go @@ -6,8 +6,6 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -32,7 +30,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgUnjail defines the Msg/Unjail request type type MsgUnjail struct { - ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"address"` + ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"address" yaml:"address"` } func (m *MsgUnjail) Reset() { *m = MsgUnjail{} } @@ -106,33 +104,31 @@ func (m *MsgUnjailResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnjailResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgUnjail)(nil), "cosmos.slashing.v1beta1.MsgUnjail") - proto.RegisterType((*MsgUnjailResponse)(nil), "cosmos.slashing.v1beta1.MsgUnjailResponse") + proto.RegisterType((*MsgUnjail)(nil), "liquidstaking.slashing.v1beta1.MsgUnjail") + proto.RegisterType((*MsgUnjailResponse)(nil), "liquidstaking.slashing.v1beta1.MsgUnjailResponse") } func init() { proto.RegisterFile("cosmos/slashing/v1beta1/tx.proto", fileDescriptor_3c5611c0c4a59d9d) } var fileDescriptor_3c5611c0c4a59d9d = []byte{ - // 296 bytes of a gzipped FileDescriptorProto + // 269 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x2f, 0xce, 0x49, 0x2c, 0xce, 0xc8, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, 0xd0, 0x83, 0xa9, 0xd0, 0x83, 0xaa, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd1, 0x07, - 0xb1, 0x20, 0xca, 0xa5, 0x24, 0x21, 0xca, 0xe3, 0x21, 0x12, 0x50, 0xbd, 0x10, 0x29, 0xa8, 0x49, - 0xfa, 0xb9, 0xc5, 0x20, 0x6b, 0x40, 0x14, 0x44, 0x42, 0xa9, 0x84, 0x8b, 0xd3, 0xb7, 0x38, 0x3d, - 0x34, 0x2f, 0x2b, 0x31, 0x33, 0x47, 0xc8, 0x8b, 0x8b, 0xaf, 0x2c, 0x31, 0x27, 0x33, 0x25, 0xb1, - 0x24, 0xbf, 0x28, 0x3e, 0x31, 0x25, 0xa5, 0x48, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd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0x12, 0x33, 0x73, + 0x84, 0x5c, 0xb8, 0xf8, 0xca, 0x12, 0x73, 0x32, 0x53, 0x12, 0x4b, 0xf2, 0x8b, 0xe2, 0x13, 0x53, + 0x52, 0x8a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x64, 0x5f, 0xdd, 0x93, 0x67, 0x07, 0xf1, + 0x53, 0x8b, 0x8b, 0x3f, 0xdd, 0x93, 0xe7, 0xab, 0x4c, 0xcc, 0xcd, 0xb1, 0x52, 0x82, 0x0a, 0x28, + 0x05, 0xf1, 0xc2, 0x35, 0x39, 0xa6, 0xa4, 0x14, 0x59, 0x71, 0x74, 0x2c, 0x90, 0x67, 0x98, 0xb1, + 0x40, 0x9e, 0x51, 0x49, 0x98, 0x4b, 0x10, 0x6e, 0x78, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, + 0xaa, 0x51, 0x3c, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x04, 0x17, 0x1b, 0xd4, 0x56, 0x25, 0x3d, + 0x1c, 0x4e, 0xd6, 0x83, 0x6b, 0x96, 0xd2, 0x22, 0xac, 0x06, 0x66, 0x81, 0x93, 0xf7, 0x8a, 0x47, + 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, + 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9b, 0x9e, 0x59, + 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x0d, 0x4c, 0x08, 0xa5, 0x5b, 0x9c, 0x92, + 0xad, 0x5f, 0x81, 0x08, 0xd9, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x30, 0x19, 0x03, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x1b, 0xa7, 0xdc, 0xcf, 0x79, 0x01, 0x00, 0x00, } func (this *MsgUnjail) Equal(that interface{}) bool { diff --git a/x/staking/app_test.go b/x/staking/app_test.go index 5a3bd723cb9c..68268ce26781 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -7,11 +7,12 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func checkValidator(t *testing.T, app *simapp.SimApp, addr sdk.ValAddress, expFound bool) types.Validator { @@ -26,6 +27,7 @@ func checkDelegation( t *testing.T, app *simapp.SimApp, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, expFound bool, expShares sdk.Dec, ) { + ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{}) delegation, found := app.StakingKeeper.GetDelegation(ctxCheck, delegatorAddr, validatorAddr) if expFound { @@ -65,7 +67,7 @@ func TestStakingMsgs(t *testing.T) { // create validator description := types.NewDescription("foo_moniker", "", "", "", "") createValidatorMsg, err := types.NewMsgCreateValidator( - sdk.ValAddress(addr1), valKey.PubKey(), bondCoin, description, commissionRates, sdk.OneInt(), + sdk.ValAddress(addr1), valKey.PubKey(), bondCoin, description, commissionRates, ) require.NoError(t, err) @@ -80,7 +82,7 @@ func TestStakingMsgs(t *testing.T) { validator := checkValidator(t, app, sdk.ValAddress(addr1), true) require.Equal(t, sdk.ValAddress(addr1).String(), validator.OperatorAddress) - require.Equal(t, types.Bonded, validator.Status) + require.Equal(t, sdkstaking.Bonded, validator.Status) require.True(sdk.IntEq(t, bondTokens, validator.BondedTokens())) header = tmproto.Header{Height: app.LastBlockHeight() + 1} @@ -88,7 +90,7 @@ func TestStakingMsgs(t *testing.T) { // edit the validator description = types.NewDescription("bar_moniker", "", "", "", "") - editValidatorMsg := types.NewMsgEditValidator(sdk.ValAddress(addr1), description, nil, nil) + editValidatorMsg := types.NewMsgEditValidator(sdk.ValAddress(addr1), description, nil) header = tmproto.Header{Height: app.LastBlockHeight() + 1} _, _, err = simapp.SignCheckDeliver(t, txGen, app.BaseApp, header, []sdk.Msg{editValidatorMsg}, "", []uint64{0}, []uint64{1}, true, true, priv1) diff --git a/x/staking/client/cli/flags.go b/x/staking/client/cli/flags.go index 85879567a6af..5b1b49b06dd8 100644 --- a/x/staking/client/cli/flags.go +++ b/x/staking/client/cli/flags.go @@ -26,8 +26,6 @@ const ( FlagCommissionMaxRate = "commission-max-rate" FlagCommissionMaxChangeRate = "commission-max-change-rate" - FlagMinSelfDelegation = "min-self-delegation" - FlagGenesisFormat = "genesis-format" FlagNodeID = "node-id" FlagIP = "ip" @@ -59,13 +57,6 @@ func FlagSetCommissionCreate() *flag.FlagSet { return fs } -// FlagSetMinSelfDelegation Returns the FlagSet used for minimum set delegation. -func FlagSetMinSelfDelegation() *flag.FlagSet { - fs := flag.NewFlagSet("", flag.ContinueOnError) - fs.String(FlagMinSelfDelegation, "", "The minimum self delegation required on the validator") - return fs -} - // FlagSetAmount Returns the FlagSet for amount related operations. func FlagSetAmount() *flag.FlagSet { fs := flag.NewFlagSet("", flag.ContinueOnError) diff --git a/x/staking/client/cli/query.go b/x/staking/client/cli/query.go index 0982296161e4..7521d014b2c4 100644 --- a/x/staking/client/cli/query.go +++ b/x/staking/client/cli/query.go @@ -39,6 +39,12 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryHistoricalInfo(), GetCmdQueryParams(), GetCmdQueryPool(), + GetCmdQueryTokenizeShareRecordById(), + GetCmdQueryTokenizeShareRecordByDenom(), + GetCmdQueryTokenizeShareRecordsOwned(), + GetCmdQueryAllTokenizeShareRecords(), + GetCmdQueryLastTokenizeShareRecordId(), + GetCmdQueryTotalTokenizeSharedAssets(), ) return stakingQueryCmd @@ -744,3 +750,235 @@ $ %s query staking params return cmd } + +// GetCmdQueryTokenizeShareRecordById implements the query for individual tokenize share record information by share by id +func GetCmdQueryTokenizeShareRecordById() *cobra.Command { + cmd := &cobra.Command{ + Use: "tokenize-share-record-by-id [id]", + Args: cobra.ExactArgs(1), + Short: "Query individual tokenize share record information by share by id", + Long: strings.TrimSpace( + fmt.Sprintf(`Query individual tokenize share record information by share by id. + +Example: +$ %s query staking tokenize-share-record-by-id [id] +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + id, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + + res, err := queryClient.TokenizeShareRecordById(cmd.Context(), &types.QueryTokenizeShareRecordByIdRequest{ + Id: uint64(id), + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryTokenizeShareRecordByDenom implements the query for individual tokenize share record information by share denom +func GetCmdQueryTokenizeShareRecordByDenom() *cobra.Command { + cmd := &cobra.Command{ + Use: "tokenize-share-record-by-denom", + Args: cobra.ExactArgs(1), + Short: "Query individual tokenize share record information by share denom", + Long: strings.TrimSpace( + fmt.Sprintf(`Query individual tokenize share record information by share denom. + +Example: +$ %s query staking tokenize-share-record-by-denom +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.TokenizeShareRecordByDenom(cmd.Context(), &types.QueryTokenizeShareRecordByDenomRequest{ + Denom: args[0], + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryTokenizeShareRecordsOwned implements the query tokenize share records by address +func GetCmdQueryTokenizeShareRecordsOwned() *cobra.Command { + cmd := &cobra.Command{ + Use: "tokenize-share-records-owned", + Args: cobra.ExactArgs(1), + Short: "Query tokenize share records by address", + Long: strings.TrimSpace( + fmt.Sprintf(`Query tokenize share records by address. + +Example: +$ %s query staking tokenize-share-records-owned [owner] +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + owner, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + res, err := queryClient.TokenizeShareRecordsOwned(cmd.Context(), &types.QueryTokenizeShareRecordsOwnedRequest{ + Owner: owner.String(), + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryAllTokenizeShareRecords implements the query for all tokenize share records +func GetCmdQueryAllTokenizeShareRecords() *cobra.Command { + cmd := &cobra.Command{ + Use: "all-tokenize-share-records", + Args: cobra.NoArgs, + Short: "Query for all tokenize share records", + Long: strings.TrimSpace( + fmt.Sprintf(`Query for all tokenize share records. + +Example: +$ %s query staking all-tokenize-share-records +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.AllTokenizeShareRecords(cmd.Context(), &types.QueryAllTokenizeShareRecordsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryLastTokenizeShareRecordId implements the query for last tokenize share record id +func GetCmdQueryLastTokenizeShareRecordId() *cobra.Command { + cmd := &cobra.Command{ + Use: "last-tokenize-share-record-id", + Args: cobra.NoArgs, + Short: "Query for last tokenize share record id", + Long: strings.TrimSpace( + fmt.Sprintf(`Query for last tokenize share record id. + +Example: +$ %s query staking last-tokenize-share-record-id +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.LastTokenizeShareRecordId(cmd.Context(), &types.QueryLastTokenizeShareRecordIdRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryTotalTokenizeSharedAssets implements the query for total tokenized staked assets +func GetCmdQueryTotalTokenizeSharedAssets() *cobra.Command { + cmd := &cobra.Command{ + Use: "total-tokenize-share-assets", + Args: cobra.NoArgs, + Short: "Query for total tokenized staked assets", + Long: strings.TrimSpace( + fmt.Sprintf(`Query for total tokenized staked assets. + +Example: +$ %s query staking total-tokenize-share-assets +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.TotalTokenizeSharedAssets(cmd.Context(), &types.QueryTotalTokenizeSharedAssetsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/staking/client/cli/tx.go b/x/staking/client/cli/tx.go index f184d27d6a94..c4a47c83f16a 100644 --- a/x/staking/client/cli/tx.go +++ b/x/staking/client/cli/tx.go @@ -14,7 +14,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -26,7 +25,6 @@ var ( defaultCommissionRate = "0.1" defaultCommissionMaxRate = "0.2" defaultCommissionMaxChangeRate = "0.01" - defaultMinSelfDelegation = "1" ) // NewTxCmd returns a root CLI command handler for all x/staking transaction commands. @@ -45,13 +43,15 @@ func NewTxCmd() *cobra.Command { NewDelegateCmd(), NewRedelegateCmd(), NewUnbondCmd(), - NewCancelUnbondingDelegation(), + NewTokenizeSharesCmd(), + NewRedeemTokensCmd(), + NewTransferTokenizeShareRecordCmd(), + NewExemptDelegationCmd(), ) return stakingTxCmd } -// NewCreateValidatorCmd returns a CLI command handler for creating a MsgCreateValidator transaction. func NewCreateValidatorCmd() *cobra.Command { cmd := &cobra.Command{ Use: "create-validator", @@ -77,7 +77,6 @@ func NewCreateValidatorCmd() *cobra.Command { cmd.Flags().AddFlagSet(FlagSetAmount()) cmd.Flags().AddFlagSet(flagSetDescriptionCreate()) cmd.Flags().AddFlagSet(FlagSetCommissionCreate()) - cmd.Flags().AddFlagSet(FlagSetMinSelfDelegation()) cmd.Flags().String(FlagIP, "", fmt.Sprintf("The node's public IP. It takes effect only when used in combination with --%s", flags.FlagGenerateOnly)) cmd.Flags().String(FlagNodeID, "", "The node's ID") @@ -91,7 +90,6 @@ func NewCreateValidatorCmd() *cobra.Command { return cmd } -// NewEditValidatorCmd returns a CLI command handler for creating a MsgEditValidator transaction. func NewEditValidatorCmd() *cobra.Command { cmd := &cobra.Command{ Use: "edit-validator", @@ -121,19 +119,7 @@ func NewEditValidatorCmd() *cobra.Command { newRate = &rate } - var newMinSelfDelegation *sdk.Int - - minSelfDelegationString, _ := cmd.Flags().GetString(FlagMinSelfDelegation) - if minSelfDelegationString != "" { - msb, ok := sdk.NewIntFromString(minSelfDelegationString) - if !ok { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "minimum self delegation must be a positive integer") - } - - newMinSelfDelegation = &msb - } - - msg := types.NewMsgEditValidator(sdk.ValAddress(valAddr), description, newRate, newMinSelfDelegation) + msg := types.NewMsgEditValidator(sdk.ValAddress(valAddr), description, newRate) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, @@ -141,13 +127,11 @@ func NewEditValidatorCmd() *cobra.Command { cmd.Flags().AddFlagSet(flagSetDescriptionEdit()) cmd.Flags().AddFlagSet(flagSetCommissionUpdate()) - cmd.Flags().AddFlagSet(FlagSetMinSelfDelegation()) flags.AddTxFlagsToCmd(cmd) return cmd } -// NewDelegateCmd returns a CLI command handler for creating a MsgDelegate transaction. func NewDelegateCmd() *cobra.Command { bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() @@ -191,7 +175,6 @@ $ %s tx staking delegate %s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 1000stake --f return cmd } -// NewRedelegateCmd returns a CLI command handler for creating a MsgBeginRedelegate transaction. func NewRedelegateCmd() *cobra.Command { bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() @@ -240,7 +223,6 @@ $ %s tx staking redelegate %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj %s1l2rsakp3 return cmd } -// NewUnbondCmd returns a CLI command handler for creating a MsgUndelegate transaction. func NewUnbondCmd() *cobra.Command { bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() @@ -284,57 +266,6 @@ $ %s tx staking unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from return cmd } -// NewCancelUnbondingDelegation returns a CLI command handler for creating a MsgCancelUnbondingDelegation transaction. -func NewCancelUnbondingDelegation() *cobra.Command { - bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() - - cmd := &cobra.Command{ - Use: "cancel-unbond [validator-addr] [amount] [creation-height]", - Short: "Cancel unbonding delegation and delegate back to the validator", - Args: cobra.ExactArgs(3), - Long: strings.TrimSpace( - fmt.Sprintf(`Cancel Unbonding Delegation and delegate back to the validator. - -Example: -$ %s tx staking cancel-unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake 2 --from mykey -`, - version.AppName, bech32PrefixValAddr, - ), - ), - Example: fmt.Sprintf(`$ %s tx staking cancel-unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake 2 --from mykey`, - version.AppName, bech32PrefixValAddr), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - delAddr := clientCtx.GetFromAddress() - valAddr, err := sdk.ValAddressFromBech32(args[0]) - if err != nil { - return err - } - - amount, err := sdk.ParseCoinNormalized(args[1]) - if err != nil { - return err - } - - creationHeight, err := strconv.ParseInt(args[2], 10, 64) - if err != nil { - return sdkerrors.Wrap(fmt.Errorf("invalid height: %d", creationHeight), "invalid height") - } - - msg := types.NewMsgCancelUnbondingDelegation(delAddr, valAddr, creationHeight, amount) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - func newBuildCreateValidatorMsg(clientCtx client.Context, txf tx.Factory, fs *flag.FlagSet) (tx.Factory, *types.MsgCreateValidator, error) { fAmount, _ := fs.GetString(FlagAmount) amount, err := sdk.ParseCoinNormalized(fAmount) @@ -376,17 +307,8 @@ func newBuildCreateValidatorMsg(clientCtx client.Context, txf tx.Factory, fs *fl return txf, nil, err } - // get the initial validator min self delegation - msbStr, _ := fs.GetString(FlagMinSelfDelegation) - - minSelfDelegation, ok := sdk.NewIntFromString(msbStr) - if !ok { - return txf, nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "minimum self delegation must be a positive integer") - } - msg, err := types.NewMsgCreateValidator( - sdk.ValAddress(valAddr), pk, amount, description, commissionRates, minSelfDelegation, - ) + sdk.ValAddress(valAddr), pk, amount, description, commissionRates) if err != nil { return txf, nil, err } @@ -419,7 +341,6 @@ func CreateValidatorMsgFlagSet(ipDefault string) (fs *flag.FlagSet, defaultsDesc fsCreateValidator.String(FlagDetails, "", "The validator's (optional) details") fsCreateValidator.String(FlagIdentity, "", "The (optional) identity signature (ex. UPort or Keybase)") fsCreateValidator.AddFlagSet(FlagSetCommissionCreate()) - fsCreateValidator.AddFlagSet(FlagSetMinSelfDelegation()) fsCreateValidator.AddFlagSet(FlagSetAmount()) fsCreateValidator.AddFlagSet(FlagSetPublicKey()) @@ -428,10 +349,8 @@ func CreateValidatorMsgFlagSet(ipDefault string) (fs *flag.FlagSet, defaultsDesc commission rate: %s commission max rate: %s commission max change rate: %s - minimum self delegation: %s `, defaultAmount, defaultCommissionRate, - defaultCommissionMaxRate, defaultCommissionMaxChangeRate, - defaultMinSelfDelegation) + defaultCommissionMaxRate, defaultCommissionMaxChangeRate) return fsCreateValidator, defaultsDesc } @@ -446,7 +365,6 @@ type TxCreateValidatorConfig struct { CommissionRate string CommissionMaxRate string CommissionMaxChangeRate string - MinSelfDelegation string PubKey cryptotypes.PubKey @@ -514,11 +432,6 @@ func PrepareConfigForTxCreateValidator(flagSet *flag.FlagSet, moniker, nodeID, c return c, err } - c.MinSelfDelegation, err = flagSet.GetString(FlagMinSelfDelegation) - if err != nil { - return c, err - } - c.NodeID = nodeID c.PubKey = valPubKey c.Website = website @@ -544,10 +457,6 @@ func PrepareConfigForTxCreateValidator(flagSet *flag.FlagSet, moniker, nodeID, c c.CommissionMaxChangeRate = defaultCommissionMaxChangeRate } - if c.MinSelfDelegation == "" { - c.MinSelfDelegation = defaultMinSelfDelegation - } - return c, nil } @@ -555,6 +464,7 @@ func PrepareConfigForTxCreateValidator(flagSet *flag.FlagSet, moniker, nodeID, c func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorConfig, txBldr tx.Factory, generateOnly bool) (tx.Factory, sdk.Msg, error) { amounstStr := config.Amount amount, err := sdk.ParseCoinNormalized(amounstStr) + if err != nil { return txBldr, nil, err } @@ -573,20 +483,13 @@ func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorC maxRateStr := config.CommissionMaxRate maxChangeRateStr := config.CommissionMaxChangeRate commissionRates, err := buildCommissionRates(rateStr, maxRateStr, maxChangeRateStr) + if err != nil { return txBldr, nil, err } - // get the initial validator min self delegation - msbStr := config.MinSelfDelegation - minSelfDelegation, ok := sdk.NewIntFromString(msbStr) - - if !ok { - return txBldr, nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "minimum self delegation must be a positive integer") - } - msg, err := types.NewMsgCreateValidator( - sdk.ValAddress(valAddr), config.PubKey, amount, description, commissionRates, minSelfDelegation, + sdk.ValAddress(valAddr), config.PubKey, amount, description, commissionRates, ) if err != nil { return txBldr, msg, err @@ -602,3 +505,182 @@ func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorC return txBldr, msg, nil } + +// NewTokenizeSharesCmd defines a command for tokenizing shares from a validator. +func NewTokenizeSharesCmd() *cobra.Command { + bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() + bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() + + cmd := &cobra.Command{ + Use: "tokenize-share [validator-addr] [amount] [rewardOwner]", + Short: "Tokenize delegation to share tokens", + Args: cobra.ExactArgs(3), + Long: strings.TrimSpace( + fmt.Sprintf(`Tokenize delegation to share tokens. + +Example: +$ %s tx staking tokenize-share %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey +`, + version.AppName, bech32PrefixValAddr, bech32PrefixAccAddr, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + delAddr := clientCtx.GetFromAddress() + valAddr, err := sdk.ValAddressFromBech32(args[0]) + if err != nil { + return err + } + + amount, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + rewardOwner, err := sdk.AccAddressFromBech32(args[2]) + if err != nil { + return err + } + + msg := &types.MsgTokenizeShares{ + DelegatorAddress: delAddr.String(), + ValidatorAddress: valAddr.String(), + Amount: amount, + TokenizedShareOwner: rewardOwner.String(), + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewRedeemTokensCmd defines a command for redeeming tokens from a validator for shares. +func NewRedeemTokensCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "redeem-tokens [amount]", + Short: "Redeem specified amount of share tokens to delegation", + Args: cobra.ExactArgs(1), + Long: strings.TrimSpace( + fmt.Sprintf(`Redeem specified amount of share tokens to delegation. + +Example: +$ %s tx staking redeem-tokens 100sharetoken --from mykey +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + delAddr := clientCtx.GetFromAddress() + + amount, err := sdk.ParseCoinNormalized(args[0]) + if err != nil { + return err + } + + msg := &types.MsgRedeemTokensforShares{ + DelegatorAddress: delAddr.String(), + Amount: amount, + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewTransferTokenizeShareRecordCmd defines a command to transfer ownership of TokenizeShareRecord +func NewTransferTokenizeShareRecordCmd() *cobra.Command { + bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() + + cmd := &cobra.Command{ + Use: "transfer-tokenize-share-record [record-id] [new-owner]", + Short: "Transfer ownership of TokenizeShareRecord", + Args: cobra.ExactArgs(2), + Long: strings.TrimSpace( + fmt.Sprintf(`Transfer ownership of TokenizeShareRecord. + +Example: +$ %s tx staking transfer-tokenize-share-record 1 %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey +`, + version.AppName, bech32PrefixAccAddr, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + recordId, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + + ownerAddr, err := sdk.AccAddressFromBech32(args[1]) + if err != nil { + return err + } + + msg := &types.MsgTransferTokenizeShareRecord{ + Sender: clientCtx.GetFromAddress().String(), + TokenizeShareRecordId: uint64(recordId), + NewOwner: ownerAddr.String(), + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewExemptDelegationCmd defines a command to make delegation to a validator as exempt delegation +func NewExemptDelegationCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "exempt-delegation [validator]", + Short: "Make delegation to a validator as exempt delegation", + Args: cobra.ExactArgs(1), + Long: strings.TrimSpace( + fmt.Sprintf(`Make delegation to a validator as exempt delegation. + +Example: +$ %s tx staking exempt-delegation cosmosvaloper13h5xdxhsdaugwdrkusf8lkgu406h8t62jkqv3h --from mykey +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := &types.MsgExemptDelegation{ + DelegatorAddress: clientCtx.GetFromAddress().String(), + ValidatorAddress: args[0], + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/staking/client/cli/tx_test.go b/x/staking/client/cli/tx_test.go index 243780bc6e03..a41455e4ca56 100644 --- a/x/staking/client/cli/tx_test.go +++ b/x/staking/client/cli/tx_test.go @@ -17,7 +17,7 @@ func TestPrepareConfigForTxCreateValidator(t *testing.T) { privKey := ed25519.GenPrivKey() valPubKey := privKey.PubKey() moniker := "DefaultMoniker" - mkTxValCfg := func(amount, commission, commissionMax, commissionMaxChange, minSelfDelegation string) TxCreateValidatorConfig { + mkTxValCfg := func(amount, commission, commissionMax, commissionMaxChange string) TxCreateValidatorConfig { return TxCreateValidatorConfig{ IP: ip, ChainID: chainID, @@ -28,7 +28,6 @@ func TestPrepareConfigForTxCreateValidator(t *testing.T) { CommissionRate: commission, CommissionMaxRate: commissionMax, CommissionMaxChangeRate: commissionMaxChange, - MinSelfDelegation: minSelfDelegation, } } @@ -42,42 +41,31 @@ func TestPrepareConfigForTxCreateValidator(t *testing.T) { fsModify: func(fs *pflag.FlagSet) { return }, - expectedCfg: mkTxValCfg(defaultAmount, "0.1", "0.2", "0.01", "1"), - }, - { + expectedCfg: mkTxValCfg(defaultAmount, "0.1", "0.2", "0.01"), + }, { name: "Custom amount", fsModify: func(fs *pflag.FlagSet) { fs.Set(FlagAmount, "2000stake") }, - expectedCfg: mkTxValCfg("2000stake", "0.1", "0.2", "0.01", "1"), - }, - { + expectedCfg: mkTxValCfg("2000stake", "0.1", "0.2", "0.01"), + }, { name: "Custom commission rate", fsModify: func(fs *pflag.FlagSet) { fs.Set(FlagCommissionRate, "0.54") }, - expectedCfg: mkTxValCfg(defaultAmount, "0.54", "0.2", "0.01", "1"), - }, - { + expectedCfg: mkTxValCfg(defaultAmount, "0.54", "0.2", "0.01"), + }, { name: "Custom commission max rate", fsModify: func(fs *pflag.FlagSet) { fs.Set(FlagCommissionMaxRate, "0.89") }, - expectedCfg: mkTxValCfg(defaultAmount, "0.1", "0.89", "0.01", "1"), - }, - { + expectedCfg: mkTxValCfg(defaultAmount, "0.1", "0.89", "0.01"), + }, { name: "Custom commission max change rate", fsModify: func(fs *pflag.FlagSet) { fs.Set(FlagCommissionMaxChangeRate, "0.55") }, - expectedCfg: mkTxValCfg(defaultAmount, "0.1", "0.2", "0.55", "1"), - }, - { - name: "Custom min self delegations", - fsModify: func(fs *pflag.FlagSet) { - fs.Set(FlagMinSelfDelegation, "0.33") - }, - expectedCfg: mkTxValCfg(defaultAmount, "0.1", "0.2", "0.01", "0.33"), + expectedCfg: mkTxValCfg(defaultAmount, "0.1", "0.2", "0.55"), }, } diff --git a/x/staking/client/testutil/grpc.go b/x/staking/client/testutil/grpc.go index 26093aa15bc3..b601da4f9e52 100644 --- a/x/staking/client/testutil/grpc.go +++ b/x/staking/client/testutil/grpc.go @@ -148,7 +148,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryValidatorDelegations() { &types.QueryValidatorDelegationsResponse{}, &types.QueryValidatorDelegationsResponse{ DelegationResponses: types.DelegationResponses{ - types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), + types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), false, sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), }, Pagination: &query.PageResponse{Total: 1}, }, @@ -348,7 +348,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryUnbondingDelegation() { s.Require().NoError(err) s.Require().Equal(ubd.Unbond.DelegatorAddress, val.Address.String()) s.Require().Equal(ubd.Unbond.ValidatorAddress, val.ValAddress.String()) - s.Require().Len(ubd.Unbond.Entries, 2) + s.Require().Len(ubd.Unbond.Entries, 1) } }) } @@ -398,7 +398,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryDelegatorDelegations() { &types.QueryDelegatorDelegationsResponse{}, &types.QueryDelegatorDelegationsResponse{ DelegationResponses: types.DelegationResponses{ - types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), + types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), false, sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), }, Pagination: &query.PageResponse{Total: 1}, }, diff --git a/x/staking/client/testutil/suite.go b/x/staking/client/testutil/suite.go index 92323b07e462..85988d132764 100644 --- a/x/staking/client/testutil/suite.go +++ b/x/staking/client/testutil/suite.go @@ -18,9 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" - "github.com/cosmos/cosmos-sdk/testutil/rest" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" "github.com/cosmos/cosmos-sdk/x/staking/client/cli" @@ -73,21 +71,11 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().Equal(uint32(0), txRes.Code) _, err = s.network.WaitForHeight(1) s.Require().NoError(err) - - unbondingAmount := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5)) - // unbonding the amount - out, err = MsgUnbondExec(val.ClientCtx, val.Address, val.ValAddress, unbondingAmount) - s.Require().NoError(err) - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txRes)) - s.Require().Equal(uint32(0), txRes.Code) - // unbonding the amount - out, err = MsgUnbondExec(val.ClientCtx, val.Address, val.ValAddress, unbondingAmount) - s.Require().NoError(err) + // unbonding + _, err = MsgUnbondExec(val.ClientCtx, val.Address, val.ValAddress, unbond) s.Require().NoError(err) - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txRes)) - s.Require().Equal(uint32(0), txRes.Code) - err = s.network.WaitForNextBlock() + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } @@ -139,7 +127,6 @@ func (s *IntegrationTestSuite) TestNewCreateValidatorCmd() { fmt.Sprintf("--%s=0.5", cli.FlagCommissionRate), fmt.Sprintf("--%s=1.0", cli.FlagCommissionMaxRate), fmt.Sprintf("--%s=0.1", cli.FlagCommissionMaxChangeRate), - fmt.Sprintf("--%s=1", cli.FlagMinSelfDelegation), fmt.Sprintf("--%s=%s", flags.FlagFrom, newAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), @@ -158,7 +145,6 @@ func (s *IntegrationTestSuite) TestNewCreateValidatorCmd() { fmt.Sprintf("--%s=0.5", cli.FlagCommissionRate), fmt.Sprintf("--%s=1.0", cli.FlagCommissionMaxRate), fmt.Sprintf("--%s=0.1", cli.FlagCommissionMaxChangeRate), - fmt.Sprintf("--%s=1", cli.FlagMinSelfDelegation), fmt.Sprintf("--%s=%s", flags.FlagFrom, newAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), @@ -178,7 +164,6 @@ func (s *IntegrationTestSuite) TestNewCreateValidatorCmd() { fmt.Sprintf("--%s=0.5", cli.FlagCommissionRate), fmt.Sprintf("--%s=1.0", cli.FlagCommissionMaxRate), fmt.Sprintf("--%s=0.1", cli.FlagCommissionMaxChangeRate), - fmt.Sprintf("--%s=1", cli.FlagMinSelfDelegation), fmt.Sprintf("--%s=%s", flags.FlagFrom, newAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), @@ -199,7 +184,6 @@ func (s *IntegrationTestSuite) TestNewCreateValidatorCmd() { fmt.Sprintf("--%s=0.5", cli.FlagCommissionRate), fmt.Sprintf("--%s=1.0", cli.FlagCommissionMaxRate), fmt.Sprintf("--%s=0.1", cli.FlagCommissionMaxChangeRate), - fmt.Sprintf("--%s=1", cli.FlagMinSelfDelegation), fmt.Sprintf("--%s=%s", flags.FlagFrom, newAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), @@ -420,7 +404,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryDelegations() { &types.QueryDelegatorDelegationsResponse{}, &types.QueryDelegatorDelegationsResponse{ DelegationResponses: types.DelegationResponses{ - types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), + types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), false, sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), }, Pagination: &query.PageResponse{}, }, @@ -476,7 +460,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryValidatorDelegations() { &types.QueryValidatorDelegationsResponse{}, &types.QueryValidatorDelegationsResponse{ DelegationResponses: types.DelegationResponses{ - types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), + types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), false, sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), }, Pagination: &query.PageResponse{}, }, @@ -603,7 +587,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryUnbondingDelegation() { s.Require().NoError(err) s.Require().Equal(ubd.DelegatorAddress, val.Address.String()) s.Require().Equal(ubd.ValidatorAddress, val.ValAddress.String()) - s.Require().Len(ubd.Entries, 2) + s.Require().Len(ubd.Entries, 1) } }) } @@ -1309,7 +1293,7 @@ func (s *IntegrationTestSuite) TestNewUnbondCmd() { } } -func (s *IntegrationTestSuite) TestNewCancelUnbondingDelegationCmd() { +func (s *IntegrationTestSuite) TestNewTokenizeSharesCmd() { val := s.network.Validators[0] testCases := []struct { @@ -1320,8 +1304,10 @@ func (s *IntegrationTestSuite) TestNewCancelUnbondingDelegationCmd() { respType proto.Message }{ { - "Without validator address", + "Without reward owner", []string{ + val.ValAddress.String(), + sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(150)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), @@ -1330,7 +1316,7 @@ func (s *IntegrationTestSuite) TestNewCancelUnbondingDelegationCmd() { true, 0, nil, }, { - "Without canceling unbond delegation amount", + "Without tokenize share amount", []string{ val.ValAddress.String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), @@ -1341,10 +1327,22 @@ func (s *IntegrationTestSuite) TestNewCancelUnbondingDelegationCmd() { true, 0, nil, }, { - "Without unbond creation height", + "Without tokenize share amount and reward owner", []string{ val.ValAddress.String(), + val.Address.String(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + true, 0, nil, + }, + { + "Without validator address", + []string{ sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(150)).String(), + val.Address.String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), @@ -1353,35 +1351,32 @@ func (s *IntegrationTestSuite) TestNewCancelUnbondingDelegationCmd() { true, 0, nil, }, { - "Wrong unbonding creation height", + "Without validator address and reward owner", []string{ - val.ValAddress.String(), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)).String(), - sdk.NewInt(10000).String(), + sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(150)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, - false, sdkerrors.ErrNotFound.ABCICode(), &sdk.TxResponse{}, + true, 0, nil, }, { - "Invalid unbonding amount (higher than the unbonding amount)", + "Without validator address, tokenize share amount and reward owner", []string{ - val.ValAddress.String(), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10000)).String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, - false, sdkerrors.ErrInvalidRequest.ABCICode(), &sdk.TxResponse{}, + true, 0, nil, }, { - "valid transaction of canceling unbonding delegation", + "valid transaction of tokenize share", []string{ val.ValAddress.String(), - sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(5)).String(), + sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(150)).String(), + val.Address.String(), fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), @@ -1395,24 +1390,139 @@ func (s *IntegrationTestSuite) TestNewCancelUnbondingDelegationCmd() { tc := tc s.Run(tc.name, func() { - cmd := cli.NewCancelUnbondingDelegation() + cmd := cli.NewTokenizeSharesCmd() clientCtx := val.ClientCtx - if !tc.expectErr && tc.expectedCode != sdkerrors.ErrNotFound.ABCICode() { - getCreationHeight := func() int64 { - // fethichg the unbonding delegations - resp, err := rest.GetRequest(fmt.Sprintf("%s/cosmos/staking/v1beta1/delegators/%s/unbonding_delegations", val.APIAddress, val.Address.String())) - s.Require().NoError(err) - - var ubds types.QueryDelegatorUnbondingDelegationsResponse - - err = val.ClientCtx.Codec.UnmarshalJSON(resp, &ubds) - s.Require().NoError(err) - s.Require().Len(ubds.UnbondingResponses, 1) - s.Require().Equal(ubds.UnbondingResponses[0].DelegatorAddress, val.Address.String()) - return ubds.UnbondingResponses[0].Entries[1].CreationHeight - } - tc.args = append(tc.args, fmt.Sprint(getCreationHeight())) + + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err, out.String()) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + + txResp := tc.respType.(*sdk.TxResponse) + s.Require().Equal(tc.expectedCode, txResp.Code, out.String()) } + }) + } +} + +func (s *IntegrationTestSuite) TestNewRedeemTokensCmd() { + val := s.network.Validators[0] + + testCases := []struct { + name string + args []string + expectErr bool + expectedCode uint32 + respType proto.Message + }{ + { + "Without redeem token amount", + []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + true, 0, nil, + }, + { + "valid transaction of redeem token", + []string{ + sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(150)).String(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + false, 0, &sdk.TxResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.NewRedeemTokensCmd() + clientCtx := val.ClientCtx + + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err, out.String()) + s.Require().NoError(clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + + txResp := tc.respType.(*sdk.TxResponse) + s.Require().Equal(tc.expectedCode, txResp.Code, out.String()) + } + }) + } +} + +func (s *IntegrationTestSuite) TestNewTransferTokenizeShareRecordCmd() { + val := s.network.Validators[0] + + testCases := []struct { + name string + args []string + expectErr bool + expectedCode uint32 + respType proto.Message + }{ + { + "Without new owner", + []string{ + "123", + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + true, 0, nil, + }, + { + "Without record id", + []string{ + val.Address.String(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + true, 0, nil, + }, + { + "Without record id and new owner", + []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + true, 0, nil, + }, + { + "valid transaction of transfer tokenize share record", + []string{ + "123", + val.Address.String(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + false, 0, &sdk.TxResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.NewTransferTokenizeShareRecordCmd() + clientCtx := val.ClientCtx out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) if tc.expectErr { diff --git a/x/staking/client/testutil/test_helpers.go b/x/staking/client/testutil/test_helpers.go index 0fa752e05720..3a31ea004f3d 100644 --- a/x/staking/client/testutil/test_helpers.go +++ b/x/staking/client/testutil/test_helpers.go @@ -18,7 +18,9 @@ var commonArgs = []string{ } // MsgRedelegateExec creates a redelegate message. -func MsgRedelegateExec(clientCtx client.Context, from, src, dst, amount fmt.Stringer, extraArgs ...string) (testutil.BufferWriter, error) { +func MsgRedelegateExec(clientCtx client.Context, from, src, dst, amount fmt.Stringer, + extraArgs ...string) (testutil.BufferWriter, error) { + args := []string{ src.String(), dst.String(), @@ -34,8 +36,8 @@ func MsgRedelegateExec(clientCtx client.Context, from, src, dst, amount fmt.Stri // MsgUnbondExec creates a unbond message. func MsgUnbondExec(clientCtx client.Context, from fmt.Stringer, valAddress, - amount fmt.Stringer, extraArgs ...string, -) (testutil.BufferWriter, error) { + amount fmt.Stringer, extraArgs ...string) (testutil.BufferWriter, error) { + args := []string{ valAddress.String(), amount.String(), diff --git a/x/staking/common_test.go b/x/staking/common_test.go index 93193e459ca1..2d308989a9d2 100644 --- a/x/staking/common_test.go +++ b/x/staking/common_test.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/staking/genesis.go b/x/staking/genesis.go index 5b94b8adf48b..02ae77bd4ebb 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -9,11 +9,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // WriteValidators returns a slice of bonded genesis validators. func WriteValidators(ctx sdk.Context, keeper keeper.Keeper) (vals []tmtypes.GenesisValidator, err error) { - keeper.IterateLastValidators(ctx, func(_ int64, validator types.ValidatorI) (stop bool) { + keeper.IterateLastValidators(ctx, func(_ int64, validator sdkstaking.ValidatorI) (stop bool) { pk, err := validator.ConsPubKey() if err != nil { return true diff --git a/x/staking/genesis_test.go b/x/staking/genesis_test.go index 6f4a8ad8bda0..bc36ddc2709b 100644 --- a/x/staking/genesis_test.go +++ b/x/staking/genesis_test.go @@ -6,12 +6,21 @@ import ( "github.com/stretchr/testify/assert" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) +func bootstrapGenesisTest(t *testing.T, numAddrs int) (*simapp.SimApp, sdk.Context, []sdk.AccAddress) { + _, app, ctx := getBaseSimappWithCustomKeeper(t) + + addrDels, _ := generateAddresses(app, ctx, numAddrs, sdk.NewInt(10000)) + return app, ctx, addrDels +} + func TestValidateGenesis(t *testing.T) { genValidators1 := make([]types.Validator, 1, 5) pk := ed25519.GenPrivKey().PubKey() @@ -37,17 +46,15 @@ func TestValidateGenesis(t *testing.T) { {"jailed and bonded validator", func(data *types.GenesisState) { data.Validators = genValidators1 data.Validators[0].Jailed = true - data.Validators[0].Status = types.Bonded + data.Validators[0].Status = sdkstaking.Bonded }, true}, } for _, tt := range tests { tt := tt - t.Run(tt.name, func(t *testing.T) { genesisState := types.DefaultGenesisState() tt.mutate(genesisState) - if tt.wantErr { assert.Error(t, staking.ValidateGenesis(genesisState)) } else { diff --git a/x/staking/keeper/alias_functions.go b/x/staking/keeper/alias_functions.go index 59c4d23be2e8..7c3ea4e37a11 100644 --- a/x/staking/keeper/alias_functions.go +++ b/x/staking/keeper/alias_functions.go @@ -5,12 +5,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // Validator Set // iterate through the validator set and perform the provided function -func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { +func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator sdkstaking.ValidatorI) (stop bool)) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.ValidatorsKey) @@ -30,7 +31,7 @@ func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validato } // iterate through the bonded validator set and perform the provided function -func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { +func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator sdkstaking.ValidatorI) (stop bool)) { store := ctx.KVStore(k.storeKey) maxValidators := k.MaxValidators(ctx) @@ -53,7 +54,7 @@ func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index in } // iterate through the active validator set and perform the provided function -func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { +func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator sdkstaking.ValidatorI) (stop bool)) { iterator := k.LastValidatorsIterator(ctx) defer iterator.Close() @@ -76,7 +77,7 @@ func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, vali } // Validator gets the Validator interface for a particular address -func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) types.ValidatorI { +func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) sdkstaking.ValidatorI { val, found := k.GetValidator(ctx, address) if !found { return nil @@ -86,7 +87,7 @@ func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) types.Validat } // ValidatorByConsAddr gets the validator interface for a particular pubkey -func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) types.ValidatorI { +func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) sdkstaking.ValidatorI { val, found := k.GetValidatorByConsAddr(ctx, addr) if !found { return nil @@ -103,7 +104,7 @@ func (k Keeper) GetValidatorSet() types.ValidatorSet { } // Delegation get the delegation interface for a particular set of delegator and validator addresses -func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) types.DelegationI { +func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) sdkstaking.DelegationI { bond, ok := k.GetDelegation(ctx, addrDel, addrVal) if !ok { return nil @@ -114,8 +115,7 @@ func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk. // iterate through all of the delegations from a delegator func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, - fn func(index int64, del types.DelegationI) (stop bool), -) { + fn func(index int64, del sdkstaking.DelegationI) (stop bool)) { store := ctx.KVStore(k.storeKey) delegatorPrefixKey := types.GetDelegationsKey(delAddr) diff --git a/x/staking/keeper/common_test.go b/x/staking/keeper/common_test.go index ad31204ba43b..64ae727248d1 100644 --- a/x/staking/keeper/common_test.go +++ b/x/staking/keeper/common_test.go @@ -7,13 +7,16 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) -var PKs = simapp.CreateTestPubKeys(500) +var ( + PKs = simapp.CreateTestPubKeys(500) +) func init() { sdk.DefaultPowerReduction = sdk.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil)) @@ -47,3 +50,12 @@ func generateAddresses(app *simapp.SimApp, ctx sdk.Context, numAddrs int) ([]sdk return addrDels, addrVals } + +func delegateCoinsFromAccount(ctx sdk.Context, app *simapp.SimApp, addr sdk.AccAddress, amount sdk.Int, val types.Validator) error { + // bondDenom := app.StakingKeeper.BondDenom(ctx) + // coins := sdk.Coins{sdk.NewCoin(bondDenom, amount)} + // app.BankKeeper.DelegateCoinsFromAccountToModule(ctx, addr, types.EpochDelegationPoolName, coins) + _, err := app.StakingKeeper.Delegate(ctx, addr, amount, sdkstaking.Unbonded, val, true) + + return err +} diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index a7af75af4448..559b8200fff7 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -8,6 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // GetDelegation returns a specific delegation. @@ -611,20 +612,20 @@ func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time // Delegate performs a delegation, set/update everything necessary within the store. // tokenSrc indicates the bond status of the incoming funds. func (k Keeper) Delegate( - ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc types.BondStatus, + ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc sdkstaking.BondStatus, validator types.Validator, subtractAccount bool, ) (newShares sdk.Dec, err error) { // In some situations, the exchange rate becomes invalid, e.g. if // Validator loses all tokens due to slashing. In this case, // make all future delegations invalid. if validator.InvalidExRate() { - return sdk.ZeroDec(), types.ErrDelegatorShareExRateInvalid + return sdk.ZeroDec(), sdkstaking.ErrDelegatorShareExRateInvalid } // Get or create the delegation object delegation, found := k.GetDelegation(ctx, delAddr, validator.GetOperator()) if !found { - delegation = types.NewDelegation(delAddr, validator.GetOperator(), sdk.ZeroDec()) + delegation = types.NewDelegation(delAddr, validator.GetOperator(), sdk.ZeroDec(), false) } // call the appropriate hook if present @@ -644,7 +645,7 @@ func (k Keeper) Delegate( // performing a delegation and not a redelegation, thus the source tokens are // all non bonded if subtractAccount { - if tokenSrc == types.Bonded { + if tokenSrc == sdkstaking.Bonded { panic("delegation token source cannot be bonded") } @@ -666,14 +667,14 @@ func (k Keeper) Delegate( } else { // potentially transfer tokens between pools, if switch { - case tokenSrc == types.Bonded && validator.IsBonded(): + case tokenSrc == sdkstaking.Bonded && validator.IsBonded(): // do nothing - case (tokenSrc == types.Unbonded || tokenSrc == types.Unbonding) && !validator.IsBonded(): + case (tokenSrc == sdkstaking.Unbonded || tokenSrc == sdkstaking.Unbonding) && !validator.IsBonded(): // do nothing - case (tokenSrc == types.Unbonded || tokenSrc == types.Unbonding) && validator.IsBonded(): + case (tokenSrc == sdkstaking.Unbonded || tokenSrc == sdkstaking.Unbonding) && validator.IsBonded(): // transfer pools k.notBondedTokensToBonded(ctx, bondAmt) - case tokenSrc == types.Bonded && !validator.IsBonded(): + case tokenSrc == sdkstaking.Bonded && !validator.IsBonded(): // transfer pools k.bondedTokensToNotBonded(ctx, bondAmt) default: @@ -702,7 +703,7 @@ func (k Keeper) Unbond( // check if a delegation object exists in the store delegation, found := k.GetDelegation(ctx, delAddr, valAddr) if !found { - return amount, types.ErrNoDelegatorForAddress + return amount, sdkstaking.ErrNoDelegatorForAddress } // call the before-delegation-modified hook @@ -712,13 +713,13 @@ func (k Keeper) Unbond( // ensure that we have enough shares to remove if delegation.Shares.LT(shares) { - return amount, sdkerrors.Wrap(types.ErrNotEnoughDelegationShares, delegation.Shares.String()) + return amount, sdkerrors.Wrap(sdkstaking.ErrNotEnoughDelegationShares, delegation.Shares.String()) } // get validator validator, found := k.GetValidator(ctx, valAddr) if !found { - return amount, types.ErrNoValidatorFound + return amount, sdkstaking.ErrNoValidatorFound } // subtract shares from delegation @@ -729,16 +730,6 @@ func (k Keeper) Unbond( return amount, err } - isValidatorOperator := delegatorAddress.Equals(validator.GetOperator()) - - // If the delegation is the operator of the validator and undelegating will decrease the validator's - // self-delegation below their minimum, we jail the validator. - if isValidatorOperator && !validator.Jailed && - validator.TokensFromShares(delegation.Shares).TruncateInt().LT(validator.MinSelfDelegation) { - k.jailValidator(ctx, validator) - validator = k.mustGetValidator(ctx, validator.GetOperator()) - } - if delegation.Shares.IsZero() { err = k.RemoveDelegation(ctx, delegation) } else { @@ -800,11 +791,11 @@ func (k Keeper) Undelegate( ) (time.Time, error) { validator, found := k.GetValidator(ctx, valAddr) if !found { - return time.Time{}, types.ErrNoDelegatorForAddress + return time.Time{}, sdkstaking.ErrNoDelegatorForAddress } if k.HasMaxUnbondingDelegationEntries(ctx, delAddr, valAddr) { - return time.Time{}, types.ErrMaxUnbondingDelegationEntries + return time.Time{}, sdkstaking.ErrMaxUnbondingDelegationEntries } returnAmount, err := k.Unbond(ctx, delAddr, valAddr, sharesAmount) @@ -830,7 +821,7 @@ func (k Keeper) Undelegate( func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error) { ubd, found := k.GetUnbondingDelegation(ctx, delAddr, valAddr) if !found { - return nil, types.ErrNoUnbondingDelegation + return nil, sdkstaking.ErrNoUnbondingDelegation } bondDenom := k.GetParams(ctx).BondDenom @@ -879,26 +870,26 @@ func (k Keeper) BeginRedelegation( ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount sdk.Dec, ) (completionTime time.Time, err error) { if bytes.Equal(valSrcAddr, valDstAddr) { - return time.Time{}, types.ErrSelfRedelegation + return time.Time{}, sdkstaking.ErrSelfRedelegation } dstValidator, found := k.GetValidator(ctx, valDstAddr) if !found { - return time.Time{}, types.ErrBadRedelegationDst + return time.Time{}, sdkstaking.ErrBadRedelegationDst } srcValidator, found := k.GetValidator(ctx, valSrcAddr) if !found { - return time.Time{}, types.ErrBadRedelegationDst + return time.Time{}, sdkstaking.ErrBadRedelegationDst } // check if this is a transitive redelegation if k.HasReceivingRedelegation(ctx, delAddr, valSrcAddr) { - return time.Time{}, types.ErrTransitiveRedelegation + return time.Time{}, sdkstaking.ErrTransitiveRedelegation } if k.HasMaxRedelegationEntries(ctx, delAddr, valSrcAddr, valDstAddr) { - return time.Time{}, types.ErrMaxRedelegationEntries + return time.Time{}, sdkstaking.ErrMaxRedelegationEntries } returnAmount, err := k.Unbond(ctx, delAddr, valSrcAddr, sharesAmount) @@ -907,7 +898,7 @@ func (k Keeper) BeginRedelegation( } if returnAmount.IsZero() { - return time.Time{}, types.ErrTinyRedelegationAmount + return time.Time{}, sdkstaking.ErrTinyRedelegationAmount } sharesCreated, err := k.Delegate(ctx, delAddr, returnAmount, srcValidator.GetStatus(), dstValidator, false) @@ -939,7 +930,7 @@ func (k Keeper) CompleteRedelegation( ) (sdk.Coins, error) { red, found := k.GetRedelegation(ctx, delAddr, valSrcAddr, valDstAddr) if !found { - return nil, types.ErrNoRedelegation + return nil, sdkstaking.ErrNoRedelegation } bondDenom := k.GetParams(ctx).BondDenom @@ -977,12 +968,12 @@ func (k Keeper) ValidateUnbondAmount( ) (shares sdk.Dec, err error) { validator, found := k.GetValidator(ctx, valAddr) if !found { - return shares, types.ErrNoValidatorFound + return shares, sdkstaking.ErrNoValidatorFound } del, found := k.GetDelegation(ctx, delAddr, valAddr) if !found { - return shares, types.ErrNoDelegation + return shares, sdkstaking.ErrNoDelegation } shares, err = validator.SharesFromTokens(amt) diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index 04d67c143c5f..e203f31287e5 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -4,15 +4,15 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // tests GetDelegation, GetDelegatorDelegations, SetDelegation, RemoveDelegation, GetDelegatorDelegations @@ -31,7 +31,7 @@ func TestDelegation(t *testing.T) { addrDels := simapp.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(10000)) valAddrs := simapp.ConvertAddrsToValAddrs(addrDels) - // construct the validators + //construct the validators amts := []sdk.Int{sdk.NewInt(9), sdk.NewInt(8), sdk.NewInt(7)} var validators [3]types.Validator for i, amt := range amts { @@ -44,7 +44,7 @@ func TestDelegation(t *testing.T) { validators[2] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[2], true) // first add a validators[0] to delegate too - bond1to1 := types.NewDelegation(addrDels[0], valAddrs[0], sdk.NewDec(9)) + bond1to1 := types.NewDelegation(addrDels[0], valAddrs[0], sdk.NewDec(9), false) // check the empty keeper first _, found := app.StakingKeeper.GetDelegation(ctx, addrDels[0], valAddrs[0]) @@ -64,11 +64,11 @@ func TestDelegation(t *testing.T) { require.Equal(t, bond1to1, resBond) // add some more records - bond1to2 := types.NewDelegation(addrDels[0], valAddrs[1], sdk.NewDec(9)) - bond1to3 := types.NewDelegation(addrDels[0], valAddrs[2], sdk.NewDec(9)) - bond2to1 := types.NewDelegation(addrDels[1], valAddrs[0], sdk.NewDec(9)) - bond2to2 := types.NewDelegation(addrDels[1], valAddrs[1], sdk.NewDec(9)) - bond2to3 := types.NewDelegation(addrDels[1], valAddrs[2], sdk.NewDec(9)) + bond1to2 := types.NewDelegation(addrDels[0], valAddrs[1], sdk.NewDec(9), false) + bond1to3 := types.NewDelegation(addrDels[0], valAddrs[2], sdk.NewDec(9), false) + bond2to1 := types.NewDelegation(addrDels[1], valAddrs[0], sdk.NewDec(9), false) + bond2to2 := types.NewDelegation(addrDels[1], valAddrs[1], sdk.NewDec(9), false) + bond2to3 := types.NewDelegation(addrDels[1], valAddrs[2], sdk.NewDec(9), false) app.StakingKeeper.SetDelegation(ctx, bond1to2) app.StakingKeeper.SetDelegation(ctx, bond1to3) app.StakingKeeper.SetDelegation(ctx, bond2to1) @@ -117,11 +117,6 @@ func TestDelegation(t *testing.T) { require.Len(t, resDels, 2) } - // test total bonded for single delegator - expBonded := bond1to1.Shares.Add(bond2to1.Shares).Add(bond1to3.Shares) - resDelBond := app.StakingKeeper.GetDelegatorBonded(ctx, addrDels[0]) - require.Equal(t, expBonded, sdk.NewDecFromInt(resDelBond)) - // delete a record app.StakingKeeper.RemoveDelegation(ctx, bond2to3) _, found = app.StakingKeeper.GetDelegation(ctx, addrDels[1], valAddrs[2]) @@ -167,8 +162,7 @@ func TestUnbondingDelegation(t *testing.T) { require.Equal(t, ubd, resUnbond) // modify a records, save, and retrieve - expUnbond := sdk.NewInt(21) - ubd.Entries[0].Balance = expUnbond + ubd.Entries[0].Balance = sdk.NewInt(21) app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) resUnbonds := app.StakingKeeper.GetUnbondingDelegations(ctx, delAddrs[0], 5) @@ -181,9 +175,6 @@ func TestUnbondingDelegation(t *testing.T) { require.True(t, found) require.Equal(t, ubd, resUnbond) - resDelUnbond := app.StakingKeeper.GetDelegatorUnbonding(ctx, delAddrs[0]) - require.Equal(t, expUnbond, resDelUnbond) - // delete a record app.StakingKeeper.RemoveUnbondingDelegation(ctx, ubd) _, found = app.StakingKeeper.GetUnbondingDelegation(ctx, delAddrs[0], valAddrs[0]) @@ -217,7 +208,7 @@ func TestUnbondDelegation(t *testing.T) { validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - delegation := types.NewDelegation(delAddrs[0], valAddrs[0], issuedShares) + delegation := types.NewDelegation(delAddrs[0], valAddrs[0], issuedShares, false) app.StakingKeeper.SetDelegation(ctx, delegation) bondTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 6) @@ -259,7 +250,7 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { require.True(sdk.IntEq(t, startTokens, validator.BondedTokens())) require.True(t, validator.IsBonded()) - delegation := types.NewDelegation(addrDels[0], addrVals[0], issuedShares) + delegation := types.NewDelegation(addrDels[0], addrVals[0], issuedShares, false) app.StakingKeeper.SetDelegation(ctx, delegation) maxEntries := app.StakingKeeper.MaxEntries(ctx) @@ -315,307 +306,6 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { require.True(sdk.IntEq(t, newNotBonded, oldNotBonded.AddRaw(1))) } -//// test undelegating self delegation from a validator pushing it below MinSelfDelegation -//// shift it from the bonded to unbonding state and jailed -func TestUndelegateSelfDelegationBelowMinSelfDelegation(t *testing.T) { - _, app, ctx := createTestInput(t) - - addrDels := simapp.AddTestAddrsIncremental(app, ctx, 1, sdk.NewInt(10000)) - addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - delCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delTokens)) - - // create a validator with a self-delegation - validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) - - validator.MinSelfDelegation = delTokens - validator, issuedShares := validator.AddTokensFromDel(delTokens) - require.Equal(t, delTokens, issuedShares.RoundInt()) - - // add bonded tokens to pool for delegations - notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - require.True(t, validator.IsBonded()) - - selfDelegation := types.NewDelegation(sdk.AccAddress(addrVals[0].Bytes()), addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, selfDelegation) - - // add bonded tokens to pool for delegations - bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, bondedPool) - - // create a second delegation to this validator - app.StakingKeeper.DeleteValidatorByPowerIndex(ctx, validator) - validator, issuedShares = validator.AddTokensFromDel(delTokens) - require.True(t, validator.IsBonded()) - require.Equal(t, delTokens, issuedShares.RoundInt()) - - // add bonded tokens to pool for delegations - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, bondedPool) - - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - delegation := types.NewDelegation(addrDels[0], addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - - val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - _, err := app.StakingKeeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(app.StakingKeeper.TokensFromConsensusPower(ctx, 6))) - require.NoError(t, err) - - // end block - applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) - - validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.True(t, found) - require.Equal(t, app.StakingKeeper.TokensFromConsensusPower(ctx, 14), validator.Tokens) - require.Equal(t, types.Unbonding, validator.Status) - require.True(t, validator.Jailed) -} - -func TestUndelegateFromUnbondingValidator(t *testing.T) { - _, app, ctx := createTestInput(t) - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - delCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delTokens)) - - addrDels := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(0)) - addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - - // create a validator with a self-delegation - validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) - app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - - validator, issuedShares := validator.AddTokensFromDel(delTokens) - require.Equal(t, delTokens, issuedShares.RoundInt()) - - // add bonded tokens to pool for delegations - notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - require.True(t, validator.IsBonded()) - - selfDelegation := types.NewDelegation(addrVals[0].Bytes(), addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, selfDelegation) - - // add bonded tokens to pool for delegations - bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, bondedPool) - - // create a second delegation to this validator - app.StakingKeeper.DeleteValidatorByPowerIndex(ctx, validator) - - validator, issuedShares = validator.AddTokensFromDel(delTokens) - require.Equal(t, delTokens, issuedShares.RoundInt()) - - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, bondedPool) - - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - delegation := types.NewDelegation(addrDels[1], addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, bondedPool) - - header := ctx.BlockHeader() - blockHeight := int64(10) - header.Height = blockHeight - blockTime := time.Unix(333, 0) - header.Time = blockTime - ctx = ctx.WithBlockHeader(header) - - // unbond the all self-delegation to put validator in unbonding state - val0AccAddr := sdk.AccAddress(addrVals[0]) - _, err := app.StakingKeeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(delTokens)) - require.NoError(t, err) - - // end block - applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) - - validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.True(t, found) - require.Equal(t, blockHeight, validator.UnbondingHeight) - params := app.StakingKeeper.GetParams(ctx) - require.True(t, blockTime.Add(params.UnbondingTime).Equal(validator.UnbondingTime)) - - blockHeight2 := int64(20) - blockTime2 := time.Unix(444, 0).UTC() - ctx = ctx.WithBlockHeight(blockHeight2) - ctx = ctx.WithBlockTime(blockTime2) - - // unbond some of the other delegation's shares - _, err = app.StakingKeeper.Undelegate(ctx, addrDels[1], addrVals[0], sdk.NewDec(6)) - require.NoError(t, err) - - // retrieve the unbonding delegation - ubd, found := app.StakingKeeper.GetUnbondingDelegation(ctx, addrDels[1], addrVals[0]) - require.True(t, found) - require.Len(t, ubd.Entries, 1) - require.True(t, ubd.Entries[0].Balance.Equal(sdk.NewInt(6))) - assert.Equal(t, blockHeight2, ubd.Entries[0].CreationHeight) - assert.True(t, blockTime2.Add(params.UnbondingTime).Equal(ubd.Entries[0].CompletionTime)) -} - -func TestUndelegateFromUnbondedValidator(t *testing.T) { - _, app, ctx := createTestInput(t) - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - delCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delTokens)) - - addrDels := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(0)) - addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - - // add bonded tokens to pool for delegations - notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - - // create a validator with a self-delegation - validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) - app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - - valTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - validator, issuedShares := validator.AddTokensFromDel(valTokens) - require.Equal(t, valTokens, issuedShares.RoundInt()) - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - require.True(t, validator.IsBonded()) - - val0AccAddr := sdk.AccAddress(addrVals[0]) - selfDelegation := types.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, selfDelegation) - - // add bonded tokens to pool for delegations - bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, bondedPool) - - // create a second delegation to this validator - app.StakingKeeper.DeleteValidatorByPowerIndex(ctx, validator) - validator, issuedShares = validator.AddTokensFromDel(delTokens) - require.Equal(t, delTokens, issuedShares.RoundInt()) - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - require.True(t, validator.IsBonded()) - delegation := types.NewDelegation(addrDels[1], addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - - ctx = ctx.WithBlockHeight(10) - ctx = ctx.WithBlockTime(time.Unix(333, 0)) - - // unbond the all self-delegation to put validator in unbonding state - _, err := app.StakingKeeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(valTokens)) - require.NoError(t, err) - - // end block - applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) - - validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.True(t, found) - require.Equal(t, ctx.BlockHeight(), validator.UnbondingHeight) - params := app.StakingKeeper.GetParams(ctx) - require.True(t, ctx.BlockHeader().Time.Add(params.UnbondingTime).Equal(validator.UnbondingTime)) - - // unbond the validator - ctx = ctx.WithBlockTime(validator.UnbondingTime) - app.StakingKeeper.UnbondAllMatureValidators(ctx) - - // Make sure validator is still in state because there is still an outstanding delegation - validator, found = app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.True(t, found) - require.Equal(t, validator.Status, types.Unbonded) - - // unbond some of the other delegation's shares - unbondTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 6) - _, err = app.StakingKeeper.Undelegate(ctx, addrDels[1], addrVals[0], sdk.NewDecFromInt(unbondTokens)) - require.NoError(t, err) - - // unbond rest of the other delegation's shares - remainingTokens := delTokens.Sub(unbondTokens) - _, err = app.StakingKeeper.Undelegate(ctx, addrDels[1], addrVals[0], sdk.NewDecFromInt(remainingTokens)) - require.NoError(t, err) - - // now validator should be deleted from state - validator, found = app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.False(t, found, "%v", validator) -} - -func TestUnbondingAllDelegationFromValidator(t *testing.T) { - _, app, ctx := createTestInput(t) - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - delCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delTokens)) - - addrDels := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(0)) - addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - - // add bonded tokens to pool for delegations - notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - - // create a validator with a self-delegation - validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) - app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - - valTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - validator, issuedShares := validator.AddTokensFromDel(valTokens) - require.Equal(t, valTokens, issuedShares.RoundInt()) - - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - require.True(t, validator.IsBonded()) - val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - - selfDelegation := types.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, selfDelegation) - - // create a second delegation to this validator - app.StakingKeeper.DeleteValidatorByPowerIndex(ctx, validator) - validator, issuedShares = validator.AddTokensFromDel(delTokens) - require.Equal(t, delTokens, issuedShares.RoundInt()) - - // add bonded tokens to pool for delegations - bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) - app.AccountKeeper.SetModuleAccount(ctx, bondedPool) - - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - require.True(t, validator.IsBonded()) - - delegation := types.NewDelegation(addrDels[1], addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - - ctx = ctx.WithBlockHeight(10) - ctx = ctx.WithBlockTime(time.Unix(333, 0)) - - // unbond the all self-delegation to put validator in unbonding state - _, err := app.StakingKeeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(valTokens)) - require.NoError(t, err) - - // end block - applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) - - // unbond all the remaining delegation - _, err = app.StakingKeeper.Undelegate(ctx, addrDels[1], addrVals[0], sdk.NewDecFromInt(delTokens)) - require.NoError(t, err) - - // validator should still be in state and still be in unbonding state - validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.True(t, found) - require.Equal(t, validator.Status, types.Unbonding) - - // unbond the validator - ctx = ctx.WithBlockTime(validator.UnbondingTime) - app.StakingKeeper.UnbondAllMatureValidators(ctx) - - // validator should now be deleted from state - _, found = app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.False(t, found) -} - // Make sure that that the retrieving the delegations doesn't affect the state func TestGetRedelegationsFromSrcValidator(t *testing.T) { _, app, ctx := createTestInput(t) @@ -729,7 +419,7 @@ func TestRedelegateToSameValidator(t *testing.T) { require.True(t, validator.IsBonded()) val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - selfDelegation := types.NewDelegation(val0AccAddr, addrVals[0], issuedShares) + selfDelegation := types.NewDelegation(val0AccAddr, addrVals[0], issuedShares, false) app.StakingKeeper.SetDelegation(ctx, selfDelegation) _, err := app.StakingKeeper.BeginRedelegation(ctx, val0AccAddr, addrVals[0], addrVals[0], sdk.NewDec(5)) @@ -757,7 +447,7 @@ func TestRedelegationMaxEntries(t *testing.T) { require.Equal(t, valTokens, issuedShares.RoundInt()) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - selfDelegation := types.NewDelegation(val0AccAddr, addrVals[0], issuedShares) + selfDelegation := types.NewDelegation(val0AccAddr, addrVals[0], issuedShares, false) app.StakingKeeper.SetDelegation(ctx, selfDelegation) // create a second validator @@ -766,7 +456,7 @@ func TestRedelegationMaxEntries(t *testing.T) { require.Equal(t, valTokens, issuedShares.RoundInt()) validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) - require.Equal(t, types.Bonded, validator2.Status) + require.Equal(t, sdkstaking.Bonded, validator2.Status) maxEntries := app.StakingKeeper.MaxEntries(ctx) @@ -791,212 +481,3 @@ func TestRedelegationMaxEntries(t *testing.T) { _, err = app.StakingKeeper.BeginRedelegation(ctx, val0AccAddr, addrVals[0], addrVals[1], sdk.NewDec(1)) require.NoError(t, err) } - -func TestRedelegateSelfDelegation(t *testing.T) { - _, app, ctx := createTestInput(t) - - addrDels := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(0)) - addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - - startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 30) - startCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)) - - // add bonded tokens to pool for delegations - notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) - app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - - // create a validator with a self-delegation - validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) - app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - - valTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - validator, issuedShares := validator.AddTokensFromDel(valTokens) - require.Equal(t, valTokens, issuedShares.RoundInt()) - - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - - val0AccAddr := sdk.AccAddress(addrVals[0]) - selfDelegation := types.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, selfDelegation) - - // create a second validator - validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) - validator2, issuedShares = validator2.AddTokensFromDel(valTokens) - require.Equal(t, valTokens, issuedShares.RoundInt()) - validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) - require.Equal(t, types.Bonded, validator2.Status) - - // create a second delegation to validator 1 - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - validator, issuedShares = validator.AddTokensFromDel(delTokens) - require.Equal(t, delTokens, issuedShares.RoundInt()) - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - - delegation := types.NewDelegation(addrDels[0], addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - - _, err := app.StakingKeeper.BeginRedelegation(ctx, val0AccAddr, addrVals[0], addrVals[1], sdk.NewDecFromInt(delTokens)) - require.NoError(t, err) - - // end block - applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 2) - - validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.True(t, found) - require.Equal(t, valTokens, validator.Tokens) - require.Equal(t, types.Unbonding, validator.Status) -} - -func TestRedelegateFromUnbondingValidator(t *testing.T) { - _, app, ctx := createTestInput(t) - - addrDels := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(0)) - addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - - startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 30) - startCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)) - - // add bonded tokens to pool for delegations - notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) - app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - - // create a validator with a self-delegation - validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) - app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - - valTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - validator, issuedShares := validator.AddTokensFromDel(valTokens) - require.Equal(t, valTokens, issuedShares.RoundInt()) - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - selfDelegation := types.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, selfDelegation) - - // create a second delegation to this validator - app.StakingKeeper.DeleteValidatorByPowerIndex(ctx, validator) - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - validator, issuedShares = validator.AddTokensFromDel(delTokens) - require.Equal(t, delTokens, issuedShares.RoundInt()) - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - delegation := types.NewDelegation(addrDels[1], addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - - // create a second validator - validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) - validator2, issuedShares = validator2.AddTokensFromDel(valTokens) - require.Equal(t, valTokens, issuedShares.RoundInt()) - validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) - - header := ctx.BlockHeader() - blockHeight := int64(10) - header.Height = blockHeight - blockTime := time.Unix(333, 0) - header.Time = blockTime - ctx = ctx.WithBlockHeader(header) - - // unbond the all self-delegation to put validator in unbonding state - _, err := app.StakingKeeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(delTokens)) - require.NoError(t, err) - - // end block - applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) - - validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.True(t, found) - require.Equal(t, blockHeight, validator.UnbondingHeight) - params := app.StakingKeeper.GetParams(ctx) - require.True(t, blockTime.Add(params.UnbondingTime).Equal(validator.UnbondingTime)) - - // change the context - header = ctx.BlockHeader() - blockHeight2 := int64(20) - header.Height = blockHeight2 - blockTime2 := time.Unix(444, 0) - header.Time = blockTime2 - ctx = ctx.WithBlockHeader(header) - - // unbond some of the other delegation's shares - redelegateTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 6) - _, err = app.StakingKeeper.BeginRedelegation(ctx, addrDels[1], addrVals[0], addrVals[1], sdk.NewDecFromInt(redelegateTokens)) - require.NoError(t, err) - - // retrieve the unbonding delegation - ubd, found := app.StakingKeeper.GetRedelegation(ctx, addrDels[1], addrVals[0], addrVals[1]) - require.True(t, found) - require.Len(t, ubd.Entries, 1) - assert.Equal(t, blockHeight, ubd.Entries[0].CreationHeight) - assert.True(t, blockTime.Add(params.UnbondingTime).Equal(ubd.Entries[0].CompletionTime)) -} - -func TestRedelegateFromUnbondedValidator(t *testing.T) { - _, app, ctx := createTestInput(t) - - addrDels := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(0)) - addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - - startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 30) - startCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)) - - // add bonded tokens to pool for delegations - notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) - app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - - // create a validator with a self-delegation - validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) - app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - - valTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - validator, issuedShares := validator.AddTokensFromDel(valTokens) - require.Equal(t, valTokens, issuedShares.RoundInt()) - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - selfDelegation := types.NewDelegation(val0AccAddr, addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, selfDelegation) - - // create a second delegation to this validator - app.StakingKeeper.DeleteValidatorByPowerIndex(ctx, validator) - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - validator, issuedShares = validator.AddTokensFromDel(delTokens) - require.Equal(t, delTokens, issuedShares.RoundInt()) - validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) - delegation := types.NewDelegation(addrDels[1], addrVals[0], issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - - // create a second validator - validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) - validator2, issuedShares = validator2.AddTokensFromDel(valTokens) - require.Equal(t, valTokens, issuedShares.RoundInt()) - validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) - require.Equal(t, types.Bonded, validator2.Status) - - ctx = ctx.WithBlockHeight(10) - ctx = ctx.WithBlockTime(time.Unix(333, 0)) - - // unbond the all self-delegation to put validator in unbonding state - _, err := app.StakingKeeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(delTokens)) - require.NoError(t, err) - - // end block - applyValidatorSetUpdates(t, ctx, app.StakingKeeper, 1) - - validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.True(t, found) - require.Equal(t, ctx.BlockHeight(), validator.UnbondingHeight) - params := app.StakingKeeper.GetParams(ctx) - require.True(t, ctx.BlockHeader().Time.Add(params.UnbondingTime).Equal(validator.UnbondingTime)) - - // unbond the validator - app.StakingKeeper.UnbondingToUnbonded(ctx, validator) - - // redelegate some of the delegation's shares - redelegationTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 6) - _, err = app.StakingKeeper.BeginRedelegation(ctx, addrDels[1], addrVals[0], addrVals[1], sdk.NewDecFromInt(redelegationTokens)) - require.NoError(t, err) - - // no red should have been found - red, found := app.StakingKeeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) - require.False(t, found, "%v", red) -} diff --git a/x/staking/keeper/genesis.go b/x/staking/keeper/genesis.go index b47e32de1b3e..9e8e0cb1de31 100644 --- a/x/staking/keeper/genesis.go +++ b/x/staking/keeper/genesis.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // InitGenesis sets the pool and parameters for the provided keeper. For each @@ -48,10 +49,10 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []ab } switch validator.GetStatus() { - case types.Bonded: + case sdkstaking.Bonded: bondedTokens = bondedTokens.Add(validator.GetTokens()) - case types.Unbonding, types.Unbonded: + case sdkstaking.Unbonding, sdkstaking.Unbonded: notBondedTokens = notBondedTokens.Add(validator.GetTokens()) default: diff --git a/x/staking/keeper/genesis_test.go b/x/staking/keeper/genesis_test.go index 908e301decfa..1f4059b1c352 100644 --- a/x/staking/keeper/genesis_test.go +++ b/x/staking/keeper/genesis_test.go @@ -9,11 +9,12 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func bootstrapGenesisTest(t *testing.T, numAddrs int) (*simapp.SimApp, sdk.Context, []sdk.AccAddress) { @@ -44,7 +45,7 @@ func TestInitGenesis(t *testing.T) { bondedVal1 := types.Validator{ OperatorAddress: sdk.ValAddress(addrs[0]).String(), ConsensusPubkey: pk0, - Status: types.Bonded, + Status: sdkstaking.Bonded, Tokens: valTokens, DelegatorShares: sdk.NewDecFromInt(valTokens), Description: types.NewDescription("hoop", "", "", "", ""), @@ -52,7 +53,7 @@ func TestInitGenesis(t *testing.T) { bondedVal2 := types.Validator{ OperatorAddress: sdk.ValAddress(addrs[1]).String(), ConsensusPubkey: pk1, - Status: types.Bonded, + Status: sdkstaking.Bonded, Tokens: valTokens, DelegatorShares: sdk.NewDecFromInt(valTokens), Description: types.NewDescription("bloop", "", "", "", ""), @@ -96,11 +97,11 @@ func TestInitGenesis(t *testing.T) { // now make sure the validators are bonded and intra-tx counters are correct resVal, found := app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addrs[0])) require.True(t, found) - require.Equal(t, types.Bonded, resVal.Status) + require.Equal(t, sdkstaking.Bonded, resVal.Status) resVal, found = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addrs[1])) require.True(t, found) - require.Equal(t, types.Bonded, resVal.Status) + require.Equal(t, sdkstaking.Bonded, resVal.Status) abcivals := make([]abci.ValidatorUpdate, len(vals)) @@ -137,7 +138,7 @@ func TestInitGenesis_PoolsBalanceMismatch(t *testing.T) { require.Panics(t, func() { // setting validator status to bonded so the balance counts towards bonded pool - validator.Status = types.Bonded + validator.Status = sdkstaking.Bonded app.StakingKeeper.InitGenesis(ctx, &types.GenesisState{ Params: params, Validators: []types.Validator{validator}, @@ -148,7 +149,7 @@ func TestInitGenesis_PoolsBalanceMismatch(t *testing.T) { require.Panics(t, func() { // setting validator status to unbonded so the balance counts towards not bonded pool - validator.Status = types.Unbonded + validator.Status = sdkstaking.Unbonded app.StakingKeeper.InitGenesis(ctx, &types.GenesisState{ Params: params, Validators: []types.Validator{validator}, @@ -179,7 +180,7 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { types.NewDescription(fmt.Sprintf("#%d", i), "", "", "", ""), ) require.NoError(t, err) - validators[i].Status = types.Bonded + validators[i].Status = sdkstaking.Bonded tokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 1) if i < 100 { diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index 9bbed760fc97..8686e1ea3ee4 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -11,6 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper @@ -31,30 +32,34 @@ func (k Querier) Validators(c context.Context, req *types.QueryValidatorsRequest return nil, status.Errorf(codes.InvalidArgument, "invalid validator status %s", req.Status) } + var validators types.Validators ctx := sdk.UnwrapSDKContext(c) store := ctx.KVStore(k.storeKey) valStore := prefix.NewStore(store, types.ValidatorsKey) - validators, pageRes, err := query.GenericFilteredPaginate(k.cdc, valStore, req.Pagination, func(key []byte, val *types.Validator) (*types.Validator, error) { + pageRes, err := query.FilteredPaginate(valStore, req.Pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { + val, err := types.UnmarshalValidator(k.cdc, value) + if err != nil { + return false, err + } + if req.Status != "" && !strings.EqualFold(val.GetStatus().String(), req.Status) { - return nil, nil + return false, nil + } + + if accumulate { + validators = append(validators, val) } - return val, nil - }, func() *types.Validator { - return &types.Validator{} + return true, nil }) + if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - vals := types.Validators{} - for _, val := range validators { - vals = append(vals, *val) - } - - return &types.QueryValidatorsResponse{Validators: vals, Pagination: pageRes}, nil + return &types.QueryValidatorsResponse{Validators: validators, Pagination: pageRes}, nil } // Validator queries validator info for given validator address @@ -90,41 +95,42 @@ func (k Querier) ValidatorDelegations(c context.Context, req *types.QueryValidat if req.ValidatorAddr == "" { return nil, status.Error(codes.InvalidArgument, "validator address cannot be empty") } + var delegations []types.Delegation ctx := sdk.UnwrapSDKContext(c) store := ctx.KVStore(k.storeKey) valStore := prefix.NewStore(store, types.DelegationKey) - delegations, pageRes, err := query.GenericFilteredPaginate(k.cdc, valStore, req.Pagination, func(key []byte, delegation *types.Delegation) (*types.Delegation, error) { + pageRes, err := query.FilteredPaginate(valStore, req.Pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { + delegation, err := types.UnmarshalDelegation(k.cdc, value) + if err != nil { + return false, err + } + valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddr) if err != nil { - return nil, err + return false, err } if !delegation.GetValidatorAddr().Equals(valAddr) { - return nil, nil + return false, nil } - return delegation, nil - }, func() *types.Delegation { - return &types.Delegation{} + if accumulate { + delegations = append(delegations, delegation) + } + return true, nil }) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - dels := types.Delegations{} - for _, d := range delegations { - dels = append(dels, *d) - } - - delResponses, err := DelegationsToDelegationResponses(ctx, k.Keeper, dels) + delResponses, err := DelegationsToDelegationResponses(ctx, k.Keeper, delegations) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } return &types.QueryValidatorDelegationsResponse{ - DelegationResponses: delResponses, Pagination: pageRes, - }, nil + DelegationResponses: delResponses, Pagination: pageRes}, nil } // ValidatorUnbondingDelegations queries unbonding delegations of a validator @@ -282,6 +288,7 @@ func (k Querier) DelegatorDelegations(c context.Context, req *types.QueryDelegat } return &types.QueryDelegatorDelegationsResponse{DelegationResponses: delegationResps, Pagination: pageRes}, nil + } // DelegatorValidator queries validator info for given delegator validator pair @@ -348,8 +355,7 @@ func (k Querier) DelegatorUnbondingDelegations(c context.Context, req *types.Que } return &types.QueryDelegatorUnbondingDelegationsResponse{ - UnbondingResponses: unbondingDelegations, Pagination: pageRes, - }, nil + UnbondingResponses: unbondingDelegations, Pagination: pageRes}, nil } // HistoricalInfo queries the historical info for given height @@ -428,12 +434,13 @@ func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegato validator, found := k.GetValidator(ctx, delegation.GetValidatorAddr()) if !found { - return types.ErrNoValidatorFound + return sdkstaking.ErrNoValidatorFound } validators = append(validators, validator) return nil }) + if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -465,6 +472,7 @@ func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types. } func queryRedelegation(ctx sdk.Context, k Querier, req *types.QueryRedelegationsRequest) (redels types.Redelegations, err error) { + delAddr, err := sdk.AccAddressFromBech32(req.DelegatorAddr) if err != nil { return nil, err @@ -532,3 +540,114 @@ func queryAllRedelegations(store sdk.KVStore, k Querier, req *types.QueryRedeleg return redels, res, err } + +// Query for individual tokenize share record information by share by id +func (k Querier) TokenizeShareRecordById(c context.Context, req *types.QueryTokenizeShareRecordByIdRequest) (*types.QueryTokenizeShareRecordByIdResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + record, err := k.GetTokenizeShareRecord(ctx, req.Id) + if err != nil { + return nil, err + } + + return &types.QueryTokenizeShareRecordByIdResponse{ + Record: record, + }, nil +} + +// Query for individual tokenize share record information by share denom +func (k Querier) TokenizeShareRecordByDenom(c context.Context, req *types.QueryTokenizeShareRecordByDenomRequest) (*types.QueryTokenizeShareRecordByDenomResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + record, err := k.GetTokenizeShareRecordByDenom(ctx, req.Denom) + if err != nil { + return nil, err + } + + return &types.QueryTokenizeShareRecordByDenomResponse{ + Record: record, + }, nil +} + +// Query tokenize share records by address +func (k Querier) TokenizeShareRecordsOwned(c context.Context, req *types.QueryTokenizeShareRecordsOwnedRequest) (*types.QueryTokenizeShareRecordsOwnedResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + owner, err := sdk.AccAddressFromBech32(req.Owner) + if err != nil { + return nil, err + } + records := k.GetTokenizeShareRecordsByOwner(ctx, owner) + + return &types.QueryTokenizeShareRecordsOwnedResponse{ + Records: records, + }, nil +} + +// Query for all tokenize share records +func (k Querier) AllTokenizeShareRecords(c context.Context, req *types.QueryAllTokenizeShareRecordsRequest) (*types.QueryAllTokenizeShareRecordsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(c) + records := k.GetAllTokenizeShareRecords(ctx) + + return &types.QueryAllTokenizeShareRecordsResponse{ + Records: records, + }, nil +} + +// Query for last tokenize share record id +func (k Querier) LastTokenizeShareRecordId(c context.Context, req *types.QueryLastTokenizeShareRecordIdRequest) (*types.QueryLastTokenizeShareRecordIdResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + return &types.QueryLastTokenizeShareRecordIdResponse{ + Id: k.GetLastTokenizeShareRecordId(ctx), + }, nil +} + +// Query for total tokenized staked assets +func (k Querier) TotalTokenizeSharedAssets(c context.Context, req *types.QueryTotalTokenizeSharedAssetsRequest) (*types.QueryTotalTokenizeSharedAssetsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(c) + records := k.GetAllTokenizeShareRecords(ctx) + totalTokenizeShared := sdk.ZeroInt() + + for _, record := range records { + moduleAcc := record.GetModuleAddress() + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return nil, err + } + + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, sdkstaking.ErrNoValidatorFound + } + + delegation, found := k.GetDelegation(ctx, moduleAcc, valAddr) + if !found { + return nil, sdkstaking.ErrNoDelegation + } + + tokens := validator.TokensFromShares(delegation.Shares) + totalTokenizeShared = totalTokenizeShared.Add(tokens.RoundInt()) + } + return &types.QueryTotalTokenizeSharedAssetsResponse{ + Value: sdk.NewCoin(k.BondDenom(ctx), totalTokenizeShared), + }, nil +} diff --git a/x/staking/keeper/grpc_query_test.go b/x/staking/keeper/grpc_query_test.go index 09cdb5e47cea..d9451ac90b5e 100644 --- a/x/staking/keeper/grpc_query_test.go +++ b/x/staking/keeper/grpc_query_test.go @@ -7,12 +7,13 @@ import ( "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func (suite *KeeperTestSuite) TestGRPCQueryValidators() { @@ -56,10 +57,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryValidators() { { "valid request", func() { - req = &types.QueryValidatorsRequest{ - Status: types.Bonded.String(), - Pagination: &query.PageRequest{Limit: 1, CountTotal: true}, - } + req = &types.QueryValidatorsRequest{Status: types.Bonded.String(), + Pagination: &query.PageRequest{Limit: 1, CountTotal: true}} }, true, 1, @@ -151,8 +150,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDelegatorValidators() { func() { req = &types.QueryDelegatorValidatorsRequest{ DelegatorAddr: addrs[0].String(), - Pagination: &query.PageRequest{Limit: 1, CountTotal: true}, - } + Pagination: &query.PageRequest{Limit: 1, CountTotal: true}} }, true, }, @@ -324,10 +322,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryDelegatorDelegations() { { "valid request", func() { - req = &types.QueryDelegatorDelegationsRequest{ - DelegatorAddr: addrAcc.String(), - Pagination: &query.PageRequest{Limit: 1, CountTotal: true}, - } + req = &types.QueryDelegatorDelegationsRequest{DelegatorAddr: addrAcc.String(), + Pagination: &query.PageRequest{Limit: 1, CountTotal: true}} }, func(suite *KeeperTestSuite, response *types.QueryDelegatorDelegationsResponse) { suite.Equal(uint64(2), response.Pagination.Total) @@ -389,10 +385,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryValidatorDelegations() { { "valid request", func() { - req = &types.QueryValidatorDelegationsRequest{ - ValidatorAddr: addrVal1, - Pagination: &query.PageRequest{Limit: 1, CountTotal: true}, - } + req = &types.QueryValidatorDelegationsRequest{ValidatorAddr: addrVal1, + Pagination: &query.PageRequest{Limit: 1, CountTotal: true}} }, true, false, @@ -458,8 +452,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryUnbondingDelegation() { "valid request", func() { req = &types.QueryUnbondingDelegationRequest{ - DelegatorAddr: addrAcc2.String(), ValidatorAddr: addrVal2, - } + DelegatorAddr: addrAcc2.String(), ValidatorAddr: addrVal2} }, true, }, @@ -523,10 +516,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryDelegatorUnbondingDelegations() { { "valid request", func() { - req = &types.QueryDelegatorUnbondingDelegationsRequest{ - DelegatorAddr: addrAcc.String(), - Pagination: &query.PageRequest{Limit: 1, CountTotal: true}, - } + req = &types.QueryDelegatorUnbondingDelegationsRequest{DelegatorAddr: addrAcc.String(), + Pagination: &query.PageRequest{Limit: 1, CountTotal: true}} }, true, false, @@ -637,7 +628,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryRedelegations() { valAddrs := simapp.ConvertAddrsToValAddrs(addrs) val1, val2, val3, val4 := vals[0], vals[1], valAddrs[3], valAddrs[4] delAmount := app.StakingKeeper.TokensFromConsensusPower(ctx, 1) - _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, types.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, sdkstaking.Unbonded, val1, true) suite.NoError(err) applyValidatorSetUpdates(suite.T(), ctx, app.StakingKeeper, -1) @@ -667,10 +658,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryRedelegations() { { "request redelegations with non existent pairs", func() { - req = &types.QueryRedelegationsRequest{ - DelegatorAddr: addrAcc.String(), SrcValidatorAddr: val3.String(), - DstValidatorAddr: val4.String(), - } + req = &types.QueryRedelegationsRequest{DelegatorAddr: addrAcc.String(), SrcValidatorAddr: val3.String(), + DstValidatorAddr: val4.String()} }, false, true, @@ -680,8 +669,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryRedelegations() { func() { req = &types.QueryRedelegationsRequest{ DelegatorAddr: addrAcc1.String(), SrcValidatorAddr: val1.OperatorAddress, - DstValidatorAddr: val2.OperatorAddress, Pagination: &query.PageRequest{}, - } + DstValidatorAddr: val2.OperatorAddress, Pagination: &query.PageRequest{}} }, true, false, @@ -691,8 +679,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryRedelegations() { func() { req = &types.QueryRedelegationsRequest{ DelegatorAddr: addrAcc1.String(), SrcValidatorAddr: val1.OperatorAddress, - Pagination: &query.PageRequest{}, - } + Pagination: &query.PageRequest{}} }, true, false, @@ -702,8 +689,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryRedelegations() { func() { req = &types.QueryRedelegationsRequest{ SrcValidatorAddr: val1.GetOperator().String(), - Pagination: &query.PageRequest{Limit: 1, CountTotal: true}, - } + Pagination: &query.PageRequest{Limit: 1, CountTotal: true}} }, true, false, @@ -761,8 +747,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryValidatorUnbondingDelegations() { func() { req = &types.QueryValidatorUnbondingDelegationsRequest{ ValidatorAddr: val1.GetOperator().String(), - Pagination: &query.PageRequest{Limit: 1, CountTotal: true}, - } + Pagination: &query.PageRequest{Limit: 1, CountTotal: true}} }, true, }, @@ -809,11 +794,11 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val1) app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val2) - _, err := app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[0]), types.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[0]), sdkstaking.Unbonded, val1, true) require.NoError(t, err) - _, err = app.StakingKeeper.Delegate(ctx, addrs[1], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[1]), types.Unbonded, val2, true) + _, err = app.StakingKeeper.Delegate(ctx, addrs[1], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[1]), sdkstaking.Unbonded, val2, true) require.NoError(t, err) - _, err = app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[2]), types.Unbonded, val2, true) + _, err = app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[2]), sdkstaking.Unbonded, val2, true) require.NoError(t, err) applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) diff --git a/x/staking/keeper/historical_info_test.go b/x/staking/keeper/historical_info_test.go index 437269956936..3033b2dd7b4a 100644 --- a/x/staking/keeper/historical_info_test.go +++ b/x/staking/keeper/historical_info_test.go @@ -6,10 +6,11 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // IsValSetSorted reports whether valset is sorted. @@ -92,12 +93,12 @@ func TestTrackHistoricalInfo(t *testing.T) { // Set bonded validators in keeper val1 := teststaking.NewValidator(t, addrVals[2], PKs[2]) - val1.Status = types.Bonded // when not bonded, consensus power is Zero + val1.Status = sdkstaking.Bonded // when not bonded, consensus power is Zero val1.Tokens = app.StakingKeeper.TokensFromConsensusPower(ctx, 10) app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetLastValidatorPower(ctx, val1.GetOperator(), 10) val2 := teststaking.NewValidator(t, addrVals[3], PKs[3]) - val1.Status = types.Bonded + val1.Status = sdkstaking.Bonded val2.Tokens = app.StakingKeeper.TokensFromConsensusPower(ctx, 80) app.StakingKeeper.SetValidator(ctx, val2) app.StakingKeeper.SetLastValidatorPower(ctx, val2.GetOperator(), 80) diff --git a/x/staking/keeper/hooks.go b/x/staking/keeper/hooks.go index 91375c9e3881..d3a78b1b5334 100644 --- a/x/staking/keeper/hooks.go +++ b/x/staking/keeper/hooks.go @@ -32,6 +32,13 @@ func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, return nil } +func (k Keeper) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordId uint64) error { + if k.hooks != nil { + k.hooks.BeforeTokenizeShareRecordRemoved(ctx, recordId) + } + return nil +} + // AfterValidatorBonded - call hook if registered func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { if k.hooks != nil { diff --git a/x/staking/keeper/invariants.go b/x/staking/keeper/invariants.go index 7ebc427c11b0..fea647823bd8 100644 --- a/x/staking/keeper/invariants.go +++ b/x/staking/keeper/invariants.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // RegisterInvariants registers all staking invariants @@ -52,11 +53,11 @@ func ModuleAccountInvariants(k Keeper) sdk.Invariant { notBondedPool := k.GetNotBondedPool(ctx) bondDenom := k.BondDenom(ctx) - k.IterateValidators(ctx, func(_ int64, validator types.ValidatorI) bool { + k.IterateValidators(ctx, func(_ int64, validator sdkstaking.ValidatorI) bool { switch validator.GetStatus() { - case types.Bonded: + case sdkstaking.Bonded: bonded = bonded.Add(validator.GetTokens()) - case types.Unbonding, types.Unbonded: + case sdkstaking.Unbonding, sdkstaking.Unbonded: notBonded = notBonded.Add(validator.GetTokens()) default: panic("invalid validator status") diff --git a/x/staking/keeper/keeper.go b/x/staking/keeper/keeper.go index 5dde8f1bb92a..45cd7528805e 100644 --- a/x/staking/keeper/keeper.go +++ b/x/staking/keeper/keeper.go @@ -3,10 +3,10 @@ package keeper import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/tendermint/tendermint/libs/log" "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index 610acf4cb030..d7c34f61e163 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -23,7 +23,6 @@ type KeeperTestSuite struct { addrs []sdk.AccAddress vals []types.Validator queryClient types.QueryClient - msgServer types.MsgServer } func (suite *KeeperTestSuite) SetupTest() { @@ -36,8 +35,6 @@ func (suite *KeeperTestSuite) SetupTest() { types.RegisterQueryServer(queryHelper, querier) queryClient := types.NewQueryClient(queryHelper) - suite.msgServer = keeper.NewMsgServerImpl(app.StakingKeeper) - addrs, _, validators := createValidators(suite.T(), ctx, app, []int64{9, 8, 7}) header := tmproto.Header{ ChainID: "HelloChain", @@ -53,18 +50,17 @@ func (suite *KeeperTestSuite) SetupTest() { suite.app, suite.ctx, suite.queryClient, suite.addrs, suite.vals = app, ctx, queryClient, addrs, validators } - func TestParams(t *testing.T) { app := simapp.Setup(t, false) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) expParams := types.DefaultParams() - // check that the empty keeper loads the default + //check that the empty keeper loads the default resParams := app.StakingKeeper.GetParams(ctx) require.True(t, expParams.Equal(resParams)) - // modify a params, save, and retrieve + //modify a params, save, and retrieve expParams.MaxValidators = 777 app.StakingKeeper.SetParams(ctx, expParams) resParams = app.StakingKeeper.GetParams(ctx) diff --git a/x/staking/keeper/migrations.go b/x/staking/keeper/migrations.go index 1d1f019f1201..b55569d4a442 100644 --- a/x/staking/keeper/migrations.go +++ b/x/staking/keeper/migrations.go @@ -1,29 +1 @@ package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - v043 "github.com/cosmos/cosmos-sdk/x/staking/migrations/v043" - v046 "github.com/cosmos/cosmos-sdk/x/staking/migrations/v046" -) - -// Migrator is a struct for handling in-place store migrations. -type Migrator struct { - keeper Keeper -} - -// NewMigrator returns a new Migrator. -func NewMigrator(keeper Keeper) Migrator { - return Migrator{ - keeper: keeper, - } -} - -// Migrate1to2 migrates from version 1 to 2. -func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return v043.MigrateStore(ctx, m.keeper.storeKey) -} - -// Migrate2to3 migrates x/staking state from consensus version 2 to 3. -func (m Migrator) Migrate2to3(ctx sdk.Context) error { - return v046.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc, m.keeper.paramstore) -} diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index cf74b61ea02f..598b5f05fcd0 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -2,19 +2,22 @@ package keeper import ( "context" + "fmt" "strconv" "time" + metrics "github.com/armon/go-metrics" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/armon/go-metrics" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) type msgServer struct { @@ -39,12 +42,12 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa } if msg.Commission.Rate.LT(k.MinCommissionRate(ctx)) { - return nil, sdkerrors.Wrapf(types.ErrCommissionLTMinRate, "cannot set validator commission to less than minimum rate of %s", k.MinCommissionRate(ctx)) + return nil, sdkerrors.Wrapf(sdkstaking.ErrCommissionLTMinRate, "cannot set validator commission to less than minimum rate of %s", k.MinCommissionRate(ctx)) } // check to see if the pubkey or sender has been registered before if _, found := k.GetValidator(ctx, valAddr); found { - return nil, types.ErrValidatorOwnerExists + return nil, sdkstaking.ErrValidatorOwnerExists } pk, ok := msg.Pubkey.GetCachedValue().(cryptotypes.PubKey) @@ -53,7 +56,7 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa } if _, found := k.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)); found { - return nil, types.ErrValidatorPubKeyExists + return nil, sdkstaking.ErrValidatorPubKeyExists } bondDenom := k.BondDenom(ctx) @@ -79,7 +82,7 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa } if !hasKeyType { return nil, sdkerrors.Wrapf( - types.ErrValidatorPubKeyTypeNotSupported, + sdkstaking.ErrValidatorPubKeyTypeNotSupported, "got: %s, expected: %s", pk.Type(), cp.Validator.PubKeyTypes, ) } @@ -105,8 +108,6 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa return nil, err } - validator.MinSelfDelegation = msg.MinSelfDelegation - k.SetValidator(ctx, validator) k.SetValidatorByConsAddr(ctx, validator) k.SetNewValidatorByPowerIndex(ctx, validator) @@ -119,7 +120,7 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa // move coins from the msg.Address account to a (self-delegation) delegator account // the validator account and global shares are updated within here // NOTE source will always be from a wallet which are unbonded - _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Value.Amount, types.Unbonded, validator, true) + _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Value.Amount, sdkstaking.Unbonded, validator, true) if err != nil { return nil, err } @@ -150,7 +151,7 @@ func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValida // validator must already be registered validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, types.ErrNoValidatorFound + return nil, sdkstaking.ErrNoValidatorFound } // replace all editable fields (clients should autofill existing values) @@ -175,25 +176,12 @@ func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValida validator.Commission = commission } - if msg.MinSelfDelegation != nil { - if !msg.MinSelfDelegation.GT(validator.MinSelfDelegation) { - return nil, types.ErrMinSelfDelegationDecreased - } - - if msg.MinSelfDelegation.GT(validator.Tokens) { - return nil, types.ErrSelfDelegationBelowMinimum - } - - validator.MinSelfDelegation = *msg.MinSelfDelegation - } - k.SetValidator(ctx, validator) ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeEditValidator, sdk.NewAttribute(types.AttributeKeyCommissionRate, validator.Commission.String()), - sdk.NewAttribute(types.AttributeKeyMinSelfDelegation, validator.MinSelfDelegation.String()), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -215,7 +203,7 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, types.ErrNoValidatorFound + return nil, sdkstaking.ErrNoValidatorFound } delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) @@ -231,7 +219,7 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ } // NOTE: source funds are always unbonded - newShares, err := k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonded, validator, true) + newShares, err := k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, sdkstaking.Unbonded, validator, true) if err != nil { return nil, err } @@ -275,6 +263,16 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRed if err != nil { return nil, err } + + delegation, found := k.GetDelegation(ctx, delegatorAddress, valSrcAddr) + if !found { + return nil, status.Errorf( + codes.NotFound, + "delegation with delegator %s not found for validator %s", + msg.DelegatorAddress, msg.ValidatorSrcAddress, + ) + } + shares, err := k.ValidateUnbondAmount( ctx, delegatorAddress, valSrcAddr, msg.Amount.Amount, ) @@ -282,6 +280,20 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRed return nil, err } + // tokenize share vs exempt delegation check if exempt delegation + exemptionFactor := k.ExemptionFactor(ctx) + if delegation.Exempt && !exemptionFactor.IsNegative() { + validator, found := k.GetValidator(ctx, valSrcAddr) + if !found { + return nil, sdkstaking.ErrNoValidatorFound + } + + maxTokenizeShareAfter := validator.TotalExemptShares.Sub(shares).Mul(exemptionFactor) + if maxTokenizeShareAfter.GT(validator.TotalTokenizedShares) { + return nil, types.ErrInsufficientExemptShares + } + } + bondDenom := k.BondDenom(ctx) if msg.Amount.Denom != bondDenom { return nil, sdkerrors.Wrapf( @@ -351,6 +363,29 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( return nil, err } + validator, found := k.GetValidator(ctx, addr) + if !found { + return nil, sdkstaking.ErrNoValidatorFound + } + + delegation, found := k.GetDelegation(ctx, delegatorAddress, addr) + if !found { + return nil, status.Errorf( + codes.NotFound, + "delegation with delegator %s not found for validator %s", + msg.DelegatorAddress, msg.ValidatorAddress, + ) + } + + // tokenize share vs exempt delegation check if exempt delegation + exemptionFactor := k.ExemptionFactor(ctx) + if delegation.Exempt && !exemptionFactor.IsNegative() { + maxTokenizeShareAfter := validator.TotalExemptShares.Sub(shares).Mul(exemptionFactor) + if maxTokenizeShareAfter.GT(validator.TotalTokenizedShares) { + return nil, types.ErrInsufficientExemptShares + } + } + bondDenom := k.BondDenom(ctx) if msg.Amount.Denom != bondDenom { return nil, sdkerrors.Wrapf( @@ -417,18 +452,18 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, types.ErrNoValidatorFound + return nil, sdkstaking.ErrNoValidatorFound } // In some situations, the exchange rate becomes invalid, e.g. if // Validator loses all tokens due to slashing. In this case, // make all future delegations invalid. if validator.InvalidExRate() { - return nil, types.ErrDelegatorShareExRateInvalid + return nil, sdkstaking.ErrDelegatorShareExRateInvalid } if validator.IsJailed() { - return nil, types.ErrValidatorJailed + return nil, sdkstaking.ErrValidatorJailed } ubd, found := k.GetUnbondingDelegation(ctx, delegatorAddress, valAddr) @@ -465,7 +500,7 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M } // delegate back the unbonding delegation amount to the validator - _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonding, validator, false) + _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, sdkstaking.Unbonding, validator, false) if err != nil { return nil, err } @@ -489,13 +524,335 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M ctx.EventManager().EmitEvent( sdk.NewEvent( - types.EventTypeCancelUnbondingDelegation, + sdkstaking.EventTypeCancelUnbondingDelegation, sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()), sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), - sdk.NewAttribute(types.AttributeKeyCreationHeight, strconv.FormatInt(msg.CreationHeight, 10)), + sdk.NewAttribute(sdkstaking.AttributeKeyCreationHeight, strconv.FormatInt(msg.CreationHeight, 10)), ), ) return &types.MsgCancelUnbondingDelegationResponse{}, nil } + +func (k msgServer) TokenizeShares(goCtx context.Context, msg *types.MsgTokenizeShares) (*types.MsgTokenizeSharesResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if valErr != nil { + return nil, valErr + } + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, sdkstaking.ErrNoValidatorFound + } + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + delegation, found := k.GetDelegation(ctx, delegatorAddress, valAddr) + if !found { + return nil, sdkstaking.ErrNoDelegatorForAddress + } + + if msg.Amount.Denom != k.BondDenom(ctx) { + return nil, types.ErrOnlyBondDenomAllowdForTokenize + } + + delegationAmount := sdk.NewDecFromInt(validator.Tokens).Mul(delegation.GetShares()).Quo(validator.DelegatorShares) + if sdk.NewDecFromInt(msg.Amount.Amount).GT(delegationAmount) { + return nil, sdkstaking.ErrNotEnoughDelegationShares + } + + acc := k.authKeeper.GetAccount(ctx, delegatorAddress) + if acc != nil { + acc, ok := acc.(vesting.VestingAccount) + if ok { + // if account is a vesting account, it checks if free delegation (non-vesting delegation) is not exceeding + // the tokenize share amount and execute further tokenize share process + // tokenize share is reducing unlocked tokens delegation from the vesting account and further process + // is not causing issues + delFree := acc.GetDelegatedFree().AmountOf(msg.Amount.Denom) + if delFree.LT(msg.Amount.Amount) { + return nil, types.ErrExceedingFreeVestingDelegations + } + } + } + + shares, err := k.ValidateUnbondAmount( + ctx, delegatorAddress, valAddr, msg.Amount.Amount, + ) + if err != nil { + return nil, err + } + + // exempt shares check before tokenize operation + exemptionFactor := k.ExemptionFactor(ctx) + if !exemptionFactor.IsNegative() { + maxValTotalShare := validator.TotalExemptShares.Mul(exemptionFactor) + if validator.TotalTokenizedShares.Add(shares).GT(maxValTotalShare) { + return nil, types.ErrInsufficientExemptShares + } + } + + recordId := k.GetLastTokenizeShareRecordId(ctx) + 1 + k.SetLastTokenizeShareRecordId(ctx, recordId) + + record := types.TokenizeShareRecord{ + Id: recordId, + Owner: msg.TokenizedShareOwner, + ModuleAccount: fmt.Sprintf("tokenizeshare_%d", recordId), + Validator: msg.ValidatorAddress, + } + + shareToken := sdk.NewCoin(record.GetShareTokenDenom(), msg.Amount.Amount) + + err = k.bankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{shareToken}) + if err != nil { + return nil, err + } + + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, delegatorAddress, sdk.Coins{shareToken}) + if err != nil { + return nil, err + } + + returnAmount, err := k.Unbond(ctx, delegatorAddress, valAddr, shares) + if err != nil { + return nil, err + } + + if validator.IsBonded() { + k.bondedTokensToNotBonded(ctx, returnAmount) + } + + // Note: UndelegateCoinsFromModuleToAccount is internally calling TrackUndelegation for vesting account + err = k.bankKeeper.UndelegateCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, delegatorAddress, sdk.Coins{msg.Amount}) + if err != nil { + return nil, err + } + + // create reward ownership record + k.AddTokenizeShareRecord(ctx, record) + + // send coins to module account + err = k.bankKeeper.SendCoins(ctx, delegatorAddress, record.GetModuleAddress(), sdk.Coins{msg.Amount}) + if err != nil { + return nil, err + } + + // Note: it is needed to get latest validator object to get Keeper.Delegate function work properly + validator, found = k.GetValidator(ctx, valAddr) + if !found { + return nil, sdkstaking.ErrNoValidatorFound + } + + // delegate from module account + _, err = k.Keeper.Delegate(ctx, record.GetModuleAddress(), msg.Amount.Amount, sdkstaking.Unbonded, validator, true) + if err != nil { + return nil, err + } + + validator, _ = k.GetValidator(ctx, valAddr) + validator.TotalTokenizedShares = validator.TotalTokenizedShares.Add(shares) + k.SetValidator(ctx, validator) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeTokenizeShares, + sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(types.AttributeKeyShareOwner, msg.TokenizedShareOwner), + sdk.NewAttribute(types.AttributeKeyShareRecordId, fmt.Sprintf("%d", record.Id)), + sdk.NewAttribute(types.AttributeKeyAmount, msg.Amount.String()), + ), + ) + + return &types.MsgTokenizeSharesResponse{ + Amount: shareToken, + }, nil +} + +func (k msgServer) RedeemTokens(goCtx context.Context, msg *types.MsgRedeemTokensforShares) (*types.MsgRedeemTokensforSharesResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + balance := k.bankKeeper.GetBalance(ctx, delegatorAddress, msg.Amount.Denom) + if balance.Amount.LT(msg.Amount.Amount) { + return nil, types.ErrNotEnoughBalance + } + + record, err := k.GetTokenizeShareRecordByDenom(ctx, msg.Amount.Denom) + if err != nil { + return nil, err + } + + valAddr, valErr := sdk.ValAddressFromBech32(record.Validator) + if valErr != nil { + return nil, valErr + } + + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, sdkstaking.ErrNoValidatorFound + } + + // calculate the ratio between shares and redeem amount + // moduleAccountTotalDelegation * redeemAmount / totalIssue + delegation, found := k.GetDelegation(ctx, record.GetModuleAddress(), valAddr) + shareDenomSupply := k.bankKeeper.GetSupply(ctx, msg.Amount.Denom) + shares := delegation.Shares.Mul(sdk.NewDecFromInt(msg.Amount.Amount)).QuoInt(shareDenomSupply.Amount) + + returnAmount, err := k.Unbond(ctx, record.GetModuleAddress(), valAddr, shares) + if err != nil { + return nil, err + } + + if validator.IsBonded() { + k.bondedTokensToNotBonded(ctx, returnAmount) + } + + // Note: since delegation object has been changed from unbond call, it gets latest delegation + _, found = k.GetDelegation(ctx, record.GetModuleAddress(), valAddr) + if !found { + if k.hooks != nil { + k.hooks.BeforeTokenizeShareRecordRemoved(ctx, record.Id) + } + + err = k.DeleteTokenizeShareRecord(ctx, record.Id) + if err != nil { + return nil, err + } + } + + // send share tokens to NotBondedPool and burn + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, delegatorAddress, types.NotBondedPoolName, sdk.Coins{msg.Amount}) + if err != nil { + return nil, err + } + err = k.bankKeeper.BurnCoins(ctx, types.NotBondedPoolName, sdk.Coins{msg.Amount}) + if err != nil { + return nil, err + } + + // send equivalent amount of tokens to the delegator + returnCoin := sdk.NewCoin(k.BondDenom(ctx), returnAmount) + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, delegatorAddress, sdk.Coins{returnCoin}) + if err != nil { + return nil, err + } + + // Note: it is needed to get latest validator object to get Keeper.Delegate function work properly + validator, found = k.GetValidator(ctx, valAddr) + if !found { + return nil, sdkstaking.ErrNoValidatorFound + } + + // convert the share tokens to delegated status + // Note: Delegate(substractAccount => true) -> DelegateCoinsFromAccountToModule -> TrackDelegation for vesting account + _, err = k.Keeper.Delegate(ctx, delegatorAddress, returnAmount, sdkstaking.Unbonded, validator, true) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeRedeemShares, + sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), + sdk.NewAttribute(types.AttributeKeyValidator, validator.OperatorAddress), + sdk.NewAttribute(types.AttributeKeyAmount, msg.Amount.String()), + ), + ) + + return &types.MsgRedeemTokensforSharesResponse{ + Amount: returnCoin, + }, nil +} + +func (k msgServer) TransferTokenizeShareRecord(goCtx context.Context, msg *types.MsgTransferTokenizeShareRecord) (*types.MsgTransferTokenizeShareRecordResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + record, err := k.GetTokenizeShareRecord(ctx, msg.TokenizeShareRecordId) + if err != nil { + return nil, types.ErrTokenizeShareRecordNotExists + } + + if record.Owner != msg.Sender { + return nil, types.ErrNotTokenizeShareRecordOwner + } + + // Remove old account reference + oldOwner, err := sdk.AccAddressFromBech32(record.Owner) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress + } + k.deleteTokenizeShareRecordWithOwner(ctx, oldOwner, record.Id) + + record.Owner = msg.NewOwner + k.setTokenizeShareRecord(ctx, record) + + // Set new account reference + newOwner, err := sdk.AccAddressFromBech32(record.Owner) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress + } + k.setTokenizeShareRecordWithOwner(ctx, newOwner, record.Id) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeTransferTokenizeShareRecord, + sdk.NewAttribute(types.AttributeKeyShareRecordId, fmt.Sprintf("%d", msg.TokenizeShareRecordId)), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + sdk.NewAttribute(types.AttributeKeyShareOwner, msg.NewOwner), + ), + ) + + return &types.MsgTransferTokenizeShareRecordResponse{}, nil +} + +func (k msgServer) ExemptDelegation(goCtx context.Context, msg *types.MsgExemptDelegation) (*types.MsgExemptDelegationResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + delAddr, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if valErr != nil { + return nil, valErr + } + + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, sdkstaking.ErrNoValidatorFound + } + + delegation, found := k.GetDelegation(ctx, delAddr, valAddr) + if !found { + return nil, sdkstaking.ErrNoDelegation + } + + if !delegation.Exempt { + delegation.Exempt = true + k.SetDelegation(ctx, delegation) + validator.TotalExemptShares = validator.TotalExemptShares.Add(delegation.Shares) + k.SetValidator(ctx, validator) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeExemptDelegation, + sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + ), + ) + } + + return &types.MsgExemptDelegationResponse{}, nil +} diff --git a/x/staking/keeper/msg_server_test.go b/x/staking/keeper/msg_server_test.go index 44538be4d4ae..0ed3b5f5a53a 100644 --- a/x/staking/keeper/msg_server_test.go +++ b/x/staking/keeper/msg_server_test.go @@ -2,145 +2,337 @@ package keeper_test import ( "testing" - "time" - "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/bank/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) -func TestCancelUnbondingDelegation(t *testing.T) { - // setup the app - app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - bondDenom := app.StakingKeeper.BondDenom(ctx) - - // set the not bonded pool module account - notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 5) - - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)))) - app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - - moduleBalance := app.BankKeeper.GetBalance(ctx, notBondedPool.GetAddress(), app.StakingKeeper.BondDenom(ctx)) - require.Equal(t, sdk.NewInt64Coin(bondDenom, startTokens.Int64()), moduleBalance) - - // accounts - delAddrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(10000)) - validators := app.StakingKeeper.GetValidators(ctx, 10) - require.Equal(t, len(validators), 1) - - validatorAddr, err := sdk.ValAddressFromBech32(validators[0].OperatorAddress) - require.NoError(t, err) - delegatorAddr := delAddrs[0] - - // setting the ubd entry - unbondingAmount := sdk.NewInt64Coin(app.StakingKeeper.BondDenom(ctx), 5) - ubd := types.NewUnbondingDelegation( - delegatorAddr, validatorAddr, 10, - ctx.BlockTime().Add(time.Minute*10), - unbondingAmount.Amount, - ) - - // set and retrieve a record - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) - resUnbond, found := app.StakingKeeper.GetUnbondingDelegation(ctx, delegatorAddr, validatorAddr) - require.True(t, found) - require.Equal(t, ubd, resUnbond) +func TestTokenizeSharesAndRedeemTokens(t *testing.T) { + _, app, ctx := createTestInput(t) testCases := []struct { - Name string - ExceptErr bool - req types.MsgCancelUnbondingDelegation + name string + vestingAmount sdk.Int + delegationAmount sdk.Int + tokenizeShareAmount sdk.Int + redeemAmount sdk.Int + targetVestingDelAfterShare sdk.Int + targetVestingDelAfterRedeem sdk.Int + slashFactor sdk.Dec + expTokenizeErr bool + expRedeemErr bool + prevAccountDelegationExists bool + recordAccountDelegationExists bool }{ { - Name: "invalid height", - ExceptErr: true, - req: types.MsgCancelUnbondingDelegation{ - DelegatorAddress: resUnbond.DelegatorAddress, - ValidatorAddress: resUnbond.ValidatorAddress, - Amount: sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), sdk.NewInt(4)), - CreationHeight: 0, - }, + name: "full amount tokenize and redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + slashFactor: sdk.ZeroDec(), + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: false, + recordAccountDelegationExists: false, }, { - Name: "invalid coin", - ExceptErr: true, - req: types.MsgCancelUnbondingDelegation{ - DelegatorAddress: resUnbond.DelegatorAddress, - ValidatorAddress: resUnbond.ValidatorAddress, - Amount: sdk.NewCoin("dump_coin", sdk.NewInt(4)), - CreationHeight: 0, - }, + name: "full amount tokenize and partial redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.NewDecWithPrec(10, 2), + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: false, + recordAccountDelegationExists: true, }, { - Name: "validator not exists", - ExceptErr: true, - req: types.MsgCancelUnbondingDelegation{ - DelegatorAddress: resUnbond.DelegatorAddress, - ValidatorAddress: sdk.ValAddress(sdk.AccAddress("asdsad")).String(), - Amount: unbondingAmount, - CreationHeight: 0, - }, + name: "partial amount tokenize and full redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + recordAccountDelegationExists: false, }, { - Name: "invalid delegator address", - ExceptErr: true, - req: types.MsgCancelUnbondingDelegation{ - DelegatorAddress: "invalid_delegator_addrtess", - ValidatorAddress: resUnbond.ValidatorAddress, - Amount: unbondingAmount, - CreationHeight: 0, - }, + name: "over tokenize", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 30), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + slashFactor: sdk.ZeroDec(), + expTokenizeErr: true, + expRedeemErr: false, }, { - Name: "invalid amount", - ExceptErr: true, - req: types.MsgCancelUnbondingDelegation{ - DelegatorAddress: resUnbond.DelegatorAddress, - ValidatorAddress: resUnbond.ValidatorAddress, - Amount: unbondingAmount.Add(sdk.NewInt64Coin(bondDenom, 10)), - CreationHeight: 10, - }, + name: "over redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 40), + slashFactor: sdk.ZeroDec(), + expTokenizeErr: false, + expRedeemErr: true, }, { - Name: "success", - ExceptErr: false, - req: types.MsgCancelUnbondingDelegation{ - DelegatorAddress: resUnbond.DelegatorAddress, - ValidatorAddress: resUnbond.ValidatorAddress, - Amount: unbondingAmount.Sub(sdk.NewInt64Coin(bondDenom, 1)), - CreationHeight: 10, - }, + name: "vesting account tokenize share failure", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + slashFactor: sdk.ZeroDec(), + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, }, { - Name: "success", - ExceptErr: false, - req: types.MsgCancelUnbondingDelegation{ - DelegatorAddress: resUnbond.DelegatorAddress, - ValidatorAddress: resUnbond.ValidatorAddress, - Amount: unbondingAmount.Sub(unbondingAmount.Sub(sdk.NewInt64Coin(bondDenom, 1))), - CreationHeight: 10, - }, + name: "vesting account tokenize share success", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, }, } - for _, testCase := range testCases { - t.Run(testCase.Name, func(t *testing.T) { - _, err := msgServer.CancelUnbondingDelegation(ctx, &testCase.req) - if testCase.ExceptErr { + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, app, ctx = createTestInput(t) + addrs := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + addrAcc1, addrAcc2 := addrs[0], addrs[1] + addrVal1, addrVal2 := sdk.ValAddress(addrAcc1), sdk.ValAddress(addrAcc2) + + if !tc.vestingAmount.IsZero() { + // create vesting account + pubkey := secp256k1.GenPrivKey().PubKey() + baseAcc := authtypes.NewBaseAccount(addrAcc2, pubkey, 0, 0) + initialVesting := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, tc.vestingAmount)) + baseVestingWithCoins := vestingtypes.NewBaseVestingAccount(baseAcc, initialVesting, ctx.BlockTime().Unix()+86400*365) + delayedVestingAccount := vestingtypes.NewDelayedVestingAccountRaw(baseVestingWithCoins) + app.AccountKeeper.SetAccount(ctx, delayedVestingAccount) + } + + pubKeys := simapp.CreateTestPubKeys(2) + pk1, pk2 := pubKeys[0], pubKeys[1] + + // Create Validators and Delegation + val1 := teststaking.NewValidator(t, addrVal1, pk1) + val1.Status = sdkstaking.Bonded + app.StakingKeeper.SetValidator(ctx, val1) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) + app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) + + val2 := teststaking.NewValidator(t, addrVal2, pk2) + val2.Status = sdkstaking.Bonded + app.StakingKeeper.SetValidator(ctx, val2) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, val2) + app.StakingKeeper.SetValidatorByConsAddr(ctx, val2) + + delTokens := tc.delegationAmount + err := delegateCoinsFromAccount(ctx, app, addrAcc2, delTokens, val1) + require.NoError(t, err) + + // apply TM updates + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) + + _, found := app.StakingKeeper.GetDelegation(ctx, addrAcc2, addrVal1) + require.True(t, found, "delegation not found after delegate") + + lastRecordId := app.StakingKeeper.GetLastTokenizeShareRecordId(ctx) + oldValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + resp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: addrAcc2.String(), + ValidatorAddress: addrVal1.String(), + Amount: sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), tc.tokenizeShareAmount), + TokenizedShareOwner: addrAcc2.String(), + }) + if tc.expTokenizeErr { require.Error(t, err) + return + } + require.NoError(t, err) + + // check last record id increase + require.Equal(t, lastRecordId+1, app.StakingKeeper.GetLastTokenizeShareRecordId(ctx)) + + // ensure validator's total tokens is consistent + newValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + require.Equal(t, oldValidator.Tokens, newValidator.Tokens) + + if tc.vestingAmount.IsPositive() { + acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) + vestingAcc := acc.(vesting.VestingAccount) + require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterShare.String()) + } + + if tc.prevAccountDelegationExists { + _, found = app.StakingKeeper.GetDelegation(ctx, addrAcc2, addrVal1) + require.True(t, found, "delegation found after partial tokenize share") } else { + _, found = app.StakingKeeper.GetDelegation(ctx, addrAcc2, addrVal1) + require.False(t, found, "delegation found after full tokenize share") + } + + shareToken := app.BankKeeper.GetBalance(ctx, addrAcc2, resp.Amount.Denom) + require.Equal(t, resp.Amount, shareToken) + _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found, true, "validator not found") + + records := app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + require.Len(t, records, 1) + delegation, found := app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) + require.True(t, found, "delegation not found from tokenize share module account after tokenize share") + + // slash before redeem + if tc.slashFactor.IsPositive() { + consAddr, err := val1.GetConsAddr() require.NoError(t, err) - balanceForNotBondedPool := app.BankKeeper.GetBalance(ctx, sdk.AccAddress(notBondedPool.GetAddress()), bondDenom) - require.Equal(t, balanceForNotBondedPool, moduleBalance.Sub(testCase.req.Amount)) - moduleBalance = moduleBalance.Sub(testCase.req.Amount) + ctx = ctx.WithBlockHeight(100) + val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + power := app.StakingKeeper.TokensToConsensusPower(ctx, val1.Tokens) + app.StakingKeeper.Slash(ctx, consAddr, 10, power, tc.slashFactor) + } + + // get deletagor balance and delegation + bondDenomAmountBefore := app.BankKeeper.GetBalance(ctx, addrAcc2, app.StakingKeeper.BondDenom(ctx)) + val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + delegation, found = app.StakingKeeper.GetDelegation(ctx, addrAcc2, addrVal1) + if !found { + delegation = types.Delegation{Shares: sdk.ZeroDec()} + } + delAmountBefore := val1.TokensFromShares(delegation.Shares) + oldValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + + _, err = msgServer.RedeemTokens(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensforShares{ + DelegatorAddress: addrAcc2.String(), + Amount: sdk.NewCoin(resp.Amount.Denom, tc.redeemAmount), + }) + if tc.expRedeemErr { + require.Error(t, err) + return + } + require.NoError(t, err) + + // ensure validator's total tokens is consistent + newValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + require.Equal(t, oldValidator.Tokens, newValidator.Tokens) + + if tc.vestingAmount.IsPositive() { + acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) + vestingAcc := acc.(vesting.VestingAccount) + require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterRedeem.String()) + } + + delegation, found = app.StakingKeeper.GetDelegation(ctx, addrAcc2, addrVal1) + require.True(t, found, "delegation not found after redeem tokens") + require.Equal(t, delegation.DelegatorAddress, addrAcc2.String()) + require.Equal(t, delegation.ValidatorAddress, addrVal1.String()) + require.Equal(t, delegation.Shares, sdk.NewDecFromInt(tc.delegationAmount.Sub(tc.tokenizeShareAmount).Add(tc.redeemAmount))) + + // check delegator balance is not changed + bondDenomAmountAfter := app.BankKeeper.GetBalance(ctx, addrAcc2, app.StakingKeeper.BondDenom(ctx)) + require.Equal(t, bondDenomAmountAfter.Amount.String(), bondDenomAmountBefore.Amount.String()) + + // get delegation amount is changed correctly + val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + delegation, found = app.StakingKeeper.GetDelegation(ctx, addrAcc2, addrVal1) + if !found { + delegation = types.Delegation{Shares: sdk.ZeroDec()} + } + delAmountAfter := val1.TokensFromShares(delegation.Shares) + require.Equal(t, delAmountAfter.String(), delAmountBefore.Add(sdk.NewDecFromInt(tc.redeemAmount).Mul(sdk.OneDec().Sub(tc.slashFactor))).String()) + + shareToken = app.BankKeeper.GetBalance(ctx, addrAcc2, resp.Amount.Denom) + require.Equal(t, shareToken.Amount.String(), tc.tokenizeShareAmount.Sub(tc.redeemAmount).String()) + _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found, true, "validator not found") + + if tc.recordAccountDelegationExists { + _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) + require.True(t, found, "delegation not found from tokenize share module account after redeem partial amount") + + records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + require.Len(t, records, 1) + } else { + _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) + require.False(t, found, "delegation found from tokenize share module account after redeem full amount") + + records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + require.Len(t, records, 0) } }) } } + +func TestTransferTokenizeShareRecord(t *testing.T) { + _, app, ctx := createTestInput(t) + + addrs := simapp.AddTestAddrs(app, ctx, 3, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + addrAcc1, addrAcc2, valAcc := addrs[0], addrs[1], addrs[2] + addrVal := sdk.ValAddress(valAcc) + + pubKeys := simapp.CreateTestPubKeys(1) + pk := pubKeys[0] + + val := teststaking.NewValidator(t, addrVal, pk) + app.StakingKeeper.SetValidator(ctx, val) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, val) + + // apply TM updates + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) + + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + err := app.StakingKeeper.AddTokenizeShareRecord(ctx, types.TokenizeShareRecord{ + Id: 1, + Owner: addrAcc1.String(), + ModuleAccount: "module_account", + Validator: val.String(), + }) + require.NoError(t, err) + + _, err = msgServer.TransferTokenizeShareRecord(sdk.WrapSDKContext(ctx), &types.MsgTransferTokenizeShareRecord{ + TokenizeShareRecordId: 1, + Sender: addrAcc1.String(), + NewOwner: addrAcc2.String(), + }) + require.NoError(t, err) + + record, err := app.StakingKeeper.GetTokenizeShareRecord(ctx, 1) + require.NoError(t, err) + require.Equal(t, record.Owner, addrAcc2.String()) + + records := app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc1) + require.Len(t, records, 0) + records = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc2) + require.Len(t, records, 1) +} diff --git a/x/staking/keeper/params.go b/x/staking/keeper/params.go index 498576fea53f..0a89decefe87 100644 --- a/x/staking/keeper/params.go +++ b/x/staking/keeper/params.go @@ -53,6 +53,12 @@ func (k Keeper) MinCommissionRate(ctx sdk.Context) (res sdk.Dec) { return } +// ExemptionFactor - exemption factor for all validators +func (k Keeper) ExemptionFactor(ctx sdk.Context) (res sdk.Dec) { + k.paramstore.Get(ctx, types.KeyExemptionFactor, &res) + return +} + // Get all parameters as types.Params func (k Keeper) GetParams(ctx sdk.Context) types.Params { return types.NewParams( @@ -62,6 +68,7 @@ func (k Keeper) GetParams(ctx sdk.Context) types.Params { k.HistoricalEntries(ctx), k.BondDenom(ctx), k.MinCommissionRate(ctx), + k.ExemptionFactor(ctx), ) } diff --git a/x/staking/keeper/querier.go b/x/staking/keeper/querier.go index b3ec7e18d92f..3e0fd04318fa 100644 --- a/x/staking/keeper/querier.go +++ b/x/staking/keeper/querier.go @@ -11,6 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // creates a querier for staking REST endpoints @@ -107,7 +108,7 @@ func queryValidator(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuer validator, found := k.GetValidator(ctx, params.ValidatorAddr) if !found { - return nil, types.ErrNoValidatorFound + return nil, sdkstaking.ErrNoValidatorFound } res, err := codec.MarshalJSONIndent(legacyQuerierCdc, validator) @@ -301,7 +302,7 @@ func queryDelegation(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQue delegation, found := k.GetDelegation(ctx, delAddr, valAddr) if !found { - return nil, types.ErrNoDelegation + return nil, sdkstaking.ErrNoDelegation } delegationResp, err := DelegationToDelegationResponse(ctx, k, delegation) @@ -337,7 +338,7 @@ func queryUnbondingDelegation(ctx sdk.Context, req abci.RequestQuery, k Keeper, unbond, found := k.GetUnbondingDelegation(ctx, delAddr, valAddr) if !found { - return nil, types.ErrNoUnbondingDelegation + return nil, sdkstaking.ErrNoUnbondingDelegation } res, err := codec.MarshalJSONIndent(legacyQuerierCdc, unbond) @@ -362,7 +363,7 @@ func queryRedelegations(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacy case !params.DelegatorAddr.Empty() && !params.SrcValidatorAddr.Empty() && !params.DstValidatorAddr.Empty(): redel, found := k.GetRedelegation(ctx, params.DelegatorAddr, params.SrcValidatorAddr, params.DstValidatorAddr) if !found { - return nil, types.ErrNoRedelegation + return nil, sdkstaking.ErrNoRedelegation } redels = []types.Redelegation{redel} @@ -399,7 +400,7 @@ func queryHistoricalInfo(ctx sdk.Context, req abci.RequestQuery, k Keeper, legac hi, found := k.GetHistoricalInfo(ctx, params.Height) if !found { - return nil, types.ErrNoHistoricalInfo + return nil, sdkstaking.ErrNoHistoricalInfo } res, err := codec.MarshalJSONIndent(legacyQuerierCdc, hi) @@ -448,7 +449,7 @@ func queryParameters(ctx sdk.Context, k Keeper, legacyQuerierCdc *codec.LegacyAm func DelegationToDelegationResponse(ctx sdk.Context, k Keeper, del types.Delegation) (types.DelegationResponse, error) { val, found := k.GetValidator(ctx, del.GetValidatorAddr()) if !found { - return types.DelegationResponse{}, types.ErrNoValidatorFound + return types.DelegationResponse{}, sdkstaking.ErrNoValidatorFound } delegatorAddress, err := sdk.AccAddressFromBech32(del.DelegatorAddress) @@ -460,6 +461,7 @@ func DelegationToDelegationResponse(ctx sdk.Context, k Keeper, del types.Delegat delegatorAddress, del.GetValidatorAddr(), del.Shares, + del.Exempt, sdk.NewCoin(k.BondDenom(ctx), val.TokensFromShares(del.Shares).TruncateInt()), ), nil } @@ -500,7 +502,7 @@ func RedelegationsToRedelegationResponses( val, found := k.GetValidator(ctx, valDstAddr) if !found { - return nil, types.ErrNoValidatorFound + return nil, sdkstaking.ErrNoValidatorFound } entryResponses := make([]types.RedelegationEntryResponse, len(redel.Entries)) diff --git a/x/staking/keeper/querier_test.go b/x/staking/keeper/querier_test.go index ac5b1eed5a56..8b0115ba5f90 100644 --- a/x/staking/keeper/querier_test.go +++ b/x/staking/keeper/querier_test.go @@ -9,11 +9,12 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestNewQuerier(t *testing.T) { @@ -144,7 +145,7 @@ func TestQueryValidators(t *testing.T) { // Create Validators amts := []sdk.Int{sdk.NewInt(8), sdk.NewInt(7)} - status := []types.BondStatus{types.Unbonded, types.Unbonding} + status := []sdkstaking.BondStatus{sdkstaking.Unbonded, sdkstaking.Unbonding} var validators [2]types.Validator for i, amt := range amts { validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) @@ -224,7 +225,7 @@ func TestQueryDelegation(t *testing.T) { app.StakingKeeper.SetValidatorByPowerIndex(ctx, val2) delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 20) - _, err := app.StakingKeeper.Delegate(ctx, addrAcc2, delTokens, types.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrAcc2, delTokens, sdkstaking.Unbonded, val1, true) require.NoError(t, err) // apply TM updates @@ -404,7 +405,8 @@ func TestQueryDelegation(t *testing.T) { // Query redelegation redelegationTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - _, err = app.StakingKeeper.BeginRedelegation(ctx, addrAcc2, val1.GetOperator(), val2.GetOperator(), sdk.NewDecFromInt(redelegationTokens)) + _, err = app.StakingKeeper.BeginRedelegation(ctx, addrAcc2, val1.GetOperator(), + val2.GetOperator(), sdk.NewDecFromInt(redelegationTokens)) require.NoError(t, err) redel, found := app.StakingKeeper.GetRedelegation(ctx, addrAcc2, val1.GetOperator(), val2.GetOperator()) require.True(t, found) @@ -474,7 +476,7 @@ func TestQueryValidatorDelegations_Pagination(t *testing.T) { } delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 20) - _, err := app.StakingKeeper.Delegate(ctx, addr, delTokens, types.Unbonded, validator, true) + _, err := app.StakingKeeper.Delegate(ctx, addr, delTokens, sdkstaking.Unbonded, validator, true) require.NoError(t, err) } @@ -553,7 +555,7 @@ func TestQueryRedelegations(t *testing.T) { app.StakingKeeper.SetValidator(ctx, val2) delAmount := app.StakingKeeper.TokensFromConsensusPower(ctx, 100) - _, err := app.StakingKeeper.Delegate(ctx, addrAcc2, delAmount, types.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrAcc2, delAmount, sdkstaking.Unbonded, val1, true) require.NoError(t, err) applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) @@ -624,7 +626,7 @@ func TestQueryUnbondingDelegation(t *testing.T) { // delegate delAmount := app.StakingKeeper.TokensFromConsensusPower(ctx, 100) - _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, types.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, sdkstaking.Unbonded, val1, true) require.NoError(t, err) applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) diff --git a/x/staking/keeper/query_utils.go b/x/staking/keeper/query_utils.go index d757522f6dd7..171629102e68 100644 --- a/x/staking/keeper/query_utils.go +++ b/x/staking/keeper/query_utils.go @@ -3,6 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // Return all validators that a delegator is bonded to. If maxRetrieve is supplied, the respective amount will be returned. @@ -23,7 +24,7 @@ func (k Keeper) GetDelegatorValidators( validator, found := k.GetValidator(ctx, delegation.GetValidatorAddr()) if !found { - panic(types.ErrNoValidatorFound) + panic(sdkstaking.ErrNoValidatorFound) } validators[i] = validator @@ -39,12 +40,12 @@ func (k Keeper) GetDelegatorValidator( ) (validator types.Validator, err error) { delegation, found := k.GetDelegation(ctx, delegatorAddr, validatorAddr) if !found { - return validator, types.ErrNoDelegation + return validator, sdkstaking.ErrNoDelegation } validator, found = k.GetValidator(ctx, delegation.GetValidatorAddr()) if !found { - panic(types.ErrNoValidatorFound) + panic(sdkstaking.ErrNoValidatorFound) } return validator, nil diff --git a/x/staking/keeper/slash.go b/x/staking/keeper/slash.go index 75e22ca49fb2..e33b7c7afd85 100644 --- a/x/staking/keeper/slash.go +++ b/x/staking/keeper/slash.go @@ -4,6 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" types "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -122,11 +123,11 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh validator = k.RemoveValidatorTokens(ctx, validator, tokensToBurn) switch validator.GetStatus() { - case types.Bonded: + case sdkstaking.Bonded: if err := k.burnBondedTokens(ctx, tokensToBurn); err != nil { panic(err) } - case types.Unbonding, types.Unbonded: + case sdkstaking.Unbonding, sdkstaking.Unbonded: if err := k.burnNotBondedTokens(ctx, tokensToBurn); err != nil { panic(err) } diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index ea83aab9dce2..ba94a7178874 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -8,12 +8,13 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // bootstrapSlashTest creates 3 validators and bootstrap the app. @@ -137,7 +138,7 @@ func TestSlashRedelegation(t *testing.T) { app.StakingKeeper.SetRedelegation(ctx, rd) // set the associated delegation - del := types.NewDelegation(addrDels[0], addrVals[1], sdk.NewDec(10)) + del := types.NewDelegation(addrDels[0], addrVals[1], sdk.NewDec(10), false) app.StakingKeeper.SetDelegation(ctx, del) // started redelegating prior to the current height, stake didn't contribute to infraction @@ -378,7 +379,7 @@ func TestSlashWithUnbondingDelegation(t *testing.T) { // power decreased by 1 again, validator is out of stake // validator should be in unbonding period validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - require.Equal(t, validator.GetStatus(), types.Unbonding) + require.Equal(t, validator.GetStatus(), sdkstaking.Unbonding) } // tests Slash at a previous height with a redelegation @@ -390,11 +391,12 @@ func TestSlashWithRedelegation(t *testing.T) { // set a redelegation rdTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 6) - rd := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdTokens, sdk.NewDecFromInt(rdTokens)) + rd := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, + time.Unix(0, 0), rdTokens, sdk.NewDecFromInt(rdTokens)) app.StakingKeeper.SetRedelegation(ctx, rd) // set the associated delegation - del := types.NewDelegation(addrDels[0], addrVals[1], sdk.NewDecFromInt(rdTokens)) + del := types.NewDelegation(addrDels[0], addrVals[1], sdk.NewDecFromInt(rdTokens), false) app.StakingKeeper.SetDelegation(ctx, del) // update bonded tokens @@ -503,14 +505,14 @@ func TestSlashWithRedelegation(t *testing.T) { // read updated validator // validator decreased to zero power, should be in unbonding period validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - require.Equal(t, validator.GetStatus(), types.Unbonding) + require.Equal(t, validator.GetStatus(), sdkstaking.Unbonding) // slash the validator again, by 100% // no stake remains to be slashed ctx = ctx.WithBlockHeight(12) // validator still in unbonding period validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - require.Equal(t, validator.GetStatus(), types.Unbonding) + require.Equal(t, validator.GetStatus(), sdkstaking.Unbonding) require.NotPanics(t, func() { app.StakingKeeper.Slash(ctx, consAddr, 10, 10, sdk.OneDec()) }) @@ -530,7 +532,7 @@ func TestSlashWithRedelegation(t *testing.T) { // read updated validator // power still zero, still in unbonding period validator, _ = app.StakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - require.Equal(t, validator.GetStatus(), types.Unbonding) + require.Equal(t, validator.GetStatus(), sdkstaking.Unbonding) } // tests Slash at a previous height with both an unbonding delegation and a redelegation @@ -542,11 +544,13 @@ func TestSlashBoth(t *testing.T) { // set a redelegation with expiration timestamp beyond which the // redelegation shouldn't be slashed rdATokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 6) - rdA := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, time.Unix(0, 0), rdATokens, sdk.NewDecFromInt(rdATokens)) + rdA := types.NewRedelegation(addrDels[0], addrVals[0], addrVals[1], 11, + time.Unix(0, 0), rdATokens, + sdk.NewDecFromInt(rdATokens)) app.StakingKeeper.SetRedelegation(ctx, rdA) // set the associated delegation - delA := types.NewDelegation(addrDels[0], addrVals[1], sdk.NewDecFromInt(rdATokens)) + delA := types.NewDelegation(addrDels[0], addrVals[1], sdk.NewDecFromInt(rdATokens), false) app.StakingKeeper.SetDelegation(ctx, delA) // set an unbonding delegation with expiration timestamp (beyond which the diff --git a/x/staking/keeper/tokenize_share_record.go b/x/staking/keeper/tokenize_share_record.go new file mode 100644 index 000000000000..febd02acb252 --- /dev/null +++ b/x/staking/keeper/tokenize_share_record.go @@ -0,0 +1,150 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + gogotypes "github.com/gogo/protobuf/types" + + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func (k Keeper) GetLastTokenizeShareRecordId(ctx sdk.Context) uint64 { + store := ctx.KVStore(k.storeKey) + bytes := store.Get(types.LastTokenizeShareRecordIdKey) + if bytes == nil { + return 0 + } + return sdk.BigEndianToUint64(bytes) +} + +func (k Keeper) SetLastTokenizeShareRecordId(ctx sdk.Context, id uint64) { + store := ctx.KVStore(k.storeKey) + store.Set(types.LastTokenizeShareRecordIdKey, sdk.Uint64ToBigEndian(id)) +} + +func (k Keeper) GetTokenizeShareRecord(ctx sdk.Context, id uint64) (tokenizeShareRecord types.TokenizeShareRecord, err error) { + store := ctx.KVStore(k.storeKey) + + bz := store.Get(types.GetTokenizeShareRecordByIndexKey(id)) + if bz == nil { + return tokenizeShareRecord, sdkerrors.Wrap(types.ErrTokenizeShareRecordNotExists, fmt.Sprintf("tokenizeShareRecord %d does not exist", id)) + } + + k.cdc.MustUnmarshal(bz, &tokenizeShareRecord) + return tokenizeShareRecord, nil +} + +func (k Keeper) GetTokenizeShareRecordsByOwner(ctx sdk.Context, owner sdk.AccAddress) (tokenizeShareRecords []types.TokenizeShareRecord) { + store := ctx.KVStore(k.storeKey) + + var it sdk.Iterator = sdk.KVStorePrefixIterator(store, types.GetTokenizeShareRecordIdsByOwnerPrefix(owner)) + defer it.Close() + + for ; it.Valid(); it.Next() { + var id gogotypes.UInt64Value + k.cdc.MustUnmarshal(it.Value(), &id) + + tokenizeShareRecord, err := k.GetTokenizeShareRecord(ctx, id.Value) + if err != nil { + continue + } + tokenizeShareRecords = append(tokenizeShareRecords, tokenizeShareRecord) + } + return +} + +func (k Keeper) GetTokenizeShareRecordByDenom(ctx sdk.Context, denom string) (types.TokenizeShareRecord, error) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.GetTokenizeShareRecordIdByDenomKey(denom)) + if bz == nil { + return types.TokenizeShareRecord{}, fmt.Errorf("tokenize share record not found from denom: %s", denom) + } + + var id gogotypes.UInt64Value + k.cdc.MustUnmarshal(bz, &id) + + return k.GetTokenizeShareRecord(ctx, id.Value) +} + +func (k Keeper) GetAllTokenizeShareRecords(ctx sdk.Context) (tokenizeShareRecords []types.TokenizeShareRecord) { + store := ctx.KVStore(k.storeKey) + + var it sdk.Iterator = sdk.KVStorePrefixIterator(store, types.TokenizeShareRecordPrefix) + defer it.Close() + + for ; it.Valid(); it.Next() { + var tokenizeShareRecord types.TokenizeShareRecord + k.cdc.MustUnmarshal(it.Value(), &tokenizeShareRecord) + + tokenizeShareRecords = append(tokenizeShareRecords, tokenizeShareRecord) + } + return +} + +func (k Keeper) AddTokenizeShareRecord(ctx sdk.Context, tokenizeShareRecord types.TokenizeShareRecord) error { + if k.hasTokenizeShareRecord(ctx, tokenizeShareRecord.Id) { + return sdkerrors.Wrapf(types.ErrTokenizeShareRecordAlreadyExists, "TokenizeShareRecord already exists: %d", tokenizeShareRecord.Id) + } + + k.setTokenizeShareRecord(ctx, tokenizeShareRecord) + + owner, err := sdk.AccAddressFromBech32(tokenizeShareRecord.Owner) + if err != nil { + return err + } + + k.setTokenizeShareRecordWithOwner(ctx, owner, tokenizeShareRecord.Id) + k.setTokenizeShareRecordWithDenom(ctx, tokenizeShareRecord.GetShareTokenDenom(), tokenizeShareRecord.Id) + + return nil +} + +func (k Keeper) DeleteTokenizeShareRecord(ctx sdk.Context, recordId uint64) error { + record, err := k.GetTokenizeShareRecord(ctx, recordId) + if err != nil { + return err + } + owner, err := sdk.AccAddressFromBech32(record.Owner) + if err != nil { + return err + } + + store := ctx.KVStore(k.storeKey) + store.Delete(types.GetTokenizeShareRecordByIndexKey(recordId)) + store.Delete(types.GetTokenizeShareRecordIdByOwnerAndIdKey(owner, recordId)) + store.Delete(types.GetTokenizeShareRecordIdByDenomKey(record.GetShareTokenDenom())) + return nil +} + +func (k Keeper) hasTokenizeShareRecord(ctx sdk.Context, id uint64) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.GetTokenizeShareRecordByIndexKey(id)) +} + +func (k Keeper) setTokenizeShareRecord(ctx sdk.Context, tokenizeShareRecord types.TokenizeShareRecord) { + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&tokenizeShareRecord) + + store.Set(types.GetTokenizeShareRecordByIndexKey(tokenizeShareRecord.Id), bz) +} + +func (k Keeper) setTokenizeShareRecordWithOwner(ctx sdk.Context, owner sdk.AccAddress, id uint64) { + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&gogotypes.UInt64Value{Value: id}) + + store.Set(types.GetTokenizeShareRecordIdByOwnerAndIdKey(owner, id), bz) +} + +func (k Keeper) deleteTokenizeShareRecordWithOwner(ctx sdk.Context, owner sdk.AccAddress, id uint64) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.GetTokenizeShareRecordIdByOwnerAndIdKey(owner, id)) +} + +func (k Keeper) setTokenizeShareRecordWithDenom(ctx sdk.Context, denom string, id uint64) { + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&gogotypes.UInt64Value{Value: id}) + + store.Set(types.GetTokenizeShareRecordIdByDenomKey(denom), bz) +} diff --git a/x/staking/keeper/tokenize_share_record_test.go b/x/staking/keeper/tokenize_share_record_test.go new file mode 100644 index 000000000000..82e3425e87fc --- /dev/null +++ b/x/staking/keeper/tokenize_share_record_test.go @@ -0,0 +1,58 @@ +package keeper_test + +import ( + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func (suite *KeeperTestSuite) TestGetLastTokenizeShareRecordId() { + app, ctx := suite.app, suite.ctx + lastTokenizeShareRecordId := app.StakingKeeper.GetLastTokenizeShareRecordId(ctx) + suite.Equal(lastTokenizeShareRecordId, uint64(0)) + app.StakingKeeper.SetLastTokenizeShareRecordId(ctx, 100) + lastTokenizeShareRecordId = app.StakingKeeper.GetLastTokenizeShareRecordId(ctx) + suite.Equal(lastTokenizeShareRecordId, uint64(100)) +} + +func (suite *KeeperTestSuite) TestGetTokenizeShareRecord() { + app, ctx := suite.app, suite.ctx + owner1, owner2 := suite.addrs[0], suite.addrs[1] + + tokenizeShareRecord1 := types.TokenizeShareRecord{ + Id: 0, + Owner: owner1.String(), + ModuleAccount: "test-module-account-1", + Validator: "test-validator", + } + tokenizeShareRecord2 := types.TokenizeShareRecord{ + Id: 1, + Owner: owner2.String(), + ModuleAccount: "test-module-account-2", + Validator: "test-validator", + } + tokenizeShareRecord3 := types.TokenizeShareRecord{ + Id: 2, + Owner: owner1.String(), + ModuleAccount: "test-module-account-3", + Validator: "test-validator", + } + app.StakingKeeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord1) + app.StakingKeeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord2) + app.StakingKeeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord3) + + tokenizeShareRecord, err := app.StakingKeeper.GetTokenizeShareRecord(ctx, 2) + suite.NoError(err) + suite.Equal(tokenizeShareRecord, tokenizeShareRecord3) + + tokenizeShareRecord, err = app.StakingKeeper.GetTokenizeShareRecordByDenom(ctx, tokenizeShareRecord2.GetShareTokenDenom()) + suite.NoError(err) + suite.Equal(tokenizeShareRecord, tokenizeShareRecord2) + + tokenizeShareRecords := app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + suite.Equal(len(tokenizeShareRecords), 3) + + tokenizeShareRecords = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, owner1) + suite.Equal(len(tokenizeShareRecords), 2) + + tokenizeShareRecords = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, owner2) + suite.Equal(len(tokenizeShareRecords), 1) +} diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index 22f699366119..49812b7852e5 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // BlockValidatorUpdates calculates the ValidatorUpdates for the current block @@ -283,7 +284,7 @@ func (k Keeper) bondValidator(ctx sdk.Context, validator types.Validator) (types // delete the validator by power index, as the key will change k.DeleteValidatorByPowerIndex(ctx, validator) - validator = validator.UpdateStatus(types.Bonded) + validator = validator.UpdateStatus(sdkstaking.Bonded) // save the now bonded validator record to the two referenced stores k.SetValidator(ctx, validator) @@ -310,11 +311,11 @@ func (k Keeper) beginUnbondingValidator(ctx sdk.Context, validator types.Validat k.DeleteValidatorByPowerIndex(ctx, validator) // sanity check - if validator.Status != types.Bonded { + if validator.Status != sdkstaking.Bonded { panic(fmt.Sprintf("should not already be unbonded or unbonding, validator: %v\n", validator)) } - validator = validator.UpdateStatus(types.Unbonding) + validator = validator.UpdateStatus(sdkstaking.Unbonding) // set the unbonding completion time and completion height appropriately validator.UnbondingTime = ctx.BlockHeader().Time.Add(params.UnbondingTime) @@ -339,7 +340,7 @@ func (k Keeper) beginUnbondingValidator(ctx sdk.Context, validator types.Validat // perform all the store operations for when a validator status becomes unbonded func (k Keeper) completeUnbondingValidator(ctx sdk.Context, validator types.Validator) types.Validator { - validator = validator.UpdateStatus(types.Unbonded) + validator = validator.UpdateStatus(sdkstaking.Unbonded) k.SetValidator(ctx, validator) return validator diff --git a/x/staking/keeper/validator_bench_test.go b/x/staking/keeper/validator_bench_test.go index ea727b72457d..54a616c90e50 100644 --- a/x/staking/keeper/validator_bench_test.go +++ b/x/staking/keeper/validator_bench_test.go @@ -5,10 +5,10 @@ import "testing" func BenchmarkGetValidator(b *testing.B) { // 900 is the max number we are allowed to use in order to avoid simapp.CreateTestPubKeys // panic: encoding/hex: odd length hex string - powersNumber := 900 + var powersNumber = 900 var totalPower int64 = 0 - powers := make([]int64, powersNumber) + var powers = make([]int64, powersNumber) for i := range powers { powers[i] = int64(i) totalPower += int64(i) diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index ffa6d595854f..cd86cd8ab6a0 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -11,13 +11,14 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func newMonikerValidator(t testing.TB, operator sdk.ValAddress, pubKey cryptotypes.PubKey, moniker string) types.Validator { @@ -77,7 +78,7 @@ func TestSetValidator(t *testing.T) { // test how the validator is set from a purely unbonbed pool validator := teststaking.NewValidator(t, valAddr, valPubKey) validator, _ = validator.AddTokensFromDel(valTokens) - require.Equal(t, types.Unbonded, validator.Status) + require.Equal(t, sdkstaking.Unbonded, validator.Status) assert.Equal(t, valTokens, validator.Tokens) assert.Equal(t, valTokens, validator.DelegatorShares.RoundInt()) app.StakingKeeper.SetValidator(ctx, validator) @@ -90,7 +91,7 @@ func TestSetValidator(t *testing.T) { require.Equal(t, validator.ABCIValidatorUpdate(app.StakingKeeper.PowerReduction(ctx)), updates[0]) // after the save the validator should be bonded - require.Equal(t, types.Bonded, validator.Status) + require.Equal(t, sdkstaking.Bonded, validator.Status) assert.Equal(t, valTokens, validator.Tokens) assert.Equal(t, valTokens, validator.DelegatorShares.RoundInt()) @@ -133,7 +134,7 @@ func TestUpdateValidatorByPowerIndex(t *testing.T) { // add a validator validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) validator, delSharesCreated := validator.AddTokensFromDel(app.StakingKeeper.TokensFromConsensusPower(ctx, 100)) - require.Equal(t, types.Unbonded, validator.Status) + require.Equal(t, sdkstaking.Unbonded, validator.Status) require.Equal(t, app.StakingKeeper.TokensFromConsensusPower(ctx, 100), validator.Tokens) keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) validator, found := app.StakingKeeper.GetValidator(ctx, addrVals[0]) @@ -199,9 +200,9 @@ func TestUpdateBondedValidatorsDecreaseCliff(t *testing.T) { nextCliffVal, _ = nextCliffVal.RemoveDelShares(sdk.NewDecFromInt(shares)) nextCliffVal = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, nextCliffVal, true) - expectedValStatus := map[int]types.BondStatus{ - 9: types.Bonded, 8: types.Bonded, 7: types.Bonded, 5: types.Bonded, 4: types.Bonded, - 0: types.Unbonding, 1: types.Unbonding, 2: types.Unbonding, 3: types.Unbonding, 6: types.Unbonding, + expectedValStatus := map[int]sdkstaking.BondStatus{ + 9: sdkstaking.Bonded, 8: sdkstaking.Bonded, 7: sdkstaking.Bonded, 5: sdkstaking.Bonded, 4: sdkstaking.Bonded, + 0: sdkstaking.Unbonding, 1: sdkstaking.Unbonding, 2: sdkstaking.Unbonding, 3: sdkstaking.Unbonding, 6: sdkstaking.Unbonding, } // require all the validators have their respective statuses @@ -233,7 +234,7 @@ func TestSlashToZeroPowerRemoved(t *testing.T) { app.AccountKeeper.SetModuleAccount(ctx, bondedPool) validator, _ = validator.AddTokensFromDel(valTokens) - require.Equal(t, types.Unbonded, validator.Status) + require.Equal(t, sdkstaking.Unbonded, validator.Status) require.Equal(t, valTokens, validator.Tokens) app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) @@ -245,19 +246,19 @@ func TestSlashToZeroPowerRemoved(t *testing.T) { applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) // validator should be unbonding validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) - require.Equal(t, validator.GetStatus(), types.Unbonding) + require.Equal(t, validator.GetStatus(), sdkstaking.Unbonding) } // This function tests UpdateValidator, GetValidator, GetLastValidators, RemoveValidator func TestValidatorBasics(t *testing.T) { app, ctx, _, addrVals := bootstrapValidatorTest(t, 1000, 20) - // construct the validators + //construct the validators var validators [3]types.Validator powers := []int64{9, 8, 7} for i, power := range powers { validators[i] = teststaking.NewValidator(t, addrVals[i], PKs[i]) - validators[i].Status = types.Unbonded + validators[i].Status = sdkstaking.Unbonded validators[i].Tokens = sdk.ZeroInt() tokens := app.StakingKeeper.TokensFromConsensusPower(ctx, power) @@ -294,11 +295,11 @@ func TestValidatorBasics(t *testing.T) { resVals = app.StakingKeeper.GetLastValidators(ctx) require.Equal(t, 1, len(resVals)) assert.True(ValEq(t, validators[0], resVals[0])) - assert.Equal(t, types.Bonded, validators[0].Status) + assert.Equal(t, sdkstaking.Bonded, validators[0].Status) assert.True(sdk.IntEq(t, app.StakingKeeper.TokensFromConsensusPower(ctx, 9), validators[0].BondedTokens())) // modify a records, save, and retrieve - validators[0].Status = types.Bonded + validators[0].Status = sdkstaking.Bonded validators[0].Tokens = app.StakingKeeper.TokensFromConsensusPower(ctx, 10) validators[0].DelegatorShares = sdk.NewDecFromInt(validators[0].Tokens) validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], true) @@ -334,7 +335,7 @@ func TestValidatorBasics(t *testing.T) { func() { app.StakingKeeper.RemoveValidator(ctx, validators[1].GetOperator()) }) // shouldn't be able to remove if there are still tokens left - validators[1].Status = types.Unbonded + validators[1].Status = sdkstaking.Unbonded app.StakingKeeper.SetValidator(ctx, validators[1]) assert.PanicsWithValue(t, "attempting to remove a validator which still contains tokens", @@ -357,13 +358,12 @@ func TestGetValidatorSortingUnmixed(t *testing.T) { app.StakingKeeper.PowerReduction(ctx).MulRaw(100), app.StakingKeeper.PowerReduction(ctx), app.StakingKeeper.PowerReduction(ctx).MulRaw(400), - app.StakingKeeper.PowerReduction(ctx).MulRaw(200), - } + app.StakingKeeper.PowerReduction(ctx).MulRaw(200)} n := len(amts) var validators [5]types.Validator for i, amt := range amts { validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) - validators[i].Status = types.Bonded + validators[i].Status = sdkstaking.Bonded validators[i].Tokens = amt validators[i].DelegatorShares = sdk.NewDecFromInt(amt) keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[i], true) @@ -451,14 +451,13 @@ func TestGetValidatorSortingMixed(t *testing.T) { app.StakingKeeper.PowerReduction(ctx).MulRaw(100), app.StakingKeeper.PowerReduction(ctx), app.StakingKeeper.PowerReduction(ctx).MulRaw(400), - app.StakingKeeper.PowerReduction(ctx).MulRaw(200), - } + app.StakingKeeper.PowerReduction(ctx).MulRaw(200)} var validators [5]types.Validator for i, amt := range amts { validators[i] = teststaking.NewValidator(t, sdk.ValAddress(addrs[i]), PKs[i]) validators[i].DelegatorShares = sdk.NewDecFromInt(amt) - validators[i].Status = types.Bonded + validators[i].Status = sdkstaking.Bonded validators[i].Tokens = amt keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[i], true) } @@ -473,11 +472,11 @@ func TestGetValidatorSortingMixed(t *testing.T) { require.True(t, found) val4, found := app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addrs[4])) require.True(t, found) - require.Equal(t, types.Bonded, val0.Status) - require.Equal(t, types.Unbonding, val1.Status) - require.Equal(t, types.Unbonding, val2.Status) - require.Equal(t, types.Bonded, val3.Status) - require.Equal(t, types.Bonded, val4.Status) + require.Equal(t, sdkstaking.Bonded, val0.Status) + require.Equal(t, sdkstaking.Unbonding, val1.Status) + require.Equal(t, sdkstaking.Unbonding, val2.Status) + require.Equal(t, sdkstaking.Bonded, val3.Status) + require.Equal(t, sdkstaking.Bonded, val4.Status) // first make sure everything made it in to the gotValidator group resValidators := app.StakingKeeper.GetBondedValidatorsByPower(ctx) @@ -670,11 +669,11 @@ func TestFullValidatorSetPowerChange(t *testing.T) { validators[i], found = app.StakingKeeper.GetValidator(ctx, validators[i].GetOperator()) require.True(t, found) } - assert.Equal(t, types.Unbonded, validators[0].Status) - assert.Equal(t, types.Unbonding, validators[1].Status) - assert.Equal(t, types.Bonded, validators[2].Status) - assert.Equal(t, types.Bonded, validators[3].Status) - assert.Equal(t, types.Unbonded, validators[4].Status) + assert.Equal(t, sdkstaking.Unbonded, validators[0].Status) + assert.Equal(t, sdkstaking.Unbonding, validators[1].Status) + assert.Equal(t, sdkstaking.Bonded, validators[2].Status) + assert.Equal(t, sdkstaking.Bonded, validators[3].Status) + assert.Equal(t, sdkstaking.Unbonded, validators[4].Status) resValidators := app.StakingKeeper.GetBondedValidatorsByPower(ctx) assert.Equal(t, max, len(resValidators)) assert.True(ValEq(t, validators[2], resValidators[0])) // in the order of txs @@ -761,7 +760,7 @@ func TestApplyAndReturnValidatorSetUpdatesSingleValueChange(t *testing.T) { // test single value change // tendermintUpdate set: {} -> {c1'} - validators[0].Status = types.Bonded + validators[0].Status = sdkstaking.Bonded validators[0].Tokens = app.StakingKeeper.TokensFromConsensusPower(ctx, 600) validators[0] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[0], false) diff --git a/x/staking/migrations/v042/types.go b/x/staking/migrations/v042/types.go deleted file mode 100644 index 097c9ca8bc14..000000000000 --- a/x/staking/migrations/v042/types.go +++ /dev/null @@ -1,306 +0,0 @@ -package v042 - -import ( - "bytes" - "encoding/binary" - "fmt" - "strconv" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/kv" - v042auth "github.com/cosmos/cosmos-sdk/x/auth/migrations/v042" - "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// Staking params default values -const ( - // DefaultUnbondingTime reflects three weeks in seconds as the default - // unbonding time. - // TODO: Justify our choice of default here. - DefaultUnbondingTime time.Duration = time.Hour * 24 * 7 * 3 - - // Default maximum number of bonded validators - DefaultMaxValidators uint32 = 100 - - // Default maximum entries in a UBD/RED pair - DefaultMaxEntries uint32 = 7 - - // DefaultHistorical entries is 10000. Apps that don't use IBC can ignore this - // value by not adding the staking module to the application module manager's - // SetOrderBeginBlockers. - DefaultHistoricalEntries uint32 = 10000 -) - -var ( - // Keys for store prefixes - // Last* values are constant during a block. - LastValidatorPowerKey = []byte{0x11} // prefix for each key to a validator index, for bonded validators - LastTotalPowerKey = []byte{0x12} // prefix for the total power - - ValidatorsKey = []byte{0x21} // prefix for each key to a validator - ValidatorsByConsAddrKey = []byte{0x22} // prefix for each key to a validator index, by pubkey - ValidatorsByPowerIndexKey = []byte{0x23} // prefix for each key to a validator index, sorted by power - - DelegationKey = []byte{0x31} // key for a delegation - UnbondingDelegationKey = []byte{0x32} // key for an unbonding-delegation - UnbondingDelegationByValIndexKey = []byte{0x33} // prefix for each key for an unbonding-delegation, by validator operator - RedelegationKey = []byte{0x34} // key for a redelegation - RedelegationByValSrcIndexKey = []byte{0x35} // prefix for each key for an redelegation, by source validator operator - RedelegationByValDstIndexKey = []byte{0x36} // prefix for each key for an redelegation, by destination validator operator - - UnbondingQueueKey = []byte{0x41} // prefix for the timestamps in unbonding queue - RedelegationQueueKey = []byte{0x42} // prefix for the timestamps in redelegations queue - ValidatorQueueKey = []byte{0x43} // prefix for the timestamps in validator queue - - HistoricalInfoKey = []byte{0x50} // prefix for the historical info -) - -// gets the key for the validator with address -// VALUE: staking/Validator -func GetValidatorKey(operatorAddr sdk.ValAddress) []byte { - return append(ValidatorsKey, operatorAddr.Bytes()...) -} - -// gets the key for the validator with pubkey -// VALUE: validator operator address ([]byte) -func GetValidatorByConsAddrKey(addr sdk.ConsAddress) []byte { - return append(ValidatorsByConsAddrKey, addr.Bytes()...) -} - -// Get the validator operator address from LastValidatorPowerKey -func AddressFromLastValidatorPowerKey(key []byte) []byte { - kv.AssertKeyAtLeastLength(key, 2) - return key[1:] // remove prefix bytes -} - -// get the validator by power index. -// Power index is the key used in the power-store, and represents the relative -// power ranking of the validator. -// VALUE: validator operator address ([]byte) -func GetValidatorsByPowerIndexKey(validator types.Validator) []byte { - // NOTE the address doesn't need to be stored because counter bytes must always be different - // NOTE the larger values are of higher value - - consensusPower := sdk.TokensToConsensusPower(validator.Tokens, sdk.DefaultPowerReduction) - consensusPowerBytes := make([]byte, 8) - binary.BigEndian.PutUint64(consensusPowerBytes, uint64(consensusPower)) - - powerBytes := consensusPowerBytes - powerBytesLen := len(powerBytes) // 8 - - // key is of format prefix || powerbytes || addrBytes - key := make([]byte, 1+powerBytesLen+v042auth.AddrLen) - - key[0] = ValidatorsByPowerIndexKey[0] - copy(key[1:powerBytesLen+1], powerBytes) - addr, err := sdk.ValAddressFromBech32(validator.OperatorAddress) - if err != nil { - panic(err) - } - operAddrInvr := sdk.CopyBytes(addr) - - for i, b := range operAddrInvr { - operAddrInvr[i] = ^b - } - - copy(key[powerBytesLen+1:], operAddrInvr) - - return key -} - -// get the bonded validator index key for an operator address -func GetLastValidatorPowerKey(operator sdk.ValAddress) []byte { - return append(LastValidatorPowerKey, operator...) -} - -// GetREDKey returns a key prefix for indexing a redelegation from a delegator -// and source validator to a destination validator. -func GetREDKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte { - key := make([]byte, 1+v042auth.AddrLen*3) - - copy(key[0:v042auth.AddrLen+1], GetREDsKey(delAddr.Bytes())) - copy(key[v042auth.AddrLen+1:2*v042auth.AddrLen+1], valSrcAddr.Bytes()) - copy(key[2*v042auth.AddrLen+1:3*v042auth.AddrLen+1], valDstAddr.Bytes()) - - return key -} - -// gets the index-key for a redelegation, stored by source-validator-index -// VALUE: none (key rearrangement used) -func GetREDByValSrcIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte { - REDSFromValsSrcKey := GetREDsFromValSrcIndexKey(valSrcAddr) - offset := len(REDSFromValsSrcKey) - - // key is of the form REDSFromValsSrcKey || delAddr || valDstAddr - key := make([]byte, len(REDSFromValsSrcKey)+2*v042auth.AddrLen) - copy(key[0:offset], REDSFromValsSrcKey) - copy(key[offset:offset+v042auth.AddrLen], delAddr.Bytes()) - copy(key[offset+v042auth.AddrLen:offset+2*v042auth.AddrLen], valDstAddr.Bytes()) - - return key -} - -// gets the index-key for a redelegation, stored by destination-validator-index -// VALUE: none (key rearrangement used) -func GetREDByValDstIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte { - REDSToValsDstKey := GetREDsToValDstIndexKey(valDstAddr) - offset := len(REDSToValsDstKey) - - // key is of the form REDSToValsDstKey || delAddr || valSrcAddr - key := make([]byte, len(REDSToValsDstKey)+2*v042auth.AddrLen) - copy(key[0:offset], REDSToValsDstKey) - copy(key[offset:offset+v042auth.AddrLen], delAddr.Bytes()) - copy(key[offset+v042auth.AddrLen:offset+2*v042auth.AddrLen], valSrcAddr.Bytes()) - - return key -} - -// GetREDKeyFromValSrcIndexKey rearranges the ValSrcIndexKey to get the REDKey -func GetREDKeyFromValSrcIndexKey(indexKey []byte) []byte { - // note that first byte is prefix byte - kv.AssertKeyLength(indexKey, 3*v042auth.AddrLen+1) - - valSrcAddr := indexKey[1 : v042auth.AddrLen+1] - delAddr := indexKey[v042auth.AddrLen+1 : 2*v042auth.AddrLen+1] - valDstAddr := indexKey[2*v042auth.AddrLen+1 : 3*v042auth.AddrLen+1] - - return GetREDKey(delAddr, valSrcAddr, valDstAddr) -} - -// GetREDKeyFromValDstIndexKey rearranges the ValDstIndexKey to get the REDKey -func GetREDKeyFromValDstIndexKey(indexKey []byte) []byte { - // note that first byte is prefix byte - kv.AssertKeyLength(indexKey, 3*v042auth.AddrLen+1) - - valDstAddr := indexKey[1 : v042auth.AddrLen+1] - delAddr := indexKey[v042auth.AddrLen+1 : 2*v042auth.AddrLen+1] - valSrcAddr := indexKey[2*v042auth.AddrLen+1 : 3*v042auth.AddrLen+1] - - return GetREDKey(delAddr, valSrcAddr, valDstAddr) -} - -func GetREDsToValDstIndexKey(valDstAddr sdk.ValAddress) []byte { - return append(RedelegationByValDstIndexKey, valDstAddr.Bytes()...) -} - -// GetREDsFromValSrcIndexKey returns a key prefix for indexing a redelegation to -// a source validator. -func GetREDsFromValSrcIndexKey(valSrcAddr sdk.ValAddress) []byte { - return append(RedelegationByValSrcIndexKey, valSrcAddr.Bytes()...) -} - -// GetREDsKey returns a key prefix for indexing a redelegation from a delegator -// address. -func GetREDsKey(delAddr sdk.AccAddress) []byte { - return append(RedelegationKey, delAddr.Bytes()...) -} - -// gets the prefix for all unbonding delegations from a delegator -func GetUBDsKey(delAddr sdk.AccAddress) []byte { - return append(UnbondingDelegationKey, delAddr.Bytes()...) -} - -// gets the prefix keyspace for the indexes of unbonding delegations for a validator -func GetUBDsByValIndexKey(valAddr sdk.ValAddress) []byte { - return append(UnbondingDelegationByValIndexKey, valAddr.Bytes()...) -} - -// gets the prefix for all unbonding delegations from a delegator -func GetUnbondingDelegationTimeKey(timestamp time.Time) []byte { - bz := sdk.FormatTimeBytes(timestamp) - return append(UnbondingQueueKey, bz...) -} - -// from GetValidatorQueueKey. -func ParseValidatorQueueKey(bz []byte) (time.Time, int64, error) { - prefixL := len(ValidatorQueueKey) - if prefix := bz[:prefixL]; !bytes.Equal(prefix, ValidatorQueueKey) { - return time.Time{}, 0, fmt.Errorf("invalid prefix; expected: %X, got: %X", ValidatorQueueKey, prefix) - } - - timeBzL := sdk.BigEndianToUint64(bz[prefixL : prefixL+8]) - ts, err := sdk.ParseTimeBytes(bz[prefixL+8 : prefixL+8+int(timeBzL)]) - if err != nil { - return time.Time{}, 0, err - } - - height := sdk.BigEndianToUint64(bz[prefixL+8+int(timeBzL):]) - - return ts, int64(height), nil -} - -// gets the key for delegator bond with validator -// VALUE: staking/Delegation -func GetDelegationKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte { - return append(GetDelegationsKey(delAddr), valAddr.Bytes()...) -} - -// gets the prefix for a delegator for all validators -func GetDelegationsKey(delAddr sdk.AccAddress) []byte { - return append(DelegationKey, delAddr.Bytes()...) -} - -// gets the key for an unbonding delegation by delegator and validator addr -// VALUE: staking/UnbondingDelegation -func GetUBDKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte { - return append( - GetUBDsKey(delAddr.Bytes()), - valAddr.Bytes()...) -} - -// gets the index-key for an unbonding delegation, stored by validator-index -// VALUE: none (key rearrangement used) -func GetUBDByValIndexKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte { - return append(GetUBDsByValIndexKey(valAddr), delAddr.Bytes()...) -} - -// rearranges the ValIndexKey to get the UBDKey -func GetUBDKeyFromValIndexKey(indexKey []byte) []byte { - kv.AssertKeyAtLeastLength(indexKey, 2) - addrs := indexKey[1:] // remove prefix bytes - kv.AssertKeyLength(addrs, 2*v042auth.AddrLen) - - kv.AssertKeyAtLeastLength(addrs, v042auth.AddrLen+1) - valAddr := addrs[:v042auth.AddrLen] - delAddr := addrs[v042auth.AddrLen:] - - return GetUBDKey(delAddr, valAddr) -} - -// GetValidatorQueueKey returns the prefix key used for getting a set of unbonding -// validators whose unbonding completion occurs at the given time and height. -func GetValidatorQueueKey(timestamp time.Time, height int64) []byte { - heightBz := sdk.Uint64ToBigEndian(uint64(height)) - timeBz := sdk.FormatTimeBytes(timestamp) - timeBzL := len(timeBz) - prefixL := len(ValidatorQueueKey) - - bz := make([]byte, prefixL+8+timeBzL+8) - - // copy the prefix - copy(bz[:prefixL], ValidatorQueueKey) - - // copy the encoded time bytes length - copy(bz[prefixL:prefixL+8], sdk.Uint64ToBigEndian(uint64(timeBzL))) - - // copy the encoded time bytes - copy(bz[prefixL+8:prefixL+8+timeBzL], timeBz) - - // copy the encoded height - copy(bz[prefixL+8+timeBzL:], heightBz) - - return bz -} - -// GetRedelegationTimeKey returns a key prefix for indexing an unbonding -// redelegation based on a completion time. -func GetRedelegationTimeKey(timestamp time.Time) []byte { - bz := sdk.FormatTimeBytes(timestamp) - return append(RedelegationQueueKey, bz...) -} - -// GetHistoricalInfoKey returns a key prefix for indexing HistoricalInfo objects. -func GetHistoricalInfoKey(height int64) []byte { - return append(HistoricalInfoKey, []byte(strconv.FormatInt(height, 10))...) -} diff --git a/x/staking/migrations/v043/keys.go b/x/staking/migrations/v043/keys.go deleted file mode 100644 index bca943d8aec8..000000000000 --- a/x/staking/migrations/v043/keys.go +++ /dev/null @@ -1,6 +0,0 @@ -package v043 - -const ( - // ModuleName is the name of the module - ModuleName = "staking" -) diff --git a/x/staking/migrations/v043/store.go b/x/staking/migrations/v043/store.go index 620d9b6a1a07..73ef0c9c7770 100644 --- a/x/staking/migrations/v043/store.go +++ b/x/staking/migrations/v043/store.go @@ -1,79 +1 @@ package v043 - -import ( - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" - v042auth "github.com/cosmos/cosmos-sdk/x/auth/migrations/v042" - v043distribution "github.com/cosmos/cosmos-sdk/x/distribution/migrations/v043" - v040staking "github.com/cosmos/cosmos-sdk/x/staking/migrations/v042" - "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// migratePrefixAddressAddressAddress is a helper function that migrates all keys of format: -// prefix_bytes | address_1_bytes | address_2_bytes | address_3_bytes -// into format: -// prefix_bytes | address_1_len (1 byte) | address_1_bytes | address_2_len (1 byte) | address_2_bytes | address_3_len (1 byte) | address_3_bytes -func migratePrefixAddressAddressAddress(store sdk.KVStore, prefixBz []byte) { - oldStore := prefix.NewStore(store, prefixBz) - - oldStoreIter := oldStore.Iterator(nil, nil) - defer oldStoreIter.Close() - - for ; oldStoreIter.Valid(); oldStoreIter.Next() { - addr1 := oldStoreIter.Key()[:v042auth.AddrLen] - addr2 := oldStoreIter.Key()[v042auth.AddrLen : 2*v042auth.AddrLen] - addr3 := oldStoreIter.Key()[2*v042auth.AddrLen:] - newStoreKey := append(append(append( - prefixBz, - address.MustLengthPrefix(addr1)...), address.MustLengthPrefix(addr2)...), address.MustLengthPrefix(addr3)..., - ) - - // Set new key on store. Values don't change. - store.Set(newStoreKey, oldStoreIter.Value()) - oldStore.Delete(oldStoreIter.Key()) - } -} - -const powerBytesLen = 8 - -func migrateValidatorsByPowerIndexKey(store sdk.KVStore) { - oldStore := prefix.NewStore(store, v040staking.ValidatorsByPowerIndexKey) - - oldStoreIter := oldStore.Iterator(nil, nil) - defer oldStoreIter.Close() - - for ; oldStoreIter.Valid(); oldStoreIter.Next() { - powerBytes := oldStoreIter.Key()[:powerBytesLen] - valAddr := oldStoreIter.Key()[powerBytesLen:] - newStoreKey := append(append(types.ValidatorsByPowerIndexKey, powerBytes...), address.MustLengthPrefix(valAddr)...) - - // Set new key on store. Values don't change. - store.Set(newStoreKey, oldStoreIter.Value()) - oldStore.Delete(oldStoreIter.Key()) - } -} - -// MigrateStore performs in-place store migrations from v0.40 to v0.43. The -// migration includes: -// -// - Setting the Power Reduction param in the paramstore -func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey) error { - store := ctx.KVStore(storeKey) - - v043distribution.MigratePrefixAddress(store, v040staking.LastValidatorPowerKey) - - v043distribution.MigratePrefixAddress(store, v040staking.ValidatorsKey) - v043distribution.MigratePrefixAddress(store, v040staking.ValidatorsByConsAddrKey) - migrateValidatorsByPowerIndexKey(store) - - v043distribution.MigratePrefixAddressAddress(store, v040staking.DelegationKey) - v043distribution.MigratePrefixAddressAddress(store, v040staking.UnbondingDelegationKey) - v043distribution.MigratePrefixAddressAddress(store, v040staking.UnbondingDelegationByValIndexKey) - migratePrefixAddressAddressAddress(store, v040staking.RedelegationKey) - migratePrefixAddressAddressAddress(store, v040staking.RedelegationByValSrcIndexKey) - migratePrefixAddressAddressAddress(store, v040staking.RedelegationByValDstIndexKey) - - return nil -} diff --git a/x/staking/migrations/v043/store_test.go b/x/staking/migrations/v043/store_test.go index 920ff55067de..596b211a8336 100644 --- a/x/staking/migrations/v043/store_test.go +++ b/x/staking/migrations/v043/store_test.go @@ -1,138 +1 @@ package v043_test - -import ( - "bytes" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/testutil" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - sdk "github.com/cosmos/cosmos-sdk/types" - v042staking "github.com/cosmos/cosmos-sdk/x/staking/migrations/v042" - v043staking "github.com/cosmos/cosmos-sdk/x/staking/migrations/v043" - "github.com/cosmos/cosmos-sdk/x/staking/teststaking" - "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -func TestStoreMigration(t *testing.T) { - stakingKey := sdk.NewKVStoreKey("staking") - tStakingKey := sdk.NewTransientStoreKey("transient_test") - ctx := testutil.DefaultContext(stakingKey, tStakingKey) - store := ctx.KVStore(stakingKey) - - _, pk1, addr1 := testdata.KeyTestPubAddr() - valAddr1 := sdk.ValAddress(addr1) - val := teststaking.NewValidator(t, valAddr1, pk1) - _, pk1, addr2 := testdata.KeyTestPubAddr() - valAddr2 := sdk.ValAddress(addr2) - _, _, addr3 := testdata.KeyTestPubAddr() - consAddr := sdk.ConsAddress(addr3.String()) - _, _, addr4 := testdata.KeyTestPubAddr() - now := time.Now() - // Use dummy value for all keys. - value := []byte("foo") - - testCases := []struct { - name string - oldKey []byte - newKey []byte - }{ - { - "LastValidatorPowerKey", - v042staking.GetLastValidatorPowerKey(valAddr1), - types.GetLastValidatorPowerKey(valAddr1), - }, - { - "LastTotalPowerKey", - v042staking.LastTotalPowerKey, - types.LastTotalPowerKey, - }, - { - "ValidatorsKey", - v042staking.GetValidatorKey(valAddr1), - types.GetValidatorKey(valAddr1), - }, - { - "ValidatorsByConsAddrKey", - v042staking.GetValidatorByConsAddrKey(consAddr), - types.GetValidatorByConsAddrKey(consAddr), - }, - { - "ValidatorsByPowerIndexKey", - v042staking.GetValidatorsByPowerIndexKey(val), - types.GetValidatorsByPowerIndexKey(val, sdk.DefaultPowerReduction), - }, - { - "DelegationKey", - v042staking.GetDelegationKey(addr4, valAddr1), - types.GetDelegationKey(addr4, valAddr1), - }, - { - "UnbondingDelegationKey", - v042staking.GetUBDKey(addr4, valAddr1), - types.GetUBDKey(addr4, valAddr1), - }, - { - "UnbondingDelegationByValIndexKey", - v042staking.GetUBDByValIndexKey(addr4, valAddr1), - types.GetUBDByValIndexKey(addr4, valAddr1), - }, - { - "RedelegationKey", - v042staking.GetREDKey(addr4, valAddr1, valAddr2), - types.GetREDKey(addr4, valAddr1, valAddr2), - }, - { - "RedelegationByValSrcIndexKey", - v042staking.GetREDByValSrcIndexKey(addr4, valAddr1, valAddr2), - types.GetREDByValSrcIndexKey(addr4, valAddr1, valAddr2), - }, - { - "RedelegationByValDstIndexKey", - v042staking.GetREDByValDstIndexKey(addr4, valAddr1, valAddr2), - types.GetREDByValDstIndexKey(addr4, valAddr1, valAddr2), - }, - { - "UnbondingQueueKey", - v042staking.GetUnbondingDelegationTimeKey(now), - types.GetUnbondingDelegationTimeKey(now), - }, - { - "RedelegationQueueKey", - v042staking.GetRedelegationTimeKey(now), - types.GetRedelegationTimeKey(now), - }, - { - "ValidatorQueueKey", - v042staking.GetValidatorQueueKey(now, 4), - types.GetValidatorQueueKey(now, 4), - }, - { - "HistoricalInfoKey", - v042staking.GetHistoricalInfoKey(4), - types.GetHistoricalInfoKey(4), - }, - } - - // Set all the old keys to the store - for _, tc := range testCases { - store.Set(tc.oldKey, value) - } - - // Run migrations. - err := v043staking.MigrateStore(ctx, stakingKey) - require.NoError(t, err) - - // Make sure the new keys are set and old keys are deleted. - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - if !bytes.Equal(tc.oldKey, tc.newKey) { - require.Nil(t, store.Get(tc.oldKey)) - } - require.Equal(t, value, store.Get(tc.newKey)) - }) - } -} diff --git a/x/staking/migrations/v046/json.go b/x/staking/migrations/v046/json.go deleted file mode 100644 index e3be292a2c74..000000000000 --- a/x/staking/migrations/v046/json.go +++ /dev/null @@ -1,13 +0,0 @@ -package v046 - -import "github.com/cosmos/cosmos-sdk/x/staking/types" - -// MigrateJSON accepts exported v0.43 x/stakinng genesis state and migrates it to -// v0.46 x/staking genesis state. The migration includes: -// -// - Add MinCommissionRate param. -func MigrateJSON(oldState types.GenesisState) (types.GenesisState, error) { - oldState.Params.MinCommissionRate = types.DefaultMinCommissionRate - - return oldState, nil -} diff --git a/x/staking/migrations/v046/json_test.go b/x/staking/migrations/v046/json_test.go deleted file mode 100644 index df1d8db94329..000000000000 --- a/x/staking/migrations/v046/json_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package v046_test - -import ( - "encoding/json" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/simapp" - v046 "github.com/cosmos/cosmos-sdk/x/staking/migrations/v046" - "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -func TestMigrateJSON(t *testing.T) { - encodingConfig := simapp.MakeTestEncodingConfig() - clientCtx := client.Context{}. - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithCodec(encodingConfig.Codec) - - oldState := types.DefaultGenesisState() - - newState, err := v046.MigrateJSON(*oldState) - require.NoError(t, err) - - bz, err := clientCtx.Codec.MarshalJSON(&newState) - require.NoError(t, err) - - // Indent the JSON bz correctly. - var jsonObj map[string]interface{} - err = json.Unmarshal(bz, &jsonObj) - require.NoError(t, err) - indentedBz, err := json.MarshalIndent(jsonObj, "", "\t") - require.NoError(t, err) - - // Make sure about new param MinCommissionRate. - expected := `{ - "delegations": [], - "exported": false, - "last_total_power": "0", - "last_validator_powers": [], - "params": { - "bond_denom": "stake", - "historical_entries": 10000, - "max_entries": 7, - "max_validators": 100, - "min_commission_rate": "0.000000000000000000", - "unbonding_time": "1814400s" - }, - "redelegations": [], - "unbonding_delegations": [], - "validators": [] -}` - - require.Equal(t, expected, string(indentedBz)) -} diff --git a/x/staking/migrations/v046/keys.go b/x/staking/migrations/v046/keys.go deleted file mode 100644 index f937f1593058..000000000000 --- a/x/staking/migrations/v046/keys.go +++ /dev/null @@ -1,6 +0,0 @@ -package v046 - -const ( - // ModuleName is the name of the module - ModuleName = "staking" -) diff --git a/x/staking/migrations/v046/store.go b/x/staking/migrations/v046/store.go index e2be22cbb1ff..20825ec26029 100644 --- a/x/staking/migrations/v046/store.go +++ b/x/staking/migrations/v046/store.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// MigrateStore performs in-place store migrations from v0.43/v0.44/v0.45 to v0.46. +// MigrateStore performs in-place store migrations from v0.43/v0.44 to v0.45. // The migration includes: // // - Setting the MinCommissionRate param in the paramstore @@ -19,10 +19,6 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar } func migrateParamsStore(ctx sdk.Context, paramstore paramtypes.Subspace) { - if paramstore.HasKeyTable() { - paramstore.Set(ctx, types.KeyMinCommissionRate, types.DefaultMinCommissionRate) - } else { - paramstore.WithKeyTable(types.ParamKeyTable()) - paramstore.Set(ctx, types.KeyMinCommissionRate, types.DefaultMinCommissionRate) - } + paramstore.WithKeyTable(types.ParamKeyTable()) + paramstore.Set(ctx, types.KeyMinCommissionRate, types.DefaultMinCommissionRate) } diff --git a/x/staking/migrations/v046/store_test.go b/x/staking/migrations/v046/store_test.go index 6ac24a9e8a5b..a5be02bb97cc 100644 --- a/x/staking/migrations/v046/store_test.go +++ b/x/staking/migrations/v046/store_test.go @@ -1,32 +1 @@ package v046_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/simapp" - "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - v046staking "github.com/cosmos/cosmos-sdk/x/staking/migrations/v046" - "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -func TestStoreMigration(t *testing.T) { - encCfg := simapp.MakeTestEncodingConfig() - stakingKey := sdk.NewKVStoreKey("staking") - tStakingKey := sdk.NewTransientStoreKey("transient_test") - ctx := testutil.DefaultContext(stakingKey, tStakingKey) - paramstore := paramtypes.NewSubspace(encCfg.Codec, encCfg.Amino, stakingKey, tStakingKey, "staking") - - // Check no params - require.False(t, paramstore.Has(ctx, types.KeyMinCommissionRate)) - - // Run migrations. - err := v046staking.MigrateStore(ctx, stakingKey, encCfg.Codec, paramstore) - require.NoError(t, err) - - // Make sure the new params are set. - require.True(t, paramstore.Has(ctx, types.KeyMinCommissionRate)) -} diff --git a/x/staking/module.go b/x/staking/module.go index 93b41daef60a..f8f428346c7c 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -6,6 +6,7 @@ import ( "fmt" "math/rand" + "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" @@ -70,6 +71,11 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod return ValidateGenesis(&data) } +// RegisterRESTRoutes registers the REST routes for the staking module. +// Deprecated: RegisterRESTRoutes is deprecated. `x/staking` legacy REST implementation +// has been removed from the SDK. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {} + // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the staking module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { @@ -136,10 +142,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) querier := keeper.Querier{Keeper: am.keeper} types.RegisterQueryServer(cfg.QueryServer(), querier) - - m := keeper.NewMigrator(am.keeper) - cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2) - cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3) } // InitGenesis performs genesis initialization for the staking module. It returns diff --git a/x/staking/module_test.go b/x/staking/module_test.go index 3f1e5d916883..313de42620a3 100644 --- a/x/staking/module_test.go +++ b/x/staking/module_test.go @@ -10,7 +10,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) diff --git a/x/staking/simulation/decoder_test.go b/x/staking/simulation/decoder_test.go index 3d7546369d6b..da47f2e41622 100644 --- a/x/staking/simulation/decoder_test.go +++ b/x/staking/simulation/decoder_test.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/x/staking/simulation" @@ -38,7 +38,7 @@ func TestDecodeStore(t *testing.T) { val, err := types.NewValidator(valAddr1, delPk1, types.NewDescription("test", "test", "test", "test", "test")) require.NoError(t, err) - del := types.NewDelegation(delAddr1, valAddr1, sdk.OneDec()) + del := types.NewDelegation(delAddr1, valAddr1, sdk.OneDec(), false) ubd := types.NewUnbondingDelegation(delAddr1, valAddr1, 15, bondTime, sdk.OneInt()) red := types.NewRedelegation(delAddr1, valAddr1, valAddr1, 12, bondTime, sdk.OneInt(), sdk.OneDec()) diff --git a/x/staking/simulation/genesis.go b/x/staking/simulation/genesis.go index afd393c1c778..63d9a86af21c 100644 --- a/x/staking/simulation/genesis.go +++ b/x/staking/simulation/genesis.go @@ -44,6 +44,7 @@ func RandomizedGenState(simState *module.SimulationState) { maxVals uint32 histEntries uint32 minCommissionRate sdk.Dec + exemptionFactor sdk.Dec ) simState.AppParams.GetOrGenerate( @@ -64,7 +65,7 @@ func RandomizedGenState(simState *module.SimulationState) { // NOTE: the slashing module need to be defined after the staking module on the // NewSimulationManager constructor for this to work simState.UnbondTime = unbondTime - params := types.NewParams(simState.UnbondTime, maxVals, 7, histEntries, sdk.DefaultBondDenom, minCommissionRate) + params := types.NewParams(simState.UnbondTime, maxVals, 7, histEntries, sdk.DefaultBondDenom, minCommissionRate, exemptionFactor) // validators & delegations var ( @@ -93,7 +94,7 @@ func RandomizedGenState(simState *module.SimulationState) { validator.DelegatorShares = sdk.NewDecFromInt(simState.InitialStake) validator.Commission = commission - delegation := types.NewDelegation(simState.Accounts[i].Address, valAddr, sdk.NewDecFromInt(simState.InitialStake)) + delegation := types.NewDelegation(simState.Accounts[i].Address, valAddr, sdk.NewDecFromInt(simState.InitialStake), false) validators = append(validators, validator) delegations = append(delegations, delegation) diff --git a/x/staking/simulation/genesis_test.go b/x/staking/simulation/genesis_test.go index dd60652a87bb..90fe5d186e1c 100644 --- a/x/staking/simulation/genesis_test.go +++ b/x/staking/simulation/genesis_test.go @@ -7,10 +7,10 @@ import ( "github.com/stretchr/testify/require" - sdkmath "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/staking/simulation" @@ -33,7 +33,7 @@ func TestRandomizedGenState(t *testing.T) { Rand: r, NumBonded: 3, Accounts: simtypes.RandomAccounts(r, 3), - InitialStake: sdkmath.NewInt(1000), + InitialStake: sdk.NewInt(1000), GenState: make(map[string]json.RawMessage), } @@ -64,7 +64,6 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, "0.292059246265731326", stakingGenesis.Validators[2].Commission.CommissionRates.Rate.String()) require.Equal(t, "0.330000000000000000", stakingGenesis.Validators[2].Commission.CommissionRates.MaxRate.String()) require.Equal(t, "0.038337453731274481", stakingGenesis.Validators[2].Commission.CommissionRates.MaxChangeRate.String()) - require.Equal(t, "1", stakingGenesis.Validators[2].MinSelfDelegation.String()) } // TestRandomizedGenState1 tests abnormal scenarios of applying RandomizedGenState. @@ -95,10 +94,9 @@ func TestRandomizedGenState1(t *testing.T) { Rand: r, NumBonded: 4, Accounts: simtypes.RandomAccounts(r, 3), - InitialStake: sdkmath.NewInt(1000), + InitialStake: sdk.NewInt(1000), GenState: make(map[string]json.RawMessage), - }, "invalid memory address or nil pointer dereference", - }, + }, "invalid memory address or nil pointer dereference"}, } for _, tt := range tests { diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index c28b489d6a51..5f6c664267e5 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -12,16 +12,26 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +const ( + DefaultWeightMsgTokenizeShares int = 100 + DefaultWeightMsgRedeemTokensforShares int = 100 + DefaultWeightMsgTransferTokenizeShareRecord int = 50 ) // Simulation operation weights constants const ( - OpWeightMsgCreateValidator = "op_weight_msg_create_validator" - OpWeightMsgEditValidator = "op_weight_msg_edit_validator" - OpWeightMsgDelegate = "op_weight_msg_delegate" - OpWeightMsgUndelegate = "op_weight_msg_undelegate" - OpWeightMsgBeginRedelegate = "op_weight_msg_begin_redelegate" - OpWeightMsgCancelUnbondingDelegation = "op_weight_msg_cancel_unbonding_delegation" + OpWeightMsgCreateValidator = "op_weight_msg_create_validator" + OpWeightMsgEditValidator = "op_weight_msg_edit_validator" + OpWeightMsgDelegate = "op_weight_msg_delegate" + OpWeightMsgUndelegate = "op_weight_msg_undelegate" + OpWeightMsgBeginRedelegate = "op_weight_msg_begin_redelegate" + OpWeightMsgCancelUnbondingDelegation = "op_weight_msg_cancel_unbonding_delegation" + OpWeightMsgTokenizeShares = "op_weight_msg_tokenize_shares" + OpWeightMsgRedeemTokensforShares = "op_weight_msg_redeem_tokens_for_shares" + OpWeightMsgTransferTokenizeShareRecord = "op_weight_msg_transfer_tokenize_share_record" ) // WeightedOperations returns all the operations from the module with their respective weights @@ -30,12 +40,15 @@ func WeightedOperations( bk types.BankKeeper, k keeper.Keeper, ) simulation.WeightedOperations { var ( - weightMsgCreateValidator int - weightMsgEditValidator int - weightMsgDelegate int - weightMsgUndelegate int - weightMsgBeginRedelegate int - weightMsgCancelUnbondingDelegation int + weightMsgCreateValidator int + weightMsgEditValidator int + weightMsgDelegate int + weightMsgUndelegate int + weightMsgBeginRedelegate int + weightMsgCancelUnbondingDelegation int + weightMsgTokenizeShares int + weightMsgRedeemTokensforShares int + weightMsgTransferTokenizeShareRecord int ) appParams.GetOrGenerate(cdc, OpWeightMsgCreateValidator, &weightMsgCreateValidator, nil, @@ -74,6 +87,24 @@ func WeightedOperations( }, ) + appParams.GetOrGenerate(cdc, OpWeightMsgTokenizeShares, &weightMsgTokenizeShares, nil, + func(_ *rand.Rand) { + weightMsgTokenizeShares = DefaultWeightMsgTokenizeShares + }, + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgRedeemTokensforShares, &weightMsgRedeemTokensforShares, nil, + func(_ *rand.Rand) { + weightMsgRedeemTokensforShares = DefaultWeightMsgRedeemTokensforShares + }, + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgTransferTokenizeShareRecord, &weightMsgTransferTokenizeShareRecord, nil, + func(_ *rand.Rand) { + weightMsgTransferTokenizeShareRecord = DefaultWeightMsgTransferTokenizeShareRecord + }, + ) + return simulation.WeightedOperations{ simulation.NewWeightedOperation( weightMsgCreateValidator, @@ -99,6 +130,18 @@ func WeightedOperations( weightMsgCancelUnbondingDelegation, SimulateMsgCancelUnbondingDelegate(ak, bk, k), ), + simulation.NewWeightedOperation( + weightMsgTokenizeShares, + SimulateMsgTokenizeShares(ak, bk, k), + ), + simulation.NewWeightedOperation( + weightMsgRedeemTokensforShares, + SimulateMsgRedeemTokensforShares(ak, bk, k), + ), + simulation.NewWeightedOperation( + weightMsgTransferTokenizeShareRecord, + SimulateMsgTransferTokenizeShareRecord(ak, bk, k), + ), } } @@ -158,7 +201,7 @@ func SimulateMsgCreateValidator(ak types.AccountKeeper, bk types.BankKeeper, k k simtypes.RandomDecAmount(r, maxCommission), ) - msg, err := types.NewMsgCreateValidator(address, simAccount.ConsKey.PubKey(), selfDelegation, description, commission, sdk.OneInt()) + msg, err := types.NewMsgCreateValidator(address, simAccount.ConsKey.PubKey(), selfDelegation, description, commission) if err != nil { return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "unable to create CreateValidator message"), nil, err } @@ -219,7 +262,7 @@ func SimulateMsgEditValidator(ak types.AccountKeeper, bk types.BankKeeper, k kee simtypes.RandStringOfLength(r, 10), ) - msg := types.NewMsgEditValidator(address, description, &newCommissionRate, nil) + msg := types.NewMsgEditValidator(address, description, &newCommissionRate) txCtx := simulation.OperationInput{ R: r, @@ -397,37 +440,37 @@ func SimulateMsgCancelUnbondingDelegate(ak types.AccountKeeper, bk types.BankKee // get random validator validator, ok := keeper.RandomValidator(r, k, ctx) if !ok { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelUnbondingDelegation, "validator is not ok"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, sdkstaking.TypeMsgCancelUnbondingDelegation, "validator is not ok"), nil, nil } if validator.IsJailed() || validator.InvalidExRate() { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelUnbondingDelegation, "validator is jailed"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, sdkstaking.TypeMsgCancelUnbondingDelegation, "validator is jailed"), nil, nil } valAddr := validator.GetOperator() unbondingDelegation, found := k.GetUnbondingDelegation(ctx, simAccount.Address, valAddr) if !found { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelUnbondingDelegation, "account does have any unbonding delegation"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, sdkstaking.TypeMsgCancelUnbondingDelegation, "account does have any unbonding delegation"), nil, nil } // get random unbonding delegation entry at block height unbondingDelegationEntry := unbondingDelegation.Entries[r.Intn(len(unbondingDelegation.Entries))] if unbondingDelegationEntry.CompletionTime.Before(ctx.BlockTime()) { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelUnbondingDelegation, "unbonding delegation is already processed"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, sdkstaking.TypeMsgCancelUnbondingDelegation, "unbonding delegation is already processed"), nil, nil } if !unbondingDelegationEntry.Balance.IsPositive() { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelUnbondingDelegation, "delegator receiving balance is negative"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, sdkstaking.TypeMsgCancelUnbondingDelegation, "delegator receiving balance is negative"), nil, nil } cancelBondAmt := simtypes.RandomAmount(r, unbondingDelegationEntry.Balance) if cancelBondAmt.IsZero() { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCancelUnbondingDelegation, "cancelBondAmt amount is zero"), nil, nil + return simtypes.NoOpMsg(types.ModuleName, sdkstaking.TypeMsgCancelUnbondingDelegation, "cancelBondAmt amount is zero"), nil, nil } - msg := types.NewMsgCancelUnbondingDelegation( + msg := sdkstaking.NewMsgCancelUnbondingDelegation( simAccount.Address, valAddr, unbondingDelegationEntry.CreationHeight, sdk.NewCoin(k.BondDenom(ctx), cancelBondAmt), ) @@ -553,3 +596,212 @@ func SimulateMsgBeginRedelegate(ak types.AccountKeeper, bk types.BankKeeper, k k return simulation.GenAndDeliverTxWithRandFees(txCtx) } } + +// SimulateMsgTokenizeShares generates a MsgTokenizeShares with random values +func SimulateMsgTokenizeShares(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + // get random source validator + srcVal, ok := keeper.RandomValidator(r, k, ctx) + if !ok { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "unable to pick validator"), nil, nil + } + + srcAddr := srcVal.GetOperator() + delegations := k.GetValidatorDelegations(ctx, srcAddr) + if delegations == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "keeper does have any delegation entries"), nil, nil + } + + // get random delegator from src validator + delegation := delegations[r.Intn(len(delegations))] + delAddr := delegation.GetDelegatorAddr() + + // get random destination validator + totalBond := srcVal.TokensFromShares(delegation.GetShares()).TruncateInt() + if !totalBond.IsPositive() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "total bond is negative"), nil, nil + } + + tokenizeShareAmt, err := simtypes.RandPositiveInt(r, totalBond) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "unable to generate positive amount"), nil, err + } + + if tokenizeShareAmt.IsZero() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "amount is zero"), nil, nil + } + + // check if the shares truncate to zero + shares, err := srcVal.SharesFromTokens(tokenizeShareAmt) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "invalid shares"), nil, err + } + + if srcVal.TokensFromShares(shares).TruncateInt().IsZero() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "shares truncate to zero"), nil, nil // skip + } + + // need to retrieve the simulation account associated with delegation to retrieve PrivKey + var simAccount simtypes.Account + + for _, simAcc := range accs { + if simAcc.Address.Equals(delAddr) { + simAccount = simAcc + break + } + } + + // if simaccount.PrivKey == nil, delegation address does not exist in accs. Return error + if simAccount.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "account private key is nil"), nil, fmt.Errorf("delegation addr: %s does not exist in simulation accounts", delAddr) + } + + msg := &types.MsgTokenizeShares{ + DelegatorAddress: delAddr.String(), + ValidatorAddress: srcAddr.String(), + Amount: sdk.NewCoin(k.BondDenom(ctx), tokenizeShareAmt), + TokenizedShareOwner: delAddr.String(), + } + + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: simappparams.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// SimulateMsgRedeemTokensforShares generates a MsgRedeemTokensforShares with random values +func SimulateMsgRedeemTokensforShares(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + redeemUser := simtypes.Account{} + redeemCoin := sdk.Coin{} + + records := k.GetAllTokenizeShareRecords(ctx) + if len(records) > 0 { + record := records[r.Intn(len(records))] + for _, acc := range accs { + balance := bk.GetBalance(ctx, acc.Address, record.GetShareTokenDenom()) + if balance.Amount.IsPositive() { + redeemUser = acc + redeemAmount, err := simtypes.RandPositiveInt(r, balance.Amount) + if err == nil { + redeemCoin = sdk.NewCoin(record.GetShareTokenDenom(), redeemAmount) + } + break + } + } + } + + // if redeemUser.PrivKey == nil, redeem user does not exist in accs + if redeemUser.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgRedeemTokensforShares, "account private key is nil"), nil, nil + } + + if redeemCoin.Amount.IsZero() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgRedeemTokensforShares, "empty balance in tokens"), nil, nil + } + + account := ak.GetAccount(ctx, redeemUser.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + msg := &types.MsgRedeemTokensforShares{ + DelegatorAddress: redeemUser.Address.String(), + Amount: redeemCoin, + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: simappparams.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: redeemUser, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// SimulateMsgTransferTokenizeShareRecord generates a MsgTransferTokenizeShareRecord with random values +func SimulateMsgTransferTokenizeShareRecord(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + destAccount, _ := simtypes.RandomAcc(r, accs) + transferRecord := types.TokenizeShareRecord{} + + records := k.GetAllTokenizeShareRecords(ctx) + if len(records) > 0 { + record := records[r.Intn(len(records))] + for _, acc := range accs { + balance := bk.GetBalance(ctx, acc.Address, record.GetShareTokenDenom()) + if balance.Amount.IsPositive() { + simAccount = acc + transferRecord = record + break + } + } + } + + // if simAccount.PrivKey == nil, record owner does not exist in accs + if simAccount.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferTokenizeShareRecord, "account private key is nil"), nil, nil + } + + if transferRecord.Id == 0 { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferTokenizeShareRecord, "share record not found"), nil, nil + } + + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + msg := &types.MsgTransferTokenizeShareRecord{ + TokenizeShareRecordId: transferRecord.Id, + Sender: simAccount.Address.String(), + NewOwner: destAccount.Address.String(), + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: simappparams.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index aa07bafe0649..44c211c0016b 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -4,17 +4,14 @@ import ( "math/big" "math/rand" "testing" - "time" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - "github.com/cosmos/cosmos-sdk/simapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -22,288 +19,238 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/staking/simulation" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// TestWeightedOperations tests the weights of the operations. -func TestWeightedOperations(t *testing.T) { - s := rand.NewSource(1) - r := rand.New(s) - app, ctx, accs := createTestApp(t, false, r, 3) - - ctx.WithChainID("test-chain") - - cdc := app.AppCodec() - appParams := make(simtypes.AppParams) - - weightesOps := simulation.WeightedOperations(appParams, cdc, app.AccountKeeper, - app.BankKeeper, app.StakingKeeper, - ) - - expected := []struct { - weight int - opMsgRoute string - opMsgName string - }{ - {simappparams.DefaultWeightMsgCreateValidator, types.ModuleName, types.TypeMsgCreateValidator}, - {simappparams.DefaultWeightMsgEditValidator, types.ModuleName, types.TypeMsgEditValidator}, - {simappparams.DefaultWeightMsgDelegate, types.ModuleName, types.TypeMsgDelegate}, - {simappparams.DefaultWeightMsgUndelegate, types.ModuleName, types.TypeMsgUndelegate}, - {simappparams.DefaultWeightMsgBeginRedelegate, types.ModuleName, types.TypeMsgBeginRedelegate}, - {simappparams.DefaultWeightMsgCancelUnbondingDelegation, types.ModuleName, types.TypeMsgCancelUnbondingDelegation}, - } - - for i, w := range weightesOps { - operationMsg, _, _ := w.Op()(r, app.BaseApp, ctx, accs, ctx.ChainID()) - // the following checks are very much dependent from the ordering of the output given - // by WeightedOperations. if the ordering in WeightedOperations changes some tests - // will fail - require.Equal(t, expected[i].weight, w.Weight(), "weight should be the same") - require.Equal(t, expected[i].opMsgRoute, operationMsg.Route, "route should be the same") - require.Equal(t, expected[i].opMsgName, operationMsg.Name, "operation Msg name should be the same") - } -} - -// TestSimulateMsgCreateValidator tests the normal scenario of a valid message of type TypeMsgCreateValidator. -// Abonormal scenarios, where the message are created by an errors are not tested here. -func TestSimulateMsgCreateValidator(t *testing.T) { - s := rand.NewSource(1) - r := rand.New(s) - app, ctx, accounts := createTestApp(t, false, r, 3) - - // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) - - // execute operation - op := simulation.SimulateMsgCreateValidator(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) - operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - - var msg types.MsgCreateValidator - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - require.True(t, operationMsg.OK) - require.Equal(t, "0.080000000000000000", msg.Commission.MaxChangeRate.String()) - require.Equal(t, "0.080000000000000000", msg.Commission.MaxRate.String()) - require.Equal(t, "0.019527679037870745", msg.Commission.Rate.String()) - require.Equal(t, types.TypeMsgCreateValidator, msg.Type()) - require.Equal(t, []byte{0xa, 0x20, 0x51, 0xde, 0xbd, 0xe8, 0xfa, 0xdf, 0x4e, 0xfc, 0x33, 0xa5, 0x16, 0x94, 0xf6, 0xee, 0xd3, 0x69, 0x7a, 0x7a, 0x1c, 0x2d, 0x50, 0xb6, 0x2, 0xf7, 0x16, 0x4e, 0x66, 0x9f, 0xff, 0x38, 0x91, 0x9b}, msg.Pubkey.Value) - require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) - require.Equal(t, "cosmosvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnsvnaes", msg.ValidatorAddress) - require.Len(t, futureOperations, 0) -} - -// TestSimulateMsgCancelUnbondingDelegation tests the normal scenario of a valid message of type TypeMsgCancelUnbondingDelegation. -// Abonormal scenarios, where the message is -func TestSimulateMsgCancelUnbondingDelegation(t *testing.T) { - s := rand.NewSource(1) - r := rand.New(s) - app, ctx, accounts := createTestApp(t, false, r, 3) - - blockTime := time.Now().UTC() - ctx = ctx.WithBlockTime(blockTime) - - // remove genesis validator account - accounts = accounts[1:] - - // setup accounts[0] as validator - validator0 := getTestingValidator0(t, app, ctx, accounts) - - // setup delegation - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 2) - validator0, issuedShares := validator0.AddTokensFromDel(delTokens) - delegator := accounts[1] - delegation := types.NewDelegation(delegator.Address, validator0.GetOperator(), issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - app.DistrKeeper.SetDelegatorStartingInfo(ctx, validator0.GetOperator(), delegator.Address, distrtypes.NewDelegatorStartingInfo(2, sdk.OneDec(), 200)) - - setupValidatorRewards(app, ctx, validator0.GetOperator()) - - // unbonding delegation - udb := types.NewUnbondingDelegation(delegator.Address, validator0.GetOperator(), app.LastBlockHeight(), blockTime.Add(2*time.Minute), delTokens) - app.StakingKeeper.SetUnbondingDelegation(ctx, udb) - setupValidatorRewards(app, ctx, validator0.GetOperator()) - - // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) - - // execute operation - op := simulation.SimulateMsgCancelUnbondingDelegate(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) - accounts = []simtypes.Account{accounts[1]} - operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - - var msg types.MsgCancelUnbondingDelegation - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - require.True(t, operationMsg.OK) - require.Equal(t, types.TypeMsgCancelUnbondingDelegation, msg.Type()) - require.Equal(t, delegator.Address.String(), msg.DelegatorAddress) - require.Equal(t, validator0.GetOperator().String(), msg.ValidatorAddress) - require.Len(t, futureOperations, 0) -} - -// TestSimulateMsgEditValidator tests the normal scenario of a valid message of type TypeMsgEditValidator. -// Abonormal scenarios, where the message is created by an errors are not tested here. -func TestSimulateMsgEditValidator(t *testing.T) { - s := rand.NewSource(1) - r := rand.New(s) - app, ctx, accounts := createTestApp(t, false, r, 3) - blockTime := time.Now().UTC() - ctx = ctx.WithBlockTime(blockTime) - - // remove genesis validator account - accounts = accounts[1:] - - // setup accounts[0] as validator - _ = getTestingValidator0(t, app, ctx, accounts) - - // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) - - // execute operation - op := simulation.SimulateMsgEditValidator(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) - operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - - var msg types.MsgEditValidator - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - require.True(t, operationMsg.OK) - require.Equal(t, "0.280623462081924936", msg.CommissionRate.String()) - require.Equal(t, "xKGLwQvuyN", msg.Description.Moniker) - require.Equal(t, "SlcxgdXhhu", msg.Description.Identity) - require.Equal(t, "WeLrQKjLxz", msg.Description.Website) - require.Equal(t, "rBqDOTtGTO", msg.Description.SecurityContact) - require.Equal(t, types.TypeMsgEditValidator, msg.Type()) - require.Equal(t, "cosmosvaloper1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7epjs3u", msg.ValidatorAddress) - require.Len(t, futureOperations, 0) -} - -// TestSimulateMsgDelegate tests the normal scenario of a valid message of type TypeMsgDelegate. -// Abonormal scenarios, where the message is created by an errors are not tested here. -func TestSimulateMsgDelegate(t *testing.T) { - s := rand.NewSource(1) - r := rand.New(s) - app, ctx, accounts := createTestApp(t, false, r, 3) - - blockTime := time.Now().UTC() - ctx = ctx.WithBlockTime(blockTime) - - // execute operation - op := simulation.SimulateMsgDelegate(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) - operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - - var msg types.MsgDelegate - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - require.True(t, operationMsg.OK) - require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) - require.Equal(t, "98100858108421259236", msg.Amount.Amount.String()) - require.Equal(t, "stake", msg.Amount.Denom) - require.Equal(t, types.TypeMsgDelegate, msg.Type()) - require.Equal(t, "cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", msg.ValidatorAddress) - require.Len(t, futureOperations, 0) -} - -// TestSimulateMsgUndelegate tests the normal scenario of a valid message of type TypeMsgUndelegate. -// Abonormal scenarios, where the message is created by an errors are not tested here. -func TestSimulateMsgUndelegate(t *testing.T) { - s := rand.NewSource(1) - r := rand.New(s) - app, ctx, accounts := createTestApp(t, false, r, 3) - - blockTime := time.Now().UTC() - ctx = ctx.WithBlockTime(blockTime) - - // remove genesis validator account - accounts = accounts[1:] - - // setup accounts[0] as validator - validator0 := getTestingValidator0(t, app, ctx, accounts) - - // setup delegation - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 2) - validator0, issuedShares := validator0.AddTokensFromDel(delTokens) - delegator := accounts[1] - delegation := types.NewDelegation(delegator.Address, validator0.GetOperator(), issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - app.DistrKeeper.SetDelegatorStartingInfo(ctx, validator0.GetOperator(), delegator.Address, distrtypes.NewDelegatorStartingInfo(2, sdk.OneDec(), 200)) - - setupValidatorRewards(app, ctx, validator0.GetOperator()) - - // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) - - // execute operation - op := simulation.SimulateMsgUndelegate(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) - operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - - var msg types.MsgUndelegate - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - require.True(t, operationMsg.OK) - require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) - require.Equal(t, "280623462081924937", msg.Amount.Amount.String()) - require.Equal(t, "stake", msg.Amount.Denom) - require.Equal(t, types.TypeMsgUndelegate, msg.Type()) - require.Equal(t, "cosmosvaloper1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7epjs3u", msg.ValidatorAddress) - require.Len(t, futureOperations, 0) -} - -// TestSimulateMsgBeginRedelegate tests the normal scenario of a valid message of type TypeMsgBeginRedelegate. -// Abonormal scenarios, where the message is created by an errors, are not tested here. -func TestSimulateMsgBeginRedelegate(t *testing.T) { - s := rand.NewSource(12) - r := rand.New(s) - app, ctx, accounts := createTestApp(t, false, r, 4) - - blockTime := time.Now().UTC() - ctx = ctx.WithBlockTime(blockTime) - - // remove genesis validator account - accounts = accounts[1:] - - // setup accounts[0] as validator0 and accounts[1] as validator1 - validator0 := getTestingValidator0(t, app, ctx, accounts) - validator1 := getTestingValidator1(t, app, ctx, accounts) - - delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 2) - validator0, issuedShares := validator0.AddTokensFromDel(delTokens) - - // setup accounts[2] as delegator - delegator := accounts[2] - delegation := types.NewDelegation(delegator.Address, validator1.GetOperator(), issuedShares) - app.StakingKeeper.SetDelegation(ctx, delegation) - app.DistrKeeper.SetDelegatorStartingInfo(ctx, validator1.GetOperator(), delegator.Address, distrtypes.NewDelegatorStartingInfo(2, sdk.OneDec(), 200)) - - setupValidatorRewards(app, ctx, validator0.GetOperator()) - setupValidatorRewards(app, ctx, validator1.GetOperator()) - - // begin a new block - app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) - - // execute operation - op := simulation.SimulateMsgBeginRedelegate(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) - operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") - require.NoError(t, err) - - var msg types.MsgBeginRedelegate - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - - require.True(t, operationMsg.OK) - require.Equal(t, "cosmos1092v0qgulpejj8y8hs6dmlw82x9gv8f7jfc7jl", msg.DelegatorAddress) - require.Equal(t, "1883752832348281252", msg.Amount.Amount.String()) - require.Equal(t, "stake", msg.Amount.Denom) - require.Equal(t, types.TypeMsgBeginRedelegate, msg.Type()) - require.Equal(t, "cosmosvaloper1gnkw3uqzflagcqn6ekjwpjanlne928qhruemah", msg.ValidatorDstAddress) - require.Equal(t, "cosmosvaloper1kk653svg7ksj9fmu85x9ygj4jzwlyrgs89nnn2", msg.ValidatorSrcAddress) - require.Len(t, futureOperations, 0) -} +// // TestWeightedOperations tests the weights of the operations. +// func TestWeightedOperations(t *testing.T) { +// s := rand.NewSource(1) +// r := rand.New(s) +// app, ctx, accs := createTestApp(t, false, r, 3) + +// ctx.WithChainID("test-chain") + +// cdc := app.AppCodec() +// appParams := make(simtypes.AppParams) + +// weightesOps := simulation.WeightedOperations(appParams, cdc, app.AccountKeeper, +// app.BankKeeper, app.StakingKeeper, +// ) + +// expected := []struct { +// weight int +// opMsgRoute string +// opMsgName string +// }{{simappparams.DefaultWeightMsgCreateValidator, types.ModuleName, types.TypeMsgCreateValidator}, +// {simappparams.DefaultWeightMsgEditValidator, types.ModuleName, types.TypeMsgEditValidator}, +// {simappparams.DefaultWeightMsgDelegate, types.ModuleName, types.TypeMsgDelegate}, +// {simappparams.DefaultWeightMsgUndelegate, types.ModuleName, types.TypeMsgUndelegate}, +// {simappparams.DefaultWeightMsgBeginRedelegate, types.ModuleName, types.TypeMsgBeginRedelegate}, +// {simulation.DefaultWeightMsgTokenizeShares, types.ModuleName, types.TypeMsgTokenizeShares}, +// {simulation.DefaultWeightMsgRedeemTokensforShares, types.ModuleName, types.TypeMsgRedeemTokensforShares}, +// {simulation.DefaultWeightMsgTransferTokenizeShareRecord, types.ModuleName, types.TypeMsgTransferTokenizeShareRecord}, +// } + +// for i, w := range weightesOps { +// operationMsg, _, _ := w.Op()(r, app.BaseApp, ctx, accs, ctx.ChainID()) +// // the following checks are very much dependent from the ordering of the output given +// // by WeightedOperations. if the ordering in WeightedOperations changes some tests +// // will fail +// require.Equal(t, expected[i].weight, w.Weight(), "weight should be the same") +// require.Equal(t, expected[i].opMsgRoute, operationMsg.Route, "route should be the same") +// require.Equal(t, expected[i].opMsgName, operationMsg.Name, "operation Msg name should be the same") +// } +// } + +// // TestSimulateMsgCreateValidator tests the normal scenario of a valid message of type TypeMsgCreateValidator. +// // Abonormal scenarios, where the message are created by an errors are not tested here. +// func TestSimulateMsgCreateValidator(t *testing.T) { +// s := rand.NewSource(1) +// r := rand.New(s) +// app, ctx, accounts := createTestApp(t, false, r, 3) + +// // begin a new block +// app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) + +// // execute operation +// op := simulation.SimulateMsgCreateValidator(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) +// operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") +// require.NoError(t, err) + +// var msg types.MsgCreateValidator +// legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) + +// require.True(t, operationMsg.OK) +// require.Equal(t, "0.080000000000000000", msg.Commission.MaxChangeRate.String()) +// require.Equal(t, "0.080000000000000000", msg.Commission.MaxRate.String()) +// require.Equal(t, "0.019527679037870745", msg.Commission.Rate.String()) +// require.Equal(t, types.TypeMsgCreateValidator, msg.Type()) +// require.Equal(t, []byte{0xa, 0x20, 0x51, 0xde, 0xbd, 0xe8, 0xfa, 0xdf, 0x4e, 0xfc, 0x33, 0xa5, 0x16, 0x94, 0xf6, 0xee, 0xd3, 0x69, 0x7a, 0x7a, 0x1c, 0x2d, 0x50, 0xb6, 0x2, 0xf7, 0x16, 0x4e, 0x66, 0x9f, 0xff, 0x38, 0x91, 0x9b}, msg.Pubkey.Value) +// require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) +// require.Equal(t, "cosmosvaloper1ghekyjucln7y67ntx7cf27m9dpuxxemnsvnaes", msg.ValidatorAddress) +// require.Len(t, futureOperations, 0) +// } + +// // TestSimulateMsgEditValidator tests the normal scenario of a valid message of type TypeMsgEditValidator. +// // Abonormal scenarios, where the message is created by an errors are not tested here. +// func TestSimulateMsgEditValidator(t *testing.T) { +// s := rand.NewSource(1) +// r := rand.New(s) +// app, ctx, accounts := createTestApp(t, false, r, 3) +// blockTime := time.Now().UTC() +// ctx = ctx.WithBlockTime(blockTime) + +// // remove genesis validator account +// accounts = accounts[1:] + +// // setup accounts[0] as validator +// _ = getTestingValidator0(t, app, ctx, accounts) + +// // begin a new block +// app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) + +// // execute operation +// op := simulation.SimulateMsgEditValidator(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) +// operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") +// require.NoError(t, err) + +// var msg types.MsgEditValidator +// legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) + +// require.True(t, operationMsg.OK) +// require.Equal(t, "0.280623462081924936", msg.CommissionRate.String()) +// require.Equal(t, "xKGLwQvuyN", msg.Description.Moniker) +// require.Equal(t, "SlcxgdXhhu", msg.Description.Identity) +// require.Equal(t, "WeLrQKjLxz", msg.Description.Website) +// require.Equal(t, "rBqDOTtGTO", msg.Description.SecurityContact) +// require.Equal(t, types.TypeMsgEditValidator, msg.Type()) +// require.Equal(t, "cosmosvaloper1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7epjs3u", msg.ValidatorAddress) +// require.Len(t, futureOperations, 0) +// } + +// // TestSimulateMsgDelegate tests the normal scenario of a valid message of type TypeMsgDelegate. +// // Abonormal scenarios, where the message is created by an errors are not tested here. +// func TestSimulateMsgDelegate(t *testing.T) { +// s := rand.NewSource(1) +// r := rand.New(s) +// app, ctx, accounts := createTestApp(t, false, r, 3) + +// blockTime := time.Now().UTC() +// ctx = ctx.WithBlockTime(blockTime) + +// // execute operation +// op := simulation.SimulateMsgDelegate(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) +// operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") +// require.NoError(t, err) + +// var msg types.MsgDelegate +// legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) + +// require.True(t, operationMsg.OK) +// require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) +// require.Equal(t, "98100858108421259236", msg.Amount.Amount.String()) +// require.Equal(t, "stake", msg.Amount.Denom) +// require.Equal(t, types.TypeMsgDelegate, msg.Type()) +// require.Equal(t, "cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", msg.ValidatorAddress) +// require.Len(t, futureOperations, 0) +// } + +// // TestSimulateMsgUndelegate tests the normal scenario of a valid message of type TypeMsgUndelegate. +// // Abonormal scenarios, where the message is created by an errors are not tested here. +// func TestSimulateMsgUndelegate(t *testing.T) { +// s := rand.NewSource(1) +// r := rand.New(s) +// app, ctx, accounts := createTestApp(t, false, r, 3) + +// blockTime := time.Now().UTC() +// ctx = ctx.WithBlockTime(blockTime) + +// // remove genesis validator account +// accounts = accounts[1:] + +// // setup accounts[0] as validator +// validator0 := getTestingValidator0(t, app, ctx, accounts) + +// // setup delegation +// delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 2) +// validator0, issuedShares := validator0.AddTokensFromDel(delTokens) +// delegator := accounts[1] +// delegation := types.NewDelegation(delegator.Address, validator0.GetOperator(), issuedShares) +// app.StakingKeeper.SetDelegation(ctx, delegation) +// app.DistrKeeper.SetDelegatorStartingInfo(ctx, validator0.GetOperator(), delegator.Address, distrtypes.NewDelegatorStartingInfo(2, sdk.OneDec(), 200)) + +// setupValidatorRewards(app, ctx, validator0.GetOperator()) + +// // begin a new block +// app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) + +// // execute operation +// op := simulation.SimulateMsgUndelegate(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) +// operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") +// require.NoError(t, err) + +// var msg types.MsgUndelegate +// legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) + +// require.True(t, operationMsg.OK) +// require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) +// require.Equal(t, "280623462081924937", msg.Amount.Amount.String()) +// require.Equal(t, "stake", msg.Amount.Denom) +// require.Equal(t, types.TypeMsgUndelegate, msg.Type()) +// require.Equal(t, "cosmosvaloper1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7epjs3u", msg.ValidatorAddress) +// require.Len(t, futureOperations, 0) +// } + +// // TestSimulateMsgBeginRedelegate tests the normal scenario of a valid message of type TypeMsgBeginRedelegate. +// // Abonormal scenarios, where the message is created by an errors, are not tested here. +// func TestSimulateMsgBeginRedelegate(t *testing.T) { +// s := rand.NewSource(12) +// r := rand.New(s) +// app, ctx, accounts := createTestApp(t, false, r, 4) + +// blockTime := time.Now().UTC() +// ctx = ctx.WithBlockTime(blockTime) + +// // remove genesis validator account +// accounts = accounts[1:] + +// // setup accounts[0] as validator0 and accounts[1] as validator1 +// validator0 := getTestingValidator0(t, app, ctx, accounts) +// validator1 := getTestingValidator1(t, app, ctx, accounts) + +// delTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 2) +// validator0, issuedShares := validator0.AddTokensFromDel(delTokens) + +// // setup accounts[2] as delegator +// delegator := accounts[2] +// delegation := types.NewDelegation(delegator.Address, validator1.GetOperator(), issuedShares) +// app.StakingKeeper.SetDelegation(ctx, delegation) +// app.DistrKeeper.SetDelegatorStartingInfo(ctx, validator1.GetOperator(), delegator.Address, distrtypes.NewDelegatorStartingInfo(2, sdk.OneDec(), 200)) + +// setupValidatorRewards(app, ctx, validator0.GetOperator()) +// setupValidatorRewards(app, ctx, validator1.GetOperator()) + +// // begin a new block +// app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, Time: blockTime}}) + +// // execute operation +// op := simulation.SimulateMsgBeginRedelegate(app.AccountKeeper, app.BankKeeper, app.StakingKeeper) +// operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") +// require.NoError(t, err) + +// var msg types.MsgBeginRedelegate +// legacy.Cdc.UnmarshalJSON(operationMsg.Msg, &msg) + +// require.True(t, operationMsg.OK) +// require.Equal(t, "cosmos1092v0qgulpejj8y8hs6dmlw82x9gv8f7jfc7jl", msg.DelegatorAddress) +// require.Equal(t, "1883752832348281252", msg.Amount.Amount.String()) +// require.Equal(t, "stake", msg.Amount.Denom) +// require.Equal(t, types.TypeMsgBeginRedelegate, msg.Type()) +// require.Equal(t, "cosmosvaloper1gnkw3uqzflagcqn6ekjwpjanlne928qhruemah", msg.ValidatorDstAddress) +// require.Equal(t, "cosmosvaloper1kk653svg7ksj9fmu85x9ygj4jzwlyrgs89nnn2", msg.ValidatorSrcAddress) +// require.Len(t, futureOperations, 0) +// } // returns context and an app with updated mint keeper func createTestApp(t *testing.T, isCheckTx bool, r *rand.Rand, n int) (*simapp.SimApp, sdk.Context, []simtypes.Account) { @@ -381,4 +328,5 @@ func setupValidatorRewards(app *simapp.SimApp, ctx sdk.Context, valAddress sdk.V // setup current revards currentRewards := distrtypes.NewValidatorCurrentRewards(decCoins, 3) app.DistrKeeper.SetValidatorCurrentRewards(ctx, valAddress, currentRewards) + } diff --git a/x/staking/spec/01_state.md b/x/staking/spec/01_state.md index 4413d40cc725..219b0be07262 100644 --- a/x/staking/spec/01_state.md +++ b/x/staking/spec/01_state.md @@ -13,29 +13,31 @@ Pool is used for tracking bonded and not-bonded token supply of the bond denomin LastTotalPower tracks the total amounts of bonded tokens recorded during the previous end block. Store entries prefixed with "Last" must remain unchanged until EndBlock. -* LastTotalPower: `0x12 -> ProtocolBuffer(sdk.Int)` +- LastTotalPower: `0x12 -> ProtocolBuffer(sdk.Int)` ## Params Params is a module-wide configuration structure that stores system parameters and defines overall functioning of the staking module. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/staking.proto#L285-L306 +- Params: `Paramsspace("staking") -> legacy_amino(params)` + ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.1/proto/cosmos/staking/v1beta1/staking.proto#L230-L241 ## Validator Validators can have one of three statuses -* `Unbonded`: The validator is not in the active set. They cannot sign blocks and do not earn +- `Unbonded`: The validator is not in the active set. They cannot sign blocks and do not earn rewards. They can receive delegations. -* `Bonded`: Once the validator receives sufficient bonded tokens they automtically join the +- `Bonded`": Once the validator receives sufficient bonded tokens they automtically join the active set during [`EndBlock`](./05_end_block.md#validator-set-changes) and their status is updated to `Bonded`. They are signing blocks and receiving rewards. They can receive further delegations. They can be slashed for misbehavior. Delegators to this validator who unbond their delegation must wait the duration of the UnbondingTime, a chain-specific param, during which time they are still slashable for offences of the source validator if those offences were committed during the period of time that the tokens were bonded. -* `Unbonding`: When a validator leaves the active set, either by choice or due to slashing, jailing or +- `Unbonding`: When a validator leaves the active set, either by choice or due to slashing, jailing or tombstoning, an unbonding of all their delegations begins. All delegations must then wait the UnbondingTime before their tokens are moved to their accounts from the `BondedPool`. @@ -47,10 +49,10 @@ required lookups for slashing and validator-set updates. A third special index throughout each block, unlike the first two indices which mirror the validator records within a block. -* Validators: `0x21 | OperatorAddrLen (1 byte) | OperatorAddr -> ProtocolBuffer(validator)` -* ValidatorsByConsAddr: `0x22 | ConsAddrLen (1 byte) | ConsAddr -> OperatorAddr` -* ValidatorsByPower: `0x23 | BigEndian(ConsensusPower) | OperatorAddrLen (1 byte) | OperatorAddr -> OperatorAddr` -* LastValidatorsPower: `0x11 | OperatorAddrLen (1 byte) | OperatorAddr -> ProtocolBuffer(ConsensusPower)` +- Validators: `0x21 | OperatorAddrLen (1 byte) | OperatorAddr -> ProtocolBuffer(validator)` +- ValidatorsByConsAddr: `0x22 | ConsAddrLen (1 byte) | ConsAddr -> OperatorAddr` +- ValidatorsByPower: `0x23 | BigEndian(ConsensusPower) | OperatorAddrLen (1 byte) | OperatorAddr -> OperatorAddr` +- LastValidatorsPower: `0x11 | OperatorAddrLen (1 byte) | OperatorAddr -> ProtocolBuffer(ConsensusPower)` `Validators` is the primary index - it ensures that each operator can have only one associated validator, where the public key of that validator can change in the @@ -73,23 +75,23 @@ is updated during the validator set update process which takes place in [`EndBlo Each validator's state is stored in a `Validator` struct: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/staking.proto#L78-L127 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L65-L99 -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/staking.proto#L24-L76 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L24-L63 ## Delegation Delegations are identified by combining `DelegatorAddr` (the address of the delegator) with the `ValidatorAddr` Delegators are indexed in the store as follows: -* Delegation: `0x31 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorAddr -> ProtocolBuffer(delegation)` +- Delegation: `0x31 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorAddr -> ProtocolBuffer(delegation)` Stake holders may delegate coins to validators; under this circumstance their funds are held in a `Delegation` data structure. It is owned by one delegator, and is associated with the shares for one validator. The sender of the transaction is the owner of the bond. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/staking.proto#L187-L205 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L159-L170 ### Delegator Shares @@ -118,8 +120,8 @@ detected. `UnbondingDelegation` are indexed in the store as: -* UnbondingDelegation: `0x32 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorAddr -> ProtocolBuffer(unbondingDelegation)` -* UnbondingDelegationsFromValidator: `0x33 | ValidatorAddrLen (1 byte) | ValidatorAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` +- UnbondingDelegation: `0x32 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorAddr -> ProtocolBuffer(unbondingDelegation)` +- UnbondingDelegationsFromValidator: `0x33 | ValidatorAddrLen (1 byte) | ValidatorAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` The first map here is used in queries, to lookup all unbonding delegations for a given delegator, while the second map is used in slashing, to lookup all @@ -128,7 +130,7 @@ slashed. A UnbondingDelegation object is created every time an unbonding is initiated. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/staking.proto#L207-L220 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L172-L198 ## Redelegation @@ -140,9 +142,9 @@ committed by the source validator. `Redelegation` are indexed in the store as: -* Redelegations: `0x34 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorSrcAddr | ValidatorDstAddr -> ProtocolBuffer(redelegation)` -* RedelegationsBySrc: `0x35 | ValidatorSrcAddrLen (1 byte) | ValidatorSrcAddr | ValidatorDstAddrLen (1 byte) | ValidatorDstAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` -* RedelegationsByDst: `0x36 | ValidatorDstAddrLen (1 byte) | ValidatorDstAddr | ValidatorSrcAddrLen (1 byte) | ValidatorSrcAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` +- Redelegations: `0x34 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorSrcAddr | ValidatorDstAddr -> ProtocolBuffer(redelegation)` +- RedelegationsBySrc: `0x35 | ValidatorSrcAddrLen (1 byte) | ValidatorSrcAddr | ValidatorDstAddrLen (1 byte) | ValidatorDstAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` +- RedelegationsByDst: `0x36 | ValidatorDstAddrLen (1 byte) | ValidatorDstAddr | ValidatorSrcAddrLen (1 byte) | ValidatorSrcAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` The first map here is used for queries, to lookup all redelegations for a given delegator. The second map is used for slashing based on the `ValidatorSrcAddr`, @@ -151,22 +153,22 @@ while the third map is for slashing based on the `ValidatorDstAddr`. A redelegation object is created every time a redelegation occurs. To prevent "redelegation hopping" redelegations may not occur under the situation that: -* the (re)delegator already has another immature redelegation in progress +- the (re)delegator already has another immature redelegation in progress with a destination to a validator (let's call it `Validator X`) -* and, the (re)delegator is attempting to create a _new_ redelegation +- and, the (re)delegator is attempting to create a _new_ redelegation where the source validator for this new redelegation is `Validator X`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/staking.proto#L245-L283 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L200-L228 ## Queues All queues objects are sorted by timestamp. The time used within any queue is first rounded to the nearest nanosecond then sorted. The sortable time format -used is a slight modification of the RFC3339Nano and uses the format string +used is a slight modification of the RFC3339Nano and uses the the format string `"2006-01-02T15:04:05.000000000"`. Notably this format: -* right pads all zeros -* drops the time zone info (uses UTC) +- right pads all zeros +- drops the time zone info (uses UTC) In all cases, the stored timestamp represents the maturation time of the queue element. @@ -176,25 +178,25 @@ element. For the purpose of tracking progress of unbonding delegations the unbonding delegations queue is kept. -* UnbondingDelegation: `0x41 | format(time) -> []DVPair` +- UnbondingDelegation: `0x41 | format(time) -> []DVPair` -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/staking.proto#L151-L161 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L123-L133 ### RedelegationQueue For the purpose of tracking progress of redelegations the redelegation queue is kept. -* RedelegationQueue: `0x42 | format(time) -> []DVVTriplet` +- RedelegationQueue: `0x42 | format(time) -> []DVVTriplet` -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/staking.proto#L168-L179 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L140-L152 ### ValidatorQueue For the purpose of tracking progress of unbonding validators the validator queue is kept. -* ValidatorQueueTime: `0x43 | format(time) -> []sdk.ValAddress` +- ValidatorQueueTime: `0x43 | format(time) -> []sdk.ValAddress` The stored object as each key is an array of validator operator addresses from which the validator object can be accessed. Typically it is expected that only @@ -206,10 +208,37 @@ that multiple validators exist in the queue at the same location. HistoricalInfo objects are stored and pruned at each block such that the staking keeper persists the `n` most recent historical info defined by staking module parameter: `HistoricalEntries`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/staking.proto#L15-L22 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L15-L22 At each BeginBlock, the staking keeper will persist the current Header and the Validators that committed the current block in a `HistoricalInfo` object. The Validators are sorted on their address to ensure that they are in a determisnistic order. The oldest HistoricalEntries will be pruned to ensure that there only exist the parameter-defined number of historical entries. + +## TokenizeShareRecord + +TokenizeShareRecord objects are created when a user tokenize his delegation. + +Record is put on `0x61 | id -> TokenizeShareRecord` + +```go +type TokenizeShareRecord struct { + Id uint64 + Owner string + ShareTokenDenom string + ModuleAccount string + Validator string +} +``` + +There are helper queues to manage the tokenize share records by owner and by share token denom. + +`0x62 | owner | id -> TokenizeShareRecordId` +`0x63 | denom -> TokenizeShareRecordId` + +## LastTokenizeShareRecordIdKey + +LastTokenizeShareRecordIdKey is used to maintain unique id of tokenize share record. + +It is stored on `0x64 -> LastTokenizeShareRecordId` diff --git a/x/staking/spec/02_state_transitions.md b/x/staking/spec/02_state_transitions.md index 9e9efffaeaa2..43e8afaa497b 100644 --- a/x/staking/spec/02_state_transitions.md +++ b/x/staking/spec/02_state_transitions.md @@ -24,44 +24,44 @@ directly between all the states, except for from `Bonded` to `Unbonded`. The following transition occurs when a validator's ranking in the `ValidatorPowerIndex` surpasses that of the `LastValidator`. -* set `validator.Status` to `Bonded` -* send the `validator.Tokens` from the `NotBondedTokens` to the `BondedPool` `ModuleAccount` -* delete the existing record from `ValidatorByPowerIndex` -* add a new updated record to the `ValidatorByPowerIndex` -* update the `Validator` object for this validator -* if it exists, delete any `ValidatorQueue` record for this validator +- set `validator.Status` to `Bonded` +- send the `validator.Tokens` from the `NotBondedTokens` to the `BondedPool` `ModuleAccount` +- delete the existing record from `ValidatorByPowerIndex` +- add a new updated record to the `ValidatorByPowerIndex` +- update the `Validator` object for this validator +- if it exists, delete any `ValidatorQueue` record for this validator ### Bonded to Unbonding When a validator begins the unbonding process the following operations occur: -* send the `validator.Tokens` from the `BondedPool` to the `NotBondedTokens` `ModuleAccount` -* set `validator.Status` to `Unbonding` -* delete the existing record from `ValidatorByPowerIndex` -* add a new updated record to the `ValidatorByPowerIndex` -* update the `Validator` object for this validator -* insert a new record into the `ValidatorQueue` for this validator +- send the `validator.Tokens` from the `BondedPool` to the `NotBondedTokens` `ModuleAccount` +- set `validator.Status` to `Unbonding` +- delete the existing record from `ValidatorByPowerIndex` +- add a new updated record to the `ValidatorByPowerIndex` +- update the `Validator` object for this validator +- insert a new record into the `ValidatorQueue` for this validator ### Unbonding to Unbonded A validator moves from unbonding to unbonded when the `ValidatorQueue` object moves from bonded to unbonded -* update the `Validator` object for this validator -* set `validator.Status` to `Unbonded` +- update the `Validator` object for this validator +- set `validator.Status` to `Unbonded` ### Jail/Unjail when a validator is jailed it is effectively removed from the Tendermint set. this process may be also be reversed. the following operations occur: -* set `Validator.Jailed` and update object -* if jailed delete record from `ValidatorByPowerIndex` -* if unjailed add record to `ValidatorByPowerIndex` +- set `Validator.Jailed` and update object +- if jailed delete record from `ValidatorByPowerIndex` +- if unjailed add record to `ValidatorByPowerIndex` Jailed validators are not present in any of the following stores: -* the power store (from consensus power to address) +- the power store (from consensus power to address) ## Delegations @@ -69,53 +69,49 @@ Jailed validators are not present in any of the following stores: When a delegation occurs both the validator and the delegation objects are affected -* determine the delegators shares based on tokens delegated and the validator's exchange rate -* remove tokens from the sending account -* add shares the delegation object or add them to a created validator object -* add new delegator shares and update the `Validator` object -* transfer the `delegation.Amount` from the delegator's account to the `BondedPool` or the `NotBondedPool` `ModuleAccount` depending if the `validator.Status` is `Bonded` or not -* delete the existing record from `ValidatorByPowerIndex` -* add an new updated record to the `ValidatorByPowerIndex` +- determine the delegators shares based on tokens delegated and the validator's exchange rate +- remove tokens from the sending account +- add shares the delegation object or add them to a created validator object +- add new delegator shares and update the `Validator` object +- transfer the `delegation.Amount` from the delegator's account to the `BondedPool` or the `NotBondedPool` `ModuleAccount` depending if the `validator.Status` is `Bonded` or not +- delete the existing record from `ValidatorByPowerIndex` +- add an new updated record to the `ValidatorByPowerIndex` ### Begin Unbonding As a part of the Undelegate and Complete Unbonding state transitions Unbond Delegation may be called. -* subtract the unbonded shares from delegator -* add the unbonded tokens to an `UnbondingDelegation` Entry -* update the delegation or remove the delegation if there are no more shares -* if the delegation is the operator of the validator and no more shares exist then trigger a jail validator -* update the validator with removed the delegator shares and associated coins -* if the validator state is `Bonded`, transfer the `Coins` worth of the unbonded +- subtract the unbonded shares from delegator +- if the validator is `Unbonding` or `Bonded` add the tokens to an `UnbondingDelegation` Entry +- if the validator is `Unbonded` send the tokens directly to the withdraw + account +- update the delegation or remove the delegation if there are no more shares +- if the delegation is the operator of the validator and no more shares exist then trigger a jail validator +- update the validator with removed the delegator shares and associated coins +- if the validator state is `Bonded`, transfer the `Coins` worth of the unbonded shares from the `BondedPool` to the `NotBondedPool` `ModuleAccount` -* remove the validator if it is unbonded and there are no more delegation shares. - -### Cancel an `UnbondingDelegation` Entry -When a `cancel unbond delegation` occurs both the `validator`, the `delegation` and an `UnbondingDelegationQueue` state will be updated. -* if cancel unbonding delegation amount equals to the `UnbondingDelegation` entry `balance`, then the `UnbondingDelegation` entry deleted from `UnbondingDelegationQueue`. -* if the `cancel unbonding delegation amount is less than the `UnbondingDelegation` entry balance, then the `UnbondingDelegation` entry will be updated with new balance in the `UnbondingDelegationQueue`. -* cancel `amount` is [Delegated](02_state_transitions.md#delegations) back to the original `validator`. +- remove the validator if it is unbonded and there are no more delegation shares. ### Complete Unbonding For undelegations which do not complete immediately, the following operations occur when the unbonding delegation queue element matures: -* remove the entry from the `UnbondingDelegation` object -* transfer the tokens from the `NotBondedPool` `ModuleAccount` to the delegator `Account` +- remove the entry from the `UnbondingDelegation` object +- transfer the tokens from the `NotBondedPool` `ModuleAccount` to the delegator `Account` ### Begin Redelegation Redelegations affect the delegation, source and destination validators. -* perform an `unbond` delegation from the source validator to retrieve the tokens worth of the unbonded shares -* using the unbonded tokens, `Delegate` them to the destination validator -* if the `sourceValidator.Status` is `Bonded`, and the `destinationValidator` is not, +- perform an `unbond` delegation from the source validator to retrieve the tokens worth of the unbonded shares +- using the unbonded tokens, `Delegate` them to the destination validator +- if the `sourceValidator.Status` is `Bonded`, and the `destinationValidator` is not, transfer the newly delegated tokens from the `BondedPool` to the `NotBondedPool` `ModuleAccount` -* otherwise, if the `sourceValidator.Status` is not `Bonded`, and the `destinationValidator` +- otherwise, if the `sourceValidator.Status` is not `Bonded`, and the `destinationValidator` is `Bonded`, transfer the newly delegated tokens from the `NotBondedPool` to the `BondedPool` `ModuleAccount` -* record the token amount in an new entry in the relevant `Redelegation` +- record the token amount in an new entry in the relevant `Redelegation` From when a redelegation begins until it completes, the delegator is in a state of "pseudo-unbonding", and can still be slashed for infractions that occured before the redelegation began. @@ -124,7 +120,7 @@ slashed for infractions that occured before the redelegation began. When a redelegations complete the following occurs: -* remove the entry from the `Redelegation` object +- remove the entry from the `Redelegation` object ## Slashing @@ -132,13 +128,13 @@ When a redelegations complete the following occurs: When a Validator is slashed, the following occurs: -* The total `slashAmount` is calculated as the `slashFactor` (a chain parameter) \* `TokensFromConsensusPower`, +- The total `slashAmount` is calculated as the `slashFactor` (a chain parameter) \* `TokensFromConsensusPower`, the total number of tokens bonded to the validator at the time of the infraction. -* Every unbonding delegation and pseudo-unbonding redelegation such that the infraction occured before the unbonding or +- Every unbonding delegation and pseudo-unbonding redelegation such that the infraction occured before the unbonding or redelegation began from the validator are slashed by the `slashFactor` percentage of the initialBalance. -* Each amount slashed from redelegations and unbonding delegations is subtracted from the +- Each amount slashed from redelegations and unbonding delegations is subtracted from the total slash amount. -* The `remaingSlashAmount` is then slashed from the validator's tokens in the `BondedPool` or +- The `remaingSlashAmount` is then slashed from the validator's tokens in the `BondedPool` or `NonBondedPool` depending on the validator's status. This reduces the total supply of tokens. In the case of a slash due to any infraction that requires evidence to submitted (for example double-sign), the slash @@ -178,3 +174,42 @@ The total number of tokens is now `T + T_j`, and the total number of shares is ` A special case is the initial delegation, when `T = 0` and `S = 0`, so `T_j / T` is undefined. For the initial delegation, delegator `j` who delegates `T_j` tokens receive `S_j = T_j` shares. So a validator that hasn't received any rewards and has not been slashed will have `T = S`. + +## Tokenizing + +### Tokenize delegation shares + +Tokenizing delegation shares tokenize the delegation shares to transferrable asset. + +The process of tokenizing delegation shares + +1. Get delegation from the delegator to the validator +2. Verify that delegation amount is bigger than tokenize amount +3. Create a new tokenize share record as the owner specified by the delegator +4. Mint share tokens to delegator +5. Unbond tokenizing amount from delegator and send it to toknize share record account +6. Delegate the unbonded amount to the same validator from tokenize share record account + +### Redeem delegation shares + +Redeeming of delegation shares is to convert tokenized delegation shares to regular delegation share. + +The process of redeeming delegation shares from tokenized share + +1. Verify that tokenize share tokens amount is not lower than redeeming share tokens amount +2. Get tokenize share record from tokenized share denom +3. Unbond the amount of tokens from the tokenize share record account +4. If tokenize share record account's delegation amount is zero, delete the record +5. Burn share tokens +6. Delegate unbonded tokens from delegator address to the validator + +### Transfer tokenize share record + +Transferring of tokenized share record is done to move the reward withdrawal rights. + +The process of transferring the tokenize share record + +1. Check tokenize share record exists and the owner is the sender of the message +2. Delete old owner's reference to tokenize share record +3. Update tokenize share record to have new owner +4. Add new owner's reference to tokenize share record diff --git a/x/staking/spec/03_messages.md b/x/staking/spec/03_messages.md index a0222d36dfeb..a2c42a16f253 100644 --- a/x/staking/spec/03_messages.md +++ b/x/staking/spec/03_messages.md @@ -11,20 +11,20 @@ In this section we describe the processing of the staking messages and the corre A validator is created using the `MsgCreateValidator` message. The validator must be created with an initial delegation from the operator. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L18-L19 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L16-L17 -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L43-L65 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L35-L51 This message is expected to fail if: -* another validator with this operator address is already registered -* another validator with this pubkey is already registered -* the initial self-delegation tokens are of a denom not specified as the bonding denom -* the commission parameters are faulty, namely: - * `MaxRate` is either > 1 or < 0 - * the initial `Rate` is either negative or > `MaxRate` - * the initial `MaxChangeRate` is either negative or > `MaxRate` -* the description fields are too large +- another validator with this operator address is already registered +- another validator with this pubkey is already registered +- the initial self-delegation tokens are of a denom not specified as the bonding denom +- the commission parameters are faulty, namely: + - `MaxRate` is either > 1 or < 0 + - the initial `Rate` is either negative or > `MaxRate` + - the initial `MaxChangeRate` is either negative or > `MaxRate` +- the description fields are too large This message creates and stores the `Validator` object at appropriate indexes. Additionally a self-delegation is made with the initial tokens delegation @@ -36,16 +36,16 @@ in the first end-block. The `Description`, `CommissionRate` of a validator can be updated using the `MsgEditValidator` message. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L21-L22 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L19-L20 -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L70-L88 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L56-L76 This message is expected to fail if: -* the initial `CommissionRate` is either negative or > `MaxRate` -* the `CommissionRate` has already been updated within the previous 24 hours -* the `CommissionRate` is > `MaxChangeRate` -* the description fields are too large +- the initial `CommissionRate` is either negative or > `MaxRate` +- the `CommissionRate` has already been updated within the previous 24 hours +- the `CommissionRate` is > `MaxChangeRate` +- the description fields are too large This message stores the updated `Validator` object. @@ -55,16 +55,16 @@ Within this message the delegator provides coins, and in return receives some amount of their validator's (newly created) delegator-shares that are assigned to `Delegation.Shares`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L24-L26 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L22-L24 -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L93-L104 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90 This message is expected to fail if: -* the validator does not exist -* the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` -* the exchange rate is invalid, meaning the validator has no tokens (due to slashing) but there are outstanding shares -* the amount delegated is less than the minimum allowed delegation +- the validator does not exist +- the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` +- the exchange rate is invalid, meaning the validator has no tokens (due to slashing) but there are outstanding shares +- the amount delegated is less than the minimum allowed delegation If an existing `Delegation` object for provided addresses does not already exist then it is created as part of this message otherwise the existing @@ -87,89 +87,91 @@ will not be added to the power index until it is unjailed. The `MsgUndelegate` message allows delegators to undelegate their tokens from validator. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L32-L34 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L30-L32 -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L128-L139 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121 This message returns a response containing the completion time of the undelegation: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L128-L144 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L123-L126 This message is expected to fail if: -* the delegation doesn't exist -* the validator doesn't exist -* the delegation has less shares than the ones worth of `Amount` -* existing `UnbondingDelegation` has maximum entries as defined by `params.MaxEntries` -* the `Amount` has a denomination different than one defined by `params.BondDenom` +- the delegation doesn't exist +- the validator doesn't exist +- the delegation has less shares than the ones worth of `Amount` +- existing `UnbondingDelegation` has maximum entries as defined by `params.MaxEntries` +- the `Amount` has a denomination different than one defined by `params.BondDenom` When this message is processed the following actions occur: -* validator's `DelegatorShares` and the delegation's `Shares` are both reduced by the message `SharesAmount` -* calculate the token worth of the shares remove that amount tokens held within the validator -* with those removed tokens, if the validator is: - * `Bonded` - add them to an entry in `UnbondingDelegation` (create `UnbondingDelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares. - * `Unbonding` - add them to an entry in `UnbondingDelegation` (create `UnbondingDelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`). - * `Unbonded` - then send the coins the message `DelegatorAddr` -* if there are no more `Shares` in the delegation, then the delegation object is removed from the store - * under this situation if the delegation is the validator's self-delegation then also jail the validator. +- validator's `DelegatorShares` and the delegation's `Shares` are both reduced by the message `SharesAmount` +- calculate the token worth of the shares remove that amount tokens held within the validator +- with those removed tokens, if the validator is: + - `Bonded` - add them to an entry in `UnbondingDelegation` (create `UnbondingDelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares. + - `Unbonding` - add them to an entry in `UnbondingDelegation` (create `UnbondingDelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`). + - `Unbonded` - then send the coins the message `DelegatorAddr` +- if there are no more `Shares` in the delegation, then the delegation object is removed from the store + - under this situation if the delegation is the validator's self-delegation then also jail the validator. ![Unbond sequence](../../../docs/uml/svg/unbond_sequence.svg) -## MsgCancelUnbondingDelegation +## MsgBeginRedelegate + +The redelegation command allows delegators to instantly switch validators. Once +the unbonding period has passed, the redelegation is automatically completed in +the EndBlocker. + ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L26-L28 -The `MsgCancelUnbondingDelegation` message allows delegators to cancel the `unbondingDelegation` entry and deleagate back to a previous validator. ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105 -+++ hhttps://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L36-L40 +This message returns a response containing the completion time of the redelegation: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L146-L165 ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L107-L110 This message is expected to fail if: -* the `unbondingDelegation` entry is already processed. -* the `cancel unbonding delegation` amount is greater than the `unbondingDelegation` entry balance. -* the `cancel unbonding delegation` height doesn't exists in the `unbondingDelegationQueue` of the delegator. +- the delegation doesn't exist +- the source or destination validators don't exist +- the delegation has less shares than the ones worth of `Amount` +- the source validator has a receiving redelegation which is not matured (aka. the redelegation may be transitive) +- existing `Redelegation` has maximum entries as defined by `params.MaxEntries` +- the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` When this message is processed the following actions occur: -* if the `unbondingDelegation` Entry balance is zero - * in this condition `unbondingDelegation` entry will be removed from `unbondingDelegationQueue`. - * otherwise `unbondingDelegationQueue` will be updated with new `unbondingDelegation` entry balance and initial balance -* the validator's `DelegatorShares` and the delegation's `Shares` are both increased by the message `Amount`. +- the source validator's `DelegatorShares` and the delegations `Shares` are both reduced by the message `SharesAmount` +- calculate the token worth of the shares remove that amount tokens held within the source validator. +- if the source validator is: + - `Bonded` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares (this may be effectively reversed in the next step however). + - `Unbonding` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`). + - `Unbonded` - no action required in this step +- Delegate the token worth to the destination validator, possibly moving tokens back to the bonded state. +- if there are no more `Shares` in the source delegation, then the source delegation object is removed from the store + - under this situation if the delegation is the validator's self-delegation then also jail the validator. -## MsgBeginRedelegate +![Begin redelegation sequence](../../../docs/uml/svg/begin_redelegation_sequence.svg) -The redelegation command allows delegators to instantly switch validators. Once -the unbonding period has passed, the redelegation is automatically completed in -the EndBlocker. +## MsgTokenizeShares -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L28-L30 +The `MsgTokenizeShares` message is used to create tokenize delegated tokens. +This message can be executed by any delegator who has positive amount of delegation and after execution the specific amount of delegation disappear from the account and share tokens are provided. Share tokens are demoninated in the validator and record id of the underlying delegation. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L109-L121 +A user may tokenize some or all of their Delegation. -This message returns a response containing the completion time of the redelegation: +They will recieved shares like ` cosmosvaloper1xxxx5` where 5 is the record id for the validator operator. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/proto/cosmos/staking/v1beta1/tx.proto#L123-L126 +A validator may tokenize their self bond but tokenizing more than their min self bond will be equivalent to unbonding their min self bond and cause the validator to be removed from the active set. -This message is expected to fail if: +`MsgTokenizeSharesResponse` provides the number of tokens generated and their denom. -* the delegation doesn't exist -* the source or destination validators don't exist -* the delegation has less shares than the ones worth of `Amount` -* the source validator has a receiving redelegation which is not matured (aka. the redelegation may be transitive) -* existing `Redelegation` has maximum entries as defined by `params.MaxEntries` -* the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` +## MsgRedeemTokensforShares -When this message is processed the following actions occur: +The `MsgRedeemTokensforShares` message is used to redeem the delegation from share tokens. +This message can be executed by any user who owns share tokens and after execution the delegation appear for the user. -* the source validator's `DelegatorShares` and the delegations `Shares` are both reduced by the message `SharesAmount` -* calculate the token worth of the shares remove that amount tokens held within the source validator. -* if the source validator is: - * `Bonded` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares (this may be effectively reversed in the next step however). - * `Unbonding` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`). - * `Unbonded` - no action required in this step -* Delegate the token worth to the destination validator, possibly moving tokens back to the bonded state. -* if there are no more `Shares` in the source delegation, then the source delegation object is removed from the store - * under this situation if the delegation is the validator's self-delegation then also jail the validator. +## MsgTransferTokenizeShareRecord -![Begin redelegation sequence](../../../docs/uml/svg/begin_redelegation_sequence.svg) +The `MsgTransferTokenizeShareRecord` message is used to transfer the ownership of rewards generated from the tokenized amount of delegation. +The tokenize share record is created when a user tokenize his/her delegation and deleted and full amount of share tokens are redeemed. diff --git a/x/staking/spec/05_end_block.md b/x/staking/spec/05_end_block.md index 7eb01421182f..c097579e092a 100644 --- a/x/staking/spec/05_end_block.md +++ b/x/staking/spec/05_end_block.md @@ -1,5 +1,5 @@ # End-Block @@ -15,12 +15,12 @@ validators are also returned back to Tendermint for inclusion in the Tendermint validator set which is responsible for validating Tendermint messages at the consensus layer. Operations are as following: -* the new validator set is taken as the top `params.MaxValidators` number of +- the new validator set is taken as the top `params.MaxValidators` number of validators retrieved from the `ValidatorsByPower` index -* the previous validator set is compared with the new validator set: - * missing validators begin unbonding and their `Tokens` are transferred from the +- the previous validator set is compared with the new validator set: + - missing validators begin unbonding and their `Tokens` are transferred from the `BondedPool` to the `NotBondedPool` `ModuleAccount` - * new validators are instantly bonded and their `Tokens` are transferred from the + - new validators are instantly bonded and their `Tokens` are transferred from the `NotBondedPool` to the `BondedPool` `ModuleAccount` In all cases, any validators leaving or entering the bonded validator set or @@ -62,9 +62,9 @@ switched from `types.Unbonding` to Complete the unbonding of all mature `UnbondingDelegations.Entries` within the `UnbondingDelegations` queue with the following procedure: -* transfer the balance coins to the delegator's wallet address -* remove the mature entry from `UnbondingDelegation.Entries` -* remove the `UnbondingDelegation` object from the store if there are no +- transfer the balance coins to the delegator's wallet address +- remove the mature entry from `UnbondingDelegation.Entries` +- remove the `UnbondingDelegation` object from the store if there are no remaining entries. ### Redelegations @@ -72,6 +72,6 @@ Complete the unbonding of all mature `UnbondingDelegations.Entries` within the Complete the unbonding of all mature `Redelegation.Entries` within the `Redelegations` queue with the following procedure: -* remove the mature entry from `Redelegation.Entries` -* remove the `Redelegation` object from the store if there are no +- remove the mature entry from `Redelegation.Entries` +- remove the `Redelegation` object from the store if there are no remaining entries. diff --git a/x/staking/spec/06_hooks.md b/x/staking/spec/06_hooks.md index 18af7723874f..d4c3228eca7a 100644 --- a/x/staking/spec/06_hooks.md +++ b/x/staking/spec/06_hooks.md @@ -1,5 +1,5 @@ # Hooks @@ -9,19 +9,19 @@ occurred within staking. These events can be registered to execute either right `Before` or `After` the staking event (as per the hook name). The following hooks can registered with staking: -* `AfterValidatorCreated(Context, ValAddress) error` - * called when a validator is created -* `BeforeValidatorModified(Context, ValAddress) error` - * called when a validator's state is changed -* `AfterValidatorRemoved(Context, ConsAddress, ValAddress) error` - * called when a validator is deleted -* `AfterValidatorBonded(Context, ConsAddress, ValAddress) error` - * called when a validator is bonded -* `AfterValidatorBeginUnbonding(Context, ConsAddress, ValAddress) error` - * called when a validator begins unbonding -* `BeforeDelegationCreated(Context, AccAddress, ValAddress) error` - * called when a delegation is created -* `BeforeDelegationSharesModified(Context, AccAddress, ValAddress) error` - * called when a delegation's shares are modified -* `BeforeDelegationRemoved(Context, AccAddress, ValAddress) error` - * called when a delegation is removed +- `AfterValidatorCreated(Context, ValAddress)` + - called when a validator is created +- `BeforeValidatorModified(Context, ValAddress)` + - called when a validator's state is changed +- `AfterValidatorRemoved(Context, ConsAddress, ValAddress)` + - called when a validator is deleted +- `AfterValidatorBonded(Context, ConsAddress, ValAddress)` + - called when a validator is bonded +- `AfterValidatorBeginUnbonding(Context, ConsAddress, ValAddress)` + - called when a validator begins unbonding +- `BeforeDelegationCreated(Context, AccAddress, ValAddress)` + - called when a delegation is created +- `BeforeDelegationSharesModified(Context, AccAddress, ValAddress)` + - called when a delegation's shares are modified +- `BeforeDelegationRemoved(Context, AccAddress, ValAddress)` + - called when a delegation is removed diff --git a/x/staking/spec/07_events.md b/x/staking/spec/07_events.md index eeeb84c4b902..8066e4cfd0c4 100644 --- a/x/staking/spec/07_events.md +++ b/x/staking/spec/07_events.md @@ -1,5 +1,5 @@ # Events @@ -32,13 +32,12 @@ The staking module emits the following events: ### MsgEditValidator -| Type | Attribute Key | Attribute Value | -| -------------- | ------------------- | ------------------- | -| edit_validator | commission_rate | {commissionRate} | -| edit_validator | min_self_delegation | {minSelfDelegation} | -| message | module | staking | -| message | action | edit_validator | -| message | sender | {senderAddress} | +| Type | Attribute Key | Attribute Value | +| -------------- | --------------- | ---------------- | +| edit_validator | commission_rate | {commissionRate} | +| message | module | staking | +| message | action | edit_validator | +| message | sender | {senderAddress} | ### MsgDelegate @@ -61,19 +60,7 @@ The staking module emits the following events: | message | action | begin_unbonding | | message | sender | {senderAddress} | -* [0] Time is formatted in the RFC3339 standard - -### MsgCancelUnbondingDelegation - -| Type | Attribute Key | Attribute Value | -| ----------------------------- | ------------------ | ------------------------------------| -| cancel_unbonding_delegation | validator | {validatorAddress} | -| cancel_unbonding_delegation | delegator | {delegatorAddress} | -| cancel_unbonding_delegation | amount | {cancelUnbondingDelegationAmount} | -| cancel_unbonding_delegation | creation_height | {unbondingCreationHeight} | -| message | module | staking | -| message | action | cancel_unbond | -| message | sender | {senderAddress} | +- [0] Time is formatted in the RFC3339 standard ### MsgBeginRedelegate @@ -87,4 +74,4 @@ The staking module emits the following events: | message | action | begin_redelegate | | message | sender | {senderAddress} | -* [0] Time is formatted in the RFC3339 standard +- [0] Time is formatted in the RFC3339 standard diff --git a/x/staking/spec/08_params.md b/x/staking/spec/08_params.md index e4a56ab3fac2..48b3a61d096f 100644 --- a/x/staking/spec/08_params.md +++ b/x/staking/spec/08_params.md @@ -7,10 +7,11 @@ order: 8 The staking module contains the following parameters: | Key | Type | Example | -|-------------------|------------------|------------------------| +| ----------------- | ---------------- | ---------------------- | | UnbondingTime | string (time ns) | "259200000000000" | | MaxValidators | uint16 | 100 | | KeyMaxEntries | uint16 | 7 | | HistoricalEntries | uint16 | 3 | | BondDenom | string | "stake" | | MinCommissionRate | string | "0.000000000000000000" | +| ExemptionFactor | string | "0.000000000000000000" | diff --git a/x/staking/spec/09_client.md b/x/staking/spec/09_client.md index 0c3383d01446..74cd7caa09f0 100644 --- a/x/staking/spec/09_client.md +++ b/x/staking/spec/09_client.md @@ -179,7 +179,6 @@ valset: security_contact: "" website: "" jailed: false - min_self_delegation: "1" operator_address: cosmosvaloper1rne8lgs98p0jqe82sgt0qr4rdn4hgvmgp9ggcc status: BOND_STATUS_BONDED tokens: "10000000" @@ -526,7 +525,6 @@ description: security_contact: "" website: "" jailed: false -min_self_delegation: "1" operator_address: cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj status: BOND_STATUS_BONDED tokens: "32948270000" @@ -577,7 +575,6 @@ description: security_contact: "" website: "" jailed: false - min_self_delegation: "1" operator_address: cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj status: BOND_STATUS_BONDED tokens: "32948270000" @@ -603,7 +600,6 @@ description: security_contact: info@noderunners.biz website: http://noderunners.biz jailed: false - min_self_delegation: "1" operator_address: cosmosvaloper1q5ku90atkhktze83j9xjaks2p7uruag5zp6wt7 status: BOND_STATUS_BONDED tokens: "559343421" @@ -712,19 +708,6 @@ Example: ```bash simd tx staking unbond cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from mykey ``` -#### cancel unbond -The command `cancel-unbond` allow users to cancel the unbonding delegation entry and delegate back to the original validator. - -Usage: -```bash -simd tx staking cancel-unbond [validator-addr] [amount] [creation-height] -``` - -Example: -```bash -simd tx staking cancel-unbond cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake 123123 --from mykey -``` - ## gRPC @@ -766,8 +749,7 @@ Example Output: "maxChangeRate": "10000000000000000" }, "updateTime": "2021-10-01T05:52:50.380144238Z" - }, - "minSelfDelegation": "1" + } } ], "pagination": { @@ -812,8 +794,7 @@ Example Output: "maxChangeRate": "10000000000000000" }, "updateTime": "2021-10-01T05:52:50.380144238Z" - }, - "minSelfDelegation": "1" + } } } ``` @@ -1155,8 +1136,7 @@ Example Output: "max_change_rate": "0.150000000000000000" }, "update_time": "2021-10-01T15:00:00Z" - }, - "min_self_delegation": "1" + } } ], "pagination": { @@ -1212,8 +1192,7 @@ Example Output: "max_change_rate": "0.150000000000000000" }, "update_time": "2021-10-01T15:00:00Z" - }, - "min_self_delegation": "1" + } } } ``` @@ -1287,8 +1266,7 @@ Example Output: "max_change_rate": "0.030000000000000000" }, "update_time": "2021-10-01T15:00:00Z" - }, - "min_self_delegation": "1" + } } ] } @@ -1535,8 +1513,7 @@ Example Output: "max_change_rate": "0.100000000000000000" }, "update_time": "2021-10-09T19:03:54.984821705Z" - }, - "min_self_delegation": "1" + } } ], "pagination": { @@ -1592,8 +1569,7 @@ Example Output: "max_change_rate": "0.100000000000000000" }, "update_time": "2021-10-09T19:03:54.984821705Z" - }, - "min_self_delegation": "1" + } } } ``` @@ -1669,8 +1645,7 @@ Example Output: "max_change_rate": "0.030000000000000000" }, "update_time": "2021-10-01T15:00:00Z" - }, - "min_self_delegation": "1" + } }, { "operator_address": "cosmosvaloper1t8ehvswxjfn3ejzkjtntcyrqwvmvuknzmvtaaa", @@ -1698,8 +1673,7 @@ Example Output: "max_change_rate": "0.200000000000000000" }, "update_time": "2021-10-01T15:06:38.821314287Z" - }, - "min_self_delegation": "1" + } } ] } @@ -1804,8 +1778,7 @@ Example Output: "max_change_rate": "0.100000000000000000" }, "update_time": "2021-10-01T15:51:31.596618510Z" - }, - "min_self_delegation": "1" + } }, { "operator_address": "cosmosvaloper1q5ku90atkhktze83j9xjaks2p7uruag5zp6wt7", @@ -1833,8 +1806,7 @@ Example Output: "max_change_rate": "0.100000000000000000" }, "update_time": "2021-10-04T18:02:21.446645619Z" - }, - "min_self_delegation": "1" + } } ], "pagination": { @@ -1890,8 +1862,7 @@ Example Output: "max_change_rate": "0.020000000000000000" }, "update_time": "2021-10-01T19:24:52.663191049Z" - }, - "min_self_delegation": "1" + } } } ``` diff --git a/x/staking/spec/README.md b/x/staking/spec/README.md index 08c21234e427..70a921d7b446 100644 --- a/x/staking/spec/README.md +++ b/x/staking/spec/README.md @@ -9,48 +9,58 @@ parent: ## Abstract -This paper specifies the Staking module of the Cosmos SDK that was first +This paper specifies the Staking module of the Cosmos-SDK, which was first described in the [Cosmos Whitepaper](https://cosmos.network/about/whitepaper) in June 2016. -The module enables Cosmos SDK-based blockchain to support an advanced -Proof-of-Stake (PoS) system. In this system, holders of the native staking token of +The module enables Cosmos-SDK based blockchain to support an advanced +Proof-of-Stake system. In this system, holders of the native staking token of the chain can become validators and can delegate tokens to validators, ultimately determining the effective validator set for the system. -This module is used in the Cosmos Hub, the first Hub in the Cosmos +This module will be used in the Cosmos Hub, the first Hub in the Cosmos network. +This module has been extended with a liquid staking implementation to enable the creation of nonfungible tokenized staking shares to be used to be synthetic staked assets. The governing philosphy of this design is that it optimizes for allowing a smooth upgrade path from the existing cosmos staking module at the expense of the usability of the native staking token. It is anticipated that DAOs will form that accept these assets and issue a more usable underlying asset. + +When a user receive tokenized shares, the user is taking on slashing risk while holding the token based on validator's performance. + ## Contents 1. **[State](01_state.md)** - * [Pool](01_state.md#pool) - * [LastTotalPower](01_state.md#lasttotalpower) - * [Params](01_state.md#params) - * [Validator](01_state.md#validator) - * [Delegation](01_state.md#delegation) - * [UnbondingDelegation](01_state.md#unbondingdelegation) - * [Redelegation](01_state.md#redelegation) - * [Queues](01_state.md#queues) - * [HistoricalInfo](01_state.md#historicalinfo) + - [Pool](01_state.md#pool) + - [LastTotalPower](01_state.md#lasttotalpower) + - [Params](01_state.md#params) + - [Validator](01_state.md#validator) + - [Delegation](01_state.md#delegation) + - [UnbondingDelegation](01_state.md#unbondingdelegation) + - [Redelegation](01_state.md#redelegation) + - [Queues](01_state.md#queues) + - [HistoricalInfo](01_state.md#historicalinfo) + - [TokenizeShareRecord](01_state.md#tokenizesharerecord) 2. **[State Transitions](02_state_transitions.md)** - * [Validators](02_state_transitions.md#validators) - * [Delegations](02_state_transitions.md#delegations) - * [Slashing](02_state_transitions.md#slashing) + - [Validators](02_state_transitions.md#validators) + - [Delegations](02_state_transitions.md#delegations) + - [Slashing](02_state_transitions.md#slashing) + - [Tokenizing](02_state_transitions.md#tokenizing) 3. **[Messages](03_messages.md)** - * [MsgCreateValidator](03_messages.md#msgcreatevalidator) - * [MsgEditValidator](03_messages.md#msgeditvalidator) - * [MsgDelegate](03_messages.md#msgdelegate) - * [MsgUndelegate](03_messages.md#msgundelegate) - * [MsgCancelUnbondingDelegation](03_messages.md#msgcancelunbondingdelegation) - * [MsgBeginRedelegate](03_messages.md#msgbeginredelegate) + + - [MsgCreateValidator](03_messages.md#msgcreatevalidator) + - [MsgEditValidator](03_messages.md#msgeditvalidator) + - [MsgDelegate](03_messages.md#msgdelegate) + - [MsgUndelegate](03_messages.md#msgundelegate) + - [MsgBeginRedelegate](03_messages.md#msgbeginredelegate) + - [MsgTokenizeShares](03_messages.md#msgtokenizeshares) + - [MsgRedeemTokensforShares](03_messages.md#msgredeemtokensforshares) + - [MsgTransferTokenizeShareRecord](03_messages.md#msgtransfertokenizesharerecord) + 4. **[Begin-Block](04_begin_block.md)** - * [Historical Info Tracking](04_begin_block.md#historical-info-tracking) + - [Historical Info Tracking](04_begin_block.md#historical-info-tracking) 5. **[End-Block](05_end_block.md)** - * [Validator Set Changes](05_end_block.md#validator-set-changes) - * [Queues](05_end_block.md#queues-) + - [Validator Set Changes](05_end_block.md#validator-set-changes) + - [Queues](05_end_block.md#queues-) 6. **[Hooks](06_hooks.md)** 7. **[Events](07_events.md)** - * [EndBlocker](07_events.md#endblocker) - * [Msg's](07_events.md#msg's) + - [EndBlocker](07_events.md#endblocker) + - [Msg's](07_events.md#msg's) 8. **[Parameters](08_params.md)** diff --git a/x/staking/teststaking/helper.go b/x/staking/teststaking/helper.go index 012f21f00eda..82fd7911b5a3 100644 --- a/x/staking/teststaking/helper.go +++ b/x/staking/teststaking/helper.go @@ -11,6 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -50,7 +51,7 @@ func (sh *Helper) CreateValidatorWithValPower(addr sdk.ValAddress, pk cryptotype // CreateValidatorMsg returns a message used to create validator in this service. func (sh *Helper) CreateValidatorMsg(addr sdk.ValAddress, pk cryptotypes.PubKey, stakeAmount sdk.Int) *stakingtypes.MsgCreateValidator { coin := sdk.NewCoin(sh.Denom, stakeAmount) - msg, err := stakingtypes.NewMsgCreateValidator(addr, pk, coin, stakingtypes.Description{}, sh.Commission, sdk.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(addr, pk, coin, stakingtypes.Description{}, sh.Commission) require.NoError(sh.t, err) return msg } @@ -61,7 +62,7 @@ func (sh *Helper) CreateValidatorWithMsg(ctx context.Context, msg *stakingtypes. } func (sh *Helper) createValidator(addr sdk.ValAddress, pk cryptotypes.PubKey, coin sdk.Coin, ok bool) { - msg, err := stakingtypes.NewMsgCreateValidator(addr, pk, coin, stakingtypes.Description{}, sh.Commission, sdk.OneInt()) + msg, err := stakingtypes.NewMsgCreateValidator(addr, pk, coin, stakingtypes.Description{}, sh.Commission) require.NoError(sh.t, err) res, err := sh.msgSrvr.CreateValidator(sdk.WrapSDKContext(sh.Ctx), msg) if ok { @@ -105,9 +106,57 @@ func (sh *Helper) Undelegate(delegator sdk.AccAddress, val sdk.ValAddress, amoun } } +func (sh *Helper) TokenizeShares(delegator sdk.AccAddress, val sdk.ValAddress, amount sdk.Coin, shareOwner sdk.AccAddress, ok bool) { + msg := &stakingtypes.MsgTokenizeShares{ + DelegatorAddress: delegator.String(), + ValidatorAddress: val.String(), + Amount: amount, + TokenizedShareOwner: shareOwner.String(), + } + res, err := sh.msgSrvr.TokenizeShares(sdk.WrapSDKContext(sh.Ctx), msg) + if ok { + require.NoError(sh.t, err) + require.NotNil(sh.t, res) + } else { + require.Error(sh.t, err) + require.Nil(sh.t, res) + } +} + +func (sh *Helper) RedeemTokensForShares(delegator sdk.AccAddress, amount sdk.Coin, ok bool) { + msg := &stakingtypes.MsgRedeemTokensforShares{ + DelegatorAddress: delegator.String(), + Amount: amount, + } + res, err := sh.msgSrvr.RedeemTokens(sdk.WrapSDKContext(sh.Ctx), msg) + if ok { + require.NoError(sh.t, err) + require.NotNil(sh.t, res) + } else { + require.Error(sh.t, err) + require.Nil(sh.t, res) + } +} + +func (sh *Helper) TranserTokenizeShareRecord(recordId uint64, owner, newOwner sdk.AccAddress, ok bool) { + msg := &stakingtypes.MsgTransferTokenizeShareRecord{ + TokenizeShareRecordId: recordId, + Sender: owner.String(), + NewOwner: newOwner.String(), + } + res, err := sh.msgSrvr.TransferTokenizeShareRecord(sdk.WrapSDKContext(sh.Ctx), msg) + if ok { + require.NoError(sh.t, err) + require.NotNil(sh.t, res) + } else { + require.Error(sh.t, err) + require.Nil(sh.t, res) + } +} + // CheckValidator asserts that a validor exists and has a given status (if status!="") // and if has a right jailed flag. -func (sh *Helper) CheckValidator(addr sdk.ValAddress, status stakingtypes.BondStatus, jailed bool) stakingtypes.Validator { +func (sh *Helper) CheckValidator(addr sdk.ValAddress, status sdkstaking.BondStatus, jailed bool) stakingtypes.Validator { v, ok := sh.k.GetValidator(sh.Ctx, addr) require.True(sh.t, ok) require.Equal(sh.t, jailed, v.Jailed, "wrong Jalied status") diff --git a/x/staking/types/authz.go b/x/staking/types/authz.go index 1f9016cdbb6e..f1c2a717069a 100644 --- a/x/staking/types/authz.go +++ b/x/staking/types/authz.go @@ -10,11 +10,14 @@ import ( // Tracking issues https://github.com/cosmos/cosmos-sdk/issues/9054, https://github.com/cosmos/cosmos-sdk/discussions/9072 const gasCostPerIteration = uint64(10) -var _ authz.Authorization = &StakeAuthorization{} +// Normalized Msg type URLs +var ( + _ authz.Authorization = &StakeAuthorization{} +) // NewStakeAuthorization creates a new StakeAuthorization object. func NewStakeAuthorization(allowed []sdk.ValAddress, denied []sdk.ValAddress, authzType AuthorizationType, amount *sdk.Coin) (*StakeAuthorization, error) { - allowedValidators, deniedValidators, err := validateAllowAndDenyValidators(allowed, denied) + allowedValidators, deniedValidators, err := validateAndBech32fy(allowed, denied) if err != nil { return nil, err } @@ -45,10 +48,10 @@ func (a StakeAuthorization) MsgTypeURL() string { func (a StakeAuthorization) ValidateBasic() error { if a.MaxTokens != nil && a.MaxTokens.IsNegative() { - return sdkerrors.Wrapf(authz.ErrNegativeMaxTokens, "negative coin amount: %v", a.MaxTokens) + return sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "negative coin amount: %v", a.MaxTokens) } if a.AuthorizationType == AuthorizationType_AUTHORIZATION_TYPE_UNSPECIFIED { - return authz.ErrUnknownAuthorizationType + return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "unknown authorization type") } return nil @@ -87,35 +90,28 @@ func (a StakeAuthorization) Accept(ctx sdk.Context, msg sdk.Msg) (authz.AcceptRe for _, validator := range denyList { ctx.GasMeter().ConsumeGas(gasCostPerIteration, "stake authorization") if validator == validatorAddress { - return authz.AcceptResponse{}, sdkerrors.ErrUnauthorized.Wrapf("cannot delegate/undelegate to %s validator", validator) + return authz.AcceptResponse{}, sdkerrors.ErrUnauthorized.Wrapf(" cannot delegate/undelegate to %s validator", validator) } } - if len(allowedList) > 0 && !isValidatorExists { + if !isValidatorExists { return authz.AcceptResponse{}, sdkerrors.ErrUnauthorized.Wrapf("cannot delegate/undelegate to %s validator", validatorAddress) } if a.MaxTokens == nil { - return authz.AcceptResponse{ - Accept: true, Delete: false, - Updated: &StakeAuthorization{Validators: a.GetValidators(), AuthorizationType: a.GetAuthorizationType()}, - }, nil + return authz.AcceptResponse{Accept: true, Delete: false, + Updated: &StakeAuthorization{Validators: a.GetValidators(), AuthorizationType: a.GetAuthorizationType()}}, nil } - limitLeft, err := a.MaxTokens.SafeSub(amount) - if err != nil { - return authz.AcceptResponse{}, err - } + limitLeft := a.MaxTokens.Sub(amount) if limitLeft.IsZero() { return authz.AcceptResponse{Accept: true, Delete: true}, nil } - return authz.AcceptResponse{ - Accept: true, Delete: false, - Updated: &StakeAuthorization{Validators: a.GetValidators(), AuthorizationType: a.GetAuthorizationType(), MaxTokens: &limitLeft}, - }, nil + return authz.AcceptResponse{Accept: true, Delete: false, + Updated: &StakeAuthorization{Validators: a.GetValidators(), AuthorizationType: a.GetAuthorizationType(), MaxTokens: &limitLeft}}, nil } -func validateAllowAndDenyValidators(allowed []sdk.ValAddress, denied []sdk.ValAddress) ([]string, []string, error) { +func validateAndBech32fy(allowed []sdk.ValAddress, denied []sdk.ValAddress) ([]string, []string, error) { if len(allowed) == 0 && len(denied) == 0 { return nil, nil, sdkerrors.ErrInvalidRequest.Wrap("both allowed & deny list cannot be empty") } @@ -140,7 +136,6 @@ func validateAllowAndDenyValidators(allowed []sdk.ValAddress, denied []sdk.ValAd return nil, deniedValidators, nil } -// Normalized Msg type URLs func normalizeAuthzType(authzType AuthorizationType) (string, error) { switch authzType { case AuthorizationType_AUTHORIZATION_TYPE_DELEGATE: @@ -150,6 +145,6 @@ func normalizeAuthzType(authzType AuthorizationType) (string, error) { case AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE: return sdk.MsgTypeURL(&MsgBeginRedelegate{}), nil default: - return "", sdkerrors.Wrapf(authz.ErrUnknownAuthorizationType, "cannot normalize authz type with %T", authzType) + return "", sdkerrors.ErrInvalidType.Wrapf("unknown authorization type %T", authzType) } } diff --git a/x/staking/types/authz.pb.go b/x/staking/types/authz.pb.go index ac9c88271f25..32a87c8833cb 100644 --- a/x/staking/types/authz.pb.go +++ b/x/staking/types/authz.pb.go @@ -1,14 +1,14 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/staking/v1beta1/authz.proto +// source: staking/v1beta1/authz.proto package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" io "io" math "math" math_bits "math/bits" @@ -26,8 +26,6 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // AuthorizationType defines the type of staking module authorization type -// -// Since: cosmos-sdk 0.43 type AuthorizationType int32 const ( @@ -60,12 +58,10 @@ func (x AuthorizationType) String() string { } func (AuthorizationType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d6d8cdbc6f4432f0, []int{0} + return fileDescriptor_dbc817c76ffc2c21, []int{0} } // StakeAuthorization defines authorization for delegate/undelegate/redelegate. -// -// Since: cosmos-sdk 0.43 type StakeAuthorization struct { // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is // empty, there is no spend limit and any amount of coins can be delegated. @@ -77,14 +73,14 @@ type StakeAuthorization struct { // *StakeAuthorization_DenyList Validators isStakeAuthorization_Validators `protobuf_oneof:"validators"` // authorization_type defines one of AuthorizationType. - AuthorizationType AuthorizationType `protobuf:"varint,4,opt,name=authorization_type,json=authorizationType,proto3,enum=cosmos.staking.v1beta1.AuthorizationType" json:"authorization_type,omitempty"` + AuthorizationType AuthorizationType `protobuf:"varint,4,opt,name=authorization_type,json=authorizationType,proto3,enum=liquidstaking.staking.v1beta1.AuthorizationType" json:"authorization_type,omitempty"` } func (m *StakeAuthorization) Reset() { *m = StakeAuthorization{} } func (m *StakeAuthorization) String() string { return proto.CompactTextString(m) } func (*StakeAuthorization) ProtoMessage() {} func (*StakeAuthorization) Descriptor() ([]byte, []int) { - return fileDescriptor_d6d8cdbc6f4432f0, []int{0} + return fileDescriptor_dbc817c76ffc2c21, []int{0} } func (m *StakeAuthorization) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -181,7 +177,7 @@ func (m *StakeAuthorization_Validators) Reset() { *m = StakeAuthorizatio func (m *StakeAuthorization_Validators) String() string { return proto.CompactTextString(m) } func (*StakeAuthorization_Validators) ProtoMessage() {} func (*StakeAuthorization_Validators) Descriptor() ([]byte, []int) { - return fileDescriptor_d6d8cdbc6f4432f0, []int{0, 0} + return fileDescriptor_dbc817c76ffc2c21, []int{0, 0} } func (m *StakeAuthorization_Validators) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -218,47 +214,46 @@ func (m *StakeAuthorization_Validators) GetAddress() []string { } func init() { - proto.RegisterEnum("cosmos.staking.v1beta1.AuthorizationType", AuthorizationType_name, AuthorizationType_value) - proto.RegisterType((*StakeAuthorization)(nil), "cosmos.staking.v1beta1.StakeAuthorization") - proto.RegisterType((*StakeAuthorization_Validators)(nil), "cosmos.staking.v1beta1.StakeAuthorization.Validators") -} - -func init() { - proto.RegisterFile("cosmos/staking/v1beta1/authz.proto", fileDescriptor_d6d8cdbc6f4432f0) -} - -var fileDescriptor_d6d8cdbc6f4432f0 = []byte{ - // 476 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4d, 0x6e, 0xd3, 0x40, - 0x18, 0x86, 0xed, 0x06, 0x01, 0xf9, 0xf8, 0x51, 0x33, 0xaa, 0x50, 0x1a, 0x84, 0x5b, 0xb2, 0x21, - 0xfc, 0x64, 0xac, 0x06, 0xb1, 0x61, 0x85, 0xd3, 0xba, 0x34, 0x52, 0xd5, 0x56, 0x8e, 0x5b, 0x41, - 0x37, 0xd6, 0x24, 0x1e, 0x39, 0xa3, 0xc4, 0x9e, 0xc8, 0x33, 0x29, 0x49, 0x4f, 0xc1, 0x09, 0x38, - 0x00, 0xeb, 0x1e, 0x02, 0xb1, 0xaa, 0x58, 0xb1, 0x03, 0x25, 0x12, 0xe7, 0x40, 0xb6, 0xa7, 0x86, - 0xd2, 0x84, 0x4d, 0x57, 0xb6, 0xfc, 0x3d, 0x7e, 0xde, 0x77, 0xac, 0xcf, 0x50, 0xed, 0x72, 0x11, - 0x72, 0x61, 0x0a, 0x49, 0xfa, 0x2c, 0x0a, 0xcc, 0x93, 0x8d, 0x0e, 0x95, 0x64, 0xc3, 0x24, 0x23, - 0xd9, 0x3b, 0xc5, 0xc3, 0x98, 0x4b, 0x8e, 0x1e, 0x64, 0x0c, 0x56, 0x0c, 0x56, 0x4c, 0x65, 0x25, - 0xe0, 0x01, 0x4f, 0x11, 0x33, 0xb9, 0xcb, 0xe8, 0xca, 0x6a, 0x46, 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, 0x63, 0x2a, 0x92, 0x2f, 0x5f, 0xa8, 0x15, 0x9b, 0xe5, 0x6f, 0x67, 0xf5, 0x15, 0xe5, 0xb7, - 0xb2, 0x49, 0x5b, 0xc6, 0x2c, 0x0a, 0x9c, 0x0b, 0xf0, 0x75, 0xe9, 0xeb, 0x59, 0xfd, 0xde, 0xa5, - 0xac, 0xe6, 0x5d, 0x80, 0x93, 0x5c, 0xfa, 0xec, 0x93, 0x0e, 0xa5, 0x2b, 0x5d, 0x50, 0x15, 0x0c, - 0xeb, 0xd0, 0xdd, 0xd9, 0x77, 0x5a, 0xc7, 0x96, 0xdb, 0xda, 0xdf, 0xf3, 0xdc, 0xf7, 0x07, 0xb6, - 0x77, 0xb8, 0xd7, 0x3e, 0xb0, 0x37, 0x5b, 0xdb, 0x2d, 0x7b, 0x6b, 0x59, 0x43, 0x6b, 0xf0, 0x70, - 0x0e, 0xb3, 0x65, 0xef, 0xda, 0x6f, 0x2d, 0xd7, 0x5e, 0xd6, 0xd1, 0x63, 0x78, 0x34, 0x57, 0x92, - 0x23, 0x4b, 0x0b, 0x10, 0xc7, 0xce, 0x91, 0x42, 0x73, 0xfb, 0xcb, 0xd4, 0xd0, 0xcf, 0xa7, 0x86, - 0xfe, 0x73, 0x6a, 0xe8, 0x1f, 0x67, 0x86, 0x76, 0x3e, 0x33, 0xb4, 0xef, 0x33, 0x43, 0x3b, 0x7e, - 0xf1, 0xdf, 0xcd, 0x1a, 0xe7, 0x3f, 0x52, 0xba, 0x63, 0x9d, 0x9b, 0xe9, 0x62, 0xbf, 0xfc, 0x1d, - 0x00, 0x00, 0xff, 0xff, 0xbd, 0xd5, 0x4d, 0xf3, 0x67, 0x03, 0x00, 0x00, + proto.RegisterEnum("liquidstaking.staking.v1beta1.AuthorizationType", AuthorizationType_name, AuthorizationType_value) + proto.RegisterType((*StakeAuthorization)(nil), "liquidstaking.staking.v1beta1.StakeAuthorization") + proto.RegisterType((*StakeAuthorization_Validators)(nil), "liquidstaking.staking.v1beta1.StakeAuthorization.Validators") +} + +func init() { proto.RegisterFile("staking/v1beta1/authz.proto", fileDescriptor_dbc817c76ffc2c21) } + +var fileDescriptor_dbc817c76ffc2c21 = []byte{ + // 489 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xed, 0x06, 0x01, 0x19, 0xfe, 0xa8, 0x59, 0x71, 0x48, 0x53, 0xd5, 0x2d, 0x3d, 0x40, + 0x04, 0x8a, 0x4d, 0xcb, 0x0d, 0x21, 0xa1, 0xa4, 0x35, 0x34, 0x52, 0xd5, 0x56, 0xae, 0x8b, 0xd4, + 0x22, 0x64, 0x6d, 0xe2, 0x55, 0xb2, 0x8a, 0xbd, 0x93, 0x66, 0xd7, 0x25, 0xe9, 0x53, 0xf0, 0x04, + 0x3c, 0x00, 0x67, 0x1e, 0x82, 0x63, 0xc5, 0x89, 0x1b, 0x90, 0xbc, 0x08, 0xf2, 0xda, 0x09, 0x2d, + 0x2d, 0x70, 0xe1, 0xb4, 0x1e, 0xcf, 0x37, 0xbf, 0x6f, 0x3c, 0x9e, 0x85, 0x45, 0xa9, 0x68, 0x8f, + 0x8b, 0x8e, 0x73, 0xb2, 0xd6, 0x62, 0x8a, 0xae, 0x39, 0x34, 0x51, 0xdd, 0x53, 0xbb, 0x3f, 0x40, + 0x85, 0x64, 0x29, 0xe2, 0xc7, 0x09, 0x0f, 0x73, 0x89, 0x3d, 0x3d, 0x73, 0x69, 0xe5, 0x5e, 0x07, + 0x3b, 0xa8, 0x95, 0x4e, 0xfa, 0x94, 0x15, 0x55, 0x16, 0xda, 0x28, 0x63, 0x94, 0x41, 0x96, 0xc8, + 0x82, 0x3c, 0x65, 0x65, 0x91, 0xd3, 0xa2, 0x92, 0xcd, 0x0c, 0xdb, 0xc8, 0x45, 0x96, 0x5f, 0xfd, + 0x51, 0x00,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0, 0xc9, 0xac, 0xf4, 0xd1, 0x07, 0x13, 0x4a, + 0x97, 0x1c, 0xc9, 0x2a, 0x58, 0xf5, 0x03, 0x7f, 0x6b, 0xd7, 0x6b, 0x1e, 0xd5, 0xfd, 0xe6, 0xee, + 0x4e, 0xe0, 0x1f, 0xee, 0xb9, 0xc1, 0xc1, 0xce, 0xfe, 0x9e, 0xbb, 0xd1, 0x7c, 0xd9, 0x74, 0x37, + 0xe7, 0x0d, 0xb2, 0x0c, 0x8b, 0x57, 0x68, 0x36, 0xdd, 0x6d, 0xf7, 0x55, 0xdd, 0x77, 0xe7, 0x4d, + 0x72, 0x1f, 0x96, 0xae, 0x84, 0xcc, 0x24, 0x73, 0x7f, 0x90, 0x78, 0xee, 0x4c, 0x52, 0x68, 0x1c, + 0x7e, 0x1e, 0x5b, 0xe6, 0xd9, 0xd8, 0x32, 0xbf, 0x8f, 0x2d, 0xf3, 0xfd, 0xc4, 0x32, 0xce, 0x26, + 0x96, 0xf1, 0x75, 0x62, 0x19, 0x47, 0x2f, 0xce, 0x2d, 0x15, 0x3f, 0x8e, 0x12, 0xc9, 0x51, 0x70, + 0xd1, 0x76, 0xb2, 0xf1, 0x72, 0x35, 0xaa, 0xe5, 0xa3, 0xad, 0xc5, 0x18, 0x26, 0x11, 0x73, 0x86, + 0xce, 0xf4, 0x76, 0xe9, 0x8d, 0x6b, 0x5d, 0xd7, 0x6b, 0xfe, 0xf4, 0x67, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xaf, 0x71, 0x9e, 0x80, 0x75, 0x03, 0x00, 0x00, } func (m *StakeAuthorization) Marshal() (dAtA []byte, err error) { @@ -619,7 +614,10 @@ func (m *StakeAuthorization) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAuthz + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAuthz } if (iNdEx + skippy) > l { @@ -701,7 +699,10 @@ func (m *StakeAuthorization_Validators) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAuthz + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAuthz } if (iNdEx + skippy) > l { diff --git a/x/staking/types/authz_test.go b/x/staking/types/authz_test.go index b794618b744b..11caf2196da7 100644 --- a/x/staking/types/authz_test.go +++ b/x/staking/types/authz_test.go @@ -6,14 +6,13 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/simapp" + simapp "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) var ( coin100 = sdk.NewInt64Coin("steak", 100) - coin150 = sdk.NewInt64Coin("steak", 150) coin50 = sdk.NewInt64Coin("steak", 50) delAddr = sdk.AccAddress("_____delegator _____") val1 = sdk.ValAddress("_____validator1_____") @@ -71,17 +70,6 @@ func TestAuthzAuthorizations(t *testing.T) { true, nil, }, - { - "delegate: coins more than allowed", - []sdk.ValAddress{val1, val2}, - []sdk.ValAddress{}, - stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, - &coin100, - stakingtypes.NewMsgDelegate(delAddr, val1, coin150), - true, - false, - nil, - }, { "delegate: verify remaining coins", []sdk.ValAddress{val1, val2}, @@ -94,8 +82,7 @@ func TestAuthzAuthorizations(t *testing.T) { &stakingtypes.StakeAuthorization{ Validators: &stakingtypes.StakeAuthorization_AllowList{ AllowList: &stakingtypes.StakeAuthorization_Validators{Address: validators1_2}, - }, MaxTokens: &coin50, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, - }, + }, MaxTokens: &coin50, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE}, }, { "delegate: testing with invalid validator", @@ -120,8 +107,7 @@ func TestAuthzAuthorizations(t *testing.T) { &stakingtypes.StakeAuthorization{ Validators: &stakingtypes.StakeAuthorization_AllowList{ AllowList: &stakingtypes.StakeAuthorization_Validators{Address: validators1_2}, - }, MaxTokens: nil, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, - }, + }, MaxTokens: nil, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE}, }, { "delegate: fail validator denied", @@ -134,21 +120,7 @@ func TestAuthzAuthorizations(t *testing.T) { false, nil, }, - { - "delegate: testing with a validator out of denylist", - []sdk.ValAddress{}, - []sdk.ValAddress{val1}, - stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, - nil, - stakingtypes.NewMsgDelegate(delAddr, val2, coin100), - false, - false, - &stakingtypes.StakeAuthorization{ - Validators: &stakingtypes.StakeAuthorization_DenyList{ - DenyList: &stakingtypes.StakeAuthorization_Validators{Address: []string{val1.String()}}, - }, MaxTokens: nil, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, - }, - }, + { "undelegate: expect 0 remaining coins", []sdk.ValAddress{val1, val2}, @@ -172,8 +144,7 @@ func TestAuthzAuthorizations(t *testing.T) { &stakingtypes.StakeAuthorization{ Validators: &stakingtypes.StakeAuthorization_AllowList{ AllowList: &stakingtypes.StakeAuthorization_Validators{Address: validators1_2}, - }, MaxTokens: &coin50, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE, - }, + }, MaxTokens: &coin50, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE}, }, { "undelegate: testing with invalid validator", @@ -198,8 +169,7 @@ func TestAuthzAuthorizations(t *testing.T) { &stakingtypes.StakeAuthorization{ Validators: &stakingtypes.StakeAuthorization_AllowList{ AllowList: &stakingtypes.StakeAuthorization_Validators{Address: validators1_2}, - }, MaxTokens: nil, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE, - }, + }, MaxTokens: nil, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE}, }, { "undelegate: fail cannot undelegate, permission denied", @@ -236,8 +206,7 @@ func TestAuthzAuthorizations(t *testing.T) { &stakingtypes.StakeAuthorization{ Validators: &stakingtypes.StakeAuthorization_AllowList{ AllowList: &stakingtypes.StakeAuthorization_Validators{Address: validators1_2}, - }, MaxTokens: &coin50, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE, - }, + }, MaxTokens: &coin50, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE}, }, { "redelegate: testing with invalid validator", @@ -262,8 +231,7 @@ func TestAuthzAuthorizations(t *testing.T) { &stakingtypes.StakeAuthorization{ Validators: &stakingtypes.StakeAuthorization_AllowList{ AllowList: &stakingtypes.StakeAuthorization_Validators{Address: validators1_2}, - }, MaxTokens: nil, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE, - }, + }, MaxTokens: nil, AuthorizationType: stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE}, }, { "redelegate: fail cannot undelegate, permission denied", diff --git a/x/staking/types/codec.go b/x/staking/types/codec.go index 558f2eb038ad..4f081fad65fa 100644 --- a/x/staking/types/codec.go +++ b/x/staking/types/codec.go @@ -4,27 +4,27 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" "github.com/cosmos/cosmos-sdk/x/authz" - authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" ) // RegisterLegacyAminoCodec registers the necessary x/staking interfaces and concrete types // on the provided LegacyAmino codec. These types are used for Amino JSON serialization. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - legacy.RegisterAminoMsg(cdc, &MsgCreateValidator{}, "cosmos-sdk/MsgCreateValidator") - legacy.RegisterAminoMsg(cdc, &MsgEditValidator{}, "cosmos-sdk/MsgEditValidator") - legacy.RegisterAminoMsg(cdc, &MsgDelegate{}, "cosmos-sdk/MsgDelegate") - legacy.RegisterAminoMsg(cdc, &MsgUndelegate{}, "cosmos-sdk/MsgUndelegate") - legacy.RegisterAminoMsg(cdc, &MsgBeginRedelegate{}, "cosmos-sdk/MsgBeginRedelegate") - legacy.RegisterAminoMsg(cdc, &MsgCancelUnbondingDelegation{}, "cosmos-sdk/MsgCancelUnbondingDelegation") - - cdc.RegisterInterface((*isStakeAuthorization_Validators)(nil), nil) - cdc.RegisterConcrete(&StakeAuthorization_AllowList{}, "cosmos-sdk/StakeAuthorization/AllowList", nil) - cdc.RegisterConcrete(&StakeAuthorization_DenyList{}, "cosmos-sdk/StakeAuthorization/DenyList", nil) - cdc.RegisterConcrete(&StakeAuthorization{}, "cosmos-sdk/StakeAuthorization", nil) + // cdc.RegisterConcrete(&MsgCreateValidator{}, "cosmos-sdk/MsgCreateValidator", nil) + // cdc.RegisterConcrete(&MsgEditValidator{}, "cosmos-sdk/MsgEditValidator", nil) + // cdc.RegisterConcrete(&MsgDelegate{}, "cosmos-sdk/MsgDelegate", nil) + // cdc.RegisterConcrete(&MsgUndelegate{}, "cosmos-sdk/MsgUndelegate", nil) + // cdc.RegisterConcrete(&MsgBeginRedelegate{}, "cosmos-sdk/MsgBeginRedelegate", nil) + cdc.RegisterConcrete(&MsgTokenizeShares{}, "cosmos-sdk/MsgTokenizeShares", nil) + cdc.RegisterConcrete(&MsgRedeemTokensforShares{}, "cosmos-sdk/MsgRedeemTokensforShares", nil) + cdc.RegisterConcrete(&MsgTransferTokenizeShareRecord{}, "cosmos-sdk/MsgTransferTokenizeShareRecord", nil) + + // cdc.RegisterInterface((*isStakeAuthorization_Validators)(nil), nil) + // cdc.RegisterConcrete(&StakeAuthorization_AllowList{}, "cosmos-sdk/StakeAuthorization/AllowList", nil) + // cdc.RegisterConcrete(&StakeAuthorization_DenyList{}, "cosmos-sdk/StakeAuthorization/DenyList", nil) + // cdc.RegisterConcrete(&StakeAuthorization{}, "cosmos-sdk/StakeAuthorization", nil) } // RegisterInterfaces registers the x/staking interfaces types with the interface registry @@ -36,6 +36,9 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgUndelegate{}, &MsgBeginRedelegate{}, &MsgCancelUnbondingDelegation{}, + &MsgTokenizeShares{}, + &MsgRedeemTokensforShares{}, + &MsgTransferTokenizeShareRecord{}, ) registry.RegisterImplementations( (*authz.Authorization)(nil), @@ -45,17 +48,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } -var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewAminoCodec(amino) -) - func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - sdk.RegisterLegacyAminoCodec(amino) - - // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be - // used to properly serialize MsgGrant and MsgExec instances - RegisterLegacyAminoCodec(authzcodec.Amino) + RegisterLegacyAminoCodec(legacy.Cdc) } diff --git a/x/staking/types/commission.go b/x/staking/types/commission.go index 9bc0edf52d52..3ff78868fe3f 100644 --- a/x/staking/types/commission.go +++ b/x/staking/types/commission.go @@ -6,6 +6,7 @@ import ( "sigs.k8s.io/yaml" sdk "github.com/cosmos/cosmos-sdk/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // NewCommissionRates returns an initialized validator commission rates. @@ -52,27 +53,27 @@ func (cr CommissionRates) Validate() error { switch { case cr.MaxRate.IsNegative(): // max rate cannot be negative - return ErrCommissionNegative + return sdkstaking.ErrCommissionNegative case cr.MaxRate.GT(sdk.OneDec()): // max rate cannot be greater than 1 - return ErrCommissionHuge + return sdkstaking.ErrCommissionHuge case cr.Rate.IsNegative(): // rate cannot be negative - return ErrCommissionNegative + return sdkstaking.ErrCommissionNegative case cr.Rate.GT(cr.MaxRate): // rate cannot be greater than the max rate - return ErrCommissionGTMaxRate + return sdkstaking.ErrCommissionGTMaxRate case cr.MaxChangeRate.IsNegative(): // change rate cannot be negative - return ErrCommissionChangeRateNegative + return sdkstaking.ErrCommissionChangeRateNegative case cr.MaxChangeRate.GT(cr.MaxRate): // change rate cannot be greater than the max rate - return ErrCommissionChangeRateGTMaxRate + return sdkstaking.ErrCommissionChangeRateGTMaxRate } return nil @@ -84,19 +85,19 @@ func (c Commission) ValidateNewRate(newRate sdk.Dec, blockTime time.Time) error switch { case blockTime.Sub(c.UpdateTime).Hours() < 24: // new rate cannot be changed more than once within 24 hours - return ErrCommissionUpdateTime + return sdkstaking.ErrCommissionUpdateTime case newRate.IsNegative(): // new rate cannot be negative - return ErrCommissionNegative + return sdkstaking.ErrCommissionNegative case newRate.GT(c.MaxRate): // new rate cannot be greater than the max rate - return ErrCommissionGTMaxRate + return sdkstaking.ErrCommissionGTMaxRate case newRate.Sub(c.Rate).GT(c.MaxChangeRate): // new rate % points change cannot be greater than the max change rate - return ErrCommissionGTMaxChangeRate + return sdkstaking.ErrCommissionGTMaxChangeRate } return nil diff --git a/x/staking/types/delegation.go b/x/staking/types/delegation.go index 39a45d41d67f..6294b81c5e5b 100644 --- a/x/staking/types/delegation.go +++ b/x/staking/types/delegation.go @@ -10,10 +10,11 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // Implements Delegation interface -var _ DelegationI = Delegation{} +var _ sdkstaking.DelegationI = Delegation{} // String implements the Stringer interface for a DVPair object. func (dv DVPair) String() string { @@ -29,11 +30,12 @@ func (dvv DVVTriplet) String() string { // NewDelegation creates a new delegation object //nolint:interfacer -func NewDelegation(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec) Delegation { +func NewDelegation(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec, exempt bool) Delegation { return Delegation{ DelegatorAddress: delegatorAddr.String(), ValidatorAddress: validatorAddr.String(), Shares: shares, + Exempt: exempt, } } @@ -60,11 +62,12 @@ func UnmarshalDelegation(cdc codec.BinaryCodec, value []byte) (delegation Delega } func (d Delegation) GetDelegatorAddr() sdk.AccAddress { - delAddr := sdk.MustAccAddressFromBech32(d.DelegatorAddress) - + delAddr, err := sdk.AccAddressFromBech32(d.DelegatorAddress) + if err != nil { + panic(err) + } return delAddr } - func (d Delegation) GetValidatorAddr() sdk.ValAddress { addr, err := sdk.ValAddressFromBech32(d.ValidatorAddress) if err != nil { @@ -293,10 +296,10 @@ func (d Redelegations) String() (out string) { // NewDelegationResp creates a new DelegationResponse instance func NewDelegationResp( - delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec, balance sdk.Coin, + delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec, exempt bool, balance sdk.Coin, ) DelegationResponse { return DelegationResponse{ - Delegation: NewDelegation(delegatorAddr, validatorAddr, shares), + Delegation: NewDelegation(delegatorAddr, validatorAddr, shares, exempt), Balance: balance, } } @@ -349,8 +352,7 @@ func NewRedelegationResponse( // NewRedelegationEntryResponse creates a new RedelegationEntryResponse instance. func NewRedelegationEntryResponse( - creationHeight int64, completionTime time.Time, sharesDst sdk.Dec, initialBalance, balance sdk.Int, -) RedelegationEntryResponse { + creationHeight int64, completionTime time.Time, sharesDst sdk.Dec, initialBalance, balance sdk.Int) RedelegationEntryResponse { return RedelegationEntryResponse{ RedelegationEntry: NewRedelegationEntry(creationHeight, completionTime, initialBalance, sharesDst), Balance: balance, diff --git a/x/staking/types/delegation_test.go b/x/staking/types/delegation_test.go index 7ca5e8132eb4..338c87bf14b3 100644 --- a/x/staking/types/delegation_test.go +++ b/x/staking/types/delegation_test.go @@ -13,7 +13,7 @@ import ( ) func TestDelegationEqual(t *testing.T) { - d1 := types.NewDelegation(sdk.AccAddress(valAddr1), valAddr2, sdk.NewDec(100)) + d1 := types.NewDelegation(sdk.AccAddress(valAddr1), valAddr2, sdk.NewDec(100), false) d2 := d1 ok := d1.String() == d2.String() @@ -27,7 +27,7 @@ func TestDelegationEqual(t *testing.T) { } func TestDelegationString(t *testing.T) { - d := types.NewDelegation(sdk.AccAddress(valAddr1), valAddr2, sdk.NewDec(100)) + d := types.NewDelegation(sdk.AccAddress(valAddr1), valAddr2, sdk.NewDec(100), false) require.NotEmpty(t, d.String()) } @@ -81,9 +81,9 @@ func TestRedelegationString(t *testing.T) { func TestDelegationResponses(t *testing.T) { cdc := codec.NewLegacyAmino() - dr1 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr2, sdk.NewDec(5), + dr1 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr2, sdk.NewDec(5), false, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5))) - dr2 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr3, sdk.NewDec(5), + dr2 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr3, sdk.NewDec(5), false, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5))) drs := types.DelegationResponses{dr1, dr2} diff --git a/x/staking/types/errors.go b/x/staking/types/errors.go index a9a6e43e35b6..b582273ed75c 100644 --- a/x/staking/types/errors.go +++ b/x/staking/types/errors.go @@ -11,43 +11,51 @@ import ( // // REF: https://github.com/cosmos/cosmos-sdk/issues/5450 var ( - ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 2, "empty validator address") - ErrNoValidatorFound = sdkerrors.Register(ModuleName, 3, "validator does not exist") - ErrValidatorOwnerExists = sdkerrors.Register(ModuleName, 4, "validator already exist for this operator address; must use new validator operator address") - ErrValidatorPubKeyExists = sdkerrors.Register(ModuleName, 5, "validator already exist for this pubkey; must use new validator pubkey") - ErrValidatorPubKeyTypeNotSupported = sdkerrors.Register(ModuleName, 6, "validator pubkey type is not supported") - ErrValidatorJailed = sdkerrors.Register(ModuleName, 7, "validator for this address is currently jailed") - ErrBadRemoveValidator = sdkerrors.Register(ModuleName, 8, "failed to remove validator") - ErrCommissionNegative = sdkerrors.Register(ModuleName, 9, "commission must be positive") - ErrCommissionHuge = sdkerrors.Register(ModuleName, 10, "commission cannot be more than 100%") - ErrCommissionGTMaxRate = sdkerrors.Register(ModuleName, 11, "commission cannot be more than the max rate") - ErrCommissionUpdateTime = sdkerrors.Register(ModuleName, 12, "commission cannot be changed more than once in 24h") - ErrCommissionChangeRateNegative = sdkerrors.Register(ModuleName, 13, "commission change rate must be positive") - ErrCommissionChangeRateGTMaxRate = sdkerrors.Register(ModuleName, 14, "commission change rate cannot be more than the max rate") - ErrCommissionGTMaxChangeRate = sdkerrors.Register(ModuleName, 15, "commission cannot be changed more than max change rate") - ErrSelfDelegationBelowMinimum = sdkerrors.Register(ModuleName, 16, "validator's self delegation must be greater than their minimum self delegation") - ErrMinSelfDelegationDecreased = sdkerrors.Register(ModuleName, 17, "minimum self delegation cannot be decrease") - ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 18, "empty delegator address") - ErrNoDelegation = sdkerrors.Register(ModuleName, 19, "no delegation for (address, validator) tuple") - ErrBadDelegatorAddr = sdkerrors.Register(ModuleName, 20, "delegator does not exist with address") - ErrNoDelegatorForAddress = sdkerrors.Register(ModuleName, 21, "delegator does not contain delegation") - ErrInsufficientShares = sdkerrors.Register(ModuleName, 22, "insufficient delegation shares") - ErrDelegationValidatorEmpty = sdkerrors.Register(ModuleName, 23, "cannot delegate to an empty validator") - ErrNotEnoughDelegationShares = sdkerrors.Register(ModuleName, 24, "not enough delegation shares") - ErrNotMature = sdkerrors.Register(ModuleName, 25, "entry not mature") - ErrNoUnbondingDelegation = sdkerrors.Register(ModuleName, 26, "no unbonding delegation found") - ErrMaxUnbondingDelegationEntries = sdkerrors.Register(ModuleName, 27, "too many unbonding delegation entries for (delegator, validator) tuple") - ErrNoRedelegation = sdkerrors.Register(ModuleName, 28, "no redelegation found") - ErrSelfRedelegation = sdkerrors.Register(ModuleName, 29, "cannot redelegate to the same validator") - ErrTinyRedelegationAmount = sdkerrors.Register(ModuleName, 30, "too few tokens to redelegate (truncates to zero tokens)") - ErrBadRedelegationDst = sdkerrors.Register(ModuleName, 31, "redelegation destination validator not found") - ErrTransitiveRedelegation = sdkerrors.Register(ModuleName, 32, "redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation") - ErrMaxRedelegationEntries = sdkerrors.Register(ModuleName, 33, "too many redelegation entries for (delegator, src-validator, dst-validator) tuple") - ErrDelegatorShareExRateInvalid = sdkerrors.Register(ModuleName, 34, "cannot delegate to validators with invalid (zero) ex-rate") - ErrBothShareMsgsGiven = sdkerrors.Register(ModuleName, 35, "both shares amount and shares percent provided") - ErrNeitherShareMsgsGiven = sdkerrors.Register(ModuleName, 36, "neither shares amount nor shares percent provided") - ErrInvalidHistoricalInfo = sdkerrors.Register(ModuleName, 37, "invalid historical info") - ErrNoHistoricalInfo = sdkerrors.Register(ModuleName, 38, "no historical info found") - ErrEmptyValidatorPubKey = sdkerrors.Register(ModuleName, 39, "empty validator public key") - ErrCommissionLTMinRate = sdkerrors.Register(ModuleName, 40, "commission cannot be less than min rate") + // ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 2, "empty validator address") + // ErrNoValidatorFound = sdkerrors.Register(ModuleName, 3, "validator does not exist") + // ErrValidatorOwnerExists = sdkerrors.Register(ModuleName, 4, "validator already exist for this operator address; must use new validator operator address") + // ErrValidatorPubKeyExists = sdkerrors.Register(ModuleName, 5, "validator already exist for this pubkey; must use new validator pubkey") + // ErrValidatorPubKeyTypeNotSupported = sdkerrors.Register(ModuleName, 6, "validator pubkey type is not supported") + // ErrValidatorJailed = sdkerrors.Register(ModuleName, 7, "validator for this address is currently jailed") + // ErrBadRemoveValidator = sdkerrors.Register(ModuleName, 8, "failed to remove validator") + // ErrCommissionNegative = sdkerrors.Register(ModuleName, 9, "commission must be positive") + // ErrCommissionHuge = sdkerrors.Register(ModuleName, 10, "commission cannot be more than 100%") + // ErrCommissionGTMaxRate = sdkerrors.Register(ModuleName, 11, "commission cannot be more than the max rate") + // ErrCommissionUpdateTime = sdkerrors.Register(ModuleName, 12, "commission cannot be changed more than once in 24h") + // ErrCommissionChangeRateNegative = sdkerrors.Register(ModuleName, 13, "commission change rate must be positive") + // ErrCommissionChangeRateGTMaxRate = sdkerrors.Register(ModuleName, 14, "commission change rate cannot be more than the max rate") + // ErrCommissionGTMaxChangeRate = sdkerrors.Register(ModuleName, 15, "commission cannot be changed more than max change rate") + // ErrSelfDelegationBelowMinimum = sdkerrors.Register(ModuleName, 16, "validator's self delegation must be greater than their minimum self delegation") + // ErrMinSelfDelegationDecreased = sdkerrors.Register(ModuleName, 17, "minimum self delegation cannot be decrease") + // ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 18, "empty delegator address") + // ErrNoDelegation = sdkerrors.Register(ModuleName, 19, "no delegation for (address, validator) tuple") + // ErrBadDelegatorAddr = sdkerrors.Register(ModuleName, 20, "delegator does not exist with address") + // ErrNoDelegatorForAddress = sdkerrors.Register(ModuleName, 21, "delegator does not contain delegation") + // ErrInsufficientShares = sdkerrors.Register(ModuleName, 22, "insufficient delegation shares") + // ErrDelegationValidatorEmpty = sdkerrors.Register(ModuleName, 23, "cannot delegate to an empty validator") + // ErrNotEnoughDelegationShares = sdkerrors.Register(ModuleName, 24, "not enough delegation shares") + // ErrNotMature = sdkerrors.Register(ModuleName, 25, "entry not mature") + // ErrNoUnbondingDelegation = sdkerrors.Register(ModuleName, 26, "no unbonding delegation found") + // ErrMaxUnbondingDelegationEntries = sdkerrors.Register(ModuleName, 27, "too many unbonding delegation entries for (delegator, validator) tuple") + // ErrNoRedelegation = sdkerrors.Register(ModuleName, 28, "no redelegation found") + // ErrSelfRedelegation = sdkerrors.Register(ModuleName, 29, "cannot redelegate to the same validator") + // ErrTinyRedelegationAmount = sdkerrors.Register(ModuleName, 30, "too few tokens to redelegate (truncates to zero tokens)") + // ErrBadRedelegationDst = sdkerrors.Register(ModuleName, 31, "redelegation destination validator not found") + // ErrTransitiveRedelegation = sdkerrors.Register(ModuleName, 32, "redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation") + // ErrMaxRedelegationEntries = sdkerrors.Register(ModuleName, 33, "too many redelegation entries for (delegator, src-validator, dst-validator) tuple") + // ErrDelegatorShareExRateInvalid = sdkerrors.Register(ModuleName, 34, "cannot delegate to validators with invalid (zero) ex-rate") + // ErrBothShareMsgsGiven = sdkerrors.Register(ModuleName, 35, "both shares amount and shares percent provided") + // ErrNeitherShareMsgsGiven = sdkerrors.Register(ModuleName, 36, "neither shares amount nor shares percent provided") + // ErrInvalidHistoricalInfo = sdkerrors.Register(ModuleName, 37, "invalid historical info") + // ErrNoHistoricalInfo = sdkerrors.Register(ModuleName, 38, "no historical info found") + // ErrEmptyValidatorPubKey = sdkerrors.Register(ModuleName, 39, "empty validator public key") + // ErrCommissionLTMinRate = sdkerrors.Register(ModuleName, 40, "commission cannot be less than min rate") + ErrNotEnoughBalance = sdkerrors.Register(ModuleName, 41, "not enough balance") + ErrTokenizeShareRecordNotExists = sdkerrors.Register(ModuleName, 42, "tokenize share record not exists") + ErrTokenizeShareRecordAlreadyExists = sdkerrors.Register(ModuleName, 43, "tokenize share record already exists") + ErrNotTokenizeShareRecordOwner = sdkerrors.Register(ModuleName, 44, "not tokenize share record owner") + ErrExceedingFreeVestingDelegations = sdkerrors.Register(ModuleName, 45, "trying to exceed vested free delegation for vesting account") + ErrOnlyBondDenomAllowdForTokenize = sdkerrors.Register(ModuleName, 46, "only bond denom is allowed for tokenize") + ErrInsufficientExemptShares = sdkerrors.Register(ModuleName, 47, "insufficient exempt shares") + ErrRedelegationNotAllowedForExemptDelegation = sdkerrors.Register(ModuleName, 48, "redelegation is not allowed for exempt delegation") ) diff --git a/x/staking/types/events.go b/x/staking/types/events.go index d8aa7303fcba..45b3b5a18cb8 100644 --- a/x/staking/types/events.go +++ b/x/staking/types/events.go @@ -2,23 +2,27 @@ package types // staking module event types const ( - EventTypeCompleteUnbonding = "complete_unbonding" - EventTypeCompleteRedelegation = "complete_redelegation" - EventTypeCreateValidator = "create_validator" - EventTypeEditValidator = "edit_validator" - EventTypeDelegate = "delegate" - EventTypeUnbond = "unbond" - EventTypeCancelUnbondingDelegation = "cancel_unbonding_delegation" - EventTypeRedelegate = "redelegate" + EventTypeCompleteUnbonding = "complete_unbonding" + EventTypeCompleteRedelegation = "complete_redelegation" + EventTypeCreateValidator = "create_validator" + EventTypeEditValidator = "edit_validator" + EventTypeDelegate = "delegate" + EventTypeUnbond = "unbond" + EventTypeRedelegate = "redelegate" + EventTypeTokenizeShares = "tokenize_shares" + EventTypeRedeemShares = "redeem_shares" + EventTypeTransferTokenizeShareRecord = "transfer_tokenize_share_record" + EventTypeExemptDelegation = "exempt_delegation" - AttributeKeyValidator = "validator" - AttributeKeyCommissionRate = "commission_rate" - AttributeKeyMinSelfDelegation = "min_self_delegation" - AttributeKeySrcValidator = "source_validator" - AttributeKeyDstValidator = "destination_validator" - AttributeKeyDelegator = "delegator" - AttributeKeyCreationHeight = "creation_height" - AttributeKeyCompletionTime = "completion_time" - AttributeKeyNewShares = "new_shares" - AttributeValueCategory = ModuleName + AttributeKeyValidator = "validator" + AttributeKeyCommissionRate = "commission_rate" + AttributeKeySrcValidator = "source_validator" + AttributeKeyDstValidator = "destination_validator" + AttributeKeyDelegator = "delegator" + AttributeKeyCompletionTime = "completion_time" + AttributeKeyNewShares = "new_shares" + AttributeKeyShareOwner = "share_owner" + AttributeKeyShareRecordId = "share_record_id" + AttributeKeyAmount = "amount" + AttributeValueCategory = ModuleName ) diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index 785a969f36e4..5e0696563967 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -3,6 +3,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // DistributionKeeper expected distribution keeper (noalias) @@ -32,10 +33,14 @@ type BankKeeper interface { GetSupply(ctx sdk.Context, denom string) sdk.Coin + SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + MintCoins(cts sdk.Context, name string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error } @@ -43,20 +48,20 @@ type BankKeeper interface { type ValidatorSet interface { // iterate through validators by operator address, execute func for each validator IterateValidators(sdk.Context, - func(index int64, validator ValidatorI) (stop bool)) + func(index int64, validator sdkstaking.ValidatorI) (stop bool)) // iterate through bonded validators by operator address, execute func for each validator IterateBondedValidatorsByPower(sdk.Context, - func(index int64, validator ValidatorI) (stop bool)) + func(index int64, validator sdkstaking.ValidatorI) (stop bool)) // iterate through the consensus validator set of the last block by operator address, execute func for each validator IterateLastValidators(sdk.Context, - func(index int64, validator ValidatorI) (stop bool)) + func(index int64, validator sdkstaking.ValidatorI) (stop bool)) - Validator(sdk.Context, sdk.ValAddress) ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) ValidatorI // get a particular validator by consensus address - TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set - StakingTokenSupply(sdk.Context) sdk.Int // total staking token supply + Validator(sdk.Context, sdk.ValAddress) sdkstaking.ValidatorI // get a particular validator by operator address + ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) sdkstaking.ValidatorI // get a particular validator by consensus address + TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set + StakingTokenSupply(sdk.Context) sdk.Int // total staking token supply // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdk.Int @@ -65,7 +70,7 @@ type ValidatorSet interface { // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) DelegationI + Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) sdkstaking.DelegationI // MaxValidators returns the maximum amount of bonded validators MaxValidators(sdk.Context) uint32 @@ -78,7 +83,7 @@ type DelegationSet interface { // iterate through all delegations from one delegator by validator-AccAddress, // execute func for each validator IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, - fn func(index int64, delegation DelegationI) (stop bool)) + fn func(index int64, delegation sdkstaking.DelegationI) (stop bool)) } // Event Hooks @@ -92,6 +97,7 @@ type StakingHooks interface { AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error // Must be called when a validator's state changes AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is deleted + BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordId uint64) error // Must be called when tokenize share record is deleted AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is bonded AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator begins unbonding diff --git a/x/staking/types/exported.go b/x/staking/types/exported.go index 9599da100d20..d31bd8bde257 100644 --- a/x/staking/types/exported.go +++ b/x/staking/types/exported.go @@ -5,6 +5,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // DelegationI delegation bond for a delegated proof of stake system @@ -18,7 +19,7 @@ type DelegationI interface { type ValidatorI interface { IsJailed() bool // whether the validator is jailed GetMoniker() string // moniker of the validator - GetStatus() BondStatus // status of the validator + GetStatus() sdkstaking.BondStatus // status of the validator IsBonded() bool // check if has a bonded status IsUnbonded() bool // check if has status unbonded IsUnbonding() bool // check if has status unbonding @@ -30,7 +31,6 @@ type ValidatorI interface { GetBondedTokens() sdk.Int // validator bonded tokens GetConsensusPower(sdk.Int) int64 // validation power in tendermint GetCommission() sdk.Dec // validator commission rate - GetMinSelfDelegation() sdk.Int // validator minimum self delegation GetDelegatorShares() sdk.Dec // total outstanding delegator shares TokensFromShares(sdk.Dec) sdk.Dec // token worth of provided delegator shares TokensFromSharesTruncated(sdk.Dec) sdk.Dec // token worth of provided delegator shares, truncated diff --git a/x/staking/types/genesis.pb.go b/x/staking/types/genesis.pb.go index 51a94e79d85b..e3cb90820b80 100644 --- a/x/staking/types/genesis.pb.go +++ b/x/staking/types/genesis.pb.go @@ -1,11 +1,10 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/staking/v1beta1/genesis.proto +// source: staking/v1beta1/genesis.proto package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -31,26 +30,30 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. - LastTotalPower github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=last_total_power,json=lastTotalPower,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"last_total_power"` + LastTotalPower github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=last_total_power,json=lastTotalPower,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"last_total_power" yaml:"last_total_power"` // last_validator_powers is a special index that provides a historical list // of the last-block's bonded validators. - LastValidatorPowers []LastValidatorPower `protobuf:"bytes,3,rep,name=last_validator_powers,json=lastValidatorPowers,proto3" json:"last_validator_powers"` + LastValidatorPowers []LastValidatorPower `protobuf:"bytes,3,rep,name=last_validator_powers,json=lastValidatorPowers,proto3" json:"last_validator_powers" yaml:"last_validator_powers"` // delegations defines the validator set at genesis. Validators []Validator `protobuf:"bytes,4,rep,name=validators,proto3" json:"validators"` // delegations defines the delegations active at genesis. Delegations []Delegation `protobuf:"bytes,5,rep,name=delegations,proto3" json:"delegations"` // unbonding_delegations defines the unbonding delegations active at genesis. - UnbondingDelegations []UnbondingDelegation `protobuf:"bytes,6,rep,name=unbonding_delegations,json=unbondingDelegations,proto3" json:"unbonding_delegations"` + UnbondingDelegations []UnbondingDelegation `protobuf:"bytes,6,rep,name=unbonding_delegations,json=unbondingDelegations,proto3" json:"unbonding_delegations" yaml:"unbonding_delegations"` // redelegations defines the redelegations active at genesis. Redelegations []Redelegation `protobuf:"bytes,7,rep,name=redelegations,proto3" json:"redelegations"` Exported bool `protobuf:"varint,8,opt,name=exported,proto3" json:"exported,omitempty"` + // store tokenize share records to provide reward to record owners + TokenizeShareRecords []TokenizeShareRecord `protobuf:"bytes,9,rep,name=tokenize_share_records,json=tokenizeShareRecords,proto3" json:"tokenize_share_records"` + // last tokenize share record id, used for next share record id calculation + LastTokenizeShareRecordId uint64 `protobuf:"varint,10,opt,name=last_tokenize_share_record_id,json=lastTokenizeShareRecordId,proto3" json:"last_tokenize_share_record_id,omitempty"` } 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_9b3dec8894f2831b, []int{0} + return fileDescriptor_30376b0921a07e54, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -128,6 +131,20 @@ func (m *GenesisState) GetExported() bool { return false } +func (m *GenesisState) GetTokenizeShareRecords() []TokenizeShareRecord { + if m != nil { + return m.TokenizeShareRecords + } + return nil +} + +func (m *GenesisState) GetLastTokenizeShareRecordId() uint64 { + if m != nil { + return m.LastTokenizeShareRecordId + } + return 0 +} + // LastValidatorPower required for validator set update logic. type LastValidatorPower struct { // address is the address of the validator. @@ -140,7 +157,7 @@ func (m *LastValidatorPower) Reset() { *m = LastValidatorPower{} } func (m *LastValidatorPower) String() string { return proto.CompactTextString(m) } func (*LastValidatorPower) ProtoMessage() {} func (*LastValidatorPower) Descriptor() ([]byte, []int) { - return fileDescriptor_9b3dec8894f2831b, []int{1} + return fileDescriptor_30376b0921a07e54, []int{1} } func (m *LastValidatorPower) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -170,47 +187,51 @@ func (m *LastValidatorPower) XXX_DiscardUnknown() { var xxx_messageInfo_LastValidatorPower proto.InternalMessageInfo func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.staking.v1beta1.GenesisState") - proto.RegisterType((*LastValidatorPower)(nil), "cosmos.staking.v1beta1.LastValidatorPower") + proto.RegisterType((*GenesisState)(nil), "liquidstaking.staking.v1beta1.GenesisState") + proto.RegisterType((*LastValidatorPower)(nil), "liquidstaking.staking.v1beta1.LastValidatorPower") } -func init() { - proto.RegisterFile("cosmos/staking/v1beta1/genesis.proto", fileDescriptor_9b3dec8894f2831b) -} - -var fileDescriptor_9b3dec8894f2831b = []byte{ - // 483 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0x41, 0x6e, 0xd3, 0x40, - 0x14, 0x86, 0x6d, 0x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a1, 0x43, 0xb2, 0xc9, 0xc2, 0x50, 0x72, 0xd0, 0xfb, 0x77, 0x75, 0xe4, 0x7c, 0xfd, 0xb2, - 0xdb, 0x36, 0x05, 0x9e, 0xe8, 0xc9, 0x01, 0xca, 0x38, 0x8d, 0x82, 0x15, 0x48, 0xdb, 0x64, 0xe3, - 0xcf, 0xa6, 0xd5, 0x02, 0x7d, 0x78, 0xd4, 0xfc, 0x74, 0xd6, 0xb5, 0x7e, 0x9e, 0x75, 0xad, 0xd1, - 0xb3, 0xf3, 0x85, 0x6b, 0x5f, 0x2c, 0x5c, 0xfb, 0xc7, 0xc2, 0xb5, 0x3f, 0x2f, 0x5d, 0xeb, 0x62, - 0xe9, 0x5a, 0xdf, 0x96, 0xae, 0xf5, 0xee, 0xc1, 0x7f, 0x97, 0xf1, 0xb4, 0x78, 0x56, 0x6a, 0x2d, - 0xa7, 0x0d, 0xf5, 0x64, 0x1e, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x73, 0xbd, 0x93, 0xb3, 0xc9, - 0x03, 0x00, 0x00, +func init() { proto.RegisterFile("staking/v1beta1/genesis.proto", fileDescriptor_30376b0921a07e54) } + +var fileDescriptor_30376b0921a07e54 = []byte{ + // 585 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xcf, 0x6e, 0xd3, 0x4c, + 0x14, 0xc5, 0xed, 0xaf, 0x69, 0x92, 0x4e, 0xfa, 0x21, 0x34, 0xa4, 0x60, 0x22, 0x62, 0x47, 0x16, + 0x20, 0x23, 0x14, 0x5b, 0x09, 0xbb, 0x6e, 0x40, 0x01, 0x09, 0x45, 0x42, 0x55, 0x71, 0x0b, 0x08, + 0x36, 0xd6, 0x24, 0x33, 0x72, 0x47, 0x71, 0x3c, 0xa9, 0x67, 0x5c, 0x1a, 0x9e, 0x00, 0x09, 0x21, + 0xf1, 0x08, 0x7d, 0x04, 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 0x64, 0xc8, + 0x02, 0xcc, 0x95, 0xad, 0x7f, 0x6a, 0xc2, 0x61, 0x6a, 0x3e, 0x88, 0xbc, 0x76, 0x6c, 0x4d, 0x43, + 0xd4, 0x45, 0xf1, 0x13, 0x87, 0x4f, 0x40, 0x33, 0x3d, 0xca, 0x57, 0x14, 0x75, 0x28, 0x56, 0x40, + 0x4b, 0x36, 0x4a, 0xf6, 0xed, 0xe4, 0x70, 0x17, 0x00, 0x7d, 0xac, 0xef, 0x01, 0x58, 0x3c, 0xaa, + 0x50, 0x01, 0x15, 0x84, 0x71, 0x40, 0x78, 0x32, 0xb8, 0x5b, 0x76, 0xb6, 0x84, 0x75, 0xb0, 0xf9, + 0x7b, 0x02, 0x37, 0xec, 0x64, 0xb1, 0x5b, 0xfd, 0x78, 0xa6, 0x49, 0x3f, 0xcf, 0x34, 0xa9, 0xf7, + 0xf6, 0x7c, 0xae, 0xca, 0x17, 0x73, 0x55, 0xfe, 0x31, 0x57, 0xe5, 0x2f, 0x0b, 0x55, 0xba, 0x58, + 0xa8, 0xd2, 0xb7, 0x85, 0x2a, 0xbd, 0x7b, 0x9c, 0x1b, 0x52, 0x7a, 0xec, 0x85, 0x9c, 0x32, 0x9f, + 0xfa, 0x43, 0x2b, 0xe9, 0x08, 0x15, 0xd3, 0x76, 0xda, 0x8d, 0xf6, 0x98, 0xe1, 0xd0, 0x23, 0xd6, + 0x69, 0x76, 0xbb, 0x24, 0x13, 0x3c, 0x28, 0xc7, 0x97, 0xcc, 0xa3, 0x5f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xa3, 0xfb, 0xe7, 0x19, 0xd9, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -233,6 +254,25 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.LastTokenizeShareRecordId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.LastTokenizeShareRecordId)) + i-- + dAtA[i] = 0x50 + } + if len(m.TokenizeShareRecords) > 0 { + for iNdEx := len(m.TokenizeShareRecords) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TokenizeShareRecords[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } if m.Exported { i-- if m.Exported { @@ -425,6 +465,15 @@ func (m *GenesisState) Size() (n int) { if m.Exported { n += 2 } + if len(m.TokenizeShareRecords) > 0 { + for _, e := range m.TokenizeShareRecords { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.LastTokenizeShareRecordId != 0 { + n += 1 + sovGenesis(uint64(m.LastTokenizeShareRecordId)) + } return n } @@ -735,13 +784,69 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } } m.Exported = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenizeShareRecords", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenizeShareRecords = append(m.TokenizeShareRecords, TokenizeShareRecord{}) + if err := m.TokenizeShareRecords[len(m.TokenizeShareRecords)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTokenizeShareRecordId", wireType) + } + m.LastTokenizeShareRecordId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastTokenizeShareRecordId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { @@ -842,7 +947,10 @@ func (m *LastValidatorPower) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGenesis } if (iNdEx + skippy) > l { diff --git a/x/staking/types/historical_info.go b/x/staking/types/historical_info.go index 447a559bda7b..fa6c96a0ed02 100644 --- a/x/staking/types/historical_info.go +++ b/x/staking/types/historical_info.go @@ -10,6 +10,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // NewHistoricalInfo will create a historical information struct from header and valset @@ -45,11 +46,11 @@ func UnmarshalHistoricalInfo(cdc codec.BinaryCodec, value []byte) (hi Historical // ValidateBasic will ensure HistoricalInfo is not nil and sorted func ValidateBasic(hi HistoricalInfo) error { if len(hi.Valset) == 0 { - return sdkerrors.Wrap(ErrInvalidHistoricalInfo, "validator set is empty") + return sdkerrors.Wrap(sdkstaking.ErrInvalidHistoricalInfo, "validator set is empty") } if !sort.IsSorted(Validators(hi.Valset)) { - return sdkerrors.Wrap(ErrInvalidHistoricalInfo, "validator set is not sorted by address") + return sdkerrors.Wrap(sdkstaking.ErrInvalidHistoricalInfo, "validator set is not sorted by address") } return nil diff --git a/x/staking/types/hooks.go b/x/staking/types/hooks.go index 93e0d21cc085..4cf17cddb3af 100644 --- a/x/staking/types/hooks.go +++ b/x/staking/types/hooks.go @@ -22,7 +22,6 @@ func (h MultiStakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.Va return nil } - func (h MultiStakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].BeforeValidatorModified(ctx, valAddr); err != nil { @@ -31,7 +30,6 @@ func (h MultiStakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk. } return nil } - func (h MultiStakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].AfterValidatorRemoved(ctx, consAddr, valAddr); err != nil { @@ -41,6 +39,15 @@ func (h MultiStakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.C return nil } +func (h MultiStakingHooks) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordId uint64) error { + for i := range h { + if err := h[i].BeforeTokenizeShareRecordRemoved(ctx, recordId); err != nil { + return err + } + } + return nil +} + func (h MultiStakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].AfterValidatorBonded(ctx, consAddr, valAddr); err != nil { @@ -49,7 +56,6 @@ func (h MultiStakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.Co } return nil } - func (h MultiStakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].AfterValidatorBeginUnbonding(ctx, consAddr, valAddr); err != nil { @@ -58,7 +64,6 @@ func (h MultiStakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAdd } return nil } - func (h MultiStakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].BeforeDelegationCreated(ctx, delAddr, valAddr); err != nil { @@ -67,7 +72,6 @@ func (h MultiStakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk. } return nil } - func (h MultiStakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].BeforeDelegationSharesModified(ctx, delAddr, valAddr); err != nil { @@ -76,7 +80,6 @@ func (h MultiStakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAd } return nil } - func (h MultiStakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].BeforeDelegationRemoved(ctx, delAddr, valAddr); err != nil { @@ -85,7 +88,6 @@ func (h MultiStakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk. } return nil } - func (h MultiStakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { if err := h[i].AfterDelegationModified(ctx, delAddr, valAddr); err != nil { @@ -94,7 +96,6 @@ func (h MultiStakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk. } return nil } - func (h MultiStakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error { for i := range h { if err := h[i].BeforeValidatorSlashed(ctx, valAddr, fraction); err != nil { diff --git a/x/staking/types/keys.go b/x/staking/types/keys.go index 74d73bf19c7e..f7c56bfce353 100644 --- a/x/staking/types/keys.go +++ b/x/staking/types/keys.go @@ -48,6 +48,11 @@ var ( ValidatorQueueKey = []byte{0x43} // prefix for the timestamps in validator queue HistoricalInfoKey = []byte{0x50} // prefix for the historical info + + TokenizeShareRecordPrefix = []byte{0x61} // key for tokenizeshare record prefix + TokenizeShareRecordIdByOwnerPrefix = []byte{0x62} // key for tokenizeshare record id by owner prefix + TokenizeShareRecordIdByDenomPrefix = []byte{0x63} // key for tokenizeshare record id by denom prefix + LastTokenizeShareRecordIdKey = []byte{0x64} // key for last tokenize share record id ) // GetValidatorKey creates the key for the validator with address @@ -347,3 +352,22 @@ func GetREDsByDelToValDstIndexKey(delAddr sdk.AccAddress, valDstAddr sdk.ValAddr func GetHistoricalInfoKey(height int64) []byte { return append(HistoricalInfoKey, []byte(strconv.FormatInt(height, 10))...) } + +// GetTokenizeShareRecordByIndexKey returns the key of the specified id. Intended for querying the tokenizeShareRecord by the id. +func GetTokenizeShareRecordByIndexKey(id uint64) []byte { + return append(TokenizeShareRecordPrefix, sdk.Uint64ToBigEndian(id)...) +} + +// GetTokenizeShareRecordIdsByOwnerPrefix returns the key of the specified owner. Intended for querying all tokenizeShareRecords of an owner +func GetTokenizeShareRecordIdsByOwnerPrefix(owner sdk.AccAddress) []byte { + return append(TokenizeShareRecordIdByOwnerPrefix, address.MustLengthPrefix(owner)...) +} + +// GetTokenizeShareRecordIdByOwnerAndIdKey returns the key of the specified owner and id. Intended for setting tokenizeShareRecord of an owner +func GetTokenizeShareRecordIdByOwnerAndIdKey(owner sdk.AccAddress, id uint64) []byte { + return append(append(TokenizeShareRecordIdByOwnerPrefix, address.MustLengthPrefix(owner)...), sdk.Uint64ToBigEndian(id)...) +} + +func GetTokenizeShareRecordIdByDenomKey(denom string) []byte { + return append(TokenizeShareRecordIdByDenomPrefix, []byte(denom)...) +} diff --git a/x/staking/types/keys_test.go b/x/staking/types/keys_test.go index 20269e671baf..35667f949da5 100644 --- a/x/staking/types/keys_test.go +++ b/x/staking/types/keys_test.go @@ -56,18 +56,12 @@ func TestGetREDByValDstIndexKey(t *testing.T) { valDstAddr sdk.ValAddress wantHex string }{ - { - sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr1), - "361463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f08609", - }, - { - sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr2), sdk.ValAddress(keysAddr3), - "36143ab62f0d93849be495e21e3e9013a517038f45bd1463d771218209d8bd03c482f69dfba57310f08609145ef3b5f25c54946d4a89fc0d09d2f126614540f2", - }, - { - sdk.AccAddress(keysAddr2), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr3), - "36143ab62f0d93849be495e21e3e9013a517038f45bd145ef3b5f25c54946d4a89fc0d09d2f126614540f21463d771218209d8bd03c482f69dfba57310f08609", - }, + {sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr1), + "361463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f08609"}, + {sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr2), sdk.ValAddress(keysAddr3), + "36143ab62f0d93849be495e21e3e9013a517038f45bd1463d771218209d8bd03c482f69dfba57310f08609145ef3b5f25c54946d4a89fc0d09d2f126614540f2"}, + {sdk.AccAddress(keysAddr2), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr3), + "36143ab62f0d93849be495e21e3e9013a517038f45bd145ef3b5f25c54946d4a89fc0d09d2f126614540f21463d771218209d8bd03c482f69dfba57310f08609"}, } for i, tt := range tests { got := hex.EncodeToString(types.GetREDByValDstIndexKey(tt.delAddr, tt.valSrcAddr, tt.valDstAddr)) @@ -83,18 +77,12 @@ func TestGetREDByValSrcIndexKey(t *testing.T) { valDstAddr sdk.ValAddress wantHex string }{ - { - sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr1), - "351463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f08609", - }, - { - sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr2), sdk.ValAddress(keysAddr3), - "35145ef3b5f25c54946d4a89fc0d09d2f126614540f21463d771218209d8bd03c482f69dfba57310f08609143ab62f0d93849be495e21e3e9013a517038f45bd", - }, - { - sdk.AccAddress(keysAddr2), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr3), - "351463d771218209d8bd03c482f69dfba57310f08609145ef3b5f25c54946d4a89fc0d09d2f126614540f2143ab62f0d93849be495e21e3e9013a517038f45bd", - }, + {sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr1), + "351463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f08609"}, + {sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr2), sdk.ValAddress(keysAddr3), + "35145ef3b5f25c54946d4a89fc0d09d2f126614540f21463d771218209d8bd03c482f69dfba57310f08609143ab62f0d93849be495e21e3e9013a517038f45bd"}, + {sdk.AccAddress(keysAddr2), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr3), + "351463d771218209d8bd03c482f69dfba57310f08609145ef3b5f25c54946d4a89fc0d09d2f126614540f2143ab62f0d93849be495e21e3e9013a517038f45bd"}, } for i, tt := range tests { got := hex.EncodeToString(types.GetREDByValSrcIndexKey(tt.delAddr, tt.valSrcAddr, tt.valDstAddr)) diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index a1ae89d15751..8de1bb5f8896 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -1,20 +1,26 @@ package types import ( + "github.com/cosmos/cosmos-sdk/codec/legacy" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // staking message types const ( - TypeMsgUndelegate = "begin_unbonding" - TypeMsgCancelUnbondingDelegation = "cancel_unbond" - TypeMsgEditValidator = "edit_validator" - TypeMsgCreateValidator = "create_validator" - TypeMsgDelegate = "delegate" - TypeMsgBeginRedelegate = "begin_redelegate" + TypeMsgUndelegate = "begin_unbonding" + TypeMsgEditValidator = "edit_validator" + TypeMsgCreateValidator = "create_validator" + TypeMsgDelegate = "delegate" + TypeMsgBeginRedelegate = "begin_redelegate" + TypeMsgCancelUnbondingDelegation = "cancel_unbond" + TypeMsgTokenizeShares = "tokenize_shares" + TypeMsgRedeemTokensforShares = "redeem_tokens_for_shares" + TypeMsgTransferTokenizeShareRecord = "transfer_tokenize_share_record" + TypeMsgExemptDelegation = "exempt_delegation" ) var ( @@ -25,6 +31,9 @@ var ( _ sdk.Msg = &MsgDelegate{} _ sdk.Msg = &MsgUndelegate{} _ sdk.Msg = &MsgBeginRedelegate{} + _ sdk.Msg = &MsgTokenizeShares{} + _ sdk.Msg = &MsgRedeemTokensforShares{} + _ sdk.Msg = &MsgTransferTokenizeShareRecord{} _ sdk.Msg = &MsgCancelUnbondingDelegation{} ) @@ -32,7 +41,7 @@ var ( // Delegator address and validator address are the same. func NewMsgCreateValidator( valAddr sdk.ValAddress, pubKey cryptotypes.PubKey, //nolint:interfacer - selfDelegation sdk.Coin, description Description, commission CommissionRates, minSelfDelegation sdk.Int, + selfDelegation sdk.Coin, description Description, commission CommissionRates, ) (*MsgCreateValidator, error) { var pkAny *codectypes.Any if pubKey != nil { @@ -42,13 +51,12 @@ func NewMsgCreateValidator( } } return &MsgCreateValidator{ - Description: description, - DelegatorAddress: sdk.AccAddress(valAddr).String(), - ValidatorAddress: valAddr.String(), - Pubkey: pkAny, - Value: selfDelegation, - Commission: commission, - MinSelfDelegation: minSelfDelegation, + Description: description, + DelegatorAddress: sdk.AccAddress(valAddr).String(), + ValidatorAddress: valAddr.String(), + Pubkey: pkAny, + Value: selfDelegation, + Commission: commission, }, nil } @@ -78,7 +86,7 @@ func (msg MsgCreateValidator) GetSigners() []sdk.AccAddress { // GetSignBytes returns the message bytes to sign over. func (msg MsgCreateValidator) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -98,7 +106,7 @@ func (msg MsgCreateValidator) ValidateBasic() error { } if msg.Pubkey == nil { - return ErrEmptyValidatorPubKey + return sdkstaking.ErrEmptyValidatorPubKey } if !msg.Value.IsValid() || !msg.Value.Amount.IsPositive() { @@ -117,17 +125,6 @@ func (msg MsgCreateValidator) ValidateBasic() error { return err } - if !msg.MinSelfDelegation.IsPositive() { - return sdkerrors.Wrap( - sdkerrors.ErrInvalidRequest, - "minimum self delegation must be a positive integer", - ) - } - - if msg.Value.Amount.LT(msg.MinSelfDelegation) { - return ErrSelfDelegationBelowMinimum - } - return nil } @@ -139,12 +136,11 @@ func (msg MsgCreateValidator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) // NewMsgEditValidator creates a new MsgEditValidator instance //nolint:interfacer -func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRate *sdk.Dec, newMinSelfDelegation *sdk.Int) *MsgEditValidator { +func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRate *sdk.Dec) *MsgEditValidator { return &MsgEditValidator{ - Description: description, - CommissionRate: newRate, - ValidatorAddress: valAddr.String(), - MinSelfDelegation: newMinSelfDelegation, + Description: description, + CommissionRate: newRate, + ValidatorAddress: valAddr.String(), } } @@ -162,7 +158,7 @@ func (msg MsgEditValidator) GetSigners() []sdk.AccAddress { // GetSignBytes implements the sdk.Msg interface. func (msg MsgEditValidator) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -176,13 +172,6 @@ func (msg MsgEditValidator) ValidateBasic() error { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "empty description") } - if msg.MinSelfDelegation != nil && !msg.MinSelfDelegation.IsPositive() { - return sdkerrors.Wrap( - sdkerrors.ErrInvalidRequest, - "minimum self delegation must be a positive integer", - ) - } - if msg.CommissionRate != nil { if msg.CommissionRate.GT(sdk.OneDec()) || msg.CommissionRate.IsNegative() { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "commission rate must be between 0 and 1 (inclusive)") @@ -210,13 +199,16 @@ func (msg MsgDelegate) Type() string { return TypeMsgDelegate } // GetSigners implements the sdk.Msg interface. func (msg MsgDelegate) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } return []sdk.AccAddress{delegator} } // GetSignBytes implements the sdk.Msg interface. func (msg MsgDelegate) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -260,13 +252,16 @@ func (msg MsgBeginRedelegate) Type() string { return TypeMsgBeginRedelegate } // GetSigners implements the sdk.Msg interface func (msg MsgBeginRedelegate) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } return []sdk.AccAddress{delegator} } // GetSignBytes implements the sdk.Msg interface. func (msg MsgBeginRedelegate) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -310,13 +305,16 @@ func (msg MsgUndelegate) Type() string { return TypeMsgUndelegate } // GetSigners implements the sdk.Msg interface. func (msg MsgUndelegate) GetSigners() []sdk.AccAddress { - delegator, _ := sdk.AccAddressFromBech32(msg.DelegatorAddress) + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } return []sdk.AccAddress{delegator} } // GetSignBytes implements the sdk.Msg interface. func (msg MsgUndelegate) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) + bz := legacy.Cdc.MustMarshalJSON(&msg) return sdk.MustSortJSON(bz) } @@ -339,6 +337,101 @@ func (msg MsgUndelegate) ValidateBasic() error { return nil } +// Type implements the sdk.Msg interface. +func (msg MsgTokenizeShares) Type() string { return TypeMsgTokenizeShares } + +func (msg MsgTokenizeShares) GetSigners() []sdk.AccAddress { + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{delegator} +} + +func (msg MsgTokenizeShares) GetSignBytes() []byte { + bz := legacy.Cdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +func (msg MsgTokenizeShares) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid delegator address: %s", err) + } + if _, err := sdk.ValAddressFromBech32(msg.ValidatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) + } + if _, err := sdk.AccAddressFromBech32(msg.TokenizedShareOwner); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid tokenize share owner address: %s", err) + } + + if !msg.Amount.IsValid() || !msg.Amount.Amount.IsPositive() { + return sdkerrors.Wrap( + sdkerrors.ErrInvalidRequest, + "invalid shares amount", + ) + } + + return nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgRedeemTokensforShares) Type() string { return TypeMsgRedeemTokensforShares } + +func (msg MsgRedeemTokensforShares) GetSigners() []sdk.AccAddress { + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{delegator} +} + +func (msg MsgRedeemTokensforShares) GetSignBytes() []byte { + bz := legacy.Cdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +func (msg MsgRedeemTokensforShares) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid delegator address: %s", err) + } + + if !msg.Amount.IsValid() || !msg.Amount.Amount.IsPositive() { + return sdkerrors.Wrap( + sdkerrors.ErrInvalidRequest, + "invalid shares amount", + ) + } + + return nil +} + +// Type implements the sdk.Msg interface. +func (msg MsgTransferTokenizeShareRecord) Type() string { return TypeMsgTransferTokenizeShareRecord } + +func (msg MsgTransferTokenizeShareRecord) GetSigners() []sdk.AccAddress { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{sender} +} + +func (msg MsgTransferTokenizeShareRecord) GetSignBytes() []byte { + bz := legacy.Cdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +func (msg MsgTransferTokenizeShareRecord) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) + } + if _, err := sdk.AccAddressFromBech32(msg.NewOwner); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid new owner address: %s", err) + } + + return nil +} + // NewMsgCancelUnbondingDelegation creates a new MsgCancelUnbondingDelegation instance. //nolint:interfacer func NewMsgCancelUnbondingDelegation(delAddr sdk.AccAddress, valAddr sdk.ValAddress, creationHeight int64, amount sdk.Coin) *MsgCancelUnbondingDelegation { @@ -364,7 +457,7 @@ func (msg MsgCancelUnbondingDelegation) GetSigners() []sdk.AccAddress { // GetSignBytes implements the sdk.Msg interface. func (msg MsgCancelUnbondingDelegation) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) + return sdk.MustSortJSON(legacy.Cdc.MustMarshalJSON(&msg)) } // ValidateBasic implements the sdk.Msg interface. @@ -392,3 +485,45 @@ func (msg MsgCancelUnbondingDelegation) ValidateBasic() error { return nil } + +// NewMsgExemptDelegation creates a new MsgExemptDelegation instance. +//nolint:interfacer +func NewMsgExemptDelegation(delAddr sdk.AccAddress, valAddr sdk.ValAddress) *MsgExemptDelegation { + return &MsgExemptDelegation{ + DelegatorAddress: delAddr.String(), + ValidatorAddress: valAddr.String(), + } +} + +// Route implements the sdk.Msg interface. +func (msg MsgExemptDelegation) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgExemptDelegation) Type() string { return TypeMsgExemptDelegation } + +// GetSigners implements the sdk.Msg interface. +func (msg MsgExemptDelegation) GetSigners() []sdk.AccAddress { + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{delegator} +} + +// GetSignBytes implements the sdk.Msg interface. +func (msg MsgExemptDelegation) GetSignBytes() []byte { + bz := legacy.Cdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgExemptDelegation) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid delegator address: %s", err) + } + if _, err := sdk.ValAddressFromBech32(msg.ValidatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) + } + + return nil +} diff --git a/x/staking/types/msg_test.go b/x/staking/types/msg_test.go index f1ba552d9115..d78f6b98693d 100644 --- a/x/staking/types/msg_test.go +++ b/x/staking/types/msg_test.go @@ -37,7 +37,7 @@ func TestMsgDecode(t *testing.T) { // now let's try to serialize the whole message commission1 := types.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()) - msg, err := types.NewMsgCreateValidator(valAddr1, pk1, coinPos, types.Description{}, commission1, sdk.OneInt()) + msg, err := types.NewMsgCreateValidator(valAddr1, pk1, coinPos, types.Description{}, commission1) require.NoError(t, err) msgSerialized, err := cdc.MarshalInterface(msg) require.NoError(t, err) @@ -59,27 +59,23 @@ func TestMsgCreateValidator(t *testing.T) { tests := []struct { name, moniker, identity, website, securityContact, details string CommissionRates types.CommissionRates - minSelfDelegation sdk.Int validatorAddr sdk.ValAddress pubkey cryptotypes.PubKey bond sdk.Coin expectPass bool }{ - {"basic good", "a", "b", "c", "d", "e", commission1, sdk.OneInt(), valAddr1, pk1, coinPos, true}, - {"partial description", "", "", "c", "", "", commission1, sdk.OneInt(), valAddr1, pk1, coinPos, true}, - {"empty description", "", "", "", "", "", commission2, sdk.OneInt(), valAddr1, pk1, coinPos, false}, - {"empty address", "a", "b", "c", "d", "e", commission2, sdk.OneInt(), emptyAddr, pk1, coinPos, false}, - {"empty pubkey", "a", "b", "c", "d", "e", commission1, sdk.OneInt(), valAddr1, emptyPubkey, coinPos, false}, - {"empty bond", "a", "b", "c", "d", "e", commission2, sdk.OneInt(), valAddr1, pk1, coinZero, false}, - {"nil bond", "a", "b", "c", "d", "e", commission2, sdk.OneInt(), valAddr1, pk1, sdk.Coin{}, false}, - {"zero min self delegation", "a", "b", "c", "d", "e", commission1, sdk.ZeroInt(), valAddr1, pk1, coinPos, false}, - {"negative min self delegation", "a", "b", "c", "d", "e", commission1, sdk.NewInt(-1), valAddr1, pk1, coinPos, false}, - {"delegation less than min self delegation", "a", "b", "c", "d", "e", commission1, coinPos.Amount.Add(sdk.OneInt()), valAddr1, pk1, coinPos, false}, + {"basic good", "a", "b", "c", "d", "e", commission1, valAddr1, pk1, coinPos, true}, + {"partial description", "", "", "c", "", "", commission1, valAddr1, pk1, coinPos, true}, + {"empty description", "", "", "", "", "", commission2, valAddr1, pk1, coinPos, false}, + {"empty address", "a", "b", "c", "d", "e", commission2, emptyAddr, pk1, coinPos, false}, + {"empty pubkey", "a", "b", "c", "d", "e", commission1, valAddr1, emptyPubkey, coinPos, false}, + {"empty bond", "a", "b", "c", "d", "e", commission2, valAddr1, pk1, coinZero, false}, + {"nil bond", "a", "b", "c", "d", "e", commission2, valAddr1, pk1, sdk.Coin{}, false}, } for _, tc := range tests { description := types.NewDescription(tc.moniker, tc.identity, tc.website, tc.securityContact, tc.details) - msg, err := types.NewMsgCreateValidator(tc.validatorAddr, tc.pubkey, tc.bond, description, tc.CommissionRates, tc.minSelfDelegation) + msg, err := types.NewMsgCreateValidator(tc.validatorAddr, tc.pubkey, tc.bond, description, tc.CommissionRates) require.NoError(t, err) if tc.expectPass { require.Nil(t, msg.ValidateBasic(), "test: %v", tc.name) @@ -95,20 +91,19 @@ func TestMsgEditValidator(t *testing.T) { name, moniker, identity, website, securityContact, details string validatorAddr sdk.ValAddress expectPass bool - minSelfDelegation sdk.Int }{ - {"basic good", "a", "b", "c", "d", "e", valAddr1, true, sdk.OneInt()}, - {"partial description", "", "", "c", "", "", valAddr1, true, sdk.OneInt()}, - {"empty description", "", "", "", "", "", valAddr1, false, sdk.OneInt()}, - {"empty address", "a", "b", "c", "d", "e", emptyAddr, false, sdk.OneInt()}, - {"nil int", "a", "b", "c", "d", "e", emptyAddr, false, sdk.Int{}}, + {"basic good", "a", "b", "c", "d", "e", valAddr1, true}, + {"partial description", "", "", "c", "", "", valAddr1, true}, + {"empty description", "", "", "", "", "", valAddr1, false}, + {"empty address", "a", "b", "c", "d", "e", emptyAddr, false}, + {"nil int", "a", "b", "c", "d", "e", emptyAddr, false}, } for _, tc := range tests { description := types.NewDescription(tc.moniker, tc.identity, tc.website, tc.securityContact, tc.details) newRate := sdk.ZeroDec() - msg := types.NewMsgEditValidator(tc.validatorAddr, description, &newRate, &tc.minSelfDelegation) + msg := types.NewMsgEditValidator(tc.validatorAddr, description, &newRate) if tc.expectPass { require.Nil(t, msg.ValidateBasic(), "test: %v", tc.name) } else { diff --git a/x/staking/types/params.go b/x/staking/types/params.go index 191b66e4c809..86f3df4bbaf0 100644 --- a/x/staking/types/params.go +++ b/x/staking/types/params.go @@ -32,8 +32,12 @@ const ( DefaultHistoricalEntries uint32 = 10000 ) -// DefaultMinCommissionRate is set to 0% -var DefaultMinCommissionRate = sdk.ZeroDec() +var ( + // DefaultMinCommissionRate is set to 0% + DefaultMinCommissionRate = sdk.ZeroDec() + // DefaultExemptionFactor is set to -1 (disabled) + DefaultExemptionFactor = sdk.NewDecFromInt(sdk.NewInt(-1)) +) var ( KeyUnbondingTime = []byte("UnbondingTime") @@ -42,6 +46,7 @@ var ( KeyBondDenom = []byte("BondDenom") KeyHistoricalEntries = []byte("HistoricalEntries") KeyMinCommissionRate = []byte("MinCommissionRate") + KeyExemptionFactor = []byte("ExemptionFactor") ) var _ paramtypes.ParamSet = (*Params)(nil) @@ -52,7 +57,7 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(unbondingTime time.Duration, maxValidators, maxEntries, historicalEntries uint32, bondDenom string, minCommissionRate sdk.Dec) Params { +func NewParams(unbondingTime time.Duration, maxValidators, maxEntries, historicalEntries uint32, bondDenom string, minCommissionRate, exemptionFactor sdk.Dec) Params { return Params{ UnbondingTime: unbondingTime, MaxValidators: maxValidators, @@ -60,6 +65,7 @@ func NewParams(unbondingTime time.Duration, maxValidators, maxEntries, historica HistoricalEntries: historicalEntries, BondDenom: bondDenom, MinCommissionRate: minCommissionRate, + ExemptionFactor: exemptionFactor, } } @@ -72,6 +78,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(KeyHistoricalEntries, &p.HistoricalEntries, validateHistoricalEntries), paramtypes.NewParamSetPair(KeyBondDenom, &p.BondDenom, validateBondDenom), paramtypes.NewParamSetPair(KeyMinCommissionRate, &p.MinCommissionRate, validateMinCommissionRate), + paramtypes.NewParamSetPair(KeyExemptionFactor, &p.ExemptionFactor, validateExemptionFactor), } } @@ -84,6 +91,7 @@ func DefaultParams() Params { DefaultHistoricalEntries, sdk.DefaultBondDenom, DefaultMinCommissionRate, + DefaultExemptionFactor, ) } @@ -135,6 +143,10 @@ func (p Params) Validate() error { return err } + if err := validateExemptionFactor(p.ExemptionFactor); err != nil { + return err + } + return nil } @@ -231,3 +243,16 @@ func validateMinCommissionRate(i interface{}) error { return nil } + +func validateExemptionFactor(i interface{}) error { + v, ok := i.(sdk.Dec) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNegative() && !v.Equal(sdk.NewDec(-1)) { + return fmt.Errorf("invalid exemption factor: %s", v) + } + + return nil +} diff --git a/x/staking/types/query.pb.go b/x/staking/types/query.pb.go index 2e40de8c6f20..df42e9fa90a8 100644 --- a/x/staking/types/query.pb.go +++ b/x/staking/types/query.pb.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/staking/v1beta1/query.proto +// source: staking/v1beta1/query.proto package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -43,7 +43,7 @@ func (m *QueryValidatorsRequest) Reset() { *m = QueryValidatorsRequest{} func (m *QueryValidatorsRequest) String() string { return proto.CompactTextString(m) } func (*QueryValidatorsRequest) ProtoMessage() {} func (*QueryValidatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{0} + return fileDescriptor_b8598f616533c087, []int{0} } func (m *QueryValidatorsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -98,7 +98,7 @@ func (m *QueryValidatorsResponse) Reset() { *m = QueryValidatorsResponse func (m *QueryValidatorsResponse) String() string { return proto.CompactTextString(m) } func (*QueryValidatorsResponse) ProtoMessage() {} func (*QueryValidatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{1} + return fileDescriptor_b8598f616533c087, []int{1} } func (m *QueryValidatorsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -151,7 +151,7 @@ func (m *QueryValidatorRequest) Reset() { *m = QueryValidatorRequest{} } func (m *QueryValidatorRequest) String() string { return proto.CompactTextString(m) } func (*QueryValidatorRequest) ProtoMessage() {} func (*QueryValidatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{2} + return fileDescriptor_b8598f616533c087, []int{2} } func (m *QueryValidatorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -189,7 +189,7 @@ func (m *QueryValidatorRequest) GetValidatorAddr() string { // QueryValidatorResponse is response type for the Query/Validator RPC method type QueryValidatorResponse struct { - // validator defines the validator info. + // validator defines the the validator info. Validator Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"` } @@ -197,7 +197,7 @@ func (m *QueryValidatorResponse) Reset() { *m = QueryValidatorResponse{} func (m *QueryValidatorResponse) String() string { return proto.CompactTextString(m) } func (*QueryValidatorResponse) ProtoMessage() {} func (*QueryValidatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{3} + return fileDescriptor_b8598f616533c087, []int{3} } func (m *QueryValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -246,7 +246,7 @@ func (m *QueryValidatorDelegationsRequest) Reset() { *m = QueryValidator func (m *QueryValidatorDelegationsRequest) String() string { return proto.CompactTextString(m) } func (*QueryValidatorDelegationsRequest) ProtoMessage() {} func (*QueryValidatorDelegationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{4} + return fileDescriptor_b8598f616533c087, []int{4} } func (m *QueryValidatorDelegationsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -301,7 +301,7 @@ func (m *QueryValidatorDelegationsResponse) Reset() { *m = QueryValidato func (m *QueryValidatorDelegationsResponse) String() string { return proto.CompactTextString(m) } func (*QueryValidatorDelegationsResponse) ProtoMessage() {} func (*QueryValidatorDelegationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{5} + return fileDescriptor_b8598f616533c087, []int{5} } func (m *QueryValidatorDelegationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -361,7 +361,7 @@ func (m *QueryValidatorUnbondingDelegationsRequest) String() string { } func (*QueryValidatorUnbondingDelegationsRequest) ProtoMessage() {} func (*QueryValidatorUnbondingDelegationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{6} + return fileDescriptor_b8598f616533c087, []int{6} } func (m *QueryValidatorUnbondingDelegationsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -420,7 +420,7 @@ func (m *QueryValidatorUnbondingDelegationsResponse) String() string { } func (*QueryValidatorUnbondingDelegationsResponse) ProtoMessage() {} func (*QueryValidatorUnbondingDelegationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{7} + return fileDescriptor_b8598f616533c087, []int{7} } func (m *QueryValidatorUnbondingDelegationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -475,7 +475,7 @@ func (m *QueryDelegationRequest) Reset() { *m = QueryDelegationRequest{} func (m *QueryDelegationRequest) String() string { return proto.CompactTextString(m) } func (*QueryDelegationRequest) ProtoMessage() {} func (*QueryDelegationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{8} + return fileDescriptor_b8598f616533c087, []int{8} } func (m *QueryDelegationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -514,7 +514,7 @@ func (m *QueryDelegationResponse) Reset() { *m = QueryDelegationResponse func (m *QueryDelegationResponse) String() string { return proto.CompactTextString(m) } func (*QueryDelegationResponse) ProtoMessage() {} func (*QueryDelegationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{9} + return fileDescriptor_b8598f616533c087, []int{9} } func (m *QueryDelegationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -563,7 +563,7 @@ func (m *QueryUnbondingDelegationRequest) Reset() { *m = QueryUnbondingD func (m *QueryUnbondingDelegationRequest) String() string { return proto.CompactTextString(m) } func (*QueryUnbondingDelegationRequest) ProtoMessage() {} func (*QueryUnbondingDelegationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{10} + return fileDescriptor_b8598f616533c087, []int{10} } func (m *QueryUnbondingDelegationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -603,7 +603,7 @@ func (m *QueryUnbondingDelegationResponse) Reset() { *m = QueryUnbonding func (m *QueryUnbondingDelegationResponse) String() string { return proto.CompactTextString(m) } func (*QueryUnbondingDelegationResponse) ProtoMessage() {} func (*QueryUnbondingDelegationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{11} + return fileDescriptor_b8598f616533c087, []int{11} } func (m *QueryUnbondingDelegationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -652,7 +652,7 @@ func (m *QueryDelegatorDelegationsRequest) Reset() { *m = QueryDelegator func (m *QueryDelegatorDelegationsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorDelegationsRequest) ProtoMessage() {} func (*QueryDelegatorDelegationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{12} + return fileDescriptor_b8598f616533c087, []int{12} } func (m *QueryDelegatorDelegationsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -694,7 +694,7 @@ func (m *QueryDelegatorDelegationsResponse) Reset() { *m = QueryDelegato func (m *QueryDelegatorDelegationsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorDelegationsResponse) ProtoMessage() {} func (*QueryDelegatorDelegationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{13} + return fileDescriptor_b8598f616533c087, []int{13} } func (m *QueryDelegatorDelegationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -754,7 +754,7 @@ func (m *QueryDelegatorUnbondingDelegationsRequest) String() string { } func (*QueryDelegatorUnbondingDelegationsRequest) ProtoMessage() {} func (*QueryDelegatorUnbondingDelegationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{14} + return fileDescriptor_b8598f616533c087, []int{14} } func (m *QueryDelegatorUnbondingDelegationsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -799,7 +799,7 @@ func (m *QueryDelegatorUnbondingDelegationsResponse) String() string { } func (*QueryDelegatorUnbondingDelegationsResponse) ProtoMessage() {} func (*QueryDelegatorUnbondingDelegationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{15} + return fileDescriptor_b8598f616533c087, []int{15} } func (m *QueryDelegatorUnbondingDelegationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -859,7 +859,7 @@ func (m *QueryRedelegationsRequest) Reset() { *m = QueryRedelegationsReq func (m *QueryRedelegationsRequest) String() string { return proto.CompactTextString(m) } func (*QueryRedelegationsRequest) ProtoMessage() {} func (*QueryRedelegationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{16} + return fileDescriptor_b8598f616533c087, []int{16} } func (m *QueryRedelegationsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -900,7 +900,7 @@ func (m *QueryRedelegationsResponse) Reset() { *m = QueryRedelegationsRe func (m *QueryRedelegationsResponse) String() string { return proto.CompactTextString(m) } func (*QueryRedelegationsResponse) ProtoMessage() {} func (*QueryRedelegationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{17} + return fileDescriptor_b8598f616533c087, []int{17} } func (m *QueryRedelegationsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -956,7 +956,7 @@ func (m *QueryDelegatorValidatorsRequest) Reset() { *m = QueryDelegatorV func (m *QueryDelegatorValidatorsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorValidatorsRequest) ProtoMessage() {} func (*QueryDelegatorValidatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{18} + return fileDescriptor_b8598f616533c087, []int{18} } func (m *QueryDelegatorValidatorsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -988,7 +988,7 @@ var xxx_messageInfo_QueryDelegatorValidatorsRequest proto.InternalMessageInfo // QueryDelegatorValidatorsResponse is response type for the // Query/DelegatorValidators RPC method. type QueryDelegatorValidatorsResponse struct { - // validators defines the validators' info of a delegator. + // validators defines the the validators' info of a delegator. Validators []Validator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` @@ -998,7 +998,7 @@ func (m *QueryDelegatorValidatorsResponse) Reset() { *m = QueryDelegator func (m *QueryDelegatorValidatorsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorValidatorsResponse) ProtoMessage() {} func (*QueryDelegatorValidatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{19} + return fileDescriptor_b8598f616533c087, []int{19} } func (m *QueryDelegatorValidatorsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1054,7 +1054,7 @@ func (m *QueryDelegatorValidatorRequest) Reset() { *m = QueryDelegatorVa func (m *QueryDelegatorValidatorRequest) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorValidatorRequest) ProtoMessage() {} func (*QueryDelegatorValidatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{20} + return fileDescriptor_b8598f616533c087, []int{20} } func (m *QueryDelegatorValidatorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1086,7 +1086,7 @@ var xxx_messageInfo_QueryDelegatorValidatorRequest proto.InternalMessageInfo // QueryDelegatorValidatorResponse response type for the // Query/DelegatorValidator RPC method. type QueryDelegatorValidatorResponse struct { - // validator defines the validator info. + // validator defines the the validator info. Validator Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"` } @@ -1094,7 +1094,7 @@ func (m *QueryDelegatorValidatorResponse) Reset() { *m = QueryDelegatorV func (m *QueryDelegatorValidatorResponse) String() string { return proto.CompactTextString(m) } func (*QueryDelegatorValidatorResponse) ProtoMessage() {} func (*QueryDelegatorValidatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{21} + return fileDescriptor_b8598f616533c087, []int{21} } func (m *QueryDelegatorValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1141,7 +1141,7 @@ func (m *QueryHistoricalInfoRequest) Reset() { *m = QueryHistoricalInfoR func (m *QueryHistoricalInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryHistoricalInfoRequest) ProtoMessage() {} func (*QueryHistoricalInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{22} + return fileDescriptor_b8598f616533c087, []int{22} } func (m *QueryHistoricalInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1188,7 +1188,7 @@ func (m *QueryHistoricalInfoResponse) Reset() { *m = QueryHistoricalInfo func (m *QueryHistoricalInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryHistoricalInfoResponse) ProtoMessage() {} func (*QueryHistoricalInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{23} + return fileDescriptor_b8598f616533c087, []int{23} } func (m *QueryHistoricalInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1232,7 +1232,7 @@ func (m *QueryPoolRequest) Reset() { *m = QueryPoolRequest{} } func (m *QueryPoolRequest) String() string { return proto.CompactTextString(m) } func (*QueryPoolRequest) ProtoMessage() {} func (*QueryPoolRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{24} + return fileDescriptor_b8598f616533c087, []int{24} } func (m *QueryPoolRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1271,7 +1271,7 @@ func (m *QueryPoolResponse) Reset() { *m = QueryPoolResponse{} } func (m *QueryPoolResponse) String() string { return proto.CompactTextString(m) } func (*QueryPoolResponse) ProtoMessage() {} func (*QueryPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f270127f442bbcd8, []int{25} + return fileDescriptor_b8598f616533c087, []int{25} } func (m *QueryPoolResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1315,7 +1315,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_f270127f442bbcd8, []int{26} + return fileDescriptor_b8598f616533c087, []int{26} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1354,7 +1354,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_f270127f442bbcd8, []int{27} + return fileDescriptor_b8598f616533c087, []int{27} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1390,1087 +1390,1487 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -func init() { - proto.RegisterType((*QueryValidatorsRequest)(nil), "cosmos.staking.v1beta1.QueryValidatorsRequest") - proto.RegisterType((*QueryValidatorsResponse)(nil), "cosmos.staking.v1beta1.QueryValidatorsResponse") - proto.RegisterType((*QueryValidatorRequest)(nil), "cosmos.staking.v1beta1.QueryValidatorRequest") - proto.RegisterType((*QueryValidatorResponse)(nil), "cosmos.staking.v1beta1.QueryValidatorResponse") - proto.RegisterType((*QueryValidatorDelegationsRequest)(nil), "cosmos.staking.v1beta1.QueryValidatorDelegationsRequest") - proto.RegisterType((*QueryValidatorDelegationsResponse)(nil), "cosmos.staking.v1beta1.QueryValidatorDelegationsResponse") - proto.RegisterType((*QueryValidatorUnbondingDelegationsRequest)(nil), "cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest") - proto.RegisterType((*QueryValidatorUnbondingDelegationsResponse)(nil), "cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse") - proto.RegisterType((*QueryDelegationRequest)(nil), "cosmos.staking.v1beta1.QueryDelegationRequest") - proto.RegisterType((*QueryDelegationResponse)(nil), "cosmos.staking.v1beta1.QueryDelegationResponse") - proto.RegisterType((*QueryUnbondingDelegationRequest)(nil), "cosmos.staking.v1beta1.QueryUnbondingDelegationRequest") - proto.RegisterType((*QueryUnbondingDelegationResponse)(nil), "cosmos.staking.v1beta1.QueryUnbondingDelegationResponse") - proto.RegisterType((*QueryDelegatorDelegationsRequest)(nil), "cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest") - proto.RegisterType((*QueryDelegatorDelegationsResponse)(nil), "cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse") - proto.RegisterType((*QueryDelegatorUnbondingDelegationsRequest)(nil), "cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest") - proto.RegisterType((*QueryDelegatorUnbondingDelegationsResponse)(nil), "cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse") - proto.RegisterType((*QueryRedelegationsRequest)(nil), "cosmos.staking.v1beta1.QueryRedelegationsRequest") - proto.RegisterType((*QueryRedelegationsResponse)(nil), "cosmos.staking.v1beta1.QueryRedelegationsResponse") - proto.RegisterType((*QueryDelegatorValidatorsRequest)(nil), "cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest") - proto.RegisterType((*QueryDelegatorValidatorsResponse)(nil), "cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse") - proto.RegisterType((*QueryDelegatorValidatorRequest)(nil), "cosmos.staking.v1beta1.QueryDelegatorValidatorRequest") - proto.RegisterType((*QueryDelegatorValidatorResponse)(nil), "cosmos.staking.v1beta1.QueryDelegatorValidatorResponse") - proto.RegisterType((*QueryHistoricalInfoRequest)(nil), "cosmos.staking.v1beta1.QueryHistoricalInfoRequest") - proto.RegisterType((*QueryHistoricalInfoResponse)(nil), "cosmos.staking.v1beta1.QueryHistoricalInfoResponse") - proto.RegisterType((*QueryPoolRequest)(nil), "cosmos.staking.v1beta1.QueryPoolRequest") - proto.RegisterType((*QueryPoolResponse)(nil), "cosmos.staking.v1beta1.QueryPoolResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.staking.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.staking.v1beta1.QueryParamsResponse") +type QueryTokenizeShareRecordByIdRequest struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func init() { - proto.RegisterFile("cosmos/staking/v1beta1/query.proto", fileDescriptor_f270127f442bbcd8) -} - -var fileDescriptor_f270127f442bbcd8 = []byte{ - // 1340 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcb, 0x6f, 0x1b, 0x55, - 0x17, 0xf7, 0x4d, 0xf3, 0x45, 0x5f, 0x4f, 0xd5, 0xaa, 0x5c, 0xbb, 0x21, 0x9d, 0x16, 0x3b, 0x1d, - 0x55, 0x21, 0x4d, 0x1b, 0x0f, 0x49, 0x4a, 0x1a, 0x4a, 0x45, 0x49, 0x28, 0x29, 0x51, 0x17, 0x24, - 0xae, 0x08, 0x05, 0x16, 0xd6, 0xd8, 0x33, 0x1d, 0x8f, 0xea, 0xcc, 0xb8, 0x73, 0x27, 0x51, 0x4b, - 0x94, 0x05, 0xac, 0x60, 0x87, 0xc4, 0x8a, 0x5d, 0x17, 0x48, 0x48, 0x3c, 0x56, 0x84, 0x6d, 0x25, - 0x56, 0x94, 0x5d, 0x78, 0x2c, 0x60, 0x53, 0x50, 0xc2, 0xa2, 0xe2, 0x1f, 0x40, 0xec, 0x90, 0xef, - 0x9c, 0x19, 0x8f, 0x33, 0x4f, 0x3b, 0x8e, 0x94, 0xae, 0x1a, 0x5f, 0x9f, 0xc7, 0xef, 0x77, 0x1e, - 0xf7, 0x9e, 0xe3, 0x82, 0x58, 0x35, 0xd9, 0x8a, 0xc9, 0x24, 0x66, 0xcb, 0x77, 0x74, 0x43, 0x93, - 0xd6, 0x26,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 0xe9, 0x68, 0xac, 0x5f, 0xdf, 0x1c, 0x2b, 0x9c, 0x4b, 0x21, 0x89, 0xb8, 0xce, - 0x72, 0x5c, 0x79, 0x7a, 0x3a, 0x0a, 0x57, 0x73, 0x96, 0xa5, 0x1f, 0x13, 0x18, 0x70, 0x26, 0x4f, - 0x3a, 0x16, 0x6f, 0xdb, 0x3f, 0xec, 0x0a, 0xe7, 0x53, 0xc9, 0x22, 0x92, 0x11, 0x8e, 0x64, 0x98, - 0xe6, 0x23, 0x91, 0x38, 0xa3, 0xef, 0xfc, 0xa3, 0xed, 0x3c, 0xd9, 0xda, 0xce, 0x93, 0x3f, 0xb7, - 0xf3, 0xe4, 0x93, 0x9d, 0x7c, 0x66, 0x6b, 0x27, 0x9f, 0xf9, 0x6d, 0x27, 0x9f, 0x79, 0xf7, 0x82, - 0xa6, 0xdb, 0xb5, 0xd5, 0x4a, 0xb1, 0x6a, 0xae, 0xb8, 0x36, 0x9c, 0x7f, 0xc6, 0x99, 0x72, 0x47, - 0xba, 0xe7, 0x19, 0xb4, 0xef, 0x37, 0x54, 0x56, 0x19, 0xe0, 0xff, 0x53, 0x37, 0xf5, 0x5f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xbf, 0x31, 0x66, 0xa3, 0x88, 0x1c, 0x00, 0x00, +func (m *QueryTokenizeShareRecordByIdRequest) Reset() { *m = QueryTokenizeShareRecordByIdRequest{} } +func (m *QueryTokenizeShareRecordByIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordByIdRequest) ProtoMessage() {} +func (*QueryTokenizeShareRecordByIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{28} +} +func (m *QueryTokenizeShareRecordByIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordByIdRequest.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 *QueryTokenizeShareRecordByIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordByIdRequest.Merge(m, src) +} +func (m *QueryTokenizeShareRecordByIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordByIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordByIdRequest.DiscardUnknown(m) } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +var xxx_messageInfo_QueryTokenizeShareRecordByIdRequest proto.InternalMessageInfo -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Validators queries all validators that match the given status. - Validators(ctx context.Context, in *QueryValidatorsRequest, opts ...grpc.CallOption) (*QueryValidatorsResponse, error) - // Validator queries validator info for given validator address. - Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) - // ValidatorDelegations queries delegate info for given validator. - ValidatorDelegations(ctx context.Context, in *QueryValidatorDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorDelegationsResponse, error) - // ValidatorUnbondingDelegations queries unbonding delegations of a validator. - ValidatorUnbondingDelegations(ctx context.Context, in *QueryValidatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorUnbondingDelegationsResponse, error) - // Delegation queries delegate info for given validator delegator pair. - Delegation(ctx context.Context, in *QueryDelegationRequest, opts ...grpc.CallOption) (*QueryDelegationResponse, error) - // UnbondingDelegation queries unbonding info for given validator delegator - // pair. - UnbondingDelegation(ctx context.Context, in *QueryUnbondingDelegationRequest, opts ...grpc.CallOption) (*QueryUnbondingDelegationResponse, error) - // DelegatorDelegations queries all delegations of a given delegator address. - DelegatorDelegations(ctx context.Context, in *QueryDelegatorDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorDelegationsResponse, error) - // DelegatorUnbondingDelegations queries all unbonding delegations of a given - // delegator address. - DelegatorUnbondingDelegations(ctx context.Context, in *QueryDelegatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorUnbondingDelegationsResponse, error) - // Redelegations queries redelegations of given address. - Redelegations(ctx context.Context, in *QueryRedelegationsRequest, opts ...grpc.CallOption) (*QueryRedelegationsResponse, error) - // DelegatorValidators queries all validators info for given delegator - // address. - DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) - // DelegatorValidator queries validator info for given delegator validator - // pair. - DelegatorValidator(ctx context.Context, in *QueryDelegatorValidatorRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorResponse, error) - // HistoricalInfo queries the historical info for given height. - HistoricalInfo(ctx context.Context, in *QueryHistoricalInfoRequest, opts ...grpc.CallOption) (*QueryHistoricalInfoResponse, error) - // Pool queries the pool info. - Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) - // Parameters queries the staking parameters. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +func (m *QueryTokenizeShareRecordByIdRequest) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 } -type queryClient struct { - cc grpc1.ClientConn +type QueryTokenizeShareRecordByIdResponse struct { + Record TokenizeShareRecord `protobuf:"bytes,1,opt,name=record,proto3" json:"record"` } -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} +func (m *QueryTokenizeShareRecordByIdResponse) Reset() { *m = QueryTokenizeShareRecordByIdResponse{} } +func (m *QueryTokenizeShareRecordByIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordByIdResponse) ProtoMessage() {} +func (*QueryTokenizeShareRecordByIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{29} } - -func (c *queryClient) Validators(ctx context.Context, in *QueryValidatorsRequest, opts ...grpc.CallOption) (*QueryValidatorsResponse, error) { - out := new(QueryValidatorsResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/Validators", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryTokenizeShareRecordByIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordByIdResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryTokenizeShareRecordByIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordByIdResponse.Merge(m, src) +} +func (m *QueryTokenizeShareRecordByIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordByIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordByIdResponse.DiscardUnknown(m) } -func (c *queryClient) Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) { - out := new(QueryValidatorResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/Validator", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryTokenizeShareRecordByIdResponse proto.InternalMessageInfo + +func (m *QueryTokenizeShareRecordByIdResponse) GetRecord() TokenizeShareRecord { + if m != nil { + return m.Record } - return out, nil + return TokenizeShareRecord{} } -func (c *queryClient) ValidatorDelegations(ctx context.Context, in *QueryValidatorDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorDelegationsResponse, error) { - out := new(QueryValidatorDelegationsResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/ValidatorDelegations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type QueryTokenizeShareRecordByDenomRequest struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` } -func (c *queryClient) ValidatorUnbondingDelegations(ctx context.Context, in *QueryValidatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorUnbondingDelegationsResponse, error) { - out := new(QueryValidatorUnbondingDelegationsResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryTokenizeShareRecordByDenomRequest) Reset() { + *m = QueryTokenizeShareRecordByDenomRequest{} +} +func (m *QueryTokenizeShareRecordByDenomRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordByDenomRequest) ProtoMessage() {} +func (*QueryTokenizeShareRecordByDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{30} +} +func (m *QueryTokenizeShareRecordByDenomRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordByDenomRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryTokenizeShareRecordByDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordByDenomRequest.Merge(m, src) +} +func (m *QueryTokenizeShareRecordByDenomRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordByDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordByDenomRequest.DiscardUnknown(m) } -func (c *queryClient) Delegation(ctx context.Context, in *QueryDelegationRequest, opts ...grpc.CallOption) (*QueryDelegationResponse, error) { - out := new(QueryDelegationResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/Delegation", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryTokenizeShareRecordByDenomRequest proto.InternalMessageInfo + +func (m *QueryTokenizeShareRecordByDenomRequest) GetDenom() string { + if m != nil { + return m.Denom } - return out, nil + return "" } -func (c *queryClient) UnbondingDelegation(ctx context.Context, in *QueryUnbondingDelegationRequest, opts ...grpc.CallOption) (*QueryUnbondingDelegationResponse, error) { - out := new(QueryUnbondingDelegationResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/UnbondingDelegation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type QueryTokenizeShareRecordByDenomResponse struct { + Record TokenizeShareRecord `protobuf:"bytes,1,opt,name=record,proto3" json:"record"` } -func (c *queryClient) DelegatorDelegations(ctx context.Context, in *QueryDelegatorDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorDelegationsResponse, error) { - out := new(QueryDelegatorDelegationsResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/DelegatorDelegations", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryTokenizeShareRecordByDenomResponse) Reset() { + *m = QueryTokenizeShareRecordByDenomResponse{} +} +func (m *QueryTokenizeShareRecordByDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordByDenomResponse) ProtoMessage() {} +func (*QueryTokenizeShareRecordByDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{31} +} +func (m *QueryTokenizeShareRecordByDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordByDenomResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryTokenizeShareRecordByDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordByDenomResponse.Merge(m, src) +} +func (m *QueryTokenizeShareRecordByDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordByDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordByDenomResponse.DiscardUnknown(m) } -func (c *queryClient) DelegatorUnbondingDelegations(ctx context.Context, in *QueryDelegatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorUnbondingDelegationsResponse, error) { - out := new(QueryDelegatorUnbondingDelegationsResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryTokenizeShareRecordByDenomResponse proto.InternalMessageInfo + +func (m *QueryTokenizeShareRecordByDenomResponse) GetRecord() TokenizeShareRecord { + if m != nil { + return m.Record } - return out, nil + return TokenizeShareRecord{} } -func (c *queryClient) Redelegations(ctx context.Context, in *QueryRedelegationsRequest, opts ...grpc.CallOption) (*QueryRedelegationsResponse, error) { - out := new(QueryRedelegationsResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/Redelegations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +type QueryTokenizeShareRecordsOwnedRequest struct { + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` } -func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) { - out := new(QueryDelegatorValidatorsResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/DelegatorValidators", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryTokenizeShareRecordsOwnedRequest) Reset() { *m = QueryTokenizeShareRecordsOwnedRequest{} } +func (m *QueryTokenizeShareRecordsOwnedRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordsOwnedRequest) ProtoMessage() {} +func (*QueryTokenizeShareRecordsOwnedRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{32} +} +func (m *QueryTokenizeShareRecordsOwnedRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordsOwnedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordsOwnedRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryTokenizeShareRecordsOwnedRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordsOwnedRequest.Merge(m, src) +} +func (m *QueryTokenizeShareRecordsOwnedRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordsOwnedRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordsOwnedRequest.DiscardUnknown(m) } -func (c *queryClient) DelegatorValidator(ctx context.Context, in *QueryDelegatorValidatorRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorResponse, error) { - out := new(QueryDelegatorValidatorResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/DelegatorValidator", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryTokenizeShareRecordsOwnedRequest proto.InternalMessageInfo + +func (m *QueryTokenizeShareRecordsOwnedRequest) GetOwner() string { + if m != nil { + return m.Owner } - return out, nil + return "" } -func (c *queryClient) HistoricalInfo(ctx context.Context, in *QueryHistoricalInfoRequest, opts ...grpc.CallOption) (*QueryHistoricalInfoResponse, error) { - out := new(QueryHistoricalInfoResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/HistoricalInfo", in, out, opts...) - if err != nil { - return nil, err +type QueryTokenizeShareRecordsOwnedResponse struct { + Records []TokenizeShareRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records"` +} + +func (m *QueryTokenizeShareRecordsOwnedResponse) Reset() { + *m = QueryTokenizeShareRecordsOwnedResponse{} +} +func (m *QueryTokenizeShareRecordsOwnedResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordsOwnedResponse) ProtoMessage() {} +func (*QueryTokenizeShareRecordsOwnedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{33} +} +func (m *QueryTokenizeShareRecordsOwnedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordsOwnedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordsOwnedResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryTokenizeShareRecordsOwnedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordsOwnedResponse.Merge(m, src) +} +func (m *QueryTokenizeShareRecordsOwnedResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordsOwnedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordsOwnedResponse.DiscardUnknown(m) } -func (c *queryClient) Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) { - out := new(QueryPoolResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/Pool", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryTokenizeShareRecordsOwnedResponse proto.InternalMessageInfo + +func (m *QueryTokenizeShareRecordsOwnedResponse) GetRecords() []TokenizeShareRecord { + if m != nil { + return m.Records } - return out, nil + return nil } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err +type QueryAllTokenizeShareRecordsRequest struct { +} + +func (m *QueryAllTokenizeShareRecordsRequest) Reset() { *m = QueryAllTokenizeShareRecordsRequest{} } +func (m *QueryAllTokenizeShareRecordsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllTokenizeShareRecordsRequest) ProtoMessage() {} +func (*QueryAllTokenizeShareRecordsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{34} +} +func (m *QueryAllTokenizeShareRecordsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllTokenizeShareRecordsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllTokenizeShareRecordsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryAllTokenizeShareRecordsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllTokenizeShareRecordsRequest.Merge(m, src) +} +func (m *QueryAllTokenizeShareRecordsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllTokenizeShareRecordsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllTokenizeShareRecordsRequest.DiscardUnknown(m) } -// QueryServer is the server API for Query service. -type QueryServer interface { - // Validators queries all validators that match the given status. - Validators(context.Context, *QueryValidatorsRequest) (*QueryValidatorsResponse, error) - // Validator queries validator info for given validator address. - Validator(context.Context, *QueryValidatorRequest) (*QueryValidatorResponse, error) - // ValidatorDelegations queries delegate info for given validator. - ValidatorDelegations(context.Context, *QueryValidatorDelegationsRequest) (*QueryValidatorDelegationsResponse, error) - // ValidatorUnbondingDelegations queries unbonding delegations of a validator. - ValidatorUnbondingDelegations(context.Context, *QueryValidatorUnbondingDelegationsRequest) (*QueryValidatorUnbondingDelegationsResponse, error) - // Delegation queries delegate info for given validator delegator pair. - Delegation(context.Context, *QueryDelegationRequest) (*QueryDelegationResponse, error) - // UnbondingDelegation queries unbonding info for given validator delegator - // pair. - UnbondingDelegation(context.Context, *QueryUnbondingDelegationRequest) (*QueryUnbondingDelegationResponse, error) - // DelegatorDelegations queries all delegations of a given delegator address. - DelegatorDelegations(context.Context, *QueryDelegatorDelegationsRequest) (*QueryDelegatorDelegationsResponse, error) - // DelegatorUnbondingDelegations queries all unbonding delegations of a given - // delegator address. - DelegatorUnbondingDelegations(context.Context, *QueryDelegatorUnbondingDelegationsRequest) (*QueryDelegatorUnbondingDelegationsResponse, error) - // Redelegations queries redelegations of given address. - Redelegations(context.Context, *QueryRedelegationsRequest) (*QueryRedelegationsResponse, error) - // DelegatorValidators queries all validators info for given delegator - // address. - DelegatorValidators(context.Context, *QueryDelegatorValidatorsRequest) (*QueryDelegatorValidatorsResponse, error) - // DelegatorValidator queries validator info for given delegator validator - // pair. - DelegatorValidator(context.Context, *QueryDelegatorValidatorRequest) (*QueryDelegatorValidatorResponse, error) - // HistoricalInfo queries the historical info for given height. - HistoricalInfo(context.Context, *QueryHistoricalInfoRequest) (*QueryHistoricalInfoResponse, error) - // Pool queries the pool info. - Pool(context.Context, *QueryPoolRequest) (*QueryPoolResponse, error) - // Parameters queries the staking parameters. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) -} +var xxx_messageInfo_QueryAllTokenizeShareRecordsRequest proto.InternalMessageInfo -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { +type QueryAllTokenizeShareRecordsResponse struct { + Records []TokenizeShareRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records"` } -func (*UnimplementedQueryServer) Validators(ctx context.Context, req *QueryValidatorsRequest) (*QueryValidatorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") +func (m *QueryAllTokenizeShareRecordsResponse) Reset() { *m = QueryAllTokenizeShareRecordsResponse{} } +func (m *QueryAllTokenizeShareRecordsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllTokenizeShareRecordsResponse) ProtoMessage() {} +func (*QueryAllTokenizeShareRecordsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{35} } -func (*UnimplementedQueryServer) Validator(ctx context.Context, req *QueryValidatorRequest) (*QueryValidatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Validator not implemented") +func (m *QueryAllTokenizeShareRecordsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedQueryServer) ValidatorDelegations(ctx context.Context, req *QueryValidatorDelegationsRequest) (*QueryValidatorDelegationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorDelegations not implemented") +func (m *QueryAllTokenizeShareRecordsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllTokenizeShareRecordsResponse.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 (*UnimplementedQueryServer) ValidatorUnbondingDelegations(ctx context.Context, req *QueryValidatorUnbondingDelegationsRequest) (*QueryValidatorUnbondingDelegationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorUnbondingDelegations not implemented") +func (m *QueryAllTokenizeShareRecordsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllTokenizeShareRecordsResponse.Merge(m, src) } -func (*UnimplementedQueryServer) Delegation(ctx context.Context, req *QueryDelegationRequest) (*QueryDelegationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delegation not implemented") +func (m *QueryAllTokenizeShareRecordsResponse) XXX_Size() int { + return m.Size() } -func (*UnimplementedQueryServer) UnbondingDelegation(ctx context.Context, req *QueryUnbondingDelegationRequest) (*QueryUnbondingDelegationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UnbondingDelegation not implemented") +func (m *QueryAllTokenizeShareRecordsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllTokenizeShareRecordsResponse.DiscardUnknown(m) } -func (*UnimplementedQueryServer) DelegatorDelegations(ctx context.Context, req *QueryDelegatorDelegationsRequest) (*QueryDelegatorDelegationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegatorDelegations not implemented") + +var xxx_messageInfo_QueryAllTokenizeShareRecordsResponse proto.InternalMessageInfo + +func (m *QueryAllTokenizeShareRecordsResponse) GetRecords() []TokenizeShareRecord { + if m != nil { + return m.Records + } + return nil } -func (*UnimplementedQueryServer) DelegatorUnbondingDelegations(ctx context.Context, req *QueryDelegatorUnbondingDelegationsRequest) (*QueryDelegatorUnbondingDelegationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegatorUnbondingDelegations not implemented") + +type QueryLastTokenizeShareRecordIdRequest struct { } -func (*UnimplementedQueryServer) Redelegations(ctx context.Context, req *QueryRedelegationsRequest) (*QueryRedelegationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Redelegations not implemented") + +func (m *QueryLastTokenizeShareRecordIdRequest) Reset() { *m = QueryLastTokenizeShareRecordIdRequest{} } +func (m *QueryLastTokenizeShareRecordIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLastTokenizeShareRecordIdRequest) ProtoMessage() {} +func (*QueryLastTokenizeShareRecordIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{36} } -func (*UnimplementedQueryServer) DelegatorValidators(ctx context.Context, req *QueryDelegatorValidatorsRequest) (*QueryDelegatorValidatorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegatorValidators not implemented") +func (m *QueryLastTokenizeShareRecordIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedQueryServer) DelegatorValidator(ctx context.Context, req *QueryDelegatorValidatorRequest) (*QueryDelegatorValidatorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegatorValidator not implemented") +func (m *QueryLastTokenizeShareRecordIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLastTokenizeShareRecordIdRequest.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 (*UnimplementedQueryServer) HistoricalInfo(ctx context.Context, req *QueryHistoricalInfoRequest) (*QueryHistoricalInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method HistoricalInfo not implemented") +func (m *QueryLastTokenizeShareRecordIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLastTokenizeShareRecordIdRequest.Merge(m, src) } -func (*UnimplementedQueryServer) Pool(ctx context.Context, req *QueryPoolRequest) (*QueryPoolResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Pool not implemented") +func (m *QueryLastTokenizeShareRecordIdRequest) XXX_Size() int { + return m.Size() } -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +func (m *QueryLastTokenizeShareRecordIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLastTokenizeShareRecordIdRequest.DiscardUnknown(m) } -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) +var xxx_messageInfo_QueryLastTokenizeShareRecordIdRequest proto.InternalMessageInfo + +type QueryLastTokenizeShareRecordIdResponse struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func _Query_Validators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryValidatorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Validators(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/Validators", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Validators(ctx, req.(*QueryValidatorsRequest)) +func (m *QueryLastTokenizeShareRecordIdResponse) Reset() { + *m = QueryLastTokenizeShareRecordIdResponse{} +} +func (m *QueryLastTokenizeShareRecordIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLastTokenizeShareRecordIdResponse) ProtoMessage() {} +func (*QueryLastTokenizeShareRecordIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{37} +} +func (m *QueryLastTokenizeShareRecordIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLastTokenizeShareRecordIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLastTokenizeShareRecordIdResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *QueryLastTokenizeShareRecordIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLastTokenizeShareRecordIdResponse.Merge(m, src) +} +func (m *QueryLastTokenizeShareRecordIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLastTokenizeShareRecordIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLastTokenizeShareRecordIdResponse.DiscardUnknown(m) } -func _Query_Validator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryValidatorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Validator(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/Validator", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Validator(ctx, req.(*QueryValidatorRequest)) +var xxx_messageInfo_QueryLastTokenizeShareRecordIdResponse proto.InternalMessageInfo + +func (m *QueryLastTokenizeShareRecordIdResponse) GetId() uint64 { + if m != nil { + return m.Id } - return interceptor(ctx, in, info, handler) + return 0 } -func _Query_ValidatorDelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryValidatorDelegationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ValidatorDelegations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/ValidatorDelegations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ValidatorDelegations(ctx, req.(*QueryValidatorDelegationsRequest)) - } - return interceptor(ctx, in, info, handler) +type QueryTotalTokenizeSharedAssetsRequest struct { } -func _Query_ValidatorUnbondingDelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryValidatorUnbondingDelegationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ValidatorUnbondingDelegations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ValidatorUnbondingDelegations(ctx, req.(*QueryValidatorUnbondingDelegationsRequest)) +func (m *QueryTotalTokenizeSharedAssetsRequest) Reset() { *m = QueryTotalTokenizeSharedAssetsRequest{} } +func (m *QueryTotalTokenizeSharedAssetsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalTokenizeSharedAssetsRequest) ProtoMessage() {} +func (*QueryTotalTokenizeSharedAssetsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{38} +} +func (m *QueryTotalTokenizeSharedAssetsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalTokenizeSharedAssetsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalTokenizeSharedAssetsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *QueryTotalTokenizeSharedAssetsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalTokenizeSharedAssetsRequest.Merge(m, src) +} +func (m *QueryTotalTokenizeSharedAssetsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalTokenizeSharedAssetsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalTokenizeSharedAssetsRequest.DiscardUnknown(m) } -func _Query_Delegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDelegationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Delegation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/Delegation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Delegation(ctx, req.(*QueryDelegationRequest)) - } - return interceptor(ctx, in, info, handler) +var xxx_messageInfo_QueryTotalTokenizeSharedAssetsRequest proto.InternalMessageInfo + +type QueryTotalTokenizeSharedAssetsResponse struct { + Value types.Coin `protobuf:"bytes,1,opt,name=value,proto3" json:"value"` } -func _Query_UnbondingDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryUnbondingDelegationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).UnbondingDelegation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/UnbondingDelegation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).UnbondingDelegation(ctx, req.(*QueryUnbondingDelegationRequest)) +func (m *QueryTotalTokenizeSharedAssetsResponse) Reset() { + *m = QueryTotalTokenizeSharedAssetsResponse{} +} +func (m *QueryTotalTokenizeSharedAssetsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalTokenizeSharedAssetsResponse) ProtoMessage() {} +func (*QueryTotalTokenizeSharedAssetsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b8598f616533c087, []int{39} +} +func (m *QueryTotalTokenizeSharedAssetsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalTokenizeSharedAssetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalTokenizeSharedAssetsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *QueryTotalTokenizeSharedAssetsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalTokenizeSharedAssetsResponse.Merge(m, src) +} +func (m *QueryTotalTokenizeSharedAssetsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalTokenizeSharedAssetsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalTokenizeSharedAssetsResponse.DiscardUnknown(m) } -func _Query_DelegatorDelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDelegatorDelegationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DelegatorDelegations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/DelegatorDelegations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DelegatorDelegations(ctx, req.(*QueryDelegatorDelegationsRequest)) +var xxx_messageInfo_QueryTotalTokenizeSharedAssetsResponse proto.InternalMessageInfo + +func (m *QueryTotalTokenizeSharedAssetsResponse) GetValue() types.Coin { + if m != nil { + return m.Value } - return interceptor(ctx, in, info, handler) + return types.Coin{} } -func _Query_DelegatorUnbondingDelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDelegatorUnbondingDelegationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DelegatorUnbondingDelegations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DelegatorUnbondingDelegations(ctx, req.(*QueryDelegatorUnbondingDelegationsRequest)) - } - return interceptor(ctx, in, info, handler) +func init() { + proto.RegisterType((*QueryValidatorsRequest)(nil), "liquidstaking.staking.v1beta1.QueryValidatorsRequest") + proto.RegisterType((*QueryValidatorsResponse)(nil), "liquidstaking.staking.v1beta1.QueryValidatorsResponse") + proto.RegisterType((*QueryValidatorRequest)(nil), "liquidstaking.staking.v1beta1.QueryValidatorRequest") + proto.RegisterType((*QueryValidatorResponse)(nil), "liquidstaking.staking.v1beta1.QueryValidatorResponse") + proto.RegisterType((*QueryValidatorDelegationsRequest)(nil), "liquidstaking.staking.v1beta1.QueryValidatorDelegationsRequest") + proto.RegisterType((*QueryValidatorDelegationsResponse)(nil), "liquidstaking.staking.v1beta1.QueryValidatorDelegationsResponse") + proto.RegisterType((*QueryValidatorUnbondingDelegationsRequest)(nil), "liquidstaking.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest") + proto.RegisterType((*QueryValidatorUnbondingDelegationsResponse)(nil), "liquidstaking.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse") + proto.RegisterType((*QueryDelegationRequest)(nil), "liquidstaking.staking.v1beta1.QueryDelegationRequest") + proto.RegisterType((*QueryDelegationResponse)(nil), "liquidstaking.staking.v1beta1.QueryDelegationResponse") + proto.RegisterType((*QueryUnbondingDelegationRequest)(nil), "liquidstaking.staking.v1beta1.QueryUnbondingDelegationRequest") + proto.RegisterType((*QueryUnbondingDelegationResponse)(nil), "liquidstaking.staking.v1beta1.QueryUnbondingDelegationResponse") + proto.RegisterType((*QueryDelegatorDelegationsRequest)(nil), "liquidstaking.staking.v1beta1.QueryDelegatorDelegationsRequest") + proto.RegisterType((*QueryDelegatorDelegationsResponse)(nil), "liquidstaking.staking.v1beta1.QueryDelegatorDelegationsResponse") + proto.RegisterType((*QueryDelegatorUnbondingDelegationsRequest)(nil), "liquidstaking.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest") + proto.RegisterType((*QueryDelegatorUnbondingDelegationsResponse)(nil), "liquidstaking.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse") + proto.RegisterType((*QueryRedelegationsRequest)(nil), "liquidstaking.staking.v1beta1.QueryRedelegationsRequest") + proto.RegisterType((*QueryRedelegationsResponse)(nil), "liquidstaking.staking.v1beta1.QueryRedelegationsResponse") + proto.RegisterType((*QueryDelegatorValidatorsRequest)(nil), "liquidstaking.staking.v1beta1.QueryDelegatorValidatorsRequest") + proto.RegisterType((*QueryDelegatorValidatorsResponse)(nil), "liquidstaking.staking.v1beta1.QueryDelegatorValidatorsResponse") + proto.RegisterType((*QueryDelegatorValidatorRequest)(nil), "liquidstaking.staking.v1beta1.QueryDelegatorValidatorRequest") + proto.RegisterType((*QueryDelegatorValidatorResponse)(nil), "liquidstaking.staking.v1beta1.QueryDelegatorValidatorResponse") + proto.RegisterType((*QueryHistoricalInfoRequest)(nil), "liquidstaking.staking.v1beta1.QueryHistoricalInfoRequest") + proto.RegisterType((*QueryHistoricalInfoResponse)(nil), "liquidstaking.staking.v1beta1.QueryHistoricalInfoResponse") + proto.RegisterType((*QueryPoolRequest)(nil), "liquidstaking.staking.v1beta1.QueryPoolRequest") + proto.RegisterType((*QueryPoolResponse)(nil), "liquidstaking.staking.v1beta1.QueryPoolResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "liquidstaking.staking.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "liquidstaking.staking.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryTokenizeShareRecordByIdRequest)(nil), "liquidstaking.staking.v1beta1.QueryTokenizeShareRecordByIdRequest") + proto.RegisterType((*QueryTokenizeShareRecordByIdResponse)(nil), "liquidstaking.staking.v1beta1.QueryTokenizeShareRecordByIdResponse") + proto.RegisterType((*QueryTokenizeShareRecordByDenomRequest)(nil), "liquidstaking.staking.v1beta1.QueryTokenizeShareRecordByDenomRequest") + proto.RegisterType((*QueryTokenizeShareRecordByDenomResponse)(nil), "liquidstaking.staking.v1beta1.QueryTokenizeShareRecordByDenomResponse") + proto.RegisterType((*QueryTokenizeShareRecordsOwnedRequest)(nil), "liquidstaking.staking.v1beta1.QueryTokenizeShareRecordsOwnedRequest") + proto.RegisterType((*QueryTokenizeShareRecordsOwnedResponse)(nil), "liquidstaking.staking.v1beta1.QueryTokenizeShareRecordsOwnedResponse") + proto.RegisterType((*QueryAllTokenizeShareRecordsRequest)(nil), "liquidstaking.staking.v1beta1.QueryAllTokenizeShareRecordsRequest") + proto.RegisterType((*QueryAllTokenizeShareRecordsResponse)(nil), "liquidstaking.staking.v1beta1.QueryAllTokenizeShareRecordsResponse") + proto.RegisterType((*QueryLastTokenizeShareRecordIdRequest)(nil), "liquidstaking.staking.v1beta1.QueryLastTokenizeShareRecordIdRequest") + proto.RegisterType((*QueryLastTokenizeShareRecordIdResponse)(nil), "liquidstaking.staking.v1beta1.QueryLastTokenizeShareRecordIdResponse") + proto.RegisterType((*QueryTotalTokenizeSharedAssetsRequest)(nil), "liquidstaking.staking.v1beta1.QueryTotalTokenizeSharedAssetsRequest") + proto.RegisterType((*QueryTotalTokenizeSharedAssetsResponse)(nil), "liquidstaking.staking.v1beta1.QueryTotalTokenizeSharedAssetsResponse") +} + +func init() { proto.RegisterFile("staking/v1beta1/query.proto", fileDescriptor_b8598f616533c087) } + +var fileDescriptor_b8598f616533c087 = []byte{ + // 1666 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5a, 0xcb, 0x6f, 0xd4, 0x56, + 0x17, 0x9f, 0x1b, 0x42, 0xbe, 0x8f, 0x83, 0x40, 0x7c, 0x37, 0xe1, 0x65, 0x60, 0x92, 0xcf, 0x10, + 0x92, 0x22, 0x18, 0x93, 0x40, 0x10, 0xa5, 0x25, 0x21, 0x0f, 0x1e, 0x51, 0x51, 0x09, 0xd3, 0x96, + 0xb6, 0x6c, 0x52, 0x67, 0x6c, 0x26, 0x2e, 0x13, 0xdf, 0x89, 0xed, 0x81, 0x84, 0x34, 0x8b, 0x56, + 0xaa, 0xda, 0x5d, 0x5b, 0x75, 0x51, 0xa9, 0xdd, 0xb0, 0x40, 0xaa, 0x84, 0xd4, 0x4d, 0xab, 0xae, + 0xba, 0xea, 0x8e, 0x5d, 0x91, 0xaa, 0x0a, 0x56, 0x14, 0x85, 0x2e, 0xba, 0xe8, 0x82, 0x3f, 0xa1, + 0x9a, 0xeb, 0x63, 0xc7, 0x1e, 0x3f, 0xc7, 0x99, 0x11, 0x62, 0x45, 0xec, 0xb9, 0xe7, 0x9c, 0xdf, + 0xef, 0x3c, 0xae, 0xef, 0xef, 0x0a, 0xd8, 0x67, 0x5a, 0xf2, 0x4d, 0x4d, 0x2f, 0x4b, 0xb7, 0x86, + 0x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f5, 0xad, 0x79, 0xd9, 0x50, 0x8b, 0x6a, 0x89, 0x19, 0xca, 0xc4, 0xf2, + 0xb4, 0xe2, 0xa4, 0x7e, 0x3b, 0x74, 0x68, 0xf6, 0xe1, 0xa7, 0xb3, 0xd8, 0xa1, 0x29, 0xe2, 0x12, + 0x1c, 0x8a, 0x37, 0x5b, 0x3f, 0x38, 0x19, 0xfc, 0x6d, 0xca, 0x83, 0x53, 0x98, 0x3f, 0x04, 0x6c, + 0xfb, 0x11, 0x47, 0xe1, 0x70, 0x74, 0xe4, 0x29, 0x55, 0x67, 0x0b, 0x0e, 0xe6, 0x1e, 0xd8, 0xac, + 0xd4, 0x9f, 0x71, 0x18, 0xec, 0x07, 0x71, 0x05, 0x06, 0x12, 0xed, 0xdb, 0x06, 0xfe, 0x2c, 0xf4, + 0x47, 0x05, 0x37, 0xaf, 0xdc, 0xd6, 0x55, 0xc5, 0x83, 0x9d, 0xdd, 0xd6, 0x55, 0x67, 0x90, 0xed, + 0x07, 0xf1, 0xa3, 0x68, 0xee, 0x8e, 0x39, 0x42, 0x2f, 0xc2, 0x7f, 0xec, 0x90, 0x69, 0xcf, 0x00, + 0xd1, 0xd8, 0x1d, 0x47, 0x62, 0x3f, 0xb6, 0xca, 0x78, 0xa5, 0x12, 0x06, 0xc0, 0xe9, 0xd6, 0x3b, + 0xd8, 0x1a, 0x91, 0xcb, 0xda, 0x08, 0x71, 0x00, 0xf3, 0x7b, 0x59, 0x36, 0xad, 0x90, 0xe5, 0x6e, + 0x3f, 0x8b, 0xa7, 0x31, 0x93, 0x31, 0x0b, 0x11, 0x66, 0x63, 0xe7, 0x0f, 0xb8, 0x25, 0xb4, 0x64, + 0x3f, 0x41, 0x65, 0xdc, 0x34, 0x55, 0xcb, 0xcd, 0xc3, 0xac, 0x5b, 0xac, 0xc8, 0x85, 0x18, 0x62, + 0x04, 0x36, 0xdf, 0x92, 0x2b, 0x35, 0x47, 0x52, 0xed, 0xf5, 0x7d, 0x24, 0x1c,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, 0x96, 0x27, 0x4f, 0xd7, 0xf2, 0xe4, 0xcb, 0x67, 0xf9, 0xdc, 0xc3, 0x67, 0xf9, 0xdc, 0xe3, + 0x67, 0xf9, 0xdc, 0xf5, 0xb1, 0xb2, 0x66, 0xcd, 0xd7, 0xe6, 0x0a, 0x25, 0xb6, 0x20, 0x69, 0x8b, + 0x95, 0x9a, 0xa9, 0x31, 0x5d, 0xd3, 0x4b, 0x92, 0x1d, 0x58, 0xb3, 0x96, 0x8f, 0x61, 0xd0, 0x63, + 0x0b, 0x4c, 0xa9, 0x55, 0x54, 0x69, 0xc9, 0xdd, 0x68, 0xac, 0xe5, 0xaa, 0x6a, 0xce, 0x75, 0xf1, + 0xff, 0x1a, 0x73, 0xe2, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x72, 0x01, 0xbd, 0xa5, 0xf7, 0x23, + 0x00, 0x00, } -func _Query_Redelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRedelegationsRequest) - if err := dec(in); err != nil { +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Validators queries all validators that match the given status. + Validators(ctx context.Context, in *QueryValidatorsRequest, opts ...grpc.CallOption) (*QueryValidatorsResponse, error) + // Validator queries validator info for given validator address. + Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) + // ValidatorDelegations queries delegate info for given validator. + ValidatorDelegations(ctx context.Context, in *QueryValidatorDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorDelegationsResponse, error) + // ValidatorUnbondingDelegations queries unbonding delegations of a validator. + ValidatorUnbondingDelegations(ctx context.Context, in *QueryValidatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorUnbondingDelegationsResponse, error) + // Delegation queries delegate info for given validator delegator pair. + Delegation(ctx context.Context, in *QueryDelegationRequest, opts ...grpc.CallOption) (*QueryDelegationResponse, error) + // UnbondingDelegation queries unbonding info for given validator delegator + // pair. + UnbondingDelegation(ctx context.Context, in *QueryUnbondingDelegationRequest, opts ...grpc.CallOption) (*QueryUnbondingDelegationResponse, error) + // DelegatorDelegations queries all delegations of a given delegator address. + DelegatorDelegations(ctx context.Context, in *QueryDelegatorDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorDelegationsResponse, error) + // DelegatorUnbondingDelegations queries all unbonding delegations of a given + // delegator address. + DelegatorUnbondingDelegations(ctx context.Context, in *QueryDelegatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorUnbondingDelegationsResponse, error) + // Redelegations queries redelegations of given address. + Redelegations(ctx context.Context, in *QueryRedelegationsRequest, opts ...grpc.CallOption) (*QueryRedelegationsResponse, error) + // DelegatorValidators queries all validators info for given delegator + // address. + DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) + // DelegatorValidator queries validator info for given delegator validator + // pair. + DelegatorValidator(ctx context.Context, in *QueryDelegatorValidatorRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorResponse, error) + // HistoricalInfo queries the historical info for given height. + HistoricalInfo(ctx context.Context, in *QueryHistoricalInfoRequest, opts ...grpc.CallOption) (*QueryHistoricalInfoResponse, error) + // Pool queries the pool info. + Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) + // Parameters queries the staking parameters. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Query for individual tokenize share record information by share by id + TokenizeShareRecordById(ctx context.Context, in *QueryTokenizeShareRecordByIdRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordByIdResponse, error) + // Query for individual tokenize share record information by share denom + TokenizeShareRecordByDenom(ctx context.Context, in *QueryTokenizeShareRecordByDenomRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordByDenomResponse, error) + // Query tokenize share records by address + TokenizeShareRecordsOwned(ctx context.Context, in *QueryTokenizeShareRecordsOwnedRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordsOwnedResponse, error) + // Query for all tokenize share records + AllTokenizeShareRecords(ctx context.Context, in *QueryAllTokenizeShareRecordsRequest, opts ...grpc.CallOption) (*QueryAllTokenizeShareRecordsResponse, error) + // Query for last tokenize share record id + LastTokenizeShareRecordId(ctx context.Context, in *QueryLastTokenizeShareRecordIdRequest, opts ...grpc.CallOption) (*QueryLastTokenizeShareRecordIdResponse, error) + // Query for total tokenized staked assets + TotalTokenizeSharedAssets(ctx context.Context, in *QueryTotalTokenizeSharedAssetsRequest, opts ...grpc.CallOption) (*QueryTotalTokenizeSharedAssetsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Validators(ctx context.Context, in *QueryValidatorsRequest, opts ...grpc.CallOption) (*QueryValidatorsResponse, error) { + out := new(QueryValidatorsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/Validators", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).Redelegations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/Redelegations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Redelegations(ctx, req.(*QueryRedelegationsRequest)) - } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_DelegatorValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDelegatorValidatorsRequest) - if err := dec(in); err != nil { +func (c *queryClient) Validator(ctx context.Context, in *QueryValidatorRequest, opts ...grpc.CallOption) (*QueryValidatorResponse, error) { + out := new(QueryValidatorResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/Validator", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).DelegatorValidators(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/DelegatorValidators", + return out, nil +} + +func (c *queryClient) ValidatorDelegations(ctx context.Context, in *QueryValidatorDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorDelegationsResponse, error) { + out := new(QueryValidatorDelegationsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/ValidatorDelegations", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DelegatorValidators(ctx, req.(*QueryDelegatorValidatorsRequest)) + return out, nil +} + +func (c *queryClient) ValidatorUnbondingDelegations(ctx context.Context, in *QueryValidatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryValidatorUnbondingDelegationsResponse, error) { + out := new(QueryValidatorUnbondingDelegationsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/ValidatorUnbondingDelegations", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_DelegatorValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDelegatorValidatorRequest) - if err := dec(in); err != nil { +func (c *queryClient) Delegation(ctx context.Context, in *QueryDelegationRequest, opts ...grpc.CallOption) (*QueryDelegationResponse, error) { + out := new(QueryDelegationResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/Delegation", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).DelegatorValidator(ctx, in) + return out, nil +} + +func (c *queryClient) UnbondingDelegation(ctx context.Context, in *QueryUnbondingDelegationRequest, opts ...grpc.CallOption) (*QueryUnbondingDelegationResponse, error) { + out := new(QueryUnbondingDelegationResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/UnbondingDelegation", in, out, opts...) + if err != nil { + return nil, err } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/DelegatorValidator", + return out, nil +} + +func (c *queryClient) DelegatorDelegations(ctx context.Context, in *QueryDelegatorDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorDelegationsResponse, error) { + out := new(QueryDelegatorDelegationsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/DelegatorDelegations", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DelegatorValidator(ctx, req.(*QueryDelegatorValidatorRequest)) + return out, nil +} + +func (c *queryClient) DelegatorUnbondingDelegations(ctx context.Context, in *QueryDelegatorUnbondingDelegationsRequest, opts ...grpc.CallOption) (*QueryDelegatorUnbondingDelegationsResponse, error) { + out := new(QueryDelegatorUnbondingDelegationsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/DelegatorUnbondingDelegations", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_HistoricalInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryHistoricalInfoRequest) - if err := dec(in); err != nil { +func (c *queryClient) Redelegations(ctx context.Context, in *QueryRedelegationsRequest, opts ...grpc.CallOption) (*QueryRedelegationsResponse, error) { + out := new(QueryRedelegationsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/Redelegations", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).HistoricalInfo(ctx, in) + return out, nil +} + +func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) { + out := new(QueryDelegatorValidatorsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/DelegatorValidators", in, out, opts...) + if err != nil { + return nil, err } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/HistoricalInfo", + return out, nil +} + +func (c *queryClient) DelegatorValidator(ctx context.Context, in *QueryDelegatorValidatorRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorResponse, error) { + out := new(QueryDelegatorValidatorResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/DelegatorValidator", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).HistoricalInfo(ctx, req.(*QueryHistoricalInfoRequest)) + return out, nil +} + +func (c *queryClient) HistoricalInfo(ctx context.Context, in *QueryHistoricalInfoRequest, opts ...grpc.CallOption) (*QueryHistoricalInfoResponse, error) { + out := new(QueryHistoricalInfoResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/HistoricalInfo", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_Pool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryPoolRequest) - if err := dec(in); err != nil { +func (c *queryClient) Pool(ctx context.Context, in *QueryPoolRequest, opts ...grpc.CallOption) (*QueryPoolResponse, error) { + out := new(QueryPoolResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/Pool", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).Pool(ctx, in) + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/Pool", + return out, nil +} + +func (c *queryClient) TokenizeShareRecordById(ctx context.Context, in *QueryTokenizeShareRecordByIdRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordByIdResponse, error) { + out := new(QueryTokenizeShareRecordByIdResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/TokenizeShareRecordById", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Pool(ctx, req.(*QueryPoolRequest)) + return out, nil +} + +func (c *queryClient) TokenizeShareRecordByDenom(ctx context.Context, in *QueryTokenizeShareRecordByDenomRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordByDenomResponse, error) { + out := new(QueryTokenizeShareRecordByDenomResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/TokenizeShareRecordByDenom", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { +func (c *queryClient) TokenizeShareRecordsOwned(ctx context.Context, in *QueryTokenizeShareRecordsOwnedRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordsOwnedResponse, error) { + out := new(QueryTokenizeShareRecordsOwnedResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/TokenizeShareRecordsOwned", in, out, opts...) + if err != nil { return nil, err } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) + return out, nil +} + +func (c *queryClient) AllTokenizeShareRecords(ctx context.Context, in *QueryAllTokenizeShareRecordsRequest, opts ...grpc.CallOption) (*QueryAllTokenizeShareRecordsResponse, error) { + out := new(QueryAllTokenizeShareRecordsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/AllTokenizeShareRecords", in, out, opts...) + if err != nil { + return nil, err } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Query/Params", + return out, nil +} + +func (c *queryClient) LastTokenizeShareRecordId(ctx context.Context, in *QueryLastTokenizeShareRecordIdRequest, opts ...grpc.CallOption) (*QueryLastTokenizeShareRecordIdResponse, error) { + out := new(QueryLastTokenizeShareRecordIdResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/LastTokenizeShareRecordId", in, out, opts...) + if err != nil { + return nil, err } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + return out, nil +} + +func (c *queryClient) TotalTokenizeSharedAssets(ctx context.Context, in *QueryTotalTokenizeSharedAssetsRequest, opts ...grpc.CallOption) (*QueryTotalTokenizeSharedAssetsResponse, error) { + out := new(QueryTotalTokenizeSharedAssetsResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Query/TotalTokenizeSharedAssets", in, out, opts...) + if err != nil { + return nil, err } - return interceptor(ctx, in, info, handler) + return out, nil } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.staking.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Validators", - Handler: _Query_Validators_Handler, - }, - { - MethodName: "Validator", - Handler: _Query_Validator_Handler, - }, - { - MethodName: "ValidatorDelegations", - Handler: _Query_ValidatorDelegations_Handler, - }, - { - MethodName: "ValidatorUnbondingDelegations", - Handler: _Query_ValidatorUnbondingDelegations_Handler, - }, - { - MethodName: "Delegation", - Handler: _Query_Delegation_Handler, - }, - { - MethodName: "UnbondingDelegation", - Handler: _Query_UnbondingDelegation_Handler, - }, - { - MethodName: "DelegatorDelegations", - Handler: _Query_DelegatorDelegations_Handler, - }, - { - MethodName: "DelegatorUnbondingDelegations", - Handler: _Query_DelegatorUnbondingDelegations_Handler, - }, - { - MethodName: "Redelegations", - Handler: _Query_Redelegations_Handler, - }, - { - MethodName: "DelegatorValidators", - Handler: _Query_DelegatorValidators_Handler, - }, - { - MethodName: "DelegatorValidator", - Handler: _Query_DelegatorValidator_Handler, - }, - { - MethodName: "HistoricalInfo", - Handler: _Query_HistoricalInfo_Handler, - }, - { - MethodName: "Pool", - Handler: _Query_Pool_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/staking/v1beta1/query.proto", +// QueryServer is the server API for Query service. +type QueryServer interface { + // Validators queries all validators that match the given status. + Validators(context.Context, *QueryValidatorsRequest) (*QueryValidatorsResponse, error) + // Validator queries validator info for given validator address. + Validator(context.Context, *QueryValidatorRequest) (*QueryValidatorResponse, error) + // ValidatorDelegations queries delegate info for given validator. + ValidatorDelegations(context.Context, *QueryValidatorDelegationsRequest) (*QueryValidatorDelegationsResponse, error) + // ValidatorUnbondingDelegations queries unbonding delegations of a validator. + ValidatorUnbondingDelegations(context.Context, *QueryValidatorUnbondingDelegationsRequest) (*QueryValidatorUnbondingDelegationsResponse, error) + // Delegation queries delegate info for given validator delegator pair. + Delegation(context.Context, *QueryDelegationRequest) (*QueryDelegationResponse, error) + // UnbondingDelegation queries unbonding info for given validator delegator + // pair. + UnbondingDelegation(context.Context, *QueryUnbondingDelegationRequest) (*QueryUnbondingDelegationResponse, error) + // DelegatorDelegations queries all delegations of a given delegator address. + DelegatorDelegations(context.Context, *QueryDelegatorDelegationsRequest) (*QueryDelegatorDelegationsResponse, error) + // DelegatorUnbondingDelegations queries all unbonding delegations of a given + // delegator address. + DelegatorUnbondingDelegations(context.Context, *QueryDelegatorUnbondingDelegationsRequest) (*QueryDelegatorUnbondingDelegationsResponse, error) + // Redelegations queries redelegations of given address. + Redelegations(context.Context, *QueryRedelegationsRequest) (*QueryRedelegationsResponse, error) + // DelegatorValidators queries all validators info for given delegator + // address. + DelegatorValidators(context.Context, *QueryDelegatorValidatorsRequest) (*QueryDelegatorValidatorsResponse, error) + // DelegatorValidator queries validator info for given delegator validator + // pair. + DelegatorValidator(context.Context, *QueryDelegatorValidatorRequest) (*QueryDelegatorValidatorResponse, error) + // HistoricalInfo queries the historical info for given height. + HistoricalInfo(context.Context, *QueryHistoricalInfoRequest) (*QueryHistoricalInfoResponse, error) + // Pool queries the pool info. + Pool(context.Context, *QueryPoolRequest) (*QueryPoolResponse, error) + // Parameters queries the staking parameters. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Query for individual tokenize share record information by share by id + TokenizeShareRecordById(context.Context, *QueryTokenizeShareRecordByIdRequest) (*QueryTokenizeShareRecordByIdResponse, error) + // Query for individual tokenize share record information by share denom + TokenizeShareRecordByDenom(context.Context, *QueryTokenizeShareRecordByDenomRequest) (*QueryTokenizeShareRecordByDenomResponse, error) + // Query tokenize share records by address + TokenizeShareRecordsOwned(context.Context, *QueryTokenizeShareRecordsOwnedRequest) (*QueryTokenizeShareRecordsOwnedResponse, error) + // Query for all tokenize share records + AllTokenizeShareRecords(context.Context, *QueryAllTokenizeShareRecordsRequest) (*QueryAllTokenizeShareRecordsResponse, error) + // Query for last tokenize share record id + LastTokenizeShareRecordId(context.Context, *QueryLastTokenizeShareRecordIdRequest) (*QueryLastTokenizeShareRecordIdResponse, error) + // Query for total tokenized staked assets + TotalTokenizeSharedAssets(context.Context, *QueryTotalTokenizeSharedAssetsRequest) (*QueryTotalTokenizeSharedAssetsResponse, error) } -func (m *QueryValidatorsRequest) 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 +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { } -func (m *QueryValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (*UnimplementedQueryServer) Validators(ctx context.Context, req *QueryValidatorsRequest) (*QueryValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") } - -func (m *QueryValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Status) > 0 { - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil +func (*UnimplementedQueryServer) Validator(ctx context.Context, req *QueryValidatorRequest) (*QueryValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validator not implemented") } - -func (m *QueryValidatorsResponse) 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 (*UnimplementedQueryServer) ValidatorDelegations(ctx context.Context, req *QueryValidatorDelegationsRequest) (*QueryValidatorDelegationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorDelegations not implemented") +} +func (*UnimplementedQueryServer) ValidatorUnbondingDelegations(ctx context.Context, req *QueryValidatorUnbondingDelegationsRequest) (*QueryValidatorUnbondingDelegationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorUnbondingDelegations not implemented") +} +func (*UnimplementedQueryServer) Delegation(ctx context.Context, req *QueryDelegationRequest) (*QueryDelegationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delegation not implemented") +} +func (*UnimplementedQueryServer) UnbondingDelegation(ctx context.Context, req *QueryUnbondingDelegationRequest) (*QueryUnbondingDelegationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnbondingDelegation not implemented") +} +func (*UnimplementedQueryServer) DelegatorDelegations(ctx context.Context, req *QueryDelegatorDelegationsRequest) (*QueryDelegatorDelegationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegatorDelegations not implemented") +} +func (*UnimplementedQueryServer) DelegatorUnbondingDelegations(ctx context.Context, req *QueryDelegatorUnbondingDelegationsRequest) (*QueryDelegatorUnbondingDelegationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegatorUnbondingDelegations not implemented") +} +func (*UnimplementedQueryServer) Redelegations(ctx context.Context, req *QueryRedelegationsRequest) (*QueryRedelegationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Redelegations not implemented") +} +func (*UnimplementedQueryServer) DelegatorValidators(ctx context.Context, req *QueryDelegatorValidatorsRequest) (*QueryDelegatorValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegatorValidators not implemented") +} +func (*UnimplementedQueryServer) DelegatorValidator(ctx context.Context, req *QueryDelegatorValidatorRequest) (*QueryDelegatorValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegatorValidator not implemented") +} +func (*UnimplementedQueryServer) HistoricalInfo(ctx context.Context, req *QueryHistoricalInfoRequest) (*QueryHistoricalInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method HistoricalInfo not implemented") +} +func (*UnimplementedQueryServer) Pool(ctx context.Context, req *QueryPoolRequest) (*QueryPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Pool not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) TokenizeShareRecordById(ctx context.Context, req *QueryTokenizeShareRecordByIdRequest) (*QueryTokenizeShareRecordByIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenizeShareRecordById not implemented") +} +func (*UnimplementedQueryServer) TokenizeShareRecordByDenom(ctx context.Context, req *QueryTokenizeShareRecordByDenomRequest) (*QueryTokenizeShareRecordByDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenizeShareRecordByDenom not implemented") +} +func (*UnimplementedQueryServer) TokenizeShareRecordsOwned(ctx context.Context, req *QueryTokenizeShareRecordsOwnedRequest) (*QueryTokenizeShareRecordsOwnedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenizeShareRecordsOwned not implemented") +} +func (*UnimplementedQueryServer) AllTokenizeShareRecords(ctx context.Context, req *QueryAllTokenizeShareRecordsRequest) (*QueryAllTokenizeShareRecordsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllTokenizeShareRecords not implemented") +} +func (*UnimplementedQueryServer) LastTokenizeShareRecordId(ctx context.Context, req *QueryLastTokenizeShareRecordIdRequest) (*QueryLastTokenizeShareRecordIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LastTokenizeShareRecordId not implemented") +} +func (*UnimplementedQueryServer) TotalTokenizeSharedAssets(ctx context.Context, req *QueryTotalTokenizeSharedAssetsRequest) (*QueryTotalTokenizeSharedAssetsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalTokenizeSharedAssets not implemented") } -func (m *QueryValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) } -func (m *QueryValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func _Query_Validators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorsRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if interceptor == nil { + return srv.(QueryServer).Validators(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/Validators", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Validators(ctx, req.(*QueryValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_Validator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(QueryServer).Validator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/Validator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Validator(ctx, req.(*QueryValidatorRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Query_ValidatorDelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorDelegationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorDelegations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/ValidatorDelegations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorDelegations(ctx, req.(*QueryValidatorDelegationsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorAddr) > 0 { - i -= len(m.ValidatorAddr) - copy(dAtA[i:], m.ValidatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) - i-- - dAtA[i] = 0xa +func _Query_ValidatorUnbondingDelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorUnbondingDelegationsRequest) + if err := dec(in); err != nil { + return nil, err } - return len(dAtA) - i, nil + if interceptor == nil { + return srv.(QueryServer).ValidatorUnbondingDelegations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/ValidatorUnbondingDelegations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorUnbondingDelegations(ctx, req.(*QueryValidatorUnbondingDelegationsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_Delegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegationRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryValidatorResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if interceptor == nil { + return srv.(QueryServer).Delegation(ctx, in) } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/Delegation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Delegation(ctx, req.(*QueryDelegationRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorDelegationsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_UnbondingDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryUnbondingDelegationRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryValidatorDelegationsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + if interceptor == nil { + return srv.(QueryServer).UnbondingDelegation(ctx, in) } - if len(m.ValidatorAddr) > 0 { - i -= len(m.ValidatorAddr) - copy(dAtA[i:], m.ValidatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) - i-- - dAtA[i] = 0xa + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/UnbondingDelegation", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).UnbondingDelegation(ctx, req.(*QueryUnbondingDelegationRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorDelegationsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_DelegatorDelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegatorDelegationsRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil -} - -func (m *QueryValidatorDelegationsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + if interceptor == nil { + return srv.(QueryServer).DelegatorDelegations(ctx, in) } - if len(m.DelegationResponses) > 0 { - for iNdEx := len(m.DelegationResponses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DelegationResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/DelegatorDelegations", } - return len(dAtA) - i, nil + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DelegatorDelegations(ctx, req.(*QueryDelegatorDelegationsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorUnbondingDelegationsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_DelegatorUnbondingDelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegatorUnbondingDelegationsRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(QueryServer).DelegatorUnbondingDelegations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/DelegatorUnbondingDelegations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DelegatorUnbondingDelegations(ctx, req.(*QueryDelegatorUnbondingDelegationsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorUnbondingDelegationsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Query_Redelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRedelegationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Redelegations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/Redelegations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Redelegations(ctx, req.(*QueryRedelegationsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorUnbondingDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func _Query_DelegatorValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegatorValidatorsRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.ValidatorAddr) > 0 { - i -= len(m.ValidatorAddr) - copy(dAtA[i:], m.ValidatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) - i-- - dAtA[i] = 0xa + if interceptor == nil { + return srv.(QueryServer).DelegatorValidators(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/DelegatorValidators", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DelegatorValidators(ctx, req.(*QueryDelegatorValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorUnbondingDelegationsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_DelegatorValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegatorValidatorRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(QueryServer).DelegatorValidator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/DelegatorValidator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DelegatorValidator(ctx, req.(*QueryDelegatorValidatorRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorUnbondingDelegationsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Query_HistoricalInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryHistoricalInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).HistoricalInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/HistoricalInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).HistoricalInfo(ctx, req.(*QueryHistoricalInfoRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryValidatorUnbondingDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func _Query_Pool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPoolRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.UnbondingResponses) > 0 { - for iNdEx := len(m.UnbondingResponses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.UnbondingResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if interceptor == nil { + return srv.(QueryServer).Pool(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/Pool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Pool(ctx, req.(*QueryPoolRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryDelegationRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryDelegationRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func _Query_TokenizeShareRecordById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenizeShareRecordByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TokenizeShareRecordById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/TokenizeShareRecordById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TokenizeShareRecordById(ctx, req.(*QueryTokenizeShareRecordByIdRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryDelegationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorAddr) > 0 { - i -= len(m.ValidatorAddr) - copy(dAtA[i:], m.ValidatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) - i-- - dAtA[i] = 0x12 +func _Query_TokenizeShareRecordByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenizeShareRecordByDenomRequest) + if err := dec(in); err != nil { + return nil, err } - if len(m.DelegatorAddr) > 0 { - i -= len(m.DelegatorAddr) - copy(dAtA[i:], m.DelegatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddr))) - i-- - dAtA[i] = 0xa + if interceptor == nil { + return srv.(QueryServer).TokenizeShareRecordByDenom(ctx, in) } - return len(dAtA) - i, nil + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/TokenizeShareRecordByDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TokenizeShareRecordByDenom(ctx, req.(*QueryTokenizeShareRecordByDenomRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryDelegationResponse) Marshal() (dAtA []byte, err error) { +func _Query_TokenizeShareRecordsOwned_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenizeShareRecordsOwnedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TokenizeShareRecordsOwned(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/TokenizeShareRecordsOwned", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TokenizeShareRecordsOwned(ctx, req.(*QueryTokenizeShareRecordsOwnedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllTokenizeShareRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllTokenizeShareRecordsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllTokenizeShareRecords(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/AllTokenizeShareRecords", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllTokenizeShareRecords(ctx, req.(*QueryAllTokenizeShareRecordsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_LastTokenizeShareRecordId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLastTokenizeShareRecordIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LastTokenizeShareRecordId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/LastTokenizeShareRecordId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LastTokenizeShareRecordId(ctx, req.(*QueryLastTokenizeShareRecordIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TotalTokenizeSharedAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalTokenizeSharedAssetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalTokenizeSharedAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Query/TotalTokenizeSharedAssets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalTokenizeSharedAssets(ctx, req.(*QueryTotalTokenizeSharedAssetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "liquidstaking.staking.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Validators", + Handler: _Query_Validators_Handler, + }, + { + MethodName: "Validator", + Handler: _Query_Validator_Handler, + }, + { + MethodName: "ValidatorDelegations", + Handler: _Query_ValidatorDelegations_Handler, + }, + { + MethodName: "ValidatorUnbondingDelegations", + Handler: _Query_ValidatorUnbondingDelegations_Handler, + }, + { + MethodName: "Delegation", + Handler: _Query_Delegation_Handler, + }, + { + MethodName: "UnbondingDelegation", + Handler: _Query_UnbondingDelegation_Handler, + }, + { + MethodName: "DelegatorDelegations", + Handler: _Query_DelegatorDelegations_Handler, + }, + { + MethodName: "DelegatorUnbondingDelegations", + Handler: _Query_DelegatorUnbondingDelegations_Handler, + }, + { + MethodName: "Redelegations", + Handler: _Query_Redelegations_Handler, + }, + { + MethodName: "DelegatorValidators", + Handler: _Query_DelegatorValidators_Handler, + }, + { + MethodName: "DelegatorValidator", + Handler: _Query_DelegatorValidator_Handler, + }, + { + MethodName: "HistoricalInfo", + Handler: _Query_HistoricalInfo_Handler, + }, + { + MethodName: "Pool", + Handler: _Query_Pool_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "TokenizeShareRecordById", + Handler: _Query_TokenizeShareRecordById_Handler, + }, + { + MethodName: "TokenizeShareRecordByDenom", + Handler: _Query_TokenizeShareRecordByDenom_Handler, + }, + { + MethodName: "TokenizeShareRecordsOwned", + Handler: _Query_TokenizeShareRecordsOwned_Handler, + }, + { + MethodName: "AllTokenizeShareRecords", + Handler: _Query_AllTokenizeShareRecords_Handler, + }, + { + MethodName: "LastTokenizeShareRecordId", + Handler: _Query_LastTokenizeShareRecordId_Handler, + }, + { + MethodName: "TotalTokenizeSharedAssets", + Handler: _Query_TotalTokenizeSharedAssets_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "staking/v1beta1/query.proto", +} + +func (m *QueryValidatorsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2480,19 +2880,19 @@ func (m *QueryDelegationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDelegationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.DelegationResponse != nil { + if m.Pagination != nil { { - size, err := m.DelegationResponse.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2500,12 +2900,19 @@ func (m *QueryDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryUnbondingDelegationRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryValidatorsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2515,12 +2922,61 @@ func (m *QueryUnbondingDelegationRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryUnbondingDelegationRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryUnbondingDelegationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorRequest) 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 *QueryValidatorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2530,19 +2986,12 @@ func (m *QueryUnbondingDelegationRequest) MarshalToSizedBuffer(dAtA []byte) (int copy(dAtA[i:], m.ValidatorAddr) i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) i-- - dAtA[i] = 0x12 - } - if len(m.DelegatorAddr) > 0 { - i -= len(m.DelegatorAddr) - copy(dAtA[i:], m.DelegatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddr))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryUnbondingDelegationResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryValidatorResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2552,18 +3001,18 @@ func (m *QueryUnbondingDelegationResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryUnbondingDelegationResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryValidatorResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryUnbondingDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size, err := m.Unbond.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2575,7 +3024,7 @@ func (m *QueryUnbondingDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryDelegatorDelegationsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryValidatorDelegationsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2585,12 +3034,12 @@ func (m *QueryDelegatorDelegationsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDelegatorDelegationsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryValidatorDelegationsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDelegatorDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryValidatorDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2607,17 +3056,17 @@ func (m *QueryDelegatorDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (in i-- dAtA[i] = 0x12 } - if len(m.DelegatorAddr) > 0 { - i -= len(m.DelegatorAddr) - copy(dAtA[i:], m.DelegatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddr))) + if len(m.ValidatorAddr) > 0 { + i -= len(m.ValidatorAddr) + copy(dAtA[i:], m.ValidatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryDelegatorDelegationsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryValidatorDelegationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2627,12 +3076,12 @@ func (m *QueryDelegatorDelegationsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDelegatorDelegationsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryValidatorDelegationsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDelegatorDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryValidatorDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2666,7 +3115,7 @@ func (m *QueryDelegatorDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (i return len(dAtA) - i, nil } -func (m *QueryDelegatorUnbondingDelegationsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryValidatorUnbondingDelegationsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2676,12 +3125,12 @@ func (m *QueryDelegatorUnbondingDelegationsRequest) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *QueryDelegatorUnbondingDelegationsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryValidatorUnbondingDelegationsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDelegatorUnbondingDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryValidatorUnbondingDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2698,17 +3147,17 @@ func (m *QueryDelegatorUnbondingDelegationsRequest) MarshalToSizedBuffer(dAtA [] i-- dAtA[i] = 0x12 } - if len(m.DelegatorAddr) > 0 { - i -= len(m.DelegatorAddr) - copy(dAtA[i:], m.DelegatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddr))) + if len(m.ValidatorAddr) > 0 { + i -= len(m.ValidatorAddr) + copy(dAtA[i:], m.ValidatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryDelegatorUnbondingDelegationsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryValidatorUnbondingDelegationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2718,12 +3167,12 @@ func (m *QueryDelegatorUnbondingDelegationsResponse) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *QueryDelegatorUnbondingDelegationsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryValidatorUnbondingDelegationsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDelegatorUnbondingDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryValidatorUnbondingDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2757,7 +3206,7 @@ func (m *QueryDelegatorUnbondingDelegationsResponse) MarshalToSizedBuffer(dAtA [ return len(dAtA) - i, nil } -func (m *QueryRedelegationsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryDelegationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2767,39 +3216,20 @@ func (m *QueryRedelegationsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryRedelegationsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDelegationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryRedelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDelegationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.DstValidatorAddr) > 0 { - i -= len(m.DstValidatorAddr) - copy(dAtA[i:], m.DstValidatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DstValidatorAddr))) - i-- - dAtA[i] = 0x1a - } - if len(m.SrcValidatorAddr) > 0 { - i -= len(m.SrcValidatorAddr) - copy(dAtA[i:], m.SrcValidatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SrcValidatorAddr))) + if len(m.ValidatorAddr) > 0 { + i -= len(m.ValidatorAddr) + copy(dAtA[i:], m.ValidatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) i-- dAtA[i] = 0x12 } @@ -2813,7 +3243,7 @@ func (m *QueryRedelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *QueryRedelegationsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryDelegationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2823,19 +3253,19 @@ func (m *QueryRedelegationsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryRedelegationsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDelegationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryRedelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { + if m.DelegationResponse != nil { { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DelegationResponse.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2843,26 +3273,12 @@ func (m *QueryRedelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - if len(m.RedelegationResponses) > 0 { - for iNdEx := len(m.RedelegationResponses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.RedelegationResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryDelegatorValidatorsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryUnbondingDelegationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2872,25 +3288,20 @@ func (m *QueryDelegatorValidatorsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDelegatorValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryUnbondingDelegationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDelegatorValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryUnbondingDelegationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } + if len(m.ValidatorAddr) > 0 { + i -= len(m.ValidatorAddr) + copy(dAtA[i:], m.ValidatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) i-- dAtA[i] = 0x12 } @@ -2904,7 +3315,7 @@ func (m *QueryDelegatorValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int return len(dAtA) - i, nil } -func (m *QueryDelegatorValidatorsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryUnbondingDelegationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2914,46 +3325,30 @@ func (m *QueryDelegatorValidatorsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDelegatorValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryUnbondingDelegationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDelegatorValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryUnbondingDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + { + size, err := m.Unbond.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryDelegatorValidatorRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryDelegatorDelegationsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2963,20 +3358,25 @@ func (m *QueryDelegatorValidatorRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDelegatorValidatorRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDelegatorDelegationsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDelegatorValidatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDelegatorDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ValidatorAddr) > 0 { - i -= len(m.ValidatorAddr) - copy(dAtA[i:], m.ValidatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } @@ -2990,7 +3390,7 @@ func (m *QueryDelegatorValidatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryDelegatorValidatorResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryDelegatorDelegationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3000,30 +3400,46 @@ func (m *QueryDelegatorValidatorResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDelegatorValidatorResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDelegatorDelegationsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDelegatorValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDelegatorDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.DelegationResponses) > 0 { + for iNdEx := len(m.DelegationResponses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DelegationResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryHistoricalInfoRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryDelegatorUnbondingDelegationsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3033,25 +3449,39 @@ func (m *QueryHistoricalInfoRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryHistoricalInfoRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDelegatorUnbondingDelegationsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryHistoricalInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDelegatorUnbondingDelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Height != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x8 + dAtA[i] = 0x12 + } + if len(m.DelegatorAddr) > 0 { + i -= len(m.DelegatorAddr) + copy(dAtA[i:], m.DelegatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddr))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryHistoricalInfoResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryDelegatorUnbondingDelegationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3061,19 +3491,19 @@ func (m *QueryHistoricalInfoResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryHistoricalInfoResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDelegatorUnbondingDelegationsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryHistoricalInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDelegatorUnbondingDelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Hist != nil { + if m.Pagination != nil { { - size, err := m.Hist.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3081,12 +3511,26 @@ func (m *QueryHistoricalInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, er i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + if len(m.UnbondingResponses) > 0 { + for iNdEx := len(m.UnbondingResponses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.UnbondingResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } -func (m *QueryPoolRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryRedelegationsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3096,20 +3540,53 @@ func (m *QueryPoolRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryPoolRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRedelegationsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRedelegationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.DstValidatorAddr) > 0 { + i -= len(m.DstValidatorAddr) + copy(dAtA[i:], m.DstValidatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DstValidatorAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.SrcValidatorAddr) > 0 { + i -= len(m.SrcValidatorAddr) + copy(dAtA[i:], m.SrcValidatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SrcValidatorAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddr) > 0 { + i -= len(m.DelegatorAddr) + copy(dAtA[i:], m.DelegatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddr))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *QueryPoolResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryRedelegationsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3119,30 +3596,46 @@ func (m *QueryPoolResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryPoolResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRedelegationsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRedelegationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Pool.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RedelegationResponses) > 0 { + for iNdEx := len(m.RedelegationResponses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RedelegationResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryDelegatorValidatorsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3152,20 +3645,39 @@ func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDelegatorValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDelegatorValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddr) > 0 { + i -= len(m.DelegatorAddr) + copy(dAtA[i:], m.DelegatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddr))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryDelegatorValidatorsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3175,353 +3687,666 @@ func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDelegatorValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDelegatorValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryDelegatorValidatorRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *QueryValidatorsRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *QueryDelegatorValidatorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorValidatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Status) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.ValidatorAddr) > 0 { + i -= len(m.ValidatorAddr) + copy(dAtA[i:], m.ValidatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddr))) + i-- + dAtA[i] = 0x12 } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.DelegatorAddr) > 0 { + i -= len(m.DelegatorAddr) + copy(dAtA[i:], m.DelegatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddr))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryValidatorsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryDelegatorValidatorResponse) 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 *QueryDelegatorValidatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Validators) > 0 { - for _, e := range m.Validators { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryValidatorRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryHistoricalInfoRequest) 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 n + return dAtA[:n], nil } -func (m *QueryValidatorResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Validator.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func (m *QueryHistoricalInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryValidatorDelegationsRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryHistoricalInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *QueryValidatorDelegationsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryHistoricalInfoResponse) 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 *QueryHistoricalInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryHistoricalInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.DelegationResponses) > 0 { - for _, e := range m.DelegationResponses { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Hist != nil { + { + size, err := m.Hist.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *QueryValidatorUnbondingDelegationsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryPoolRequest) 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 *QueryPoolRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *QueryValidatorUnbondingDelegationsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryPoolResponse) 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 *QueryPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.UnbondingResponses) > 0 { - for _, e := range m.UnbondingResponses { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.Pool.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryDelegationRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryParamsRequest) 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 n + return dAtA[:n], nil } -func (m *QueryDelegationResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.DelegationResponse != nil { - l = m.DelegationResponse.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *QueryUnbondingDelegationRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.DelegatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryUnbondingDelegationResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryTokenizeShareRecordByIdRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - l = m.Unbond.Size() - n += 1 + l + sovQuery(uint64(l)) - return n + return dAtA[:n], nil } -func (m *QueryDelegatorDelegationsRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryTokenizeShareRecordByIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.DelegatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *QueryDelegatorDelegationsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryTokenizeShareRecordByIdResponse) 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 *QueryTokenizeShareRecordByIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.DelegationResponses) > 0 { - for _, e := range m.DelegationResponses { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.Record.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryDelegatorUnbondingDelegationsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryTokenizeShareRecordByDenomRequest) 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 *QueryTokenizeShareRecordByDenomRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.DelegatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryDelegatorUnbondingDelegationsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryTokenizeShareRecordByDenomResponse) 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 *QueryTokenizeShareRecordByDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.UnbondingResponses) > 0 { - for _, e := range m.UnbondingResponses { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + { + size, err := m.Record.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *QueryRedelegationsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryTokenizeShareRecordsOwnedRequest) 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 *QueryTokenizeShareRecordsOwnedRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordsOwnedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.DelegatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SrcValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.DstValidatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *QueryRedelegationsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryTokenizeShareRecordsOwnedResponse) 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 *QueryTokenizeShareRecordsOwnedResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordsOwnedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.RedelegationResponses) > 0 { - for _, e := range m.RedelegationResponses { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *QueryDelegatorValidatorsRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryAllTokenizeShareRecordsRequest) 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 *QueryAllTokenizeShareRecordsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllTokenizeShareRecordsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.DelegatorAddr) + return len(dAtA) - i, nil +} + +func (m *QueryAllTokenizeShareRecordsResponse) 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 *QueryAllTokenizeShareRecordsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllTokenizeShareRecordsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryLastTokenizeShareRecordIdRequest) 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 *QueryLastTokenizeShareRecordIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLastTokenizeShareRecordIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryLastTokenizeShareRecordIdResponse) 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 *QueryLastTokenizeShareRecordIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLastTokenizeShareRecordIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryTotalTokenizeSharedAssetsRequest) 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 *QueryTotalTokenizeSharedAssetsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalTokenizeSharedAssetsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryTotalTokenizeSharedAssetsResponse) 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 *QueryTotalTokenizeSharedAssetsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalTokenizeSharedAssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryValidatorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Status) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -3532,7 +4357,7 @@ func (m *QueryDelegatorValidatorsRequest) Size() (n int) { return n } -func (m *QueryDelegatorValidatorsResponse) Size() (n int) { +func (m *QueryValidatorsResponse) Size() (n int) { if m == nil { return 0 } @@ -3551,16 +4376,12 @@ func (m *QueryDelegatorValidatorsResponse) Size() (n int) { return n } -func (m *QueryDelegatorValidatorRequest) Size() (n int) { +func (m *QueryValidatorRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.DelegatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } l = len(m.ValidatorAddr) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -3568,7 +4389,7 @@ func (m *QueryDelegatorValidatorRequest) Size() (n int) { return n } -func (m *QueryDelegatorValidatorResponse) Size() (n int) { +func (m *QueryValidatorResponse) Size() (n int) { if m == nil { return 0 } @@ -3579,78 +4400,1754 @@ func (m *QueryDelegatorValidatorResponse) Size() (n int) { return n } -func (m *QueryHistoricalInfoRequest) Size() (n int) { +func (m *QueryValidatorDelegationsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Height != 0 { - n += 1 + sovQuery(uint64(m.Height)) + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryHistoricalInfoResponse) Size() (n int) { +func (m *QueryValidatorDelegationsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Hist != nil { - l = m.Hist.Size() + if len(m.DelegationResponses) > 0 { + for _, e := range m.DelegationResponses { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryPoolRequest) Size() (n int) { +func (m *QueryValidatorUnbondingDelegationsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } -func (m *QueryPoolResponse) Size() (n int) { +func (m *QueryValidatorUnbondingDelegationsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Pool.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.UnbondingResponses) > 0 { + for _, e := range m.UnbondingResponses { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } -func (m *QueryParamsRequest) Size() (n int) { +func (m *QueryDelegationRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.DelegatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } -func (m *QueryParamsResponse) Size() (n int) { +func (m *QueryDelegationResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.DelegationResponse != nil { + l = m.DelegationResponse.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *QueryUnbondingDelegationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *QueryUnbondingDelegationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Unbond.Size() + n += 1 + l + sovQuery(uint64(l)) + return n } -func (m *QueryValidatorsRequest) Unmarshal(dAtA []byte) error { + +func (m *QueryDelegatorDelegationsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegatorDelegationsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DelegationResponses) > 0 { + for _, e := range m.DelegationResponses { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegatorUnbondingDelegationsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegatorUnbondingDelegationsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.UnbondingResponses) > 0 { + for _, e := range m.UnbondingResponses { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRedelegationsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.SrcValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.DstValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRedelegationsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RedelegationResponses) > 0 { + for _, e := range m.RedelegationResponses { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegatorValidatorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegatorValidatorsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Validators) > 0 { + for _, e := range m.Validators { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegatorValidatorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegatorValidatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Validator.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryHistoricalInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + return n +} + +func (m *QueryHistoricalInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Hist != nil { + l = m.Hist.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryPoolRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryPoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Pool.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTokenizeShareRecordByIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryTokenizeShareRecordByIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Record.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTokenizeShareRecordByDenomRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTokenizeShareRecordByDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Record.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTokenizeShareRecordsOwnedRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTokenizeShareRecordsOwnedResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Records) > 0 { + for _, e := range m.Records { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryAllTokenizeShareRecordsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAllTokenizeShareRecordsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Records) > 0 { + for _, e := range m.Records { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryLastTokenizeShareRecordIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryLastTokenizeShareRecordIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryTotalTokenizeSharedAssetsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryTotalTokenizeSharedAssetsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Value.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryValidatorsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validators = append(m.Validators, Validator{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorDelegationsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorDelegationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorDelegationsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorDelegationsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorDelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegationResponses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegationResponses = append(m.DelegationResponses, DelegationResponse{}) + if err := m.DelegationResponses[len(m.DelegationResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorUnbondingDelegationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorUnbondingDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorUnbondingDelegationsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorUnbondingDelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingResponses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UnbondingResponses = append(m.UnbondingResponses, UnbondingDelegation{}) + if err := m.UnbondingResponses[len(m.UnbondingResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegationRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDelegationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegationResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDelegationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegationResponse", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DelegationResponse == nil { + m.DelegationResponse = &DelegationResponse{} + } + if err := m.DelegationResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryUnbondingDelegationRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryUnbondingDelegationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryUnbondingDelegationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3673,47 +6170,15 @@ func (m *QueryValidatorsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryValidatorsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryUnbondingDelegationResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryUnbondingDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Status = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Unbond", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3740,10 +6205,7 @@ func (m *QueryValidatorsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Unbond.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3753,7 +6215,10 @@ func (m *QueryValidatorsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3768,7 +6233,7 @@ func (m *QueryValidatorsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryValidatorsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDelegatorDelegationsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3791,17 +6256,17 @@ func (m *QueryValidatorsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryValidatorsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDelegatorDelegationsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDelegatorDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3811,25 +6276,23 @@ func (m *QueryValidatorsResponse) 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 ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Validators = append(m.Validators, Validator{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -3861,7 +6324,7 @@ func (m *QueryValidatorsResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + m.Pagination = &query.PageRequest{} } if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3873,7 +6336,10 @@ func (m *QueryValidatorsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3888,7 +6354,7 @@ func (m *QueryValidatorsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryValidatorRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDelegatorDelegationsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3911,17 +6377,17 @@ func (m *QueryValidatorRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryValidatorRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDelegatorDelegationsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDelegatorDelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegationResponses", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3931,77 +6397,29 @@ func (m *QueryValidatorRequest) 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 ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { + m.DelegationResponses = append(m.DelegationResponses, DelegationResponse{}) + if err := m.DelegationResponses[len(m.DelegationResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryValidatorResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryValidatorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4028,7 +6446,10 @@ func (m *QueryValidatorResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4038,7 +6459,10 @@ func (m *QueryValidatorResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4053,7 +6477,7 @@ func (m *QueryValidatorResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryValidatorDelegationsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDelegatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4076,15 +6500,15 @@ func (m *QueryValidatorDelegationsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryValidatorDelegationsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDelegatorUnbondingDelegationsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDelegatorUnbondingDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4112,7 +6536,7 @@ func (m *QueryValidatorDelegationsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -4156,7 +6580,10 @@ func (m *QueryValidatorDelegationsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4171,7 +6598,7 @@ func (m *QueryValidatorDelegationsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryValidatorDelegationsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDelegatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4194,15 +6621,15 @@ func (m *QueryValidatorDelegationsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryValidatorDelegationsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDelegatorUnbondingDelegationsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorDelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDelegatorUnbondingDelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegationResponses", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingResponses", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4229,8 +6656,8 @@ func (m *QueryValidatorDelegationsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DelegationResponses = append(m.DelegationResponses, DelegationResponse{}) - if err := m.DelegationResponses[len(m.DelegationResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.UnbondingResponses = append(m.UnbondingResponses, UnbondingDelegation{}) + if err := m.UnbondingResponses[len(m.UnbondingResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4276,7 +6703,10 @@ func (m *QueryValidatorDelegationsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4291,7 +6721,7 @@ func (m *QueryValidatorDelegationsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryValidatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryRedelegationsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4314,15 +6744,15 @@ func (m *QueryValidatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryValidatorUnbondingDelegationsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryRedelegationsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorUnbondingDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryRedelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4350,9 +6780,73 @@ func (m *QueryValidatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SrcValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SrcValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DstValidatorAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DstValidatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } @@ -4394,7 +6888,10 @@ func (m *QueryValidatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4409,7 +6906,7 @@ func (m *QueryValidatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error } return nil } -func (m *QueryValidatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryRedelegationsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4432,15 +6929,15 @@ func (m *QueryValidatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryValidatorUnbondingDelegationsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryRedelegationsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorUnbondingDelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryRedelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnbondingResponses", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RedelegationResponses", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4467,8 +6964,8 @@ func (m *QueryValidatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro if postIndex > l { return io.ErrUnexpectedEOF } - m.UnbondingResponses = append(m.UnbondingResponses, UnbondingDelegation{}) - if err := m.UnbondingResponses[len(m.UnbondingResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RedelegationResponses = append(m.RedelegationResponses, RedelegationResponse{}) + if err := m.RedelegationResponses[len(m.RedelegationResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4514,7 +7011,10 @@ func (m *QueryValidatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4529,7 +7029,7 @@ func (m *QueryValidatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro } return nil } -func (m *QueryDelegationRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDelegatorValidatorsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4552,10 +7052,10 @@ func (m *QueryDelegationRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegationRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDelegatorValidatorsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDelegatorValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4592,9 +7092,9 @@ func (m *QueryDelegationRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4604,23 +7104,27 @@ func (m *QueryDelegationRequest) 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 ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -4628,7 +7132,10 @@ func (m *QueryDelegationRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4643,7 +7150,7 @@ func (m *QueryDelegationRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDelegationResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDelegatorValidatorsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4666,15 +7173,15 @@ func (m *QueryDelegationResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegationResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDelegatorValidatorsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDelegatorValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegationResponse", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4701,10 +7208,44 @@ func (m *QueryDelegationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DelegationResponse == nil { - m.DelegationResponse = &DelegationResponse{} + m.Validators = append(m.Validators, Validator{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - if err := m.DelegationResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4714,7 +7255,10 @@ func (m *QueryDelegationResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4729,7 +7273,7 @@ func (m *QueryDelegationResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryUnbondingDelegationRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDelegatorValidatorRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4752,10 +7296,10 @@ func (m *QueryUnbondingDelegationRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryUnbondingDelegationRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDelegatorValidatorRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUnbondingDelegationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDelegatorValidatorRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4828,7 +7372,10 @@ func (m *QueryUnbondingDelegationRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4843,7 +7390,7 @@ func (m *QueryUnbondingDelegationRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDelegatorValidatorResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4866,15 +7413,15 @@ func (m *QueryUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryUnbondingDelegationResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDelegatorValidatorResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUnbondingDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDelegatorValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unbond", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -4901,7 +7448,7 @@ func (m *QueryUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Unbond.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -4911,7 +7458,10 @@ func (m *QueryUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4926,7 +7476,7 @@ func (m *QueryUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDelegatorDelegationsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryHistoricalInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4949,49 +7499,17 @@ func (m *QueryDelegatorDelegationsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegatorDelegationsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryHistoricalInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryHistoricalInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - var msglen int + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -5001,35 +7519,21 @@ func (m *QueryDelegatorDelegationsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Height |= int64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5044,7 +7548,7 @@ func (m *QueryDelegatorDelegationsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDelegatorDelegationsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryHistoricalInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5067,15 +7571,15 @@ func (m *QueryDelegatorDelegationsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegatorDelegationsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryHistoricalInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorDelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryHistoricalInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegationResponses", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hist", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5102,54 +7606,76 @@ func (m *QueryDelegatorDelegationsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DelegationResponses = append(m.DelegationResponses, DelegationResponse{}) - if err := m.DelegationResponses[len(m.DelegationResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Hist == nil { + m.Hist = &HistoricalInfo{} + } + if err := m.Hist.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if skippy < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex + 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: QueryPoolRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPoolRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5164,7 +7690,7 @@ func (m *QueryDelegatorDelegationsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDelegatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5187,47 +7713,15 @@ func (m *QueryDelegatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegatorUnbondingDelegationsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryPoolResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorUnbondingDelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5254,10 +7748,7 @@ func (m *QueryDelegatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Pool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5267,7 +7758,10 @@ func (m *QueryDelegatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5282,7 +7776,7 @@ func (m *QueryDelegatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error } return nil } -func (m *QueryDelegatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5305,49 +7799,68 @@ func (m *QueryDelegatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegatorUnbondingDelegationsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorUnbondingDelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnbondingResponses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if skippy < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.UnbondingResponses = append(m.UnbondingResponses, UnbondingDelegation{}) - if err := m.UnbondingResponses[len(m.UnbondingResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery } - iNdEx = postIndex - case 2: + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5374,10 +7887,7 @@ func (m *QueryDelegatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5387,7 +7897,10 @@ func (m *QueryDelegatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5402,7 +7915,7 @@ func (m *QueryDelegatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro } return nil } -func (m *QueryRedelegationsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryTokenizeShareRecordByIdRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5425,113 +7938,17 @@ func (m *QueryRedelegationsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryRedelegationsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTokenizeShareRecordByIdRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRedelegationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTokenizeShareRecordByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SrcValidatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SrcValidatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DstValidatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DstValidatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var msglen int + m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -5541,35 +7958,21 @@ func (m *QueryRedelegationsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Id |= uint64(b&0x7F) << shift if b < 0x80 { break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + } } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5584,7 +7987,7 @@ func (m *QueryRedelegationsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryRedelegationsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryTokenizeShareRecordByIdResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5607,49 +8010,15 @@ func (m *QueryRedelegationsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryRedelegationsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTokenizeShareRecordByIdResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRedelegationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTokenizeShareRecordByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RedelegationResponses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RedelegationResponses = append(m.RedelegationResponses, RedelegationResponse{}) - if err := m.RedelegationResponses[len(m.RedelegationResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5676,10 +8045,7 @@ func (m *QueryRedelegationsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Record.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5689,7 +8055,10 @@ func (m *QueryRedelegationsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5704,7 +8073,7 @@ func (m *QueryRedelegationsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDelegatorValidatorsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryTokenizeShareRecordByDenomRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5727,15 +8096,15 @@ func (m *QueryDelegatorValidatorsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegatorValidatorsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTokenizeShareRecordByDenomRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTokenizeShareRecordByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5763,43 +8132,7 @@ func (m *QueryDelegatorValidatorsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Denom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -5807,7 +8140,10 @@ func (m *QueryDelegatorValidatorsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5822,7 +8158,7 @@ func (m *QueryDelegatorValidatorsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDelegatorValidatorsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryTokenizeShareRecordByDenomResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5845,49 +8181,15 @@ func (m *QueryDelegatorValidatorsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegatorValidatorsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTokenizeShareRecordByDenomResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTokenizeShareRecordByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Validators = append(m.Validators, Validator{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5914,10 +8216,7 @@ func (m *QueryDelegatorValidatorsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Record.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5927,7 +8226,10 @@ func (m *QueryDelegatorValidatorsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5942,7 +8244,7 @@ func (m *QueryDelegatorValidatorsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDelegatorValidatorRequest) Unmarshal(dAtA []byte) error { +func (m *QueryTokenizeShareRecordsOwnedRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5965,47 +8267,15 @@ func (m *QueryDelegatorValidatorRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegatorValidatorRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTokenizeShareRecordsOwnedRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorValidatorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTokenizeShareRecordsOwnedRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegatorAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6033,7 +8303,7 @@ func (m *QueryDelegatorValidatorRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddr = string(dAtA[iNdEx:postIndex]) + m.Owner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -6041,7 +8311,10 @@ func (m *QueryDelegatorValidatorRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6056,7 +8329,7 @@ func (m *QueryDelegatorValidatorRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDelegatorValidatorResponse) Unmarshal(dAtA []byte) error { +func (m *QueryTokenizeShareRecordsOwnedResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6079,15 +8352,15 @@ func (m *QueryDelegatorValidatorResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryDelegatorValidatorResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTokenizeShareRecordsOwnedResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTokenizeShareRecordsOwnedResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6114,7 +8387,8 @@ func (m *QueryDelegatorValidatorResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Records = append(m.Records, TokenizeShareRecord{}) + if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6124,7 +8398,10 @@ func (m *QueryDelegatorValidatorResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6139,7 +8416,7 @@ func (m *QueryDelegatorValidatorResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryHistoricalInfoRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllTokenizeShareRecordsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6162,38 +8439,22 @@ func (m *QueryHistoricalInfoRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryHistoricalInfoRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllTokenizeShareRecordsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryHistoricalInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllTokenizeShareRecordsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6208,7 +8469,7 @@ func (m *QueryHistoricalInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryHistoricalInfoResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllTokenizeShareRecordsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6231,15 +8492,15 @@ func (m *QueryHistoricalInfoResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryHistoricalInfoResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllTokenizeShareRecordsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryHistoricalInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllTokenizeShareRecordsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hist", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6266,10 +8527,8 @@ func (m *QueryHistoricalInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Hist == nil { - m.Hist = &HistoricalInfo{} - } - if err := m.Hist.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Records = append(m.Records, TokenizeShareRecord{}) + if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6279,7 +8538,10 @@ func (m *QueryHistoricalInfoResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6294,7 +8556,7 @@ func (m *QueryHistoricalInfoResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { +func (m *QueryLastTokenizeShareRecordIdRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6317,10 +8579,10 @@ func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryPoolRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLastTokenizeShareRecordIdRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLastTokenizeShareRecordIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -6329,7 +8591,10 @@ func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6344,7 +8609,7 @@ func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { +func (m *QueryLastTokenizeShareRecordIdResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6367,17 +8632,17 @@ func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryPoolResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLastTokenizeShareRecordIdResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLastTokenizeShareRecordIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pool", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var msglen int + m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -6387,32 +8652,21 @@ func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Id |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Pool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6427,7 +8681,7 @@ func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryTotalTokenizeSharedAssetsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6450,10 +8704,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTotalTokenizeSharedAssetsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTotalTokenizeSharedAssetsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -6462,7 +8716,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6477,7 +8734,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryTotalTokenizeSharedAssetsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6500,15 +8757,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryTotalTokenizeSharedAssetsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryTotalTokenizeSharedAssetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6535,7 +8792,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6545,7 +8802,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { diff --git a/x/staking/types/query.pb.gw.go b/x/staking/types/query.pb.gw.go index 7ed30880ddff..3e21c410247e 100644 --- a/x/staking/types/query.pb.gw.go +++ b/x/staking/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/staking/v1beta1/query.proto +// source: staking/v1beta1/query.proto /* Package types is a reverse proxy. @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join var ( filter_Query_Validators_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} @@ -876,14 +874,12 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Validators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -891,7 +887,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Validators_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -905,8 +900,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Validator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -914,7 +907,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Validator_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -928,8 +920,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ValidatorDelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -937,7 +927,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ValidatorDelegations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -951,8 +940,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ValidatorUnbondingDelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -960,7 +947,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ValidatorUnbondingDelegations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -974,8 +960,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Delegation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -983,7 +967,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Delegation_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -997,8 +980,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_UnbondingDelegation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1006,7 +987,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_UnbondingDelegation_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1020,8 +1000,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DelegatorDelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1029,7 +1007,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DelegatorDelegations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1043,8 +1020,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DelegatorUnbondingDelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1052,7 +1027,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DelegatorUnbondingDelegations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1066,8 +1040,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Redelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1075,7 +1047,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Redelegations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1089,8 +1060,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DelegatorValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1098,7 +1067,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DelegatorValidators_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1112,8 +1080,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_DelegatorValidator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1121,7 +1087,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_DelegatorValidator_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1135,8 +1100,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_HistoricalInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1144,7 +1107,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_HistoricalInfo_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1158,8 +1120,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Pool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1167,7 +1127,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Pool_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1181,8 +1140,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -1190,7 +1147,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -1526,33 +1482,33 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Validators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "staking", "v1beta1", "validators"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Validators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "staking", "v1beta1", "validators"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Validator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Validator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ValidatorDelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr", "delegations"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ValidatorDelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr", "delegations"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ValidatorUnbondingDelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr", "unbonding_delegations"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ValidatorUnbondingDelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr", "unbonding_delegations"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Delegation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr", "delegations", "delegator_addr"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Delegation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr", "delegations", "delegator_addr"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_UnbondingDelegation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr", "delegations", "delegator_addr", "unbonding_delegation"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_UnbondingDelegation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"cosmos", "staking", "v1beta1", "validators", "validator_addr", "delegations", "delegator_addr", "unbonding_delegation"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DelegatorDelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "staking", "v1beta1", "delegations", "delegator_addr"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DelegatorDelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "staking", "v1beta1", "delegations", "delegator_addr"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DelegatorUnbondingDelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "delegators", "delegator_addr", "unbonding_delegations"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DelegatorUnbondingDelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "delegators", "delegator_addr", "unbonding_delegations"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Redelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "delegators", "delegator_addr", "redelegations"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Redelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "delegators", "delegator_addr", "redelegations"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DelegatorValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "delegators", "delegator_addr", "validators"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DelegatorValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "staking", "v1beta1", "delegators", "delegator_addr", "validators"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DelegatorValidator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "staking", "v1beta1", "delegators", "delegator_addr", "validators", "validator_addr"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DelegatorValidator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "staking", "v1beta1", "delegators", "delegator_addr", "validators", "validator_addr"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_HistoricalInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "staking", "v1beta1", "historical_info", "height"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_HistoricalInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "staking", "v1beta1", "historical_info", "height"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Pool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "staking", "v1beta1", "pool"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Pool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "staking", "v1beta1", "pool"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "staking", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "staking", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 8dbfa99ae59f..187a259c779d 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/staking/v1beta1/staking.proto +// source: staking/v1beta1/staking.proto package types @@ -7,18 +7,19 @@ import ( bytes "bytes" compress_gzip "compress/gzip" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" types1 "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types2 "github.com/cosmos/cosmos-sdk/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/gogo/protobuf/gogoproto" github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_protoc_gen_gogo_descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/duration" + _ "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/regen-network/cosmos-proto" types "github.com/tendermint/tendermint/proto/tendermint/types" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "google.golang.org/protobuf/types/known/timestamppb" io "io" io_ioutil "io/ioutil" math "math" @@ -73,7 +74,7 @@ func (x BondStatus) String() string { } func (BondStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{0} + return fileDescriptor_76a7656dabf68054, []int{0} } // HistoricalInfo contains header and validator information for a given block. @@ -89,7 +90,7 @@ func (m *HistoricalInfo) Reset() { *m = HistoricalInfo{} } func (m *HistoricalInfo) String() string { return proto.CompactTextString(m) } func (*HistoricalInfo) ProtoMessage() {} func (*HistoricalInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{0} + return fileDescriptor_76a7656dabf68054, []int{0} } func (m *HistoricalInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -138,15 +139,15 @@ type CommissionRates struct { // rate is the commission rate charged to delegators, as a fraction. Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. - MaxRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_rate"` + MaxRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_rate" yaml:"max_rate"` // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. - MaxChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=max_change_rate,json=maxChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_change_rate"` + MaxChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=max_change_rate,json=maxChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_change_rate" yaml:"max_change_rate"` } func (m *CommissionRates) Reset() { *m = CommissionRates{} } func (*CommissionRates) ProtoMessage() {} func (*CommissionRates) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{1} + return fileDescriptor_76a7656dabf68054, []int{1} } func (m *CommissionRates) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -180,13 +181,13 @@ type Commission struct { // commission_rates defines the initial commission rates to be used for creating a validator. CommissionRates `protobuf:"bytes,1,opt,name=commission_rates,json=commissionRates,proto3,embedded=commission_rates" json:"commission_rates"` // update_time is the last time the commission rate was changed. - UpdateTime time.Time `protobuf:"bytes,2,opt,name=update_time,json=updateTime,proto3,stdtime" json:"update_time"` + UpdateTime time.Time `protobuf:"bytes,2,opt,name=update_time,json=updateTime,proto3,stdtime" json:"update_time" yaml:"update_time"` } func (m *Commission) Reset() { *m = Commission{} } func (*Commission) ProtoMessage() {} func (*Commission) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{2} + return fileDescriptor_76a7656dabf68054, []int{2} } func (m *Commission) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -231,7 +232,7 @@ type Description struct { // website defines an optional website link. Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` // security_contact defines an optional email for security contact. - SecurityContact string `protobuf:"bytes,4,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty"` + SecurityContact string `protobuf:"bytes,4,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty" yaml:"security_contact"` // details define other optional details. Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` } @@ -239,7 +240,7 @@ type Description struct { func (m *Description) Reset() { *m = Description{} } func (*Description) ProtoMessage() {} func (*Description) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{3} + return fileDescriptor_76a7656dabf68054, []int{3} } func (m *Description) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,35 +314,34 @@ func (m *Description) GetDetails() string { // multiplied by exchange rate. type Validator struct { // operator_address defines the address of the validator's operator; bech encoded in JSON. - OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty" yaml:"operator_address"` // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"` + ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty" yaml:"consensus_pubkey"` // jailed defined whether the validator has been jailed from bonded status or not. Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` // status is the validator status (bonded/unbonding/unbonded). - Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` + Status sdkstaking.BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=liquidstaking.staking.v1beta1.BondStatus" json:"status,omitempty"` // tokens define the delegated tokens (incl. self-delegation). Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` // delegator_shares defines total shares issued to a validator's delegators. - DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares"` + DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares" yaml:"delegator_shares"` // description defines the description terms for the validator. Description Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. - UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"` + UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty" yaml:"unbonding_height"` // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time"` + UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time" yaml:"unbonding_time"` // commission defines the commission parameters. Commission Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"` - // min_self_delegation is the validator's self declared minimum self delegation. - // - // Since: cosmos-sdk 0.46 - MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation"` + // Number of shares marked_exempt_to_this_validator + TotalExemptShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,11,opt,name=total_exempt_shares,json=totalExemptShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"total_exempt_shares" yaml:"total_exempt_shares"` + TotalTokenizedShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=total_tokenized_shares,json=totalTokenizedShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"total_tokenized_shares" yaml:"total_tokenized_shares"` } func (m *Validator) Reset() { *m = Validator{} } func (*Validator) ProtoMessage() {} func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{4} + return fileDescriptor_76a7656dabf68054, []int{4} } func (m *Validator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -378,7 +378,7 @@ type ValAddresses struct { func (m *ValAddresses) Reset() { *m = ValAddresses{} } func (*ValAddresses) ProtoMessage() {} func (*ValAddresses) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{5} + return fileDescriptor_76a7656dabf68054, []int{5} } func (m *ValAddresses) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -418,14 +418,14 @@ func (m *ValAddresses) GetAddresses() []string { // It is intended to be used as a marshalable pointer. For example, a DVPair can // be used to construct the key to getting an UnbondingDelegation from state. type DVPair struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` } func (m *DVPair) Reset() { *m = DVPair{} } func (*DVPair) ProtoMessage() {} func (*DVPair) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{6} + return fileDescriptor_76a7656dabf68054, []int{6} } func (m *DVPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -463,7 +463,7 @@ func (m *DVPairs) Reset() { *m = DVPairs{} } func (m *DVPairs) String() string { return proto.CompactTextString(m) } func (*DVPairs) ProtoMessage() {} func (*DVPairs) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{7} + return fileDescriptor_76a7656dabf68054, []int{7} } func (m *DVPairs) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -504,15 +504,15 @@ func (m *DVPairs) GetPairs() []DVPair { // example, a DVVTriplet can be used to construct the key to getting a // Redelegation from state. type DVVTriplet struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"` - ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"` + ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"` } func (m *DVVTriplet) Reset() { *m = DVVTriplet{} } func (*DVVTriplet) ProtoMessage() {} func (*DVVTriplet) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{8} + return fileDescriptor_76a7656dabf68054, []int{8} } func (m *DVVTriplet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -550,7 +550,7 @@ func (m *DVVTriplets) Reset() { *m = DVVTriplets{} } func (m *DVVTriplets) String() string { return proto.CompactTextString(m) } func (*DVVTriplets) ProtoMessage() {} func (*DVVTriplets) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{9} + return fileDescriptor_76a7656dabf68054, []int{9} } func (m *DVVTriplets) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -591,17 +591,19 @@ func (m *DVVTriplets) GetTriplets() []DVVTriplet { // validator. type Delegation struct { // delegator_address is the bech32-encoded address of the delegator. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` // validator_address is the bech32-encoded address of the validator. - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` // shares define the delegation shares received. Shares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares"` + // has this delegation been marked as exempt. + Exempt bool `protobuf:"varint,4,opt,name=exempt,proto3" json:"exempt,omitempty"` } func (m *Delegation) Reset() { *m = Delegation{} } func (*Delegation) ProtoMessage() {} func (*Delegation) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{10} + return fileDescriptor_76a7656dabf68054, []int{10} } func (m *Delegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -634,9 +636,9 @@ var xxx_messageInfo_Delegation proto.InternalMessageInfo // for a single validator in an time-ordered list. type UnbondingDelegation struct { // delegator_address is the bech32-encoded address of the delegator. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` // validator_address is the bech32-encoded address of the validator. - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` // entries are the unbonding delegation entries. Entries []UnbondingDelegationEntry `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries"` } @@ -644,7 +646,7 @@ type UnbondingDelegation struct { func (m *UnbondingDelegation) Reset() { *m = UnbondingDelegation{} } func (*UnbondingDelegation) ProtoMessage() {} func (*UnbondingDelegation) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{11} + return fileDescriptor_76a7656dabf68054, []int{11} } func (m *UnbondingDelegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -676,11 +678,11 @@ var xxx_messageInfo_UnbondingDelegation proto.InternalMessageInfo // UnbondingDelegationEntry defines an unbonding object with relevant metadata. type UnbondingDelegationEntry struct { // creation_height is the height which the unbonding took place. - CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"` + CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"` // completion_time is the unix time for unbonding completion. - CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` + CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"` // initial_balance defines the tokens initially scheduled to receive at completion. - InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance"` + InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance" yaml:"initial_balance"` // balance defines the tokens to receive at completion. Balance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"balance"` } @@ -688,7 +690,7 @@ type UnbondingDelegationEntry struct { func (m *UnbondingDelegationEntry) Reset() { *m = UnbondingDelegationEntry{} } func (*UnbondingDelegationEntry) ProtoMessage() {} func (*UnbondingDelegationEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{12} + return fileDescriptor_76a7656dabf68054, []int{12} } func (m *UnbondingDelegationEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -734,11 +736,11 @@ func (m *UnbondingDelegationEntry) GetCompletionTime() time.Time { // RedelegationEntry defines a redelegation object with relevant metadata. type RedelegationEntry struct { // creation_height defines the height which the redelegation took place. - CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"` + CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"` // completion_time defines the unix time for redelegation completion. - CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` + CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"` // initial_balance defines the initial balance when redelegation started. - InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance"` + InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance" yaml:"initial_balance"` // shares_dst is the amount of destination-validator shares created by redelegation. SharesDst github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=shares_dst,json=sharesDst,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares_dst"` } @@ -746,7 +748,7 @@ type RedelegationEntry struct { func (m *RedelegationEntry) Reset() { *m = RedelegationEntry{} } func (*RedelegationEntry) ProtoMessage() {} func (*RedelegationEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{13} + return fileDescriptor_76a7656dabf68054, []int{13} } func (m *RedelegationEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -793,11 +795,11 @@ func (m *RedelegationEntry) GetCompletionTime() time.Time { // from a particular source validator to a particular destination validator. type Redelegation struct { // delegator_address is the bech32-encoded address of the delegator. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` // validator_src_address is the validator redelegation source operator address. - ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"` + ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"` // validator_dst_address is the validator redelegation destination operator address. - ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"` + ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"` // entries are the redelegation entries. Entries []RedelegationEntry `protobuf:"bytes,4,rep,name=entries,proto3" json:"entries"` } @@ -805,7 +807,7 @@ type Redelegation struct { func (m *Redelegation) Reset() { *m = Redelegation{} } func (*Redelegation) ProtoMessage() {} func (*Redelegation) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{14} + return fileDescriptor_76a7656dabf68054, []int{14} } func (m *Redelegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -848,12 +850,14 @@ type Params struct { BondDenom string `protobuf:"bytes,5,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty"` // min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators MinCommissionRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=min_commission_rate,json=minCommissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_commission_rate" yaml:"min_commission_rate"` + // exemption_factor is required for tokenize share and undelegation check for network safety + ExemptionFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=exemption_factor,json=exemptionFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"exemption_factor" yaml:"exemption_factor"` } func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{15} + return fileDescriptor_76a7656dabf68054, []int{15} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -927,7 +931,7 @@ type DelegationResponse struct { func (m *DelegationResponse) Reset() { *m = DelegationResponse{} } func (*DelegationResponse) ProtoMessage() {} func (*DelegationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{16} + return fileDescriptor_76a7656dabf68054, []int{16} } func (m *DelegationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -982,7 +986,7 @@ func (m *RedelegationEntryResponse) Reset() { *m = RedelegationEntryResp func (m *RedelegationEntryResponse) String() string { return proto.CompactTextString(m) } func (*RedelegationEntryResponse) ProtoMessage() {} func (*RedelegationEntryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{17} + return fileDescriptor_76a7656dabf68054, []int{17} } func (m *RedelegationEntryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1030,7 +1034,7 @@ func (m *RedelegationResponse) Reset() { *m = RedelegationResponse{} } func (m *RedelegationResponse) String() string { return proto.CompactTextString(m) } func (*RedelegationResponse) ProtoMessage() {} func (*RedelegationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_64c30c6cf92913c9, []int{18} + return fileDescriptor_76a7656dabf68054, []int{18} } func (m *RedelegationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1077,14 +1081,14 @@ func (m *RedelegationResponse) GetEntries() []RedelegationEntryResponse { // denomination. type Pool struct { NotBondedTokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=not_bonded_tokens,json=notBondedTokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"not_bonded_tokens"` - BondedTokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=bonded_tokens,json=bondedTokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bonded_tokens"` + BondedTokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=bonded_tokens,json=bondedTokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bonded_tokens" yaml:"bonded_tokens"` } 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_64c30c6cf92913c9, []int{19} + return fileDescriptor_76a7656dabf68054, []int{19} } func (m *Pool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1113,141 +1117,225 @@ func (m *Pool) XXX_DiscardUnknown() { var xxx_messageInfo_Pool proto.InternalMessageInfo -func init() { - proto.RegisterEnum("cosmos.staking.v1beta1.BondStatus", BondStatus_name, BondStatus_value) - proto.RegisterType((*HistoricalInfo)(nil), "cosmos.staking.v1beta1.HistoricalInfo") - proto.RegisterType((*CommissionRates)(nil), "cosmos.staking.v1beta1.CommissionRates") - proto.RegisterType((*Commission)(nil), "cosmos.staking.v1beta1.Commission") - proto.RegisterType((*Description)(nil), "cosmos.staking.v1beta1.Description") - proto.RegisterType((*Validator)(nil), "cosmos.staking.v1beta1.Validator") - proto.RegisterType((*ValAddresses)(nil), "cosmos.staking.v1beta1.ValAddresses") - proto.RegisterType((*DVPair)(nil), "cosmos.staking.v1beta1.DVPair") - proto.RegisterType((*DVPairs)(nil), "cosmos.staking.v1beta1.DVPairs") - proto.RegisterType((*DVVTriplet)(nil), "cosmos.staking.v1beta1.DVVTriplet") - proto.RegisterType((*DVVTriplets)(nil), "cosmos.staking.v1beta1.DVVTriplets") - proto.RegisterType((*Delegation)(nil), "cosmos.staking.v1beta1.Delegation") - proto.RegisterType((*UnbondingDelegation)(nil), "cosmos.staking.v1beta1.UnbondingDelegation") - proto.RegisterType((*UnbondingDelegationEntry)(nil), "cosmos.staking.v1beta1.UnbondingDelegationEntry") - proto.RegisterType((*RedelegationEntry)(nil), "cosmos.staking.v1beta1.RedelegationEntry") - proto.RegisterType((*Redelegation)(nil), "cosmos.staking.v1beta1.Redelegation") - proto.RegisterType((*Params)(nil), "cosmos.staking.v1beta1.Params") - proto.RegisterType((*DelegationResponse)(nil), "cosmos.staking.v1beta1.DelegationResponse") - proto.RegisterType((*RedelegationEntryResponse)(nil), "cosmos.staking.v1beta1.RedelegationEntryResponse") - proto.RegisterType((*RedelegationResponse)(nil), "cosmos.staking.v1beta1.RedelegationResponse") - proto.RegisterType((*Pool)(nil), "cosmos.staking.v1beta1.Pool") +type TokenizeShareRecord struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` + ModuleAccount string `protobuf:"bytes,3,opt,name=module_account,json=moduleAccount,proto3" json:"module_account,omitempty"` + Validator string `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` +} + +func (m *TokenizeShareRecord) Reset() { *m = TokenizeShareRecord{} } +func (m *TokenizeShareRecord) String() string { return proto.CompactTextString(m) } +func (*TokenizeShareRecord) ProtoMessage() {} +func (*TokenizeShareRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_76a7656dabf68054, []int{20} +} +func (m *TokenizeShareRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokenizeShareRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokenizeShareRecord.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 *TokenizeShareRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenizeShareRecord.Merge(m, src) +} +func (m *TokenizeShareRecord) XXX_Size() int { + return m.Size() +} +func (m *TokenizeShareRecord) XXX_DiscardUnknown() { + xxx_messageInfo_TokenizeShareRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenizeShareRecord proto.InternalMessageInfo + +func (m *TokenizeShareRecord) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *TokenizeShareRecord) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *TokenizeShareRecord) GetModuleAccount() string { + if m != nil { + return m.ModuleAccount + } + return "" +} + +func (m *TokenizeShareRecord) GetValidator() string { + if m != nil { + return m.Validator + } + return "" } func init() { - proto.RegisterFile("cosmos/staking/v1beta1/staking.proto", fileDescriptor_64c30c6cf92913c9) -} - -var fileDescriptor_64c30c6cf92913c9 = []byte{ - // 1669 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0x4d, 0x6c, 0x1b, 0xc7, - 0x15, 0xe6, 0x52, 0x0c, 0x45, 0x3d, 0x4a, 0xa2, 0x34, 0x56, 0x52, 0x9a, 0x68, 0x49, 0x96, 0x4d, - 0x13, 0xa7, 0x88, 0xa9, 0x5a, 0x05, 0x02, 0x54, 0x28, 0x50, 0x98, 0x22, 0x53, 0xab, 0x4e, 0x5c, - 0x86, 0x94, 0x55, 0xf4, 0x07, 0x5d, 0x0c, 0x77, 0x47, 0xd4, 0x54, 0xbb, 0xb3, 0xc4, 0xce, 0xd0, - 0x15, 0x81, 0x16, 0x28, 0xd0, 0x4b, 0xea, 0x53, 0x8e, 0xb9, 0x18, 0x30, 0x90, 0x1e, 0x73, 0x0c, - 0x7a, 0xe9, 0xa1, 0xd7, 0x34, 0x27, 0x23, 0xa7, 0xa6, 0x2d, 0xd4, 0xc2, 0xbe, 0x14, 0x3d, 0x15, - 0xb9, 0xb7, 0x28, 0xe6, 0x67, 0x7f, 0x4c, 0x8a, 0x8a, 0x14, 0xa8, 0x40, 0x00, 0x5f, 0xec, 0x9d, - 0x99, 0xf7, 0xbe, 0x79, 0xef, 0x7b, 0x3f, 0x7a, 0x43, 0x78, 0xd1, 0x09,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9e, 0x59, 0xa1, 0x6d, 0xc8, 0x73, 0x81, 0xc5, 0x98, 0x2b, 0x2a, 0x56, 0xb7, 0x1a, 0xf3, - 0x32, 0xa3, 0x15, 0x30, 0xb7, 0xaf, 0x24, 0x7b, 0x46, 0x03, 0xed, 0x41, 0x5e, 0x04, 0x47, 0x84, - 0x19, 0x92, 0x2e, 0x94, 0xd5, 0xbb, 0x4c, 0xa4, 0xb2, 0x7a, 0x97, 0x89, 0x9e, 0xc1, 0x42, 0x43, - 0x58, 0x73, 0x89, 0x47, 0x86, 0x8a, 0x4a, 0x7e, 0x88, 0x43, 0xc2, 0xcb, 0xf9, 0x4b, 0xa8, 0x9a, - 0x52, 0x8c, 0xda, 0x57, 0xa0, 0xe8, 0x36, 0x14, 0xdd, 0x24, 0xdd, 0xca, 0x8b, 0x8a, 0xe8, 0xaf, - 0xcd, 0xf3, 0x3f, 0x95, 0x99, 0xa6, 0x49, 0xa5, 0xb5, 0x65, 0x72, 0x8d, 0xd9, 0x20, 0x60, 0x2e, - 0x65, 0x43, 0xfb, 0x90, 0xd0, 0xe1, 0xa1, 0x28, 0x17, 0xea, 0xd6, 0xb5, 0x85, 0x5e, 0x29, 0xde, - 0xbf, 0xa5, 0xb6, 0xd1, 0x6d, 0x58, 0x4d, 0x44, 0x55, 0xed, 0x2c, 0x5d, 0xa0, 0x76, 0x56, 0x62, - 0x5d, 0x79, 0x8a, 0x6e, 0x01, 0x24, 0x85, 0x59, 0x06, 0x05, 0xd4, 0xf8, 0xec, 0xea, 0x36, 0x2e, - 0xa4, 0x74, 0x91, 0x07, 0x57, 0x7c, 0xca, 0x6c, 0x4e, 0xbc, 0x03, 0xdb, 0x50, 0x25, 0x21, 0x8b, - 0x97, 0x10, 0xda, 0x75, 0x9f, 0xb2, 0x3e, 0xf1, 0x0e, 0xda, 0x31, 0xec, 0xf6, 0xf2, 0xdb, 0x0f, - 0x6b, 0x19, 0x53, 0x4b, 0x99, 0x46, 0x17, 0x96, 0xf7, 0xb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 0xd9, 0xca, - 0xca, 0xfd, 0x07, 0xf5, 0xa5, 0x78, 0x8c, 0x42, 0x0d, 0x40, 0x69, 0x49, 0x83, 0xb7, 0x50, 0x81, - 0xfb, 0x0f, 0xea, 0x79, 0x4d, 0x5b, 0x25, 0xf7, 0xf6, 0x7b, 0xd5, 0x4c, 0xeb, 0xf5, 0x0f, 0x1f, - 0x57, 0xad, 0x47, 0x8f, 0xab, 0xd6, 0x3f, 0x1e, 0x57, 0xad, 0x77, 0x9e, 0x54, 0x33, 0x8f, 0x9e, - 0x54, 0x33, 0x7f, 0x7e, 0x52, 0xcd, 0xfc, 0xf8, 0xd5, 0x33, 0x19, 0x3b, 0x8e, 0x7f, 0xc9, 0x55, - 0xdc, 0x0d, 0xf2, 0xaa, 0x29, 0x7f, 0xeb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x49, 0x0e, 0x8f, - 0x94, 0xe8, 0x15, 0x00, 0x00, + proto.RegisterEnum("liquidstaking.staking.v1beta1.BondStatus", BondStatus_name, BondStatus_value) + proto.RegisterType((*HistoricalInfo)(nil), "liquidstaking.staking.v1beta1.HistoricalInfo") + proto.RegisterType((*CommissionRates)(nil), "liquidstaking.staking.v1beta1.CommissionRates") + proto.RegisterType((*Commission)(nil), "liquidstaking.staking.v1beta1.Commission") + proto.RegisterType((*Description)(nil), "liquidstaking.staking.v1beta1.Description") + proto.RegisterType((*Validator)(nil), "liquidstaking.staking.v1beta1.Validator") + proto.RegisterType((*ValAddresses)(nil), "liquidstaking.staking.v1beta1.ValAddresses") + proto.RegisterType((*DVPair)(nil), "liquidstaking.staking.v1beta1.DVPair") + proto.RegisterType((*DVPairs)(nil), "liquidstaking.staking.v1beta1.DVPairs") + proto.RegisterType((*DVVTriplet)(nil), "liquidstaking.staking.v1beta1.DVVTriplet") + proto.RegisterType((*DVVTriplets)(nil), "liquidstaking.staking.v1beta1.DVVTriplets") + proto.RegisterType((*Delegation)(nil), "liquidstaking.staking.v1beta1.Delegation") + proto.RegisterType((*UnbondingDelegation)(nil), "liquidstaking.staking.v1beta1.UnbondingDelegation") + proto.RegisterType((*UnbondingDelegationEntry)(nil), "liquidstaking.staking.v1beta1.UnbondingDelegationEntry") + proto.RegisterType((*RedelegationEntry)(nil), "liquidstaking.staking.v1beta1.RedelegationEntry") + proto.RegisterType((*Redelegation)(nil), "liquidstaking.staking.v1beta1.Redelegation") + proto.RegisterType((*Params)(nil), "liquidstaking.staking.v1beta1.Params") + proto.RegisterType((*DelegationResponse)(nil), "liquidstaking.staking.v1beta1.DelegationResponse") + proto.RegisterType((*RedelegationEntryResponse)(nil), "liquidstaking.staking.v1beta1.RedelegationEntryResponse") + proto.RegisterType((*RedelegationResponse)(nil), "liquidstaking.staking.v1beta1.RedelegationResponse") + proto.RegisterType((*Pool)(nil), "liquidstaking.staking.v1beta1.Pool") + proto.RegisterType((*TokenizeShareRecord)(nil), "liquidstaking.staking.v1beta1.TokenizeShareRecord") +} + +func init() { proto.RegisterFile("staking/v1beta1/staking.proto", fileDescriptor_76a7656dabf68054) } + +var fileDescriptor_76a7656dabf68054 = []byte{ + // 1952 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xdd, 0x6f, 0x5b, 0x49, + 0x15, 0xf7, 0xb5, 0xdd, 0xc4, 0x39, 0x4e, 0xe2, 0x64, 0x9a, 0x76, 0x5d, 0xd3, 0xc6, 0xe6, 0x4a, + 0xbb, 0x4a, 0x17, 0xe2, 0xb0, 0x59, 0x69, 0x81, 0xbe, 0xa0, 0x38, 0x4e, 0x49, 0xd8, 0xa5, 0x8d, + 0x6e, 0x3e, 0x16, 0x16, 0x24, 0x6b, 0x7c, 0xef, 0xd4, 0x19, 0xe2, 0x7b, 0xaf, 0x7b, 0x67, 0xdc, + 0x8d, 0xd1, 0x3e, 0xf0, 0x02, 0x5a, 0x55, 0x42, 0x14, 0x9e, 0xf6, 0xa5, 0x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 0x7c, 0x2b, + 0x11, 0x44, 0x7a, 0xbf, 0xdb, 0x17, 0x85, 0x94, 0x7a, 0xf6, 0x9a, 0x4a, 0x61, 0xca, 0x07, 0xab, + 0x3a, 0x7d, 0x57, 0x95, 0xbb, 0xd6, 0x4e, 0xc2, 0xff, 0xd4, 0x50, 0x11, 0x6e, 0x4f, 0xc9, 0x03, + 0xeb, 0xf5, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x89, 0xe9, 0x9c, 0xfc, 0x18, 0x00, 0x00, } func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { @@ -1256,476 +1344,668 @@ func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_ func StakingDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ - // 7499 bytes of a gzipped FileDescriptorSet - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0xbc, 0x6b, 0x70, 0x24, 0xd7, - 0x75, 0x1f, 0x8e, 0x79, 0x60, 0x30, 0x73, 0x66, 0x30, 0x68, 0x5c, 0x60, 0x77, 0x67, 0x41, 0x12, - 0x00, 0x87, 0x8f, 0x5d, 0xbe, 0xb0, 0xe4, 0x92, 0xbb, 0xcb, 0x9d, 0xb5, 0xc4, 0xff, 0xbc, 0x16, - 0xc4, 0x2e, 0x1e, 0xc3, 0x1e, 0x60, 0xf9, 0xf0, 0xdf, 0xe9, 0x6a, 0xf4, 0x5c, 0x0c, 0x9a, 0xe8, - 0xe9, 0x6e, 0x77, 0xf7, 0xec, 0x2e, 0x58, 0x4e, 0x8a, 0x2e, 0xe5, 0x21, 0x6d, 0x2a, 0x8e, 0x1c, - 0xa7, 0x62, 0x59, 0xd6, 0x2a, 0x94, 0xe5, 0x44, 0x8e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xda, 0xdd, 0x5d, 0x43, 0xd7, 0x94, 0x90, 0x1a, 0x2c, 0x27, 0xce, 0x4e, 0xca, 0x12, 0x6b, 0xa8, - 0x05, 0xca, 0x67, 0x60, 0xe6, 0x16, 0x56, 0x0f, 0xc2, 0xaa, 0x59, 0xaa, 0x9a, 0x27, 0xe2, 0x90, - 0x62, 0x15, 0x72, 0x1d, 0xec, 0xba, 0x6a, 0x1b, 0x2b, 0xde, 0xa1, 0x8d, 0x0b, 0x49, 0xda, 0xfb, - 0xe5, 0xbe, 0xde, 0xf7, 0xf6, 0x3c, 0xcb, 0x51, 0xdb, 0x87, 0x36, 0x46, 0x65, 0xc8, 0x60, 0xb3, - 0xdb, 0x61, 0x0c, 0x93, 0x43, 0xfc, 0x57, 0x37, 0xbb, 0x9d, 0x5e, 0x96, 0x34, 0x81, 0x71, 0x8a, - 0x29, 0x17, 0x3b, 0x37, 0x75, 0x0d, 0x17, 0x52, 0x94, 0xe0, 0x4c, 0x1f, 0x41, 0x93, 0xb5, 0xf7, - 0x72, 0x08, 0x1c, 0xaa, 0x42, 0x06, 0xdf, 0xf6, 0xb0, 0xe9, 0xea, 0x96, 0x59, 0x98, 0xa2, 0x24, - 0x8f, 0x0d, 0x18, 0x45, 0x6c, 0xb4, 0x7a, 0x29, 0x02, 0x1c, 0xba, 0x08, 0x53, 0x96, 0xed, 0xe9, - 0x96, 0xe9, 0x16, 0xd2, 0xcb, 0xb1, 0xb3, 0xd9, 0xf3, 0x0f, 0x0e, 0x0c, 0x84, 0x2d, 0xa6, 0x23, - 0x0b, 0x65, 0xb4, 0x06, 0x92, 0x6b, 0x75, 0x1d, 0x0d, 0x2b, 0x9a, 0xd5, 0xc2, 0x8a, 0x6e, 0xee, - 0x59, 0x85, 0x0c, 0x25, 0x58, 0xea, 0xef, 0x08, 0x55, 0xac, 0x5a, 0x2d, 0xbc, 0x66, 0xee, 0x59, - 0x72, 0xde, 0x8d, 0x5c, 0xa3, 0x93, 0x90, 0x72, 0x0f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 0xd1, 0xff, 0x17, 0x74, 0x38, 0x41, 0x3b, 0xfc, 0x78, 0xff, 0x88, 0x46, 0x98, 0x7b, 0xfb, 0xbd, - 0x70, 0x09, 0xa6, 0x23, 0x1d, 0x18, 0xf7, 0xd6, 0xc5, 0x9f, 0x80, 0x13, 0x03, 0xa9, 0xd1, 0x6b, - 0x30, 0xdf, 0x35, 0x75, 0xd3, 0xc3, 0x8e, 0xed, 0x60, 0x12, 0xb1, 0xec, 0x56, 0x85, 0xff, 0x34, - 0x35, 0x24, 0xe6, 0x76, 0xc2, 0xda, 0x8c, 0x45, 0x9e, 0xeb, 0xf6, 0x0b, 0x9f, 0xcc, 0xa4, 0xdf, - 0x9f, 0x92, 0xde, 0x7e, 0xfb, 0xed, 0xb7, 0xe3, 0xc5, 0x7f, 0x9c, 0x82, 0xf9, 0x41, 0x73, 0x66, - 0xe0, 0xf4, 0x3d, 0x09, 0x29, 0xb3, 0xdb, 0xd9, 0xc5, 0x0e, 0x75, 0xd2, 0xa4, 0xcc, 0xaf, 0x50, - 0x19, 0x26, 0x0d, 0x75, 0x17, 0x1b, 0x85, 0xe4, 0x72, 0xec, 0x6c, 0xfe, 0xfc, 0x53, 0x63, 0xcd, - 0xca, 0x95, 0x75, 0x02, 0x91, 0x19, 0x12, 0x7d, 0x14, 0x92, 0x3c, 0x45, 0x13, 0x86, 0x27, 0xc7, - 0x63, 0x20, 0x73, 0x49, 0xa6, 0x38, 0xf4, 0x00, 0x64, 0xc8, 0x5f, 0x16, 0x1b, 0x29, 0x6a, 0x73, - 0x9a, 0x08, 0x48, 0x5c, 0xa0, 0x05, 0x48, 0xd3, 0x69, 0xd2, 0xc2, 0x62, 0x69, 0xf3, 0xaf, 0x49, - 0x60, 0xb5, 0xf0, 0x9e, 0xda, 0x35, 0x3c, 0xe5, 0xa6, 0x6a, 0x74, 0x31, 0x0d, 0xf8, 0x8c, 0x9c, - 0xe3, 0xc2, 0x1b, 0x44, 0x86, 0x96, 0x20, 0xcb, 0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0a, 0x3f, 0xf7, 0xdd, - 0xe8, 0x28, 0xae, 0x32, 0x64, 0xd9, 0x30, 0x4a, 0x3b, 0x70, 0x6a, 0x40, 0x54, 0x8c, 0xc1, 0xf9, - 0x69, 0xce, 0x39, 0xdf, 0x17, 0x19, 0x84, 0xb6, 0x01, 0x42, 0xee, 0x8f, 0xe5, 0x18, 0x9c, 0x3f, - 0xcf, 0x39, 0x11, 0xc7, 0x8a, 0x21, 0x25, 0x8c, 0xd7, 0x60, 0xf6, 0x26, 0x76, 0x76, 0x2d, 0x97, - 0x9f, 0x1b, 0x8d, 0x41, 0xf7, 0x19, 0x4e, 0x37, 0xc3, 0x81, 0xf4, 0x20, 0x89, 0x70, 0x5d, 0x86, - 0xf4, 0x9e, 0xaa, 0xe1, 0x31, 0x28, 0xee, 0x72, 0x8a, 0x29, 0xa2, 0x4f, 0xa0, 0x65, 0xc8, 0xb5, - 0x2d, 0xbe, 0x46, 0x8d, 0x86, 0x7f, 0x96, 0xc3, 0xb3, 0x02, 0xc3, 0x29, 0x6c, 0xcb, 0xee, 0x1a, - 0x64, 0x01, 0x1b, 0x4d, 0xf1, 0x97, 0x05, 0x85, 0xc0, 0x70, 0x8a, 0x63, 0xb8, 0xf5, 0x1d, 0x41, - 0xe1, 0x86, 0xfc, 0xf9, 0x12, 0x64, 0x2d, 0xd3, 0x38, 0xb4, 0xcc, 0x71, 0x8c, 0xf8, 0x1c, 0x67, - 0x00, 0x0e, 0x21, 0x04, 0x57, 0x20, 0x33, 0xee, 0x40, 0xfc, 0x95, 0xef, 0x8a, 0xe9, 0x21, 0x46, - 0x60, 0x15, 0x66, 0x44, 0x82, 0xd2, 0x2d, 0x73, 0x0c, 0x8a, 0xbf, 0xca, 0x29, 0xf2, 0x21, 0x18, - 0xef, 0x86, 0x87, 0x5d, 0xaf, 0x8d, 0xc7, 0x21, 0xf9, 0x82, 0xe8, 0x06, 0x87, 0x70, 0x57, 0xee, - 0x62, 0x53, 0xdb, 0x1f, 0x8f,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df, 0x7f, 0x67, 0x29, 0xf6, - 0xe4, 0x57, 0x63, 0x00, 0xc1, 0x16, 0x1e, 0x3d, 0x0d, 0xa7, 0x2a, 0x5b, 0x9b, 0x35, 0xa5, 0xb9, - 0x5d, 0xde, 0xde, 0x69, 0x46, 0xdf, 0x7c, 0x16, 0x67, 0xc2, 0xae, 0x8d, 0x35, 0x7d, 0x4f, 0xc7, - 0x2d, 0xf4, 0x38, 0xcc, 0x47, 0xb5, 0xc9, 0x55, 0xbd, 0x26, 0xc5, 0x16, 0x72, 0x77, 0xee, 0x2e, - 0xa7, 0x59, 0x75, 0x84, 0x5b, 0xe8, 0x2c, 0x9c, 0xe8, 0xd7, 0x5b, 0xdb, 0x5c, 0x95, 0xe2, 0x0b, - 0xd3, 0x77, 0xee, 0x2e, 0x67, 0xfc, 0x32, 0x0a, 0x15, 0x01, 0x85, 0x35, 0x39, 0x5f, 0x62, 0x01, - 0xee, 0xdc, 0x5d, 0x4e, 0x31, 0xb7, 0x2d, 0x24, 0x3f, 0xfe, 0xf9, 0xc5, 0x89, 0xca, 0xd5, 0xa1, - 0xa7, 0xbe, 0x4f, 0x1f, 0xe9, 0xb1, 0xdb, 0xfe, 0x49, 0x6e, 0xe4, 0xa8, 0xf7, 0xff, 0x06, 0x00, - 0x00, 0xff, 0xff, 0xdf, 0xc6, 0xe4, 0x92, 0x04, 0x66, 0x00, 0x00, + // 10576 bytes of a gzipped FileDescriptorSet + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x6d, 0x70, 0x24, 0xc7, + 0x75, 0x18, 0x66, 0x77, 0x01, 0xec, 0x3e, 0x7c, 0x2d, 0x1a, 0xb8, 0xe3, 0xde, 0xde, 0x1d, 0x00, + 0x0e, 0xc9, 0xbb, 0xe3, 0x91, 0x07, 0x90, 0x47, 0xde, 0xf1, 0x88, 0x13, 0x79, 0xda, 0x05, 0xf6, + 0x70, 0x20, 0xf1, 0xc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 0xd1, 0x1d, 0xe0, 0x56, 0x14, 0xa9, 0x5a, + 0x01, 0xb5, 0x42, 0xfd, 0xa2, 0x72, 0x49, 0xad, 0xe1, 0xec, 0x73, 0x30, 0x18, 0x14, 0x0f, 0x1a, + 0x85, 0x6e, 0xdb, 0x51, 0x2d, 0x87, 0x6a, 0x61, 0xb7, 0xc2, 0x0a, 0x28, 0x0d, 0x71, 0xac, 0x97, + 0xa9, 0x95, 0xeb, 0x56, 0xc8, 0xbf, 0xe8, 0xad, 0xde, 0x80, 0xe3, 0x74, 0xc0, 0xc7, 0x1a, 0x67, + 0x34, 0x40, 0x39, 0x3c, 0xee, 0xec, 0x43, 0x30, 0x10, 0x18, 0x40, 0xbb, 0x5d, 0xcb, 0xcf, 0xc3, + 0x81, 0xa6, 0xa4, 0xd1, 0x53, 0x30, 0x5a, 0xd7, 0x35, 0xdd, 0xc1, 0x96, 0x69, 0x61, 0xa2, 0xb1, + 0xac, 0xab, 0xcc, 0x7f, 0xea, 0x6d, 0xa1, 0x73, 0xeb, 0x7e, 0x68, 0x46, 0x45, 0x19, 0xa9, 0x37, + 0x56, 0x9e, 0x4c, 0x25, 0x5f, 0xef, 0x4d, 0xbf, 0xf0, 0xc2, 0x0b, 0x2f, 0xc4, 0xe4, 0x0f, 0xf7, + 0xc0, 0x68, 0xb3, 0x35, 0xd3, 0x74, 0xf9, 0x1e, 0x84, 0x1e, 0xbd, 0x5e, 0xdb, 0xc0, 0x16, 0x15, + 0x52, 0xb7, 0xc2, 0x4b, 0x28, 0x07, 0xdd, 0x55, 0x75, 0x03, 0x57, 0x33, 0x89, 0x09, 0xe9, 0xc4, + 0xe0, 0xe9, 0x7b, 0xda, 0x5a, 0x95, 0x93, 0x0b, 0x04, 0x45, 0x61, 0x98, 0xe8, 0x51, 0x48, 0x70, + 0x13, 0x4d, 0x28, 0x9c, 0x6c, 0x8f, 0x02, 0x59, 0x4b, 0x0a, 0xc5, 0x43, 0x87, 0x21, 0x45, 0xfe, + 0x32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, 0x52, 0xa9, 0x6a, 0xb1, 0x93, 0xad, 0x13, 0x11, 0xe7, 0x11, 0x93, + 0x0b, 0x1c, 0x5e, 0x71, 0x31, 0xb3, 0x7f, 0x22, 0x41, 0x52, 0x54, 0xa3, 0x83, 0x90, 0x30, 0x55, + 0x67, 0x8b, 0x92, 0xeb, 0xce, 0xc7, 0xd2, 0x92, 0x42, 0xcb, 0xa4, 0xde, 0x36, 0x55, 0x9d, 0xaa, + 0x00, 0xaf, 0x27, 0x65, 0x32, 0xaf, 0x55, 0xac, 0x96, 0x69, 0xd4, 0x63, 0xd4, 0x6a, 0x58, 0x77, + 0x6c, 0x31, 0xaf, 0xbc, 0x7e, 0x86, 0x57, 0xa3, 0x7b, 0x60, 0xd8, 0xb1, 0x54, 0xad, 0x1a, 0x80, + 0x4d, 0x50, 0xd8, 0xb4, 0x68, 0x70, 0x81, 0xa7, 0xe1, 0x90, 0xa0, 0x5b, 0xc6, 0x8e, 0x5a, 0xda, + 0xc2, 0x65, 0x0f, 0xa9, 0x87, 0x66, 0x37, 0x6e, 0xe3, 0x00, 0xb3, 0xbc, 0x5d, 0xe0, 0xca, 0x5f, + 0x97, 0x60, 0x58, 0xc4, 0x69, 0x65, 0x57, 0x58, 0x8b, 0x00, 0xaa, 0xae, 0x1b, 0x8e, 0x5f, 0x5c, + 0x8d, 0xaa, 0xdc, 0x80, 0x37, 0x99, 0x73, 0x91, 0x14, 0x1f, 0x81, 0x6c, 0x0d, 0xc0, 0x6b, 0x69, + 0x29, 0xb6, 0x71, 0xe8, 0xe3, 0x27, 0x47, 0xf4, 0xf8, 0x91, 0x45, 0xf6, 0xc0, 0xaa, 0x48, 0x40, + 0x87, 0x46, 0xa1, 0x7b, 0x03, 0x57, 0x34, 0x9d, 0xe7, 0x83, 0x59, 0x41, 0xe4, 0x5f, 0x12, 0x6e, + 0xfe, 0x25, 0xff, 0x01, 0x09, 0x46, 0x4a, 0x46, 0x2d, 0xcc, 0x6f, 0x3e, 0x1d, 0x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xaa, 0x0d, 0x98, 0x76, 0xe8, 0x40, 0x30, 0x71, 0xc3, + 0x07, 0x82, 0x4f, 0x40, 0x9f, 0x2f, 0x9a, 0xcb, 0x74, 0xb7, 0xf7, 0xf9, 0xc0, 0xf0, 0x91, 0xbc, + 0x9f, 0x06, 0x7a, 0xbf, 0x04, 0x07, 0x9a, 0x46, 0xbf, 0x99, 0x9e, 0x7d, 0x9f, 0xfc, 0x87, 0x24, + 0xd6, 0x94, 0xbc, 0xac, 0x8c, 0xd6, 0x9b, 0xe5, 0x16, 0x9e, 0x84, 0x81, 0x40, 0xc8, 0x9a, 0xe9, + 0xa5, 0x6c, 0xec, 0xe3, 0xd3, 0x34, 0x41, 0x3a, 0x28, 0x0b, 0x49, 0xbc, 0x63, 0x1a, 0x96, 0x83, + 0xcb, 0xf4, 0x82, 0x76, 0x52, 0x71, 0xcb, 0x48, 0x87, 0x83, 0x4d, 0x5f, 0xda, 0xd9, 0x99, 0xd4, + 0x0d, 0x9e, 0x2b, 0x8c, 0x3a, 0xcd, 0xdc, 0xb4, 0xb7, 0xc2, 0x51, 0xae, 0xca, 0x2d, 0x9e, 0xf7, + 0x01, 0x3d, 0x2c, 0x38, 0x54, 0x6d, 0xe5, 0xba, 0xc8, 0x4b, 0x80, 0x1a, 0x55, 0x35, 0xfc, 0xc3, + 0x5e, 0x9e, 0xf5, 0x45, 0xa3, 0xd0, 0xed, 0xff, 0xe9, 0x2b, 0x56, 0xf0, 0xce, 0x69, 0xdf, 0x04, + 0xdb, 0xf6, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x88, 0xd0, 0xb6, 0xa6, 0xab, 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) @@ -1937,6 +2217,9 @@ func (this *Params) Equal(that interface{}) bool { if !this.MinCommissionRate.Equal(that1.MinCommissionRate) { return false } + if !this.ExemptionFactor.Equal(that1.ExemptionFactor) { + return false + } return true } func (this *RedelegationEntryResponse) Equal(that interface{}) bool { @@ -1993,6 +2276,39 @@ func (this *Pool) Equal(that interface{}) bool { } return true } +func (this *TokenizeShareRecord) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TokenizeShareRecord) + if !ok { + that2, ok := that.(TokenizeShareRecord) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if this.Owner != that1.Owner { + return false + } + if this.ModuleAccount != that1.ModuleAccount { + return false + } + if this.Validator != that1.Validator { + return false + } + return true +} func (m *HistoricalInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2213,9 +2529,19 @@ func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size := m.MinSelfDelegation.Size() + size := m.TotalTokenizedShares.Size() i -= size - if _, err := m.MinSelfDelegation.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.TotalTokenizedShares.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + { + size := m.TotalExemptShares.Size() + i -= size + if _, err := m.TotalExemptShares.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintStaking(dAtA, i, uint64(size)) @@ -2519,6 +2845,16 @@ func (m *Delegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Exempt { + i-- + if m.Exempt { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } { size := m.Shares.Size() i -= size @@ -2787,6 +3123,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.ExemptionFactor.Size() + i -= size + if _, err := m.ExemptionFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintStaking(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a { size := m.MinCommissionRate.Size() i -= size @@ -3006,6 +3352,55 @@ func (m *Pool) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *TokenizeShareRecord) 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 *TokenizeShareRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokenizeShareRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Validator) > 0 { + i -= len(m.Validator) + copy(dAtA[i:], m.Validator) + i = encodeVarintStaking(dAtA, i, uint64(len(m.Validator))) + i-- + dAtA[i] = 0x22 + } + if len(m.ModuleAccount) > 0 { + i -= len(m.ModuleAccount) + copy(dAtA[i:], m.ModuleAccount) + i = encodeVarintStaking(dAtA, i, uint64(len(m.ModuleAccount))) + i-- + dAtA[i] = 0x1a + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintStaking(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintStaking(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintStaking(dAtA []byte, offset int, v uint64) int { offset -= sovStaking(v) base := offset @@ -3124,7 +3519,9 @@ func (m *Validator) Size() (n int) { n += 1 + l + sovStaking(uint64(l)) l = m.Commission.Size() n += 1 + l + sovStaking(uint64(l)) - l = m.MinSelfDelegation.Size() + l = m.TotalExemptShares.Size() + n += 1 + l + sovStaking(uint64(l)) + l = m.TotalTokenizedShares.Size() n += 1 + l + sovStaking(uint64(l)) return n } @@ -3228,6 +3625,9 @@ func (m *Delegation) Size() (n int) { } l = m.Shares.Size() n += 1 + l + sovStaking(uint64(l)) + if m.Exempt { + n += 2 + } return n } @@ -3340,6 +3740,8 @@ func (m *Params) Size() (n int) { } l = m.MinCommissionRate.Size() n += 1 + l + sovStaking(uint64(l)) + l = m.ExemptionFactor.Size() + n += 1 + l + sovStaking(uint64(l)) return n } @@ -3399,6 +3801,30 @@ func (m *Pool) Size() (n int) { return n } +func (m *TokenizeShareRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovStaking(uint64(m.Id)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovStaking(uint64(l)) + } + l = len(m.ModuleAccount) + if l > 0 { + n += 1 + l + sovStaking(uint64(l)) + } + l = len(m.Validator) + if l > 0 { + n += 1 + l + sovStaking(uint64(l)) + } + return n +} + func sovStaking(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4149,7 +4575,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= BondStatus(b&0x7F) << shift + m.Status |= sdkstaking.BondStatus(b&0x7F) << shift if b < 0x80 { break } @@ -4342,7 +4768,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinSelfDelegation", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TotalExemptShares", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4370,7 +4796,41 @@ func (m *Validator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MinSelfDelegation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TotalExemptShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalTokenizedShares", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStaking + } + 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 ErrInvalidLengthStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalTokenizedShares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -5032,6 +5492,26 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exempt", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exempt = bool(v != 0) default: iNdEx = preIndex skippy, err := skipStaking(dAtA[iNdEx:]) @@ -5906,6 +6386,40 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExemptionFactor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStaking + } + 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 ErrInvalidLengthStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExemptionFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipStaking(dAtA[iNdEx:]) @@ -6395,6 +6909,171 @@ func (m *Pool) Unmarshal(dAtA []byte) error { } return nil } +func (m *TokenizeShareRecord) 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 ErrIntOverflowStaking + } + 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: TokenizeShareRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenizeShareRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStaking + } + 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 ErrInvalidLengthStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModuleAccount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStaking + } + 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 ErrInvalidLengthStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModuleAccount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStaking + } + 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 ErrInvalidLengthStaking + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStaking + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Validator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStaking(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipStaking(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/staking/types/tokenize_share_record.go b/x/staking/types/tokenize_share_record.go new file mode 100644 index 000000000000..c68a1771aa29 --- /dev/null +++ b/x/staking/types/tokenize_share_record.go @@ -0,0 +1,18 @@ +package types + +import ( + fmt "fmt" + "strconv" + "strings" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +func (r TokenizeShareRecord) GetModuleAddress() sdk.AccAddress { + return authtypes.NewModuleAddress(r.ModuleAccount) +} + +func (r TokenizeShareRecord) GetShareTokenDenom() string { + return fmt.Sprintf("%s/%s", strings.ToLower(r.Validator), strconv.Itoa(int(r.Id))) +} diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index 040c6a9233f4..6a64eb8847d1 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -1,24 +1,23 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/staking/v1beta1/tx.proto +// source: staking/v1beta1/tx.proto package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/regen-network/cosmos-proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -39,20 +38,19 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgCreateValidator defines a SDK message for creating a new validator. type MsgCreateValidator struct { - Description Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` - Commission CommissionRates `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission"` - MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation"` - DelegatorAddress string `protobuf:"bytes,4,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorAddress string `protobuf:"bytes,5,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - Pubkey *types.Any `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"` - Value types1.Coin `protobuf:"bytes,7,opt,name=value,proto3" json:"value"` + Description Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` + Commission CommissionRates `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission"` + DelegatorAddress string `protobuf:"bytes,3,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,4,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` + Pubkey *types.Any `protobuf:"bytes,5,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + Value types1.Coin `protobuf:"bytes,6,opt,name=value,proto3" json:"value"` } func (m *MsgCreateValidator) Reset() { *m = MsgCreateValidator{} } func (m *MsgCreateValidator) String() string { return proto.CompactTextString(m) } func (*MsgCreateValidator) ProtoMessage() {} func (*MsgCreateValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{0} + return fileDescriptor_dc1f14f20335eae7, []int{0} } func (m *MsgCreateValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -89,7 +87,7 @@ func (m *MsgCreateValidatorResponse) Reset() { *m = MsgCreateValidatorRe func (m *MsgCreateValidatorResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateValidatorResponse) ProtoMessage() {} func (*MsgCreateValidatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{1} + return fileDescriptor_dc1f14f20335eae7, []int{1} } func (m *MsgCreateValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,20 +119,19 @@ var xxx_messageInfo_MsgCreateValidatorResponse proto.InternalMessageInfo // MsgEditValidator defines a SDK message for editing an existing validator. type MsgEditValidator struct { Description Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"address"` // We pass a reference to the new commission rate and min self delegation as // it's not mandatory to update. If not updated, the deserialized rate will be // zero with no way to distinguish if an update was intended. // REF: #2373 - CommissionRate *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=commission_rate,json=commissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"commission_rate,omitempty"` - MinSelfDelegation *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation,omitempty"` + CommissionRate *github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=commission_rate,json=commissionRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"commission_rate,omitempty" yaml:"commission_rate"` } func (m *MsgEditValidator) Reset() { *m = MsgEditValidator{} } func (m *MsgEditValidator) String() string { return proto.CompactTextString(m) } func (*MsgEditValidator) ProtoMessage() {} func (*MsgEditValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{2} + return fileDescriptor_dc1f14f20335eae7, []int{2} } func (m *MsgEditValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -171,7 +168,7 @@ func (m *MsgEditValidatorResponse) Reset() { *m = MsgEditValidatorRespon func (m *MsgEditValidatorResponse) String() string { return proto.CompactTextString(m) } func (*MsgEditValidatorResponse) ProtoMessage() {} func (*MsgEditValidatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{3} + return fileDescriptor_dc1f14f20335eae7, []int{3} } func (m *MsgEditValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -203,8 +200,8 @@ var xxx_messageInfo_MsgEditValidatorResponse proto.InternalMessageInfo // MsgDelegate defines a SDK message for performing a delegation of coins // from a delegator to a validator. type MsgDelegate struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } @@ -212,7 +209,7 @@ func (m *MsgDelegate) Reset() { *m = MsgDelegate{} } func (m *MsgDelegate) String() string { return proto.CompactTextString(m) } func (*MsgDelegate) ProtoMessage() {} func (*MsgDelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{4} + return fileDescriptor_dc1f14f20335eae7, []int{4} } func (m *MsgDelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -249,7 +246,7 @@ func (m *MsgDelegateResponse) Reset() { *m = MsgDelegateResponse{} } func (m *MsgDelegateResponse) String() string { return proto.CompactTextString(m) } func (*MsgDelegateResponse) ProtoMessage() {} func (*MsgDelegateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{5} + return fileDescriptor_dc1f14f20335eae7, []int{5} } func (m *MsgDelegateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -281,9 +278,9 @@ var xxx_messageInfo_MsgDelegateResponse proto.InternalMessageInfo // MsgBeginRedelegate defines a SDK message for performing a redelegation // of coins from a delegator and source validator to a destination validator. type MsgBeginRedelegate struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"` - ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"` + ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"` Amount types1.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` } @@ -291,7 +288,7 @@ func (m *MsgBeginRedelegate) Reset() { *m = MsgBeginRedelegate{} } func (m *MsgBeginRedelegate) String() string { return proto.CompactTextString(m) } func (*MsgBeginRedelegate) ProtoMessage() {} func (*MsgBeginRedelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{6} + return fileDescriptor_dc1f14f20335eae7, []int{6} } func (m *MsgBeginRedelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -329,7 +326,7 @@ func (m *MsgBeginRedelegateResponse) Reset() { *m = MsgBeginRedelegateRe func (m *MsgBeginRedelegateResponse) String() string { return proto.CompactTextString(m) } func (*MsgBeginRedelegateResponse) ProtoMessage() {} func (*MsgBeginRedelegateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{7} + return fileDescriptor_dc1f14f20335eae7, []int{7} } func (m *MsgBeginRedelegateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -368,8 +365,8 @@ func (m *MsgBeginRedelegateResponse) GetCompletionTime() time.Time { // MsgUndelegate defines a SDK message for performing an undelegation from a // delegate and a validator. type MsgUndelegate struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } @@ -377,7 +374,7 @@ func (m *MsgUndelegate) Reset() { *m = MsgUndelegate{} } func (m *MsgUndelegate) String() string { return proto.CompactTextString(m) } func (*MsgUndelegate) ProtoMessage() {} func (*MsgUndelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{8} + return fileDescriptor_dc1f14f20335eae7, []int{8} } func (m *MsgUndelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -415,7 +412,7 @@ func (m *MsgUndelegateResponse) Reset() { *m = MsgUndelegateResponse{} } func (m *MsgUndelegateResponse) String() string { return proto.CompactTextString(m) } func (*MsgUndelegateResponse) ProtoMessage() {} func (*MsgUndelegateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{9} + return fileDescriptor_dc1f14f20335eae7, []int{9} } func (m *MsgUndelegateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -455,8 +452,8 @@ func (m *MsgUndelegateResponse) GetCompletionTime() time.Time { // // Since: cosmos-sdk 0.46 type MsgCancelUnbondingDelegation struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` // amount is always less than or equal to unbonding delegation entry balance Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` // creation_height is the height which the unbonding took place. @@ -467,7 +464,7 @@ func (m *MsgCancelUnbondingDelegation) Reset() { *m = MsgCancelUnbonding func (m *MsgCancelUnbondingDelegation) String() string { return proto.CompactTextString(m) } func (*MsgCancelUnbondingDelegation) ProtoMessage() {} func (*MsgCancelUnbondingDelegation) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{10} + return fileDescriptor_dc1f14f20335eae7, []int{10} } func (m *MsgCancelUnbondingDelegation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -506,7 +503,7 @@ func (m *MsgCancelUnbondingDelegationResponse) Reset() { *m = MsgCancelU func (m *MsgCancelUnbondingDelegationResponse) String() string { return proto.CompactTextString(m) } func (*MsgCancelUnbondingDelegationResponse) ProtoMessage() {} func (*MsgCancelUnbondingDelegationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{11} + return fileDescriptor_dc1f14f20335eae7, []int{11} } func (m *MsgCancelUnbondingDelegationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -535,84 +532,427 @@ func (m *MsgCancelUnbondingDelegationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCancelUnbondingDelegationResponse proto.InternalMessageInfo +type MsgTokenizeShares struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` + Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + TokenizedShareOwner string `protobuf:"bytes,4,opt,name=tokenized_share_owner,json=tokenizedShareOwner,proto3" json:"tokenized_share_owner,omitempty" yaml:"tokenized_share_owner"` +} + +func (m *MsgTokenizeShares) Reset() { *m = MsgTokenizeShares{} } +func (m *MsgTokenizeShares) String() string { return proto.CompactTextString(m) } +func (*MsgTokenizeShares) ProtoMessage() {} +func (*MsgTokenizeShares) Descriptor() ([]byte, []int) { + return fileDescriptor_dc1f14f20335eae7, []int{12} +} +func (m *MsgTokenizeShares) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTokenizeShares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTokenizeShares.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 *MsgTokenizeShares) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTokenizeShares.Merge(m, src) +} +func (m *MsgTokenizeShares) XXX_Size() int { + return m.Size() +} +func (m *MsgTokenizeShares) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTokenizeShares.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTokenizeShares proto.InternalMessageInfo + +type MsgTokenizeSharesResponse struct { + Amount types1.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgTokenizeSharesResponse) Reset() { *m = MsgTokenizeSharesResponse{} } +func (m *MsgTokenizeSharesResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTokenizeSharesResponse) ProtoMessage() {} +func (*MsgTokenizeSharesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc1f14f20335eae7, []int{13} +} +func (m *MsgTokenizeSharesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTokenizeSharesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTokenizeSharesResponse.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 *MsgTokenizeSharesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTokenizeSharesResponse.Merge(m, src) +} +func (m *MsgTokenizeSharesResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTokenizeSharesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTokenizeSharesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTokenizeSharesResponse proto.InternalMessageInfo + +func (m *MsgTokenizeSharesResponse) GetAmount() types1.Coin { + if m != nil { + return m.Amount + } + return types1.Coin{} +} + +type MsgRedeemTokensforShares struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + Amount types1.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgRedeemTokensforShares) Reset() { *m = MsgRedeemTokensforShares{} } +func (m *MsgRedeemTokensforShares) String() string { return proto.CompactTextString(m) } +func (*MsgRedeemTokensforShares) ProtoMessage() {} +func (*MsgRedeemTokensforShares) Descriptor() ([]byte, []int) { + return fileDescriptor_dc1f14f20335eae7, []int{14} +} +func (m *MsgRedeemTokensforShares) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRedeemTokensforShares) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRedeemTokensforShares.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 *MsgRedeemTokensforShares) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRedeemTokensforShares.Merge(m, src) +} +func (m *MsgRedeemTokensforShares) XXX_Size() int { + return m.Size() +} +func (m *MsgRedeemTokensforShares) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRedeemTokensforShares.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRedeemTokensforShares proto.InternalMessageInfo + +type MsgRedeemTokensforSharesResponse struct { + Amount types1.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"` +} + +func (m *MsgRedeemTokensforSharesResponse) Reset() { *m = MsgRedeemTokensforSharesResponse{} } +func (m *MsgRedeemTokensforSharesResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRedeemTokensforSharesResponse) ProtoMessage() {} +func (*MsgRedeemTokensforSharesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc1f14f20335eae7, []int{15} +} +func (m *MsgRedeemTokensforSharesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRedeemTokensforSharesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRedeemTokensforSharesResponse.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 *MsgRedeemTokensforSharesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRedeemTokensforSharesResponse.Merge(m, src) +} +func (m *MsgRedeemTokensforSharesResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRedeemTokensforSharesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRedeemTokensforSharesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRedeemTokensforSharesResponse proto.InternalMessageInfo + +func (m *MsgRedeemTokensforSharesResponse) GetAmount() types1.Coin { + if m != nil { + return m.Amount + } + return types1.Coin{} +} + +type MsgTransferTokenizeShareRecord struct { + TokenizeShareRecordId uint64 `protobuf:"varint,1,opt,name=tokenize_share_record_id,json=tokenizeShareRecordId,proto3" json:"tokenize_share_record_id,omitempty"` + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + NewOwner string `protobuf:"bytes,3,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty"` +} + +func (m *MsgTransferTokenizeShareRecord) Reset() { *m = MsgTransferTokenizeShareRecord{} } +func (m *MsgTransferTokenizeShareRecord) String() string { return proto.CompactTextString(m) } +func (*MsgTransferTokenizeShareRecord) ProtoMessage() {} +func (*MsgTransferTokenizeShareRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_dc1f14f20335eae7, []int{16} +} +func (m *MsgTransferTokenizeShareRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferTokenizeShareRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferTokenizeShareRecord.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 *MsgTransferTokenizeShareRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferTokenizeShareRecord.Merge(m, src) +} +func (m *MsgTransferTokenizeShareRecord) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferTokenizeShareRecord) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferTokenizeShareRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferTokenizeShareRecord proto.InternalMessageInfo + +type MsgTransferTokenizeShareRecordResponse struct { +} + +func (m *MsgTransferTokenizeShareRecordResponse) Reset() { + *m = MsgTransferTokenizeShareRecordResponse{} +} +func (m *MsgTransferTokenizeShareRecordResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferTokenizeShareRecordResponse) ProtoMessage() {} +func (*MsgTransferTokenizeShareRecordResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc1f14f20335eae7, []int{17} +} +func (m *MsgTransferTokenizeShareRecordResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferTokenizeShareRecordResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferTokenizeShareRecordResponse.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 *MsgTransferTokenizeShareRecordResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferTokenizeShareRecordResponse.Merge(m, src) +} +func (m *MsgTransferTokenizeShareRecordResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferTokenizeShareRecordResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferTokenizeShareRecordResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferTokenizeShareRecordResponse proto.InternalMessageInfo + +// MsgExemptDelegation defines a SDK message for performing exemption of delegated coins +// from a delegator to a validator. +type MsgExemptDelegation struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` +} + +func (m *MsgExemptDelegation) Reset() { *m = MsgExemptDelegation{} } +func (m *MsgExemptDelegation) String() string { return proto.CompactTextString(m) } +func (*MsgExemptDelegation) ProtoMessage() {} +func (*MsgExemptDelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_dc1f14f20335eae7, []int{18} +} +func (m *MsgExemptDelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExemptDelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExemptDelegation.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 *MsgExemptDelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExemptDelegation.Merge(m, src) +} +func (m *MsgExemptDelegation) XXX_Size() int { + return m.Size() +} +func (m *MsgExemptDelegation) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExemptDelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExemptDelegation proto.InternalMessageInfo + +type MsgExemptDelegationResponse struct { +} + +func (m *MsgExemptDelegationResponse) Reset() { *m = MsgExemptDelegationResponse{} } +func (m *MsgExemptDelegationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgExemptDelegationResponse) ProtoMessage() {} +func (*MsgExemptDelegationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dc1f14f20335eae7, []int{19} +} +func (m *MsgExemptDelegationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExemptDelegationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExemptDelegationResponse.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 *MsgExemptDelegationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExemptDelegationResponse.Merge(m, src) +} +func (m *MsgExemptDelegationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExemptDelegationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExemptDelegationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExemptDelegationResponse proto.InternalMessageInfo + func init() { - proto.RegisterType((*MsgCreateValidator)(nil), "cosmos.staking.v1beta1.MsgCreateValidator") - proto.RegisterType((*MsgCreateValidatorResponse)(nil), "cosmos.staking.v1beta1.MsgCreateValidatorResponse") - proto.RegisterType((*MsgEditValidator)(nil), "cosmos.staking.v1beta1.MsgEditValidator") - proto.RegisterType((*MsgEditValidatorResponse)(nil), "cosmos.staking.v1beta1.MsgEditValidatorResponse") - proto.RegisterType((*MsgDelegate)(nil), "cosmos.staking.v1beta1.MsgDelegate") - proto.RegisterType((*MsgDelegateResponse)(nil), "cosmos.staking.v1beta1.MsgDelegateResponse") - proto.RegisterType((*MsgBeginRedelegate)(nil), "cosmos.staking.v1beta1.MsgBeginRedelegate") - proto.RegisterType((*MsgBeginRedelegateResponse)(nil), "cosmos.staking.v1beta1.MsgBeginRedelegateResponse") - proto.RegisterType((*MsgUndelegate)(nil), "cosmos.staking.v1beta1.MsgUndelegate") - proto.RegisterType((*MsgUndelegateResponse)(nil), "cosmos.staking.v1beta1.MsgUndelegateResponse") - proto.RegisterType((*MsgCancelUnbondingDelegation)(nil), "cosmos.staking.v1beta1.MsgCancelUnbondingDelegation") - proto.RegisterType((*MsgCancelUnbondingDelegationResponse)(nil), "cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse") -} - -func init() { proto.RegisterFile("cosmos/staking/v1beta1/tx.proto", fileDescriptor_0926ef28816b35ab) } - -var fileDescriptor_0926ef28816b35ab = []byte{ - // 937 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x57, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xf6, 0xc6, 0x4e, 0x28, 0x13, 0xb5, 0x69, 0x37, 0x09, 0x38, 0xab, 0xca, 0xae, 0xdc, 0xd2, - 0x46, 0x85, 0xac, 0x69, 0x28, 0x02, 0x55, 0xbd, 0xd4, 0x75, 0x2b, 0xaa, 0x62, 0x09, 0x6d, 0x28, - 0x07, 0x84, 0x64, 0xcd, 0xee, 0x4e, 0x26, 0x23, 0xef, 0xce, 0xb8, 0x3b, 0xe3, 0xa8, 0xbe, 0x72, - 0xe2, 0x46, 0x25, 0xfe, 0x40, 0x7f, 0x00, 0x42, 0x1c, 0xfa, 0x23, 0x2a, 0x4e, 0x51, 0x4f, 0x88, - 0x43, 0x81, 0xe4, 0x00, 0x3f, 0x00, 0x71, 0x46, 0x3b, 0x3b, 0x3b, 0xfe, 0x58, 0x7b, 0xb3, 0x41, - 0xe9, 0x01, 0x71, 0xf2, 0x6a, 0xe6, 0x79, 0x9f, 0x99, 0x79, 0xde, 0x67, 0xde, 0x77, 0x0c, 0xea, - 0x1e, 0xe3, 0x21, 0xe3, 0x4d, 0x2e, 0x60, 0x8f, 0x50, 0xdc, 0xdc, 0xbf, 0xe1, 0x22, 0x01, 0x6f, - 0x34, 0xc5, 0x13, 0xbb, 0x1f, 0x31, 0xc1, 0xcc, 0xb7, 0x12, 0x80, 0xad, 0x00, 0xb6, 0x02, 0x58, - 0x1b, 0x98, 0x31, 0x1c, 0xa0, 0xa6, 0x44, 0xb9, 0x83, 0xdd, 0x26, 0xa4, 0xc3, 0x24, 0xc4, 0xaa, - 0x4f, 0x4f, 0x09, 0x12, 0x22, 0x2e, 0x60, 0xd8, 0x57, 0x80, 0x35, 0xcc, 0x30, 0x93, 0x9f, 0xcd, - 0xf8, 0x4b, 0x8d, 0x6e, 0x24, 0x2b, 0x75, 0x93, 0x09, 0xb5, 0x6c, 0x32, 0x55, 0x53, 0xbb, 0x74, - 0x21, 0x47, 0x7a, 0x8b, 0x1e, 0x23, 0x54, 0xcd, 0x5f, 0x99, 0x73, 0x8a, 0x74, 0xd3, 0x09, 0xea, - 0x6d, 0x85, 0x0a, 0x79, 0x8c, 0x88, 0x7f, 0x92, 0x89, 0xc6, 0xef, 0x15, 0x60, 0x76, 0x38, 0xbe, - 0x1b, 0x21, 0x28, 0xd0, 0x17, 0x30, 0x20, 0x3e, 0x14, 0x2c, 0x32, 0x1f, 0x82, 0x65, 0x1f, 0x71, - 0x2f, 0x22, 0x7d, 0x41, 0x18, 0xad, 0x1a, 0x97, 0x8c, 0xcd, 0xe5, 0xed, 0xcb, 0xf6, 0x6c, 0x41, - 0xec, 0xf6, 0x08, 0xda, 0xaa, 0xbc, 0x78, 0x55, 0x2f, 0x39, 0xe3, 0xd1, 0x66, 0x07, 0x00, 0x8f, - 0x85, 0x21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x19, 0xdd, 0x6b, 0x2e, 0xe7, 0x44, 0xa7, 0x20, 0xeb, 0xdd, 0x02, 0x20, 0xcd, - 0xfe, 0x18, 0xac, 0x4c, 0xd7, 0xee, 0x3c, 0xf5, 0xa6, 0xb0, 0xb9, 0xea, 0xcd, 0xab, 0x60, 0x2e, - 0x00, 0x63, 0xe5, 0xe6, 0x9d, 0x1c, 0x86, 0x11, 0xcc, 0xda, 0x2a, 0x04, 0xd3, 0x6b, 0x7c, 0x6b, - 0x80, 0x8d, 0xf9, 0x57, 0xee, 0x66, 0x5e, 0xce, 0xe7, 0x45, 0x59, 0xb7, 0xff, 0x4d, 0x54, 0xba, - 0xa3, 0xd6, 0xfd, 0x17, 0x87, 0x35, 0xe3, 0xe0, 0xb0, 0x66, 0xfc, 0x76, 0x58, 0x33, 0x9e, 0x1e, - 0xd5, 0x4a, 0x07, 0x47, 0xb5, 0xd2, 0xcf, 0x47, 0xb5, 0xd2, 0x97, 0xef, 0xe5, 0xbe, 0x6a, 0x9e, - 0xe8, 0xff, 0x36, 0xf2, 0x7d, 0xe3, 0x2e, 0xc9, 0xea, 0xf3, 0xc1, 0x3f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x48, 0x6a, 0x50, 0xaf, 0xc0, 0x0d, 0x00, 0x00, + proto.RegisterType((*MsgCreateValidator)(nil), "liquidstaking.staking.v1beta1.MsgCreateValidator") + proto.RegisterType((*MsgCreateValidatorResponse)(nil), "liquidstaking.staking.v1beta1.MsgCreateValidatorResponse") + proto.RegisterType((*MsgEditValidator)(nil), "liquidstaking.staking.v1beta1.MsgEditValidator") + proto.RegisterType((*MsgEditValidatorResponse)(nil), "liquidstaking.staking.v1beta1.MsgEditValidatorResponse") + proto.RegisterType((*MsgDelegate)(nil), "liquidstaking.staking.v1beta1.MsgDelegate") + proto.RegisterType((*MsgDelegateResponse)(nil), "liquidstaking.staking.v1beta1.MsgDelegateResponse") + proto.RegisterType((*MsgBeginRedelegate)(nil), "liquidstaking.staking.v1beta1.MsgBeginRedelegate") + proto.RegisterType((*MsgBeginRedelegateResponse)(nil), "liquidstaking.staking.v1beta1.MsgBeginRedelegateResponse") + proto.RegisterType((*MsgUndelegate)(nil), "liquidstaking.staking.v1beta1.MsgUndelegate") + proto.RegisterType((*MsgUndelegateResponse)(nil), "liquidstaking.staking.v1beta1.MsgUndelegateResponse") + proto.RegisterType((*MsgCancelUnbondingDelegation)(nil), "liquidstaking.staking.v1beta1.MsgCancelUnbondingDelegation") + proto.RegisterType((*MsgCancelUnbondingDelegationResponse)(nil), "liquidstaking.staking.v1beta1.MsgCancelUnbondingDelegationResponse") + proto.RegisterType((*MsgTokenizeShares)(nil), "liquidstaking.staking.v1beta1.MsgTokenizeShares") + proto.RegisterType((*MsgTokenizeSharesResponse)(nil), "liquidstaking.staking.v1beta1.MsgTokenizeSharesResponse") + proto.RegisterType((*MsgRedeemTokensforShares)(nil), "liquidstaking.staking.v1beta1.MsgRedeemTokensforShares") + proto.RegisterType((*MsgRedeemTokensforSharesResponse)(nil), "liquidstaking.staking.v1beta1.MsgRedeemTokensforSharesResponse") + proto.RegisterType((*MsgTransferTokenizeShareRecord)(nil), "liquidstaking.staking.v1beta1.MsgTransferTokenizeShareRecord") + proto.RegisterType((*MsgTransferTokenizeShareRecordResponse)(nil), "liquidstaking.staking.v1beta1.MsgTransferTokenizeShareRecordResponse") + proto.RegisterType((*MsgExemptDelegation)(nil), "liquidstaking.staking.v1beta1.MsgExemptDelegation") + proto.RegisterType((*MsgExemptDelegationResponse)(nil), "liquidstaking.staking.v1beta1.MsgExemptDelegationResponse") +} + +func init() { proto.RegisterFile("staking/v1beta1/tx.proto", fileDescriptor_dc1f14f20335eae7) } + +var fileDescriptor_dc1f14f20335eae7 = []byte{ + // 1188 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0x3a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67, 0xa5, 0xe7, 0xc7, 0x59, 0xe9, 0xef, 0xe3, + 0xac, 0xf4, 0xe4, 0x24, 0x9b, 0x7a, 0x7e, 0x92, 0x4d, 0xfd, 0x7e, 0x92, 0x4d, 0x7d, 0xb9, 0x11, + 0xfb, 0xc6, 0x76, 0x1e, 0x56, 0xeb, 0xc1, 0xa7, 0xb2, 0xe3, 0x99, 0xf9, 0x70, 0x2d, 0x87, 0x36, + 0x96, 0xf9, 0x3a, 0xcb, 0x2e, 0xb6, 0xea, 0x55, 0x94, 0x3f, 0x8c, 0xfe, 0x69, 0x0a, 0x3f, 0xc0, + 0x2b, 0x63, 0xec, 0x26, 0xfd, 0xf6, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x12, 0x95, 0x6a, 0xa3, + 0x57, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -645,6 +985,17 @@ type MsgClient interface { // // Since: cosmos-sdk 0.46 CancelUnbondingDelegation(ctx context.Context, in *MsgCancelUnbondingDelegation, opts ...grpc.CallOption) (*MsgCancelUnbondingDelegationResponse, error) + // TokenizeShares defines a method for tokenizing shares from a validator. + TokenizeShares(ctx context.Context, in *MsgTokenizeShares, opts ...grpc.CallOption) (*MsgTokenizeSharesResponse, error) + // RedeemTokens defines a method for redeeming tokens from a validator for + // shares. + RedeemTokens(ctx context.Context, in *MsgRedeemTokensforShares, opts ...grpc.CallOption) (*MsgRedeemTokensforSharesResponse, error) + // TransferTokenizeShareRecord defines a method to transfer ownership of + // TokenizeShareRecord + TransferTokenizeShareRecord(ctx context.Context, in *MsgTransferTokenizeShareRecord, opts ...grpc.CallOption) (*MsgTransferTokenizeShareRecordResponse, error) + // ExemptDelegation defines a method for performing exemption of + // delegated coins from a delegator to a validator. + ExemptDelegation(ctx context.Context, in *MsgExemptDelegation, opts ...grpc.CallOption) (*MsgExemptDelegationResponse, error) } type msgClient struct { @@ -657,7 +1008,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) { out := new(MsgCreateValidatorResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/CreateValidator", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/CreateValidator", in, out, opts...) if err != nil { return nil, err } @@ -666,7 +1017,7 @@ func (c *msgClient) CreateValidator(ctx context.Context, in *MsgCreateValidator, func (c *msgClient) EditValidator(ctx context.Context, in *MsgEditValidator, opts ...grpc.CallOption) (*MsgEditValidatorResponse, error) { out := new(MsgEditValidatorResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/EditValidator", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/EditValidator", in, out, opts...) if err != nil { return nil, err } @@ -675,7 +1026,7 @@ func (c *msgClient) EditValidator(ctx context.Context, in *MsgEditValidator, opt func (c *msgClient) Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc.CallOption) (*MsgDelegateResponse, error) { out := new(MsgDelegateResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/Delegate", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/Delegate", in, out, opts...) if err != nil { return nil, err } @@ -684,7 +1035,7 @@ func (c *msgClient) Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc. func (c *msgClient) BeginRedelegate(ctx context.Context, in *MsgBeginRedelegate, opts ...grpc.CallOption) (*MsgBeginRedelegateResponse, error) { out := new(MsgBeginRedelegateResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/BeginRedelegate", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/BeginRedelegate", in, out, opts...) if err != nil { return nil, err } @@ -693,7 +1044,7 @@ func (c *msgClient) BeginRedelegate(ctx context.Context, in *MsgBeginRedelegate, func (c *msgClient) Undelegate(ctx context.Context, in *MsgUndelegate, opts ...grpc.CallOption) (*MsgUndelegateResponse, error) { out := new(MsgUndelegateResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/Undelegate", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/Undelegate", in, out, opts...) if err != nil { return nil, err } @@ -702,7 +1053,43 @@ func (c *msgClient) Undelegate(ctx context.Context, in *MsgUndelegate, opts ...g func (c *msgClient) CancelUnbondingDelegation(ctx context.Context, in *MsgCancelUnbondingDelegation, opts ...grpc.CallOption) (*MsgCancelUnbondingDelegationResponse, error) { out := new(MsgCancelUnbondingDelegationResponse) - err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation", in, out, opts...) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/CancelUnbondingDelegation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TokenizeShares(ctx context.Context, in *MsgTokenizeShares, opts ...grpc.CallOption) (*MsgTokenizeSharesResponse, error) { + out := new(MsgTokenizeSharesResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/TokenizeShares", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RedeemTokens(ctx context.Context, in *MsgRedeemTokensforShares, opts ...grpc.CallOption) (*MsgRedeemTokensforSharesResponse, error) { + out := new(MsgRedeemTokensforSharesResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/RedeemTokens", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TransferTokenizeShareRecord(ctx context.Context, in *MsgTransferTokenizeShareRecord, opts ...grpc.CallOption) (*MsgTransferTokenizeShareRecordResponse, error) { + out := new(MsgTransferTokenizeShareRecordResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/TransferTokenizeShareRecord", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ExemptDelegation(ctx context.Context, in *MsgExemptDelegation, opts ...grpc.CallOption) (*MsgExemptDelegationResponse, error) { + out := new(MsgExemptDelegationResponse) + err := c.cc.Invoke(ctx, "/liquidstaking.staking.v1beta1.Msg/ExemptDelegation", in, out, opts...) if err != nil { return nil, err } @@ -729,6 +1116,17 @@ type MsgServer interface { // // Since: cosmos-sdk 0.46 CancelUnbondingDelegation(context.Context, *MsgCancelUnbondingDelegation) (*MsgCancelUnbondingDelegationResponse, error) + // TokenizeShares defines a method for tokenizing shares from a validator. + TokenizeShares(context.Context, *MsgTokenizeShares) (*MsgTokenizeSharesResponse, error) + // RedeemTokens defines a method for redeeming tokens from a validator for + // shares. + RedeemTokens(context.Context, *MsgRedeemTokensforShares) (*MsgRedeemTokensforSharesResponse, error) + // TransferTokenizeShareRecord defines a method to transfer ownership of + // TokenizeShareRecord + TransferTokenizeShareRecord(context.Context, *MsgTransferTokenizeShareRecord) (*MsgTransferTokenizeShareRecordResponse, error) + // ExemptDelegation defines a method for performing exemption of + // delegated coins from a delegator to a validator. + ExemptDelegation(context.Context, *MsgExemptDelegation) (*MsgExemptDelegationResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -753,6 +1151,18 @@ func (*UnimplementedMsgServer) Undelegate(ctx context.Context, req *MsgUndelegat func (*UnimplementedMsgServer) CancelUnbondingDelegation(ctx context.Context, req *MsgCancelUnbondingDelegation) (*MsgCancelUnbondingDelegationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelUnbondingDelegation not implemented") } +func (*UnimplementedMsgServer) TokenizeShares(ctx context.Context, req *MsgTokenizeShares) (*MsgTokenizeSharesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenizeShares not implemented") +} +func (*UnimplementedMsgServer) RedeemTokens(ctx context.Context, req *MsgRedeemTokensforShares) (*MsgRedeemTokensforSharesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RedeemTokens not implemented") +} +func (*UnimplementedMsgServer) TransferTokenizeShareRecord(ctx context.Context, req *MsgTransferTokenizeShareRecord) (*MsgTransferTokenizeShareRecordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferTokenizeShareRecord not implemented") +} +func (*UnimplementedMsgServer) ExemptDelegation(ctx context.Context, req *MsgExemptDelegation) (*MsgExemptDelegationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExemptDelegation not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -768,7 +1178,7 @@ func _Msg_CreateValidator_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Msg/CreateValidator", + FullMethod: "/liquidstaking.staking.v1beta1.Msg/CreateValidator", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CreateValidator(ctx, req.(*MsgCreateValidator)) @@ -786,7 +1196,7 @@ func _Msg_EditValidator_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Msg/EditValidator", + FullMethod: "/liquidstaking.staking.v1beta1.Msg/EditValidator", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).EditValidator(ctx, req.(*MsgEditValidator)) @@ -804,7 +1214,7 @@ func _Msg_Delegate_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Msg/Delegate", + FullMethod: "/liquidstaking.staking.v1beta1.Msg/Delegate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Delegate(ctx, req.(*MsgDelegate)) @@ -822,7 +1232,7 @@ func _Msg_BeginRedelegate_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Msg/BeginRedelegate", + FullMethod: "/liquidstaking.staking.v1beta1.Msg/BeginRedelegate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).BeginRedelegate(ctx, req.(*MsgBeginRedelegate)) @@ -840,7 +1250,7 @@ func _Msg_Undelegate_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Msg/Undelegate", + FullMethod: "/liquidstaking.staking.v1beta1.Msg/Undelegate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Undelegate(ctx, req.(*MsgUndelegate)) @@ -858,7 +1268,7 @@ func _Msg_CancelUnbondingDelegation_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation", + FullMethod: "/liquidstaking.staking.v1beta1.Msg/CancelUnbondingDelegation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).CancelUnbondingDelegation(ctx, req.(*MsgCancelUnbondingDelegation)) @@ -866,53 +1276,141 @@ func _Msg_CancelUnbondingDelegation_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.staking.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateValidator", - Handler: _Msg_CreateValidator_Handler, - }, - { - MethodName: "EditValidator", - Handler: _Msg_EditValidator_Handler, - }, - { - MethodName: "Delegate", - Handler: _Msg_Delegate_Handler, - }, - { - MethodName: "BeginRedelegate", - Handler: _Msg_BeginRedelegate_Handler, - }, - { - MethodName: "Undelegate", - Handler: _Msg_Undelegate_Handler, - }, - { - MethodName: "CancelUnbondingDelegation", - Handler: _Msg_CancelUnbondingDelegation_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/staking/v1beta1/tx.proto", -} - -func (m *MsgCreateValidator) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { +func _Msg_TokenizeShares_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTokenizeShares) + if err := dec(in); err != nil { return nil, err } - return dAtA[:n], nil + if interceptor == nil { + return srv.(MsgServer).TokenizeShares(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Msg/TokenizeShares", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TokenizeShares(ctx, req.(*MsgTokenizeShares)) + } + return interceptor(ctx, in, info, handler) } -func (m *MsgCreateValidator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} +func _Msg_RedeemTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRedeemTokensforShares) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RedeemTokens(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Msg/RedeemTokens", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RedeemTokens(ctx, req.(*MsgRedeemTokensforShares)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_TransferTokenizeShareRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransferTokenizeShareRecord) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TransferTokenizeShareRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Msg/TransferTokenizeShareRecord", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TransferTokenizeShareRecord(ctx, req.(*MsgTransferTokenizeShareRecord)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ExemptDelegation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExemptDelegation) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExemptDelegation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/liquidstaking.staking.v1beta1.Msg/ExemptDelegation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExemptDelegation(ctx, req.(*MsgExemptDelegation)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "liquidstaking.staking.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateValidator", + Handler: _Msg_CreateValidator_Handler, + }, + { + MethodName: "EditValidator", + Handler: _Msg_EditValidator_Handler, + }, + { + MethodName: "Delegate", + Handler: _Msg_Delegate_Handler, + }, + { + MethodName: "BeginRedelegate", + Handler: _Msg_BeginRedelegate_Handler, + }, + { + MethodName: "Undelegate", + Handler: _Msg_Undelegate_Handler, + }, + { + MethodName: "CancelUnbondingDelegation", + Handler: _Msg_CancelUnbondingDelegation_Handler, + }, + { + MethodName: "TokenizeShares", + Handler: _Msg_TokenizeShares_Handler, + }, + { + MethodName: "RedeemTokens", + Handler: _Msg_RedeemTokens_Handler, + }, + { + MethodName: "TransferTokenizeShareRecord", + Handler: _Msg_TransferTokenizeShareRecord_Handler, + }, + { + MethodName: "ExemptDelegation", + Handler: _Msg_ExemptDelegation_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "staking/v1beta1/tx.proto", +} + +func (m *MsgCreateValidator) 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 *MsgCreateValidator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} func (m *MsgCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) @@ -928,7 +1426,7 @@ func (m *MsgCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x32 if m.Pubkey != nil { { size, err := m.Pubkey.MarshalToSizedBuffer(dAtA[:i]) @@ -939,32 +1437,22 @@ func (m *MsgCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a } if len(m.ValidatorAddress) > 0 { i -= len(m.ValidatorAddress) copy(dAtA[i:], m.ValidatorAddress) i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorAddress))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } if len(m.DelegatorAddress) > 0 { i -= len(m.DelegatorAddress) copy(dAtA[i:], m.DelegatorAddress) i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) i-- - dAtA[i] = 0x22 - } - { - size := m.MinSelfDelegation.Size() - i -= size - if _, err := m.MinSelfDelegation.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) + dAtA[i] = 0x1a } - i-- - dAtA[i] = 0x1a { size, err := m.Commission.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1031,18 +1519,6 @@ func (m *MsgEditValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.MinSelfDelegation != nil { - { - size := m.MinSelfDelegation.Size() - i -= size - if _, err := m.MinSelfDelegation.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } if m.CommissionRate != nil { { size := m.CommissionRate.Size() @@ -1406,101 +1882,380 @@ func (m *MsgCancelUnbondingDelegationResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgTokenizeShares) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgCreateValidator) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgTokenizeShares) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTokenizeShares) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.Description.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.Commission.Size() - n += 1 + l + sovTx(uint64(l)) - l = m.MinSelfDelegation.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.TokenizedShareOwner) > 0 { + i -= len(m.TokenizedShareOwner) + copy(dAtA[i:], m.TokenizedShareOwner) + i = encodeVarintTx(dAtA, i, uint64(len(m.TokenizedShareOwner))) + i-- + dAtA[i] = 0x22 } - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - if m.Pubkey != nil { - l = m.Pubkey.Size() - n += 1 + l + sovTx(uint64(l)) + i-- + dAtA[i] = 0x1a + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 } - l = m.Value.Size() - n += 1 + l + sovTx(uint64(l)) - return n + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *MsgCreateValidatorResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgTokenizeSharesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *MsgEditValidator) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgTokenizeSharesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTokenizeSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.Description.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.CommissionRate != nil { - l = m.CommissionRate.Size() - n += 1 + l + sovTx(uint64(l)) - } - if m.MinSelfDelegation != nil { - l = m.MinSelfDelegation.Size() - n += 1 + l + sovTx(uint64(l)) + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - return n + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } -func (m *MsgEditValidatorResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgRedeemTokensforShares) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *MsgDelegate) Size() (n int) { - if m == nil { - return 0 - } +func (m *MsgRedeemTokensforShares) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRedeemTokensforShares) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRedeemTokensforSharesResponse) 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 *MsgRedeemTokensforSharesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRedeemTokensforSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgTransferTokenizeShareRecord) 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 *MsgTransferTokenizeShareRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferTokenizeShareRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NewOwner) > 0 { + i -= len(m.NewOwner) + copy(dAtA[i:], m.NewOwner) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewOwner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if m.TokenizeShareRecordId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TokenizeShareRecordId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferTokenizeShareRecordResponse) 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 *MsgTransferTokenizeShareRecordResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferTokenizeShareRecordResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgExemptDelegation) 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 *MsgExemptDelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExemptDelegation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExemptDelegationResponse) 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 *MsgExemptDelegationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExemptDelegationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateValidator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Description.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.Commission.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Pubkey != nil { + l = m.Pubkey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = m.Value.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgCreateValidatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgEditValidator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Description.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.CommissionRate != nil { + l = m.CommissionRate.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgEditValidatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDelegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = m.Amount.Size() n += 1 + l + sovTx(uint64(l)) return n @@ -1610,21 +2365,136 @@ func (m *MsgCancelUnbondingDelegationResponse) Size() (n int) { return n } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx +func (m *MsgTokenizeShares) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.TokenizedShareOwner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTokenizeSharesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgRedeemTokensforShares) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgRedeemTokensforSharesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgTransferTokenizeShareRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenizeShareRecordId != 0 { + n += 1 + sovTx(uint64(m.TokenizeShareRecordId)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.NewOwner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTransferTokenizeShareRecordResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgExemptDelegation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgExemptDelegationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1713,7 +2583,39 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinSelfDelegation", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1730,22 +2632,587 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pubkey == nil { + m.Pubkey = &types.Any{} + } + if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateValidatorResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateValidatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgEditValidator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditValidator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommissionRate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Dec + m.CommissionRate = &v + if err := m.CommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgEditValidatorResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgEditValidatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDelegate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - if err := m.MinSelfDelegation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 4: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBeginRedelegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBeginRedelegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) } @@ -1777,9 +3244,9 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { } m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSrcAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1807,13 +3274,13 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + m.ValidatorSrcAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorDstAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1823,31 +3290,27 @@ func (m *MsgCreateValidator) 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 ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pubkey == nil { - m.Pubkey = &types.Any{} - } - if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ValidatorDstAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1874,7 +3337,7 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1899,7 +3362,7 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateValidatorResponse) Unmarshal(dAtA []byte) error { +func (m *MsgBeginRedelegateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1922,12 +3385,45 @@ func (m *MsgCreateValidatorResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateValidatorResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgBeginRedelegateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgBeginRedelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CompletionTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1949,7 +3445,7 @@ func (m *MsgCreateValidatorResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { +func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1972,48 +3468,15 @@ func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgEditValidator: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUndelegate: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgEditValidator: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUndelegate: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Description.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2041,11 +3504,11 @@ func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommissionRate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2073,17 +3536,13 @@ func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Dec - m.CommissionRate = &v - if err := m.CommissionRate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinSelfDelegation", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2093,25 +3552,22 @@ func (m *MsgEditValidator) 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 ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int - m.MinSelfDelegation = &v - if err := m.MinSelfDelegation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2136,7 +3592,7 @@ func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgEditValidatorResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2159,12 +3615,45 @@ func (m *MsgEditValidatorResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgEditValidatorResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUndelegateResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgEditValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUndelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CompletionTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2186,7 +3675,7 @@ func (m *MsgEditValidatorResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgDelegate) Unmarshal(dAtA []byte) error { +func (m *MsgCancelUnbondingDelegation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2209,10 +3698,10 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgDelegate: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCancelUnbondingDelegation: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDelegate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCancelUnbondingDelegation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2311,7 +3800,26 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - iNdEx = postIndex + iNdEx = postIndex + case 4: + 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 ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2333,7 +3841,7 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCancelUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2356,10 +3864,10 @@ func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgDelegateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCancelUnbondingDelegationResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCancelUnbondingDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -2383,7 +3891,7 @@ func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { +func (m *MsgTokenizeShares) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2406,10 +3914,10 @@ func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgBeginRedelegate: wiretype end group for non-group") + return fmt.Errorf("proto: MsgTokenizeShares: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBeginRedelegate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgTokenizeShares: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2446,7 +3954,7 @@ func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSrcAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2474,13 +3982,13 @@ func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorSrcAddress = string(dAtA[iNdEx:postIndex]) + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorDstAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2490,29 +3998,30 @@ func (m *MsgBeginRedelegate) 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 ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorDstAddress = string(dAtA[iNdEx:postIndex]) + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenizedShareOwner", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2522,24 +4031,23 @@ func (m *MsgBeginRedelegate) 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 ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.TokenizedShareOwner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2562,7 +4070,7 @@ func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgBeginRedelegateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgTokenizeSharesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2585,15 +4093,15 @@ func (m *MsgBeginRedelegateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgBeginRedelegateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgTokenizeSharesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBeginRedelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgTokenizeSharesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2620,7 +4128,7 @@ func (m *MsgBeginRedelegateResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CompletionTime, dAtA[iNdEx:postIndex]); err != nil { + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2645,7 +4153,7 @@ func (m *MsgBeginRedelegateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { +func (m *MsgRedeemTokensforShares) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2668,10 +4176,10 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUndelegate: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRedeemTokensforShares: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUndelegate: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRedeemTokensforShares: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2707,38 +4215,6 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } @@ -2792,7 +4268,7 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRedeemTokensforSharesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2815,15 +4291,15 @@ func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUndelegateResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRedeemTokensforSharesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUndelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRedeemTokensforSharesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2850,7 +4326,7 @@ func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CompletionTime, dAtA[iNdEx:postIndex]); err != nil { + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2875,7 +4351,7 @@ func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCancelUnbondingDelegation) Unmarshal(dAtA []byte) error { +func (m *MsgTransferTokenizeShareRecord) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2898,15 +4374,34 @@ func (m *MsgCancelUnbondingDelegation) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCancelUnbondingDelegation: wiretype end group for non-group") + return fmt.Errorf("proto: MsgTransferTokenizeShareRecord: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCancelUnbondingDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgTransferTokenizeShareRecord: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenizeShareRecordId", wireType) + } + m.TokenizeShareRecordId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TokenizeShareRecordId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2934,11 +4429,11 @@ func (m *MsgCancelUnbondingDelegation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + m.Sender = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NewOwner", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2966,13 +4461,113 @@ func (m *MsgCancelUnbondingDelegation) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + m.NewOwner = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferTokenizeShareRecordResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferTokenizeShareRecordResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferTokenizeShareRecordResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgExemptDelegation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgExemptDelegation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExemptDelegation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2982,30 +4577,29 @@ func (m *MsgCancelUnbondingDelegation) 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 ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) } - m.CreationHeight = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3015,11 +4609,24 @@ func (m *MsgCancelUnbondingDelegation) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CreationHeight |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3041,7 +4648,7 @@ func (m *MsgCancelUnbondingDelegation) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCancelUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { +func (m *MsgExemptDelegationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3064,10 +4671,10 @@ func (m *MsgCancelUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCancelUnbondingDelegationResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgExemptDelegationResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCancelUnbondingDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgExemptDelegationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index 4296181ec9b5..be33e39819da 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -17,6 +17,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) const ( @@ -35,7 +36,7 @@ var ( BondStatusBonded = BondStatus_name[int32(Bonded)] ) -var _ ValidatorI = Validator{} +var _ sdkstaking.ValidatorI = Validator{} // NewValidator constructs a new Validator //nolint:interfacer @@ -46,17 +47,18 @@ func NewValidator(operator sdk.ValAddress, pubKey cryptotypes.PubKey, descriptio } return Validator{ - OperatorAddress: operator.String(), - ConsensusPubkey: pkAny, - Jailed: false, - Status: Unbonded, - Tokens: sdk.ZeroInt(), - DelegatorShares: sdk.ZeroDec(), - Description: description, - UnbondingHeight: int64(0), - UnbondingTime: time.Unix(0, 0).UTC(), - Commission: NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdk.OneInt(), + OperatorAddress: operator.String(), + ConsensusPubkey: pkAny, + Jailed: false, + Status: sdkstaking.Unbonded, + Tokens: sdk.ZeroInt(), + DelegatorShares: sdk.ZeroDec(), + Description: description, + UnbondingHeight: int64(0), + UnbondingTime: time.Unix(0, 0).UTC(), + Commission: NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), + TotalExemptShares: sdk.ZeroDec(), + TotalTokenizedShares: sdk.ZeroDec(), }, nil } @@ -86,15 +88,6 @@ func (v Validators) String() (out string) { return strings.TrimSpace(out) } -// ToSDKValidators - convenience function convert []Validator to []sdk.ValidatorI -func (v Validators) ToSDKValidators() (validators []ValidatorI) { - for _, val := range v { - validators = append(validators, val) - } - - return validators -} - // Sort Validators sorts validator array in ascending operator address order func (v Validators) Sort() { sort.Sort(v) @@ -173,17 +166,17 @@ func UnmarshalValidator(cdc codec.BinaryCodec, value []byte) (v Validator, err e // IsBonded checks if the validator status equals Bonded func (v Validator) IsBonded() bool { - return v.GetStatus() == Bonded + return v.GetStatus() == sdkstaking.Bonded } // IsUnbonded checks if the validator status equals Unbonded func (v Validator) IsUnbonded() bool { - return v.GetStatus() == Unbonded + return v.GetStatus() == sdkstaking.Unbonded } // IsUnbonding checks if the validator status equals Unbonding func (v Validator) IsUnbonding() bool { - return v.GetStatus() == Unbonding + return v.GetStatus() == sdkstaking.Unbonding } // constant used in flags to indicate that description field should not be updated @@ -329,7 +322,7 @@ func (v Validator) TokensFromSharesRoundUp(shares sdk.Dec) sdk.Dec { // returns an error if the validator has no tokens. func (v Validator) SharesFromTokens(amt sdk.Int) (sdk.Dec, error) { if v.Tokens.IsZero() { - return sdk.ZeroDec(), ErrInsufficientShares + return sdk.ZeroDec(), sdkstaking.ErrInsufficientShares } return v.GetDelegatorShares().MulInt(amt).QuoInt(v.GetTokens()), nil @@ -339,7 +332,7 @@ func (v Validator) SharesFromTokens(amt sdk.Int) (sdk.Dec, error) { // a bond amount. It returns an error if the validator has no tokens. func (v Validator) SharesFromTokensTruncated(amt sdk.Int) (sdk.Dec, error) { if v.Tokens.IsZero() { - return sdk.ZeroDec(), ErrInsufficientShares + return sdk.ZeroDec(), sdkstaking.ErrInsufficientShares } return v.GetDelegatorShares().MulInt(amt).QuoTruncate(sdk.NewDecFromInt(v.GetTokens())), nil @@ -371,7 +364,7 @@ func (v Validator) PotentialConsensusPower(r sdk.Int) int64 { // UpdateStatus updates the location of the shares within a validator // to reflect the new status -func (v Validator) UpdateStatus(newStatus BondStatus) Validator { +func (v Validator) UpdateStatus(newStatus sdkstaking.BondStatus) Validator { v.Status = newStatus return v } @@ -450,8 +443,8 @@ func (v *Validator) MinEqual(other *Validator) bool { v.Description.Equal(other.Description) && v.Commission.Equal(other.Commission) && v.Jailed == other.Jailed && - v.MinSelfDelegation.Equal(other.MinSelfDelegation) && v.ConsensusPubkey.Equal(other.ConsensusPubkey) + } // Equal checks if the receiver equals the parameter @@ -461,9 +454,9 @@ func (v *Validator) Equal(v2 *Validator) bool { v.UnbondingTime.Equal(v2.UnbondingTime) } -func (v Validator) IsJailed() bool { return v.Jailed } -func (v Validator) GetMoniker() string { return v.Description.Moniker } -func (v Validator) GetStatus() BondStatus { return v.Status } +func (v Validator) IsJailed() bool { return v.Jailed } +func (v Validator) GetMoniker() string { return v.Description.Moniker } +func (v Validator) GetStatus() sdkstaking.BondStatus { return v.Status } func (v Validator) GetOperator() sdk.ValAddress { if v.OperatorAddress == "" { return nil @@ -483,6 +476,7 @@ func (v Validator) ConsPubKey() (cryptotypes.PubKey, error) { } return pk, nil + } // TmConsPublicKey casts Validator.ConsensusPubkey to tmprotocrypto.PubKey. @@ -515,9 +509,10 @@ func (v Validator) GetBondedTokens() sdk.Int { return v.BondedTokens() } func (v Validator) GetConsensusPower(r sdk.Int) int64 { return v.ConsensusPower(r) } -func (v Validator) GetCommission() sdk.Dec { return v.Commission.Rate } -func (v Validator) GetMinSelfDelegation() sdk.Int { return v.MinSelfDelegation } -func (v Validator) GetDelegatorShares() sdk.Dec { return v.DelegatorShares } +func (v Validator) GetCommission() sdk.Dec { return v.Commission.Rate } +func (v Validator) GetDelegatorShares() sdk.Dec { return v.DelegatorShares } + +func (v Validator) GetMinSelfDelegation() sdk.Int { return sdk.ZeroInt() } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (v Validator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index 6e3172e51db2..3b7a933b6b96 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -16,6 +16,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestValidatorTestEquivalent(t *testing.T) { @@ -91,8 +92,8 @@ func TestRemoveTokens(t *testing.T) { require.Equal(t, int64(90), validator.Tokens.Int64()) // update validator to from bonded -> unbonded - validator = validator.UpdateStatus(types.Unbonded) - require.Equal(t, types.Unbonded, validator.Status) + validator = validator.UpdateStatus(sdkstaking.Unbonded) + require.Equal(t, sdkstaking.Unbonded, validator.Status) validator = validator.RemoveTokens(sdk.NewInt(10)) require.Panics(t, func() { validator.RemoveTokens(sdk.NewInt(-1)) }) @@ -101,7 +102,7 @@ func TestRemoveTokens(t *testing.T) { func TestAddTokensValidatorBonded(t *testing.T) { validator := newValidator(t, valAddr1, pk1) - validator = validator.UpdateStatus(types.Bonded) + validator = validator.UpdateStatus(sdkstaking.Bonded) validator, delShares := validator.AddTokensFromDel(sdk.NewInt(10)) assert.True(sdk.DecEq(t, sdk.NewDec(10), delShares)) @@ -111,22 +112,23 @@ func TestAddTokensValidatorBonded(t *testing.T) { func TestAddTokensValidatorUnbonding(t *testing.T) { validator := newValidator(t, valAddr1, pk1) - validator = validator.UpdateStatus(types.Unbonding) + validator = validator.UpdateStatus(sdkstaking.Unbonding) validator, delShares := validator.AddTokensFromDel(sdk.NewInt(10)) assert.True(sdk.DecEq(t, sdk.NewDec(10), delShares)) - assert.Equal(t, types.Unbonding, validator.Status) + assert.Equal(t, sdkstaking.Unbonding, validator.Status) assert.True(sdk.IntEq(t, sdk.NewInt(10), validator.Tokens)) assert.True(sdk.DecEq(t, sdk.NewDec(10), validator.DelegatorShares)) } func TestAddTokensValidatorUnbonded(t *testing.T) { + validator := newValidator(t, valAddr1, pk1) - validator = validator.UpdateStatus(types.Unbonded) + validator = validator.UpdateStatus(sdkstaking.Unbonded) validator, delShares := validator.AddTokensFromDel(sdk.NewInt(10)) assert.True(sdk.DecEq(t, sdk.NewDec(10), delShares)) - assert.Equal(t, types.Unbonded, validator.Status) + assert.Equal(t, sdkstaking.Unbonded, validator.Status) assert.True(sdk.IntEq(t, sdk.NewInt(10), validator.Tokens)) assert.True(sdk.DecEq(t, sdk.NewDec(10), validator.DelegatorShares)) } @@ -136,7 +138,7 @@ func TestRemoveDelShares(t *testing.T) { valA := types.Validator{ OperatorAddress: valAddr1.String(), ConsensusPubkey: pk1Any, - Status: types.Bonded, + Status: sdkstaking.Bonded, Tokens: sdk.NewInt(100), DelegatorShares: sdk.NewDec(100), } @@ -171,20 +173,20 @@ func TestAddTokensFromDel(t *testing.T) { func TestUpdateStatus(t *testing.T) { validator := newValidator(t, valAddr1, pk1) validator, _ = validator.AddTokensFromDel(sdk.NewInt(100)) - require.Equal(t, types.Unbonded, validator.Status) + require.Equal(t, sdkstaking.Unbonded, validator.Status) require.Equal(t, int64(100), validator.Tokens.Int64()) // Unbonded to Bonded - validator = validator.UpdateStatus(types.Bonded) - require.Equal(t, types.Bonded, validator.Status) + validator = validator.UpdateStatus(sdkstaking.Bonded) + require.Equal(t, sdkstaking.Bonded, validator.Status) // Bonded to Unbonding - validator = validator.UpdateStatus(types.Unbonding) - require.Equal(t, types.Unbonding, validator.Status) + validator = validator.UpdateStatus(sdkstaking.Unbonding) + require.Equal(t, sdkstaking.Unbonding, validator.Status) // Unbonding to Bonded - validator = validator.UpdateStatus(types.Bonded) - require.Equal(t, types.Bonded, validator.Status) + validator = validator.UpdateStatus(sdkstaking.Bonded) + require.Equal(t, sdkstaking.Bonded, validator.Status) } func TestPossibleOverflow(t *testing.T) { @@ -278,7 +280,7 @@ func TestValidatorsSortTendermint(t *testing.T) { pk := ed25519.GenPrivKey().PubKey() pk2 := ed25519.GenPrivKey().PubKey() vals[i] = newValidator(t, sdk.ValAddress(pk2.Address()), pk) - vals[i].Status = types.Bonded + vals[i].Status = sdkstaking.Bonded vals[i].Tokens = sdk.NewInt(rand.Int63()) } // create some validators with the same power @@ -310,7 +312,7 @@ func TestValidatorToTm(t *testing.T) { for i := range vals { pk := ed25519.GenPrivKey().PubKey() val := newValidator(t, sdk.ValAddress(pk.Address()), pk) - val.Status = types.Bonded + val.Status = sdkstaking.Bonded val.Tokens = sdk.NewInt(rand.Int63()) vals[i] = val tmPk, err := cryptocodec.ToTmPubKeyInterface(pk) @@ -326,7 +328,7 @@ func TestBondStatus(t *testing.T) { require.False(t, types.Unbonded == types.Bonded) require.False(t, types.Unbonded == types.Unbonding) require.False(t, types.Bonded == types.Unbonding) - require.Equal(t, types.BondStatus(4).String(), "4") + require.Equal(t, sdkstaking.BondStatus(4).String(), "4") require.Equal(t, types.BondStatusUnspecified, types.Unspecified.String()) require.Equal(t, types.BondStatusUnbonded, types.Unbonded.String()) require.Equal(t, types.BondStatusBonded, types.Bonded.String()) @@ -337,7 +339,7 @@ func mkValidator(tokens int64, shares sdk.Dec) types.Validator { return types.Validator{ OperatorAddress: valAddr1.String(), ConsensusPubkey: pk1Any, - Status: types.Bonded, + Status: sdkstaking.Bonded, Tokens: sdk.NewInt(tokens), DelegatorShares: shares, } From 0e696e414107dffe5fdd0d3e4c913ebd8178906c Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 12 Aug 2022 17:54:03 +0200 Subject: [PATCH 2/4] reduce file changes --- x/distribution/types/errors.go | 24 ++++---- x/distribution/types/proposal.go | 5 +- x/slashing/keeper/querier.go | 3 +- x/slashing/types/errors.go | 26 ++++---- x/slashing/types/msg_test.go | 3 +- x/staking/app_test.go | 3 +- x/staking/genesis.go | 3 +- x/staking/genesis_test.go | 3 +- x/staking/keeper/alias_functions.go | 15 +++-- x/staking/keeper/common_test.go | 3 +- x/staking/keeper/delegation.go | 46 +++++++------- x/staking/keeper/delegation_test.go | 3 +- x/staking/keeper/genesis.go | 5 +- x/staking/keeper/genesis_test.go | 15 +++-- x/staking/keeper/grpc_query.go | 7 +-- x/staking/keeper/grpc_query_test.go | 9 ++- x/staking/keeper/historical_info_test.go | 5 +- x/staking/keeper/invariants.go | 7 +-- x/staking/keeper/msg_server.go | 53 ++++++++-------- x/staking/types/commission.go | 21 +++---- x/staking/types/delegation.go | 3 +- x/staking/types/errors.go | 78 ++++++++++++------------ x/staking/types/expected_keepers.go | 19 +++--- x/staking/types/exported.go | 3 +- x/staking/types/historical_info.go | 5 +- x/staking/types/msg.go | 3 +- x/staking/types/staking.pb.go | 5 +- x/staking/types/validator.go | 23 ++++--- 28 files changed, 187 insertions(+), 211 deletions(-) diff --git a/x/distribution/types/errors.go b/x/distribution/types/errors.go index 5f96eec59d97..b80c8b1f25a8 100644 --- a/x/distribution/types/errors.go +++ b/x/distribution/types/errors.go @@ -6,17 +6,17 @@ import ( // x/distribution module sentinel errors var ( - // ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 2, "delegator address is empty") - // ErrEmptyWithdrawAddr = sdkerrors.Register(ModuleName, 3, "withdraw address is empty") - // ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 4, "validator address is empty") - // ErrEmptyDelegationDistInfo = sdkerrors.Register(ModuleName, 5, "no delegation distribution info") - // ErrNoValidatorDistInfo = sdkerrors.Register(ModuleName, 6, "no validator distribution info") - // ErrNoValidatorCommission = sdkerrors.Register(ModuleName, 7, "no validator commission to withdraw") - // ErrSetWithdrawAddrDisabled = sdkerrors.Register(ModuleName, 8, "set withdraw address disabled") - // ErrBadDistribution = sdkerrors.Register(ModuleName, 9, "community pool does not have sufficient coins to distribute") - // ErrInvalidProposalAmount = sdkerrors.Register(ModuleName, 10, "invalid community pool spend proposal amount") - // ErrEmptyProposalRecipient = sdkerrors.Register(ModuleName, 11, "invalid community pool spend proposal recipient") - // ErrNoValidatorExists = sdkerrors.Register(ModuleName, 12, "validator does not exist") - // ErrNoDelegationExists = sdkerrors.Register(ModuleName, 13, "delegation does not exist") + ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 2, "delegator address is empty") + ErrEmptyWithdrawAddr = sdkerrors.Register(ModuleName, 3, "withdraw address is empty") + ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 4, "validator address is empty") + ErrEmptyDelegationDistInfo = sdkerrors.Register(ModuleName, 5, "no delegation distribution info") + ErrNoValidatorDistInfo = sdkerrors.Register(ModuleName, 6, "no validator distribution info") + ErrNoValidatorCommission = sdkerrors.Register(ModuleName, 7, "no validator commission to withdraw") + ErrSetWithdrawAddrDisabled = sdkerrors.Register(ModuleName, 8, "set withdraw address disabled") + ErrBadDistribution = sdkerrors.Register(ModuleName, 9, "community pool does not have sufficient coins to distribute") + ErrInvalidProposalAmount = sdkerrors.Register(ModuleName, 10, "invalid community pool spend proposal amount") + ErrEmptyProposalRecipient = sdkerrors.Register(ModuleName, 11, "invalid community pool spend proposal recipient") + ErrNoValidatorExists = sdkerrors.Register(ModuleName, 12, "validator does not exist") + ErrNoDelegationExists = sdkerrors.Register(ModuleName, 13, "delegation does not exist") ErrNotTokenizeShareRecordOwner = sdkerrors.Register(ModuleName, 44, "not tokenize share record owner") ) diff --git a/x/distribution/types/proposal.go b/x/distribution/types/proposal.go index 2829df257c96..35435c27272c 100644 --- a/x/distribution/types/proposal.go +++ b/x/distribution/types/proposal.go @@ -5,7 +5,6 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" - sdkdistr "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) @@ -48,10 +47,10 @@ func (csp *CommunityPoolSpendProposal) ValidateBasic() error { return err } if !csp.Amount.IsValid() { - return sdkdistr.ErrInvalidProposalAmount + return ErrInvalidProposalAmount } if csp.Recipient == "" { - return sdkdistr.ErrEmptyProposalRecipient + return ErrEmptyProposalRecipient } return nil diff --git a/x/slashing/keeper/querier.go b/x/slashing/keeper/querier.go index 72faab2da76f..036f3a16dde3 100644 --- a/x/slashing/keeper/querier.go +++ b/x/slashing/keeper/querier.go @@ -8,7 +8,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/slashing/types" - sdkslashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" ) // NewQuerier creates a new querier for slashing clients. @@ -51,7 +50,7 @@ func querySigningInfo(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQu signingInfo, found := k.GetValidatorSigningInfo(ctx, sdk.ConsAddress(params.ConsAddress)) if !found { - return nil, sdkerrors.Wrap(sdkslashingtypes.ErrNoSigningInfoFound, params.ConsAddress) + return nil, sdkerrors.Wrap(types.ErrNoSigningInfoFound, params.ConsAddress) } res, err := codec.MarshalJSONIndent(legacyQuerierCdc, signingInfo) diff --git a/x/slashing/types/errors.go b/x/slashing/types/errors.go index 367071f3ea92..daff6ecc04af 100644 --- a/x/slashing/types/errors.go +++ b/x/slashing/types/errors.go @@ -1,16 +1,16 @@ package types -// import ( -// sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -// ) +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) -// // x/slashing module sentinel errors -// var ( -// ErrNoValidatorForAddress = sdkerrors.Register(ModuleName, 2, "address is not associated with any known validator") -// ErrBadValidatorAddr = sdkerrors.Register(ModuleName, 3, "validator does not exist for that address") -// ErrValidatorJailed = sdkerrors.Register(ModuleName, 4, "validator still jailed; cannot be unjailed") -// ErrValidatorNotJailed = sdkerrors.Register(ModuleName, 5, "validator not jailed; cannot be unjailed") -// ErrMissingSelfDelegation = sdkerrors.Register(ModuleName, 6, "validator has no self-delegation; cannot be unjailed") -// ErrSelfDelegationTooLowToUnjail = sdkerrors.Register(ModuleName, 7, "validator's self delegation less than minimum; cannot be unjailed") -// ErrNoSigningInfoFound = sdkerrors.Register(ModuleName, 8, "no validator signing info found") -// ) +// x/slashing module sentinel errors +var ( + ErrNoValidatorForAddress = sdkerrors.Register(ModuleName, 2, "address is not associated with any known validator") + ErrBadValidatorAddr = sdkerrors.Register(ModuleName, 3, "validator does not exist for that address") + ErrValidatorJailed = sdkerrors.Register(ModuleName, 4, "validator still jailed; cannot be unjailed") + ErrValidatorNotJailed = sdkerrors.Register(ModuleName, 5, "validator not jailed; cannot be unjailed") + ErrMissingSelfDelegation = sdkerrors.Register(ModuleName, 6, "validator has no self-delegation; cannot be unjailed") + ErrSelfDelegationTooLowToUnjail = sdkerrors.Register(ModuleName, 7, "validator's self delegation less than minimum; cannot be unjailed") + ErrNoSigningInfoFound = sdkerrors.Register(ModuleName, 8, "no validator signing info found") +) diff --git a/x/slashing/types/msg_test.go b/x/slashing/types/msg_test.go index b326c44c2572..31f7a70e75db 100644 --- a/x/slashing/types/msg_test.go +++ b/x/slashing/types/msg_test.go @@ -6,12 +6,11 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" - sdkslashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" ) func TestMsgUnjailGetSignBytes(t *testing.T) { addr := sdk.AccAddress("abcd") - msg := sdkslashingtypes.NewMsgUnjail(sdk.ValAddress(addr)) + msg := NewMsgUnjail(sdk.ValAddress(addr)) bytes := msg.GetSignBytes() require.Equal( t, diff --git a/x/staking/app_test.go b/x/staking/app_test.go index 68268ce26781..a80f49f54b75 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -12,7 +12,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func checkValidator(t *testing.T, app *simapp.SimApp, addr sdk.ValAddress, expFound bool) types.Validator { @@ -82,7 +81,7 @@ func TestStakingMsgs(t *testing.T) { validator := checkValidator(t, app, sdk.ValAddress(addr1), true) require.Equal(t, sdk.ValAddress(addr1).String(), validator.OperatorAddress) - require.Equal(t, sdkstaking.Bonded, validator.Status) + require.Equal(t, types.Bonded, validator.Status) require.True(sdk.IntEq(t, bondTokens, validator.BondedTokens())) header = tmproto.Header{Height: app.LastBlockHeight() + 1} diff --git a/x/staking/genesis.go b/x/staking/genesis.go index 02ae77bd4ebb..5b94b8adf48b 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -9,12 +9,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // WriteValidators returns a slice of bonded genesis validators. func WriteValidators(ctx sdk.Context, keeper keeper.Keeper) (vals []tmtypes.GenesisValidator, err error) { - keeper.IterateLastValidators(ctx, func(_ int64, validator sdkstaking.ValidatorI) (stop bool) { + keeper.IterateLastValidators(ctx, func(_ int64, validator types.ValidatorI) (stop bool) { pk, err := validator.ConsPubKey() if err != nil { return true diff --git a/x/staking/genesis_test.go b/x/staking/genesis_test.go index bc36ddc2709b..2f3035497161 100644 --- a/x/staking/genesis_test.go +++ b/x/staking/genesis_test.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func bootstrapGenesisTest(t *testing.T, numAddrs int) (*simapp.SimApp, sdk.Context, []sdk.AccAddress) { @@ -46,7 +45,7 @@ func TestValidateGenesis(t *testing.T) { {"jailed and bonded validator", func(data *types.GenesisState) { data.Validators = genValidators1 data.Validators[0].Jailed = true - data.Validators[0].Status = sdkstaking.Bonded + data.Validators[0].Status = types.Bonded }, true}, } diff --git a/x/staking/keeper/alias_functions.go b/x/staking/keeper/alias_functions.go index 7c3ea4e37a11..36c2d23661c6 100644 --- a/x/staking/keeper/alias_functions.go +++ b/x/staking/keeper/alias_functions.go @@ -5,13 +5,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // Validator Set // iterate through the validator set and perform the provided function -func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator sdkstaking.ValidatorI) (stop bool)) { +func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, types.ValidatorsKey) @@ -31,7 +30,7 @@ func (k Keeper) IterateValidators(ctx sdk.Context, fn func(index int64, validato } // iterate through the bonded validator set and perform the provided function -func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator sdkstaking.ValidatorI) (stop bool)) { +func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { store := ctx.KVStore(k.storeKey) maxValidators := k.MaxValidators(ctx) @@ -54,7 +53,7 @@ func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index in } // iterate through the active validator set and perform the provided function -func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator sdkstaking.ValidatorI) (stop bool)) { +func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, validator types.ValidatorI) (stop bool)) { iterator := k.LastValidatorsIterator(ctx) defer iterator.Close() @@ -77,7 +76,7 @@ func (k Keeper) IterateLastValidators(ctx sdk.Context, fn func(index int64, vali } // Validator gets the Validator interface for a particular address -func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) sdkstaking.ValidatorI { +func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) types.ValidatorI { val, found := k.GetValidator(ctx, address) if !found { return nil @@ -87,7 +86,7 @@ func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) sdkstaking.Va } // ValidatorByConsAddr gets the validator interface for a particular pubkey -func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) sdkstaking.ValidatorI { +func (k Keeper) ValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) types.ValidatorI { val, found := k.GetValidatorByConsAddr(ctx, addr) if !found { return nil @@ -104,7 +103,7 @@ func (k Keeper) GetValidatorSet() types.ValidatorSet { } // Delegation get the delegation interface for a particular set of delegator and validator addresses -func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) sdkstaking.DelegationI { +func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) types.DelegationI { bond, ok := k.GetDelegation(ctx, addrDel, addrVal) if !ok { return nil @@ -115,7 +114,7 @@ func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk. // iterate through all of the delegations from a delegator func (k Keeper) IterateDelegations(ctx sdk.Context, delAddr sdk.AccAddress, - fn func(index int64, del sdkstaking.DelegationI) (stop bool)) { + fn func(index int64, del types.DelegationI) (stop bool)) { store := ctx.KVStore(k.storeKey) delegatorPrefixKey := types.GetDelegationsKey(delAddr) diff --git a/x/staking/keeper/common_test.go b/x/staking/keeper/common_test.go index 64ae727248d1..00fc56e73add 100644 --- a/x/staking/keeper/common_test.go +++ b/x/staking/keeper/common_test.go @@ -11,7 +11,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) var ( @@ -55,7 +54,7 @@ func delegateCoinsFromAccount(ctx sdk.Context, app *simapp.SimApp, addr sdk.AccA // bondDenom := app.StakingKeeper.BondDenom(ctx) // coins := sdk.Coins{sdk.NewCoin(bondDenom, amount)} // app.BankKeeper.DelegateCoinsFromAccountToModule(ctx, addr, types.EpochDelegationPoolName, coins) - _, err := app.StakingKeeper.Delegate(ctx, addr, amount, sdkstaking.Unbonded, val, true) + _, err := app.StakingKeeper.Delegate(ctx, addr, amount, types.Unbonded, val, true) return err } diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index 559b8200fff7..398d332b7fe5 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" + ) // GetDelegation returns a specific delegation. @@ -612,14 +612,14 @@ func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time // Delegate performs a delegation, set/update everything necessary within the store. // tokenSrc indicates the bond status of the incoming funds. func (k Keeper) Delegate( - ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc sdkstaking.BondStatus, + validator types.Validator, subtractAccount bool, ) (newShares sdk.Dec, err error) { // In some situations, the exchange rate becomes invalid, e.g. if // Validator loses all tokens due to slashing. In this case, // make all future delegations invalid. if validator.InvalidExRate() { - return sdk.ZeroDec(), sdkstaking.ErrDelegatorShareExRateInvalid + } // Get or create the delegation object @@ -645,7 +645,7 @@ func (k Keeper) Delegate( // performing a delegation and not a redelegation, thus the source tokens are // all non bonded if subtractAccount { - if tokenSrc == sdkstaking.Bonded { + panic("delegation token source cannot be bonded") } @@ -667,14 +667,14 @@ func (k Keeper) Delegate( } else { // potentially transfer tokens between pools, if switch { - case tokenSrc == sdkstaking.Bonded && validator.IsBonded(): + // do nothing - case (tokenSrc == sdkstaking.Unbonded || tokenSrc == sdkstaking.Unbonding) && !validator.IsBonded(): + // do nothing - case (tokenSrc == sdkstaking.Unbonded || tokenSrc == sdkstaking.Unbonding) && validator.IsBonded(): + // transfer pools k.notBondedTokensToBonded(ctx, bondAmt) - case tokenSrc == sdkstaking.Bonded && !validator.IsBonded(): + // transfer pools k.bondedTokensToNotBonded(ctx, bondAmt) default: @@ -703,7 +703,7 @@ func (k Keeper) Unbond( // check if a delegation object exists in the store delegation, found := k.GetDelegation(ctx, delAddr, valAddr) if !found { - return amount, sdkstaking.ErrNoDelegatorForAddress + } // call the before-delegation-modified hook @@ -713,13 +713,13 @@ func (k Keeper) Unbond( // ensure that we have enough shares to remove if delegation.Shares.LT(shares) { - return amount, sdkerrors.Wrap(sdkstaking.ErrNotEnoughDelegationShares, delegation.Shares.String()) + } // get validator validator, found := k.GetValidator(ctx, valAddr) if !found { - return amount, sdkstaking.ErrNoValidatorFound + } // subtract shares from delegation @@ -791,11 +791,11 @@ func (k Keeper) Undelegate( ) (time.Time, error) { validator, found := k.GetValidator(ctx, valAddr) if !found { - return time.Time{}, sdkstaking.ErrNoDelegatorForAddress + } if k.HasMaxUnbondingDelegationEntries(ctx, delAddr, valAddr) { - return time.Time{}, sdkstaking.ErrMaxUnbondingDelegationEntries + } returnAmount, err := k.Unbond(ctx, delAddr, valAddr, sharesAmount) @@ -821,7 +821,7 @@ func (k Keeper) Undelegate( func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error) { ubd, found := k.GetUnbondingDelegation(ctx, delAddr, valAddr) if !found { - return nil, sdkstaking.ErrNoUnbondingDelegation + } bondDenom := k.GetParams(ctx).BondDenom @@ -870,26 +870,26 @@ func (k Keeper) BeginRedelegation( ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount sdk.Dec, ) (completionTime time.Time, err error) { if bytes.Equal(valSrcAddr, valDstAddr) { - return time.Time{}, sdkstaking.ErrSelfRedelegation + } dstValidator, found := k.GetValidator(ctx, valDstAddr) if !found { - return time.Time{}, sdkstaking.ErrBadRedelegationDst + } srcValidator, found := k.GetValidator(ctx, valSrcAddr) if !found { - return time.Time{}, sdkstaking.ErrBadRedelegationDst + } // check if this is a transitive redelegation if k.HasReceivingRedelegation(ctx, delAddr, valSrcAddr) { - return time.Time{}, sdkstaking.ErrTransitiveRedelegation + } if k.HasMaxRedelegationEntries(ctx, delAddr, valSrcAddr, valDstAddr) { - return time.Time{}, sdkstaking.ErrMaxRedelegationEntries + } returnAmount, err := k.Unbond(ctx, delAddr, valSrcAddr, sharesAmount) @@ -898,7 +898,7 @@ func (k Keeper) BeginRedelegation( } if returnAmount.IsZero() { - return time.Time{}, sdkstaking.ErrTinyRedelegationAmount + } sharesCreated, err := k.Delegate(ctx, delAddr, returnAmount, srcValidator.GetStatus(), dstValidator, false) @@ -930,7 +930,7 @@ func (k Keeper) CompleteRedelegation( ) (sdk.Coins, error) { red, found := k.GetRedelegation(ctx, delAddr, valSrcAddr, valDstAddr) if !found { - return nil, sdkstaking.ErrNoRedelegation + } bondDenom := k.GetParams(ctx).BondDenom @@ -968,12 +968,12 @@ func (k Keeper) ValidateUnbondAmount( ) (shares sdk.Dec, err error) { validator, found := k.GetValidator(ctx, valAddr) if !found { - return shares, sdkstaking.ErrNoValidatorFound + } del, found := k.GetDelegation(ctx, delAddr, valAddr) if !found { - return shares, sdkstaking.ErrNoDelegation + } shares, err = validator.SharesFromTokens(amt) diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index e203f31287e5..7a4bd5fdc925 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -12,7 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // tests GetDelegation, GetDelegatorDelegations, SetDelegation, RemoveDelegation, GetDelegatorDelegations @@ -456,7 +455,7 @@ func TestRedelegationMaxEntries(t *testing.T) { require.Equal(t, valTokens, issuedShares.RoundInt()) validator2 = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator2, true) - require.Equal(t, sdkstaking.Bonded, validator2.Status) + require.Equal(t, types.Bonded, validator2.Status) maxEntries := app.StakingKeeper.MaxEntries(ctx) diff --git a/x/staking/keeper/genesis.go b/x/staking/keeper/genesis.go index 9e8e0cb1de31..b47e32de1b3e 100644 --- a/x/staking/keeper/genesis.go +++ b/x/staking/keeper/genesis.go @@ -7,7 +7,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // InitGenesis sets the pool and parameters for the provided keeper. For each @@ -49,10 +48,10 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []ab } switch validator.GetStatus() { - case sdkstaking.Bonded: + case types.Bonded: bondedTokens = bondedTokens.Add(validator.GetTokens()) - case sdkstaking.Unbonding, sdkstaking.Unbonded: + case types.Unbonding, types.Unbonded: notBondedTokens = notBondedTokens.Add(validator.GetTokens()) default: diff --git a/x/staking/keeper/genesis_test.go b/x/staking/keeper/genesis_test.go index 1f4059b1c352..450955487d4e 100644 --- a/x/staking/keeper/genesis_test.go +++ b/x/staking/keeper/genesis_test.go @@ -14,7 +14,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func bootstrapGenesisTest(t *testing.T, numAddrs int) (*simapp.SimApp, sdk.Context, []sdk.AccAddress) { @@ -45,7 +44,7 @@ func TestInitGenesis(t *testing.T) { bondedVal1 := types.Validator{ OperatorAddress: sdk.ValAddress(addrs[0]).String(), ConsensusPubkey: pk0, - Status: sdkstaking.Bonded, + Status: types.Bonded, Tokens: valTokens, DelegatorShares: sdk.NewDecFromInt(valTokens), Description: types.NewDescription("hoop", "", "", "", ""), @@ -53,7 +52,7 @@ func TestInitGenesis(t *testing.T) { bondedVal2 := types.Validator{ OperatorAddress: sdk.ValAddress(addrs[1]).String(), ConsensusPubkey: pk1, - Status: sdkstaking.Bonded, + Status: types.Bonded, Tokens: valTokens, DelegatorShares: sdk.NewDecFromInt(valTokens), Description: types.NewDescription("bloop", "", "", "", ""), @@ -97,11 +96,11 @@ func TestInitGenesis(t *testing.T) { // now make sure the validators are bonded and intra-tx counters are correct resVal, found := app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addrs[0])) require.True(t, found) - require.Equal(t, sdkstaking.Bonded, resVal.Status) + require.Equal(t, types.Bonded, resVal.Status) resVal, found = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(addrs[1])) require.True(t, found) - require.Equal(t, sdkstaking.Bonded, resVal.Status) + require.Equal(t, types.Bonded, resVal.Status) abcivals := make([]abci.ValidatorUpdate, len(vals)) @@ -138,7 +137,7 @@ func TestInitGenesis_PoolsBalanceMismatch(t *testing.T) { require.Panics(t, func() { // setting validator status to bonded so the balance counts towards bonded pool - validator.Status = sdkstaking.Bonded + validator.Status = types.Bonded app.StakingKeeper.InitGenesis(ctx, &types.GenesisState{ Params: params, Validators: []types.Validator{validator}, @@ -149,7 +148,7 @@ func TestInitGenesis_PoolsBalanceMismatch(t *testing.T) { require.Panics(t, func() { // setting validator status to unbonded so the balance counts towards not bonded pool - validator.Status = sdkstaking.Unbonded + validator.Status = types.Unbonded app.StakingKeeper.InitGenesis(ctx, &types.GenesisState{ Params: params, Validators: []types.Validator{validator}, @@ -180,7 +179,7 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { types.NewDescription(fmt.Sprintf("#%d", i), "", "", "", ""), ) require.NoError(t, err) - validators[i].Status = sdkstaking.Bonded + validators[i].Status = types.Bonded tokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 1) if i < 100 { diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index 8686e1ea3ee4..63686327dad2 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -11,7 +11,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper @@ -434,7 +433,7 @@ func (k Querier) DelegatorValidators(c context.Context, req *types.QueryDelegato validator, found := k.GetValidator(ctx, delegation.GetValidatorAddr()) if !found { - return sdkstaking.ErrNoValidatorFound + return types.ErrNoValidatorFound } validators = append(validators, validator) @@ -636,12 +635,12 @@ func (k Querier) TotalTokenizeSharedAssets(c context.Context, req *types.QueryTo validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } delegation, found := k.GetDelegation(ctx, moduleAcc, valAddr) if !found { - return nil, sdkstaking.ErrNoDelegation + return nil, types.ErrNoDelegation } tokens := validator.TokensFromShares(delegation.Shares) diff --git a/x/staking/keeper/grpc_query_test.go b/x/staking/keeper/grpc_query_test.go index d9451ac90b5e..7b292bc7dce5 100644 --- a/x/staking/keeper/grpc_query_test.go +++ b/x/staking/keeper/grpc_query_test.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func (suite *KeeperTestSuite) TestGRPCQueryValidators() { @@ -628,7 +627,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryRedelegations() { valAddrs := simapp.ConvertAddrsToValAddrs(addrs) val1, val2, val3, val4 := vals[0], vals[1], valAddrs[3], valAddrs[4] delAmount := app.StakingKeeper.TokensFromConsensusPower(ctx, 1) - _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, sdkstaking.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrAcc1, delAmount, types.Unbonded, val1, true) suite.NoError(err) applyValidatorSetUpdates(suite.T(), ctx, app.StakingKeeper, -1) @@ -794,11 +793,11 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val1) app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val2) - _, err := app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[0]), sdkstaking.Unbonded, val1, true) + _, err := app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[0]), types.Unbonded, val1, true) require.NoError(t, err) - _, err = app.StakingKeeper.Delegate(ctx, addrs[1], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[1]), sdkstaking.Unbonded, val2, true) + _, err = app.StakingKeeper.Delegate(ctx, addrs[1], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[1]), types.Unbonded, val2, true) require.NoError(t, err) - _, err = app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[2]), sdkstaking.Unbonded, val2, true) + _, err = app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[2]), types.Unbonded, val2, true) require.NoError(t, err) applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) diff --git a/x/staking/keeper/historical_info_test.go b/x/staking/keeper/historical_info_test.go index 3033b2dd7b4a..e3ab422a699e 100644 --- a/x/staking/keeper/historical_info_test.go +++ b/x/staking/keeper/historical_info_test.go @@ -10,7 +10,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // IsValSetSorted reports whether valset is sorted. @@ -93,12 +92,12 @@ func TestTrackHistoricalInfo(t *testing.T) { // Set bonded validators in keeper val1 := teststaking.NewValidator(t, addrVals[2], PKs[2]) - val1.Status = sdkstaking.Bonded // when not bonded, consensus power is Zero + val1.Status = types.Bonded // when not bonded, consensus power is Zero val1.Tokens = app.StakingKeeper.TokensFromConsensusPower(ctx, 10) app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetLastValidatorPower(ctx, val1.GetOperator(), 10) val2 := teststaking.NewValidator(t, addrVals[3], PKs[3]) - val1.Status = sdkstaking.Bonded + val1.Status = types.Bonded val2.Tokens = app.StakingKeeper.TokensFromConsensusPower(ctx, 80) app.StakingKeeper.SetValidator(ctx, val2) app.StakingKeeper.SetLastValidatorPower(ctx, val2.GetOperator(), 80) diff --git a/x/staking/keeper/invariants.go b/x/staking/keeper/invariants.go index fea647823bd8..7ebc427c11b0 100644 --- a/x/staking/keeper/invariants.go +++ b/x/staking/keeper/invariants.go @@ -6,7 +6,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // RegisterInvariants registers all staking invariants @@ -53,11 +52,11 @@ func ModuleAccountInvariants(k Keeper) sdk.Invariant { notBondedPool := k.GetNotBondedPool(ctx) bondDenom := k.BondDenom(ctx) - k.IterateValidators(ctx, func(_ int64, validator sdkstaking.ValidatorI) bool { + k.IterateValidators(ctx, func(_ int64, validator types.ValidatorI) bool { switch validator.GetStatus() { - case sdkstaking.Bonded: + case types.Bonded: bonded = bonded.Add(validator.GetTokens()) - case sdkstaking.Unbonding, sdkstaking.Unbonded: + case types.Unbonding, types.Unbonded: notBonded = notBonded.Add(validator.GetTokens()) default: panic("invalid validator status") diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index 598b5f05fcd0..7ef3a7d2b5c5 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -17,7 +17,6 @@ import ( vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) type msgServer struct { @@ -42,12 +41,12 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa } if msg.Commission.Rate.LT(k.MinCommissionRate(ctx)) { - return nil, sdkerrors.Wrapf(sdkstaking.ErrCommissionLTMinRate, "cannot set validator commission to less than minimum rate of %s", k.MinCommissionRate(ctx)) + return nil, sdkerrors.Wrapf(types.ErrCommissionLTMinRate, "cannot set validator commission to less than minimum rate of %s", k.MinCommissionRate(ctx)) } // check to see if the pubkey or sender has been registered before if _, found := k.GetValidator(ctx, valAddr); found { - return nil, sdkstaking.ErrValidatorOwnerExists + return nil, types.ErrValidatorOwnerExists } pk, ok := msg.Pubkey.GetCachedValue().(cryptotypes.PubKey) @@ -56,7 +55,7 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa } if _, found := k.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)); found { - return nil, sdkstaking.ErrValidatorPubKeyExists + return nil, types.ErrValidatorPubKeyExists } bondDenom := k.BondDenom(ctx) @@ -82,7 +81,7 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa } if !hasKeyType { return nil, sdkerrors.Wrapf( - sdkstaking.ErrValidatorPubKeyTypeNotSupported, + types.ErrValidatorPubKeyTypeNotSupported, "got: %s, expected: %s", pk.Type(), cp.Validator.PubKeyTypes, ) } @@ -120,7 +119,7 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa // move coins from the msg.Address account to a (self-delegation) delegator account // the validator account and global shares are updated within here // NOTE source will always be from a wallet which are unbonded - _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Value.Amount, sdkstaking.Unbonded, validator, true) + _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Value.Amount, types.Unbonded, validator, true) if err != nil { return nil, err } @@ -151,7 +150,7 @@ func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValida // validator must already be registered validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } // replace all editable fields (clients should autofill existing values) @@ -203,7 +202,7 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) @@ -219,7 +218,7 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ } // NOTE: source funds are always unbonded - newShares, err := k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, sdkstaking.Unbonded, validator, true) + newShares, err := k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonded, validator, true) if err != nil { return nil, err } @@ -285,7 +284,7 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRed if delegation.Exempt && !exemptionFactor.IsNegative() { validator, found := k.GetValidator(ctx, valSrcAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } maxTokenizeShareAfter := validator.TotalExemptShares.Sub(shares).Mul(exemptionFactor) @@ -365,7 +364,7 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( validator, found := k.GetValidator(ctx, addr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } delegation, found := k.GetDelegation(ctx, delegatorAddress, addr) @@ -452,18 +451,18 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } // In some situations, the exchange rate becomes invalid, e.g. if // Validator loses all tokens due to slashing. In this case, // make all future delegations invalid. if validator.InvalidExRate() { - return nil, sdkstaking.ErrDelegatorShareExRateInvalid + return nil, types.ErrDelegatorShareExRateInvalid } if validator.IsJailed() { - return nil, sdkstaking.ErrValidatorJailed + return nil, types.ErrValidatorJailed } ubd, found := k.GetUnbondingDelegation(ctx, delegatorAddress, valAddr) @@ -500,7 +499,7 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M } // delegate back the unbonding delegation amount to the validator - _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, sdkstaking.Unbonding, validator, false) + _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonding, validator, false) if err != nil { return nil, err } @@ -524,11 +523,11 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M ctx.EventManager().EmitEvent( sdk.NewEvent( - sdkstaking.EventTypeCancelUnbondingDelegation, + types.EventTypeCancelUnbondingDelegation, sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()), sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), - sdk.NewAttribute(sdkstaking.AttributeKeyCreationHeight, strconv.FormatInt(msg.CreationHeight, 10)), + sdk.NewAttribute(types.AttributeKeyCreationHeight, strconv.FormatInt(msg.CreationHeight, 10)), ), ) @@ -544,7 +543,7 @@ func (k msgServer) TokenizeShares(goCtx context.Context, msg *types.MsgTokenizeS } validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) @@ -554,7 +553,7 @@ func (k msgServer) TokenizeShares(goCtx context.Context, msg *types.MsgTokenizeS delegation, found := k.GetDelegation(ctx, delegatorAddress, valAddr) if !found { - return nil, sdkstaking.ErrNoDelegatorForAddress + return nil, types.ErrNoDelegatorForAddress } if msg.Amount.Denom != k.BondDenom(ctx) { @@ -563,7 +562,7 @@ func (k msgServer) TokenizeShares(goCtx context.Context, msg *types.MsgTokenizeS delegationAmount := sdk.NewDecFromInt(validator.Tokens).Mul(delegation.GetShares()).Quo(validator.DelegatorShares) if sdk.NewDecFromInt(msg.Amount.Amount).GT(delegationAmount) { - return nil, sdkstaking.ErrNotEnoughDelegationShares + return nil, types.ErrNotEnoughDelegationShares } acc := k.authKeeper.GetAccount(ctx, delegatorAddress) @@ -646,11 +645,11 @@ func (k msgServer) TokenizeShares(goCtx context.Context, msg *types.MsgTokenizeS // Note: it is needed to get latest validator object to get Keeper.Delegate function work properly validator, found = k.GetValidator(ctx, valAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } // delegate from module account - _, err = k.Keeper.Delegate(ctx, record.GetModuleAddress(), msg.Amount.Amount, sdkstaking.Unbonded, validator, true) + _, err = k.Keeper.Delegate(ctx, record.GetModuleAddress(), msg.Amount.Amount, types.Unbonded, validator, true) if err != nil { return nil, err } @@ -700,7 +699,7 @@ func (k msgServer) RedeemTokens(goCtx context.Context, msg *types.MsgRedeemToken validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } // calculate the ratio between shares and redeem amount @@ -751,12 +750,12 @@ func (k msgServer) RedeemTokens(goCtx context.Context, msg *types.MsgRedeemToken // Note: it is needed to get latest validator object to get Keeper.Delegate function work properly validator, found = k.GetValidator(ctx, valAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } // convert the share tokens to delegated status // Note: Delegate(substractAccount => true) -> DelegateCoinsFromAccountToModule -> TrackDelegation for vesting account - _, err = k.Keeper.Delegate(ctx, delegatorAddress, returnAmount, sdkstaking.Unbonded, validator, true) + _, err = k.Keeper.Delegate(ctx, delegatorAddress, returnAmount, types.Unbonded, validator, true) if err != nil { return nil, err } @@ -831,12 +830,12 @@ func (k msgServer) ExemptDelegation(goCtx context.Context, msg *types.MsgExemptD validator, found := k.GetValidator(ctx, valAddr) if !found { - return nil, sdkstaking.ErrNoValidatorFound + return nil, types.ErrNoValidatorFound } delegation, found := k.GetDelegation(ctx, delAddr, valAddr) if !found { - return nil, sdkstaking.ErrNoDelegation + return nil, types.ErrNoDelegation } if !delegation.Exempt { diff --git a/x/staking/types/commission.go b/x/staking/types/commission.go index 3ff78868fe3f..9bc0edf52d52 100644 --- a/x/staking/types/commission.go +++ b/x/staking/types/commission.go @@ -6,7 +6,6 @@ import ( "sigs.k8s.io/yaml" sdk "github.com/cosmos/cosmos-sdk/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // NewCommissionRates returns an initialized validator commission rates. @@ -53,27 +52,27 @@ func (cr CommissionRates) Validate() error { switch { case cr.MaxRate.IsNegative(): // max rate cannot be negative - return sdkstaking.ErrCommissionNegative + return ErrCommissionNegative case cr.MaxRate.GT(sdk.OneDec()): // max rate cannot be greater than 1 - return sdkstaking.ErrCommissionHuge + return ErrCommissionHuge case cr.Rate.IsNegative(): // rate cannot be negative - return sdkstaking.ErrCommissionNegative + return ErrCommissionNegative case cr.Rate.GT(cr.MaxRate): // rate cannot be greater than the max rate - return sdkstaking.ErrCommissionGTMaxRate + return ErrCommissionGTMaxRate case cr.MaxChangeRate.IsNegative(): // change rate cannot be negative - return sdkstaking.ErrCommissionChangeRateNegative + return ErrCommissionChangeRateNegative case cr.MaxChangeRate.GT(cr.MaxRate): // change rate cannot be greater than the max rate - return sdkstaking.ErrCommissionChangeRateGTMaxRate + return ErrCommissionChangeRateGTMaxRate } return nil @@ -85,19 +84,19 @@ func (c Commission) ValidateNewRate(newRate sdk.Dec, blockTime time.Time) error switch { case blockTime.Sub(c.UpdateTime).Hours() < 24: // new rate cannot be changed more than once within 24 hours - return sdkstaking.ErrCommissionUpdateTime + return ErrCommissionUpdateTime case newRate.IsNegative(): // new rate cannot be negative - return sdkstaking.ErrCommissionNegative + return ErrCommissionNegative case newRate.GT(c.MaxRate): // new rate cannot be greater than the max rate - return sdkstaking.ErrCommissionGTMaxRate + return ErrCommissionGTMaxRate case newRate.Sub(c.Rate).GT(c.MaxChangeRate): // new rate % points change cannot be greater than the max change rate - return sdkstaking.ErrCommissionGTMaxChangeRate + return ErrCommissionGTMaxChangeRate } return nil diff --git a/x/staking/types/delegation.go b/x/staking/types/delegation.go index 6294b81c5e5b..cf869eb5d2da 100644 --- a/x/staking/types/delegation.go +++ b/x/staking/types/delegation.go @@ -10,11 +10,10 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // Implements Delegation interface -var _ sdkstaking.DelegationI = Delegation{} +var _ DelegationI = Delegation{} // String implements the Stringer interface for a DVPair object. func (dv DVPair) String() string { diff --git a/x/staking/types/errors.go b/x/staking/types/errors.go index b582273ed75c..cf6c4edfdf84 100644 --- a/x/staking/types/errors.go +++ b/x/staking/types/errors.go @@ -11,45 +11,45 @@ import ( // // REF: https://github.com/cosmos/cosmos-sdk/issues/5450 var ( - // ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 2, "empty validator address") - // ErrNoValidatorFound = sdkerrors.Register(ModuleName, 3, "validator does not exist") - // ErrValidatorOwnerExists = sdkerrors.Register(ModuleName, 4, "validator already exist for this operator address; must use new validator operator address") - // ErrValidatorPubKeyExists = sdkerrors.Register(ModuleName, 5, "validator already exist for this pubkey; must use new validator pubkey") - // ErrValidatorPubKeyTypeNotSupported = sdkerrors.Register(ModuleName, 6, "validator pubkey type is not supported") - // ErrValidatorJailed = sdkerrors.Register(ModuleName, 7, "validator for this address is currently jailed") - // ErrBadRemoveValidator = sdkerrors.Register(ModuleName, 8, "failed to remove validator") - // ErrCommissionNegative = sdkerrors.Register(ModuleName, 9, "commission must be positive") - // ErrCommissionHuge = sdkerrors.Register(ModuleName, 10, "commission cannot be more than 100%") - // ErrCommissionGTMaxRate = sdkerrors.Register(ModuleName, 11, "commission cannot be more than the max rate") - // ErrCommissionUpdateTime = sdkerrors.Register(ModuleName, 12, "commission cannot be changed more than once in 24h") - // ErrCommissionChangeRateNegative = sdkerrors.Register(ModuleName, 13, "commission change rate must be positive") - // ErrCommissionChangeRateGTMaxRate = sdkerrors.Register(ModuleName, 14, "commission change rate cannot be more than the max rate") - // ErrCommissionGTMaxChangeRate = sdkerrors.Register(ModuleName, 15, "commission cannot be changed more than max change rate") - // ErrSelfDelegationBelowMinimum = sdkerrors.Register(ModuleName, 16, "validator's self delegation must be greater than their minimum self delegation") - // ErrMinSelfDelegationDecreased = sdkerrors.Register(ModuleName, 17, "minimum self delegation cannot be decrease") - // ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 18, "empty delegator address") - // ErrNoDelegation = sdkerrors.Register(ModuleName, 19, "no delegation for (address, validator) tuple") - // ErrBadDelegatorAddr = sdkerrors.Register(ModuleName, 20, "delegator does not exist with address") - // ErrNoDelegatorForAddress = sdkerrors.Register(ModuleName, 21, "delegator does not contain delegation") - // ErrInsufficientShares = sdkerrors.Register(ModuleName, 22, "insufficient delegation shares") - // ErrDelegationValidatorEmpty = sdkerrors.Register(ModuleName, 23, "cannot delegate to an empty validator") - // ErrNotEnoughDelegationShares = sdkerrors.Register(ModuleName, 24, "not enough delegation shares") - // ErrNotMature = sdkerrors.Register(ModuleName, 25, "entry not mature") - // ErrNoUnbondingDelegation = sdkerrors.Register(ModuleName, 26, "no unbonding delegation found") - // ErrMaxUnbondingDelegationEntries = sdkerrors.Register(ModuleName, 27, "too many unbonding delegation entries for (delegator, validator) tuple") - // ErrNoRedelegation = sdkerrors.Register(ModuleName, 28, "no redelegation found") - // ErrSelfRedelegation = sdkerrors.Register(ModuleName, 29, "cannot redelegate to the same validator") - // ErrTinyRedelegationAmount = sdkerrors.Register(ModuleName, 30, "too few tokens to redelegate (truncates to zero tokens)") - // ErrBadRedelegationDst = sdkerrors.Register(ModuleName, 31, "redelegation destination validator not found") - // ErrTransitiveRedelegation = sdkerrors.Register(ModuleName, 32, "redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation") - // ErrMaxRedelegationEntries = sdkerrors.Register(ModuleName, 33, "too many redelegation entries for (delegator, src-validator, dst-validator) tuple") - // ErrDelegatorShareExRateInvalid = sdkerrors.Register(ModuleName, 34, "cannot delegate to validators with invalid (zero) ex-rate") - // ErrBothShareMsgsGiven = sdkerrors.Register(ModuleName, 35, "both shares amount and shares percent provided") - // ErrNeitherShareMsgsGiven = sdkerrors.Register(ModuleName, 36, "neither shares amount nor shares percent provided") - // ErrInvalidHistoricalInfo = sdkerrors.Register(ModuleName, 37, "invalid historical info") - // ErrNoHistoricalInfo = sdkerrors.Register(ModuleName, 38, "no historical info found") - // ErrEmptyValidatorPubKey = sdkerrors.Register(ModuleName, 39, "empty validator public key") - // ErrCommissionLTMinRate = sdkerrors.Register(ModuleName, 40, "commission cannot be less than min rate") + ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 2, "empty validator address") + ErrNoValidatorFound = sdkerrors.Register(ModuleName, 3, "validator does not exist") + ErrValidatorOwnerExists = sdkerrors.Register(ModuleName, 4, "validator already exist for this operator address; must use new validator operator address") + ErrValidatorPubKeyExists = sdkerrors.Register(ModuleName, 5, "validator already exist for this pubkey; must use new validator pubkey") + ErrValidatorPubKeyTypeNotSupported = sdkerrors.Register(ModuleName, 6, "validator pubkey type is not supported") + ErrValidatorJailed = sdkerrors.Register(ModuleName, 7, "validator for this address is currently jailed") + ErrBadRemoveValidator = sdkerrors.Register(ModuleName, 8, "failed to remove validator") + ErrCommissionNegative = sdkerrors.Register(ModuleName, 9, "commission must be positive") + ErrCommissionHuge = sdkerrors.Register(ModuleName, 10, "commission cannot be more than 100%") + ErrCommissionGTMaxRate = sdkerrors.Register(ModuleName, 11, "commission cannot be more than the max rate") + ErrCommissionUpdateTime = sdkerrors.Register(ModuleName, 12, "commission cannot be changed more than once in 24h") + ErrCommissionChangeRateNegative = sdkerrors.Register(ModuleName, 13, "commission change rate must be positive") + ErrCommissionChangeRateGTMaxRate = sdkerrors.Register(ModuleName, 14, "commission change rate cannot be more than the max rate") + ErrCommissionGTMaxChangeRate = sdkerrors.Register(ModuleName, 15, "commission cannot be changed more than max change rate") + ErrSelfDelegationBelowMinimum = sdkerrors.Register(ModuleName, 16, "validator's self delegation must be greater than their minimum self delegation") + ErrMinSelfDelegationDecreased = sdkerrors.Register(ModuleName, 17, "minimum self delegation cannot be decrease") + ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 18, "empty delegator address") + ErrNoDelegation = sdkerrors.Register(ModuleName, 19, "no delegation for (address, validator) tuple") + ErrBadDelegatorAddr = sdkerrors.Register(ModuleName, 20, "delegator does not exist with address") + ErrNoDelegatorForAddress = sdkerrors.Register(ModuleName, 21, "delegator does not contain delegation") + ErrInsufficientShares = sdkerrors.Register(ModuleName, 22, "insufficient delegation shares") + ErrDelegationValidatorEmpty = sdkerrors.Register(ModuleName, 23, "cannot delegate to an empty validator") + ErrNotEnoughDelegationShares = sdkerrors.Register(ModuleName, 24, "not enough delegation shares") + ErrNotMature = sdkerrors.Register(ModuleName, 25, "entry not mature") + ErrNoUnbondingDelegation = sdkerrors.Register(ModuleName, 26, "no unbonding delegation found") + ErrMaxUnbondingDelegationEntries = sdkerrors.Register(ModuleName, 27, "too many unbonding delegation entries for (delegator, validator) tuple") + ErrNoRedelegation = sdkerrors.Register(ModuleName, 28, "no redelegation found") + ErrSelfRedelegation = sdkerrors.Register(ModuleName, 29, "cannot redelegate to the same validator") + ErrTinyRedelegationAmount = sdkerrors.Register(ModuleName, 30, "too few tokens to redelegate (truncates to zero tokens)") + ErrBadRedelegationDst = sdkerrors.Register(ModuleName, 31, "redelegation destination validator not found") + ErrTransitiveRedelegation = sdkerrors.Register(ModuleName, 32, "redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation") + ErrMaxRedelegationEntries = sdkerrors.Register(ModuleName, 33, "too many redelegation entries for (delegator, src-validator, dst-validator) tuple") + ErrDelegatorShareExRateInvalid = sdkerrors.Register(ModuleName, 34, "cannot delegate to validators with invalid (zero) ex-rate") + ErrBothShareMsgsGiven = sdkerrors.Register(ModuleName, 35, "both shares amount and shares percent provided") + ErrNeitherShareMsgsGiven = sdkerrors.Register(ModuleName, 36, "neither shares amount nor shares percent provided") + ErrInvalidHistoricalInfo = sdkerrors.Register(ModuleName, 37, "invalid historical info") + ErrNoHistoricalInfo = sdkerrors.Register(ModuleName, 38, "no historical info found") + ErrEmptyValidatorPubKey = sdkerrors.Register(ModuleName, 39, "empty validator public key") + ErrCommissionLTMinRate = sdkerrors.Register(ModuleName, 40, "commission cannot be less than min rate") ErrNotEnoughBalance = sdkerrors.Register(ModuleName, 41, "not enough balance") ErrTokenizeShareRecordNotExists = sdkerrors.Register(ModuleName, 42, "tokenize share record not exists") ErrTokenizeShareRecordAlreadyExists = sdkerrors.Register(ModuleName, 43, "tokenize share record already exists") diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index 5e0696563967..0389e7d19016 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -3,7 +3,6 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // DistributionKeeper expected distribution keeper (noalias) @@ -48,20 +47,20 @@ type BankKeeper interface { type ValidatorSet interface { // iterate through validators by operator address, execute func for each validator IterateValidators(sdk.Context, - func(index int64, validator sdkstaking.ValidatorI) (stop bool)) + func(index int64, validator ValidatorI) (stop bool)) // iterate through bonded validators by operator address, execute func for each validator IterateBondedValidatorsByPower(sdk.Context, - func(index int64, validator sdkstaking.ValidatorI) (stop bool)) + func(index int64, validator ValidatorI) (stop bool)) // iterate through the consensus validator set of the last block by operator address, execute func for each validator IterateLastValidators(sdk.Context, - func(index int64, validator sdkstaking.ValidatorI) (stop bool)) + func(index int64, validator ValidatorI) (stop bool)) - Validator(sdk.Context, sdk.ValAddress) sdkstaking.ValidatorI // get a particular validator by operator address - ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) sdkstaking.ValidatorI // get a particular validator by consensus address - TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set - StakingTokenSupply(sdk.Context) sdk.Int // total staking token supply + Validator(sdk.Context, sdk.ValAddress) ValidatorI // get a particular validator by operator address + ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) ValidatorI // get a particular validator by consensus address + TotalBondedTokens(sdk.Context) sdk.Int // total bonded tokens within the validator set + StakingTokenSupply(sdk.Context) sdk.Int // total staking token supply // slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec) sdk.Int @@ -70,7 +69,7 @@ type ValidatorSet interface { // Delegation allows for getting a particular delegation for a given validator // and delegator outside the scope of the staking module. - Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) sdkstaking.DelegationI + Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) DelegationI // MaxValidators returns the maximum amount of bonded validators MaxValidators(sdk.Context) uint32 @@ -83,7 +82,7 @@ type DelegationSet interface { // iterate through all delegations from one delegator by validator-AccAddress, // execute func for each validator IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, - fn func(index int64, delegation sdkstaking.DelegationI) (stop bool)) + fn func(index int64, delegation DelegationI) (stop bool)) } // Event Hooks diff --git a/x/staking/types/exported.go b/x/staking/types/exported.go index d31bd8bde257..8542d677c2e4 100644 --- a/x/staking/types/exported.go +++ b/x/staking/types/exported.go @@ -5,7 +5,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // DelegationI delegation bond for a delegated proof of stake system @@ -19,7 +18,7 @@ type DelegationI interface { type ValidatorI interface { IsJailed() bool // whether the validator is jailed GetMoniker() string // moniker of the validator - GetStatus() sdkstaking.BondStatus // status of the validator + GetStatus() BondStatus // status of the validator IsBonded() bool // check if has a bonded status IsUnbonded() bool // check if has status unbonded IsUnbonding() bool // check if has status unbonding diff --git a/x/staking/types/historical_info.go b/x/staking/types/historical_info.go index fa6c96a0ed02..447a559bda7b 100644 --- a/x/staking/types/historical_info.go +++ b/x/staking/types/historical_info.go @@ -10,7 +10,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // NewHistoricalInfo will create a historical information struct from header and valset @@ -46,11 +45,11 @@ func UnmarshalHistoricalInfo(cdc codec.BinaryCodec, value []byte) (hi Historical // ValidateBasic will ensure HistoricalInfo is not nil and sorted func ValidateBasic(hi HistoricalInfo) error { if len(hi.Valset) == 0 { - return sdkerrors.Wrap(sdkstaking.ErrInvalidHistoricalInfo, "validator set is empty") + return sdkerrors.Wrap(ErrInvalidHistoricalInfo, "validator set is empty") } if !sort.IsSorted(Validators(hi.Valset)) { - return sdkerrors.Wrap(sdkstaking.ErrInvalidHistoricalInfo, "validator set is not sorted by address") + return sdkerrors.Wrap(ErrInvalidHistoricalInfo, "validator set is not sorted by address") } return nil diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index 8de1bb5f8896..8d596bfa1b48 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -6,7 +6,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // staking message types @@ -106,7 +105,7 @@ func (msg MsgCreateValidator) ValidateBasic() error { } if msg.Pubkey == nil { - return sdkstaking.ErrEmptyValidatorPubKey + return ErrEmptyValidatorPubKey } if !msg.Value.IsValid() || !msg.Value.Amount.IsPositive() { diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 187a259c779d..2dd59cff156a 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -10,7 +10,6 @@ import ( types1 "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types2 "github.com/cosmos/cosmos-sdk/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/gogo/protobuf/gogoproto" github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto" @@ -320,7 +319,7 @@ type Validator struct { // jailed defined whether the validator has been jailed from bonded status or not. Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` // status is the validator status (bonded/unbonding/unbonded). - Status sdkstaking.BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=liquidstaking.staking.v1beta1.BondStatus" json:"status,omitempty"` + Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=liquidstaking.staking.v1beta1.BondStatus" json:"status,omitempty"` // tokens define the delegated tokens (incl. self-delegation). Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` // delegator_shares defines total shares issued to a validator's delegators. @@ -4575,7 +4574,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Status |= sdkstaking.BondStatus(b&0x7F) << shift + m.Status |= BondStatus(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index be33e39819da..a831fc34c450 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -17,7 +17,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) const ( @@ -36,7 +35,7 @@ var ( BondStatusBonded = BondStatus_name[int32(Bonded)] ) -var _ sdkstaking.ValidatorI = Validator{} +var _ ValidatorI = Validator{} // NewValidator constructs a new Validator //nolint:interfacer @@ -50,7 +49,7 @@ func NewValidator(operator sdk.ValAddress, pubKey cryptotypes.PubKey, descriptio OperatorAddress: operator.String(), ConsensusPubkey: pkAny, Jailed: false, - Status: sdkstaking.Unbonded, + Status: Unbonded, Tokens: sdk.ZeroInt(), DelegatorShares: sdk.ZeroDec(), Description: description, @@ -166,17 +165,17 @@ func UnmarshalValidator(cdc codec.BinaryCodec, value []byte) (v Validator, err e // IsBonded checks if the validator status equals Bonded func (v Validator) IsBonded() bool { - return v.GetStatus() == sdkstaking.Bonded + return v.GetStatus() == Bonded } // IsUnbonded checks if the validator status equals Unbonded func (v Validator) IsUnbonded() bool { - return v.GetStatus() == sdkstaking.Unbonded + return v.GetStatus() == Unbonded } // IsUnbonding checks if the validator status equals Unbonding func (v Validator) IsUnbonding() bool { - return v.GetStatus() == sdkstaking.Unbonding + return v.GetStatus() == Unbonding } // constant used in flags to indicate that description field should not be updated @@ -322,7 +321,7 @@ func (v Validator) TokensFromSharesRoundUp(shares sdk.Dec) sdk.Dec { // returns an error if the validator has no tokens. func (v Validator) SharesFromTokens(amt sdk.Int) (sdk.Dec, error) { if v.Tokens.IsZero() { - return sdk.ZeroDec(), sdkstaking.ErrInsufficientShares + return sdk.ZeroDec(), ErrInsufficientShares } return v.GetDelegatorShares().MulInt(amt).QuoInt(v.GetTokens()), nil @@ -332,7 +331,7 @@ func (v Validator) SharesFromTokens(amt sdk.Int) (sdk.Dec, error) { // a bond amount. It returns an error if the validator has no tokens. func (v Validator) SharesFromTokensTruncated(amt sdk.Int) (sdk.Dec, error) { if v.Tokens.IsZero() { - return sdk.ZeroDec(), sdkstaking.ErrInsufficientShares + return sdk.ZeroDec(), ErrInsufficientShares } return v.GetDelegatorShares().MulInt(amt).QuoTruncate(sdk.NewDecFromInt(v.GetTokens())), nil @@ -364,7 +363,7 @@ func (v Validator) PotentialConsensusPower(r sdk.Int) int64 { // UpdateStatus updates the location of the shares within a validator // to reflect the new status -func (v Validator) UpdateStatus(newStatus sdkstaking.BondStatus) Validator { +func (v Validator) UpdateStatus(newStatus BondStatus) Validator { v.Status = newStatus return v } @@ -454,9 +453,9 @@ func (v *Validator) Equal(v2 *Validator) bool { v.UnbondingTime.Equal(v2.UnbondingTime) } -func (v Validator) IsJailed() bool { return v.Jailed } -func (v Validator) GetMoniker() string { return v.Description.Moniker } -func (v Validator) GetStatus() sdkstaking.BondStatus { return v.Status } +func (v Validator) IsJailed() bool { return v.Jailed } +func (v Validator) GetMoniker() string { return v.Description.Moniker } +func (v Validator) GetStatus() BondStatus { return v.Status } func (v Validator) GetOperator() sdk.ValAddress { if v.OperatorAddress == "" { return nil From 2e7c8a06755284bf77685747e66f15f077f0f5f4 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 12 Aug 2022 17:55:54 +0200 Subject: [PATCH 3/4] remove extra simapp --- x/distribution/keeper/allocation_test.go | 2 +- x/distribution/keeper/common_test.go | 2 +- x/distribution/keeper/delegation_test.go | 2 +- x/distribution/keeper/grpc_query_test.go | 2 +- x/distribution/keeper/keeper_test.go | 2 +- x/distribution/keeper/querier_test.go | 2 +- x/distribution/module_test.go | 2 +- x/distribution/proposal_handler_test.go | 2 +- x/distribution/simulation/decoder_test.go | 2 +- x/distribution/simulation/operations_test.go | 2 +- x/distribution/simulation/proposals_test.go | 2 +- x/slashing/abci_test.go | 2 +- x/slashing/app_test.go | 2 +- x/slashing/keeper/genesis_test.go | 2 +- x/slashing/keeper/grpc_query_test.go | 2 +- x/slashing/keeper/keeper_test.go | 2 +- x/slashing/keeper/querier_test.go | 2 +- x/slashing/keeper/signing_info_test.go | 2 +- x/slashing/simulation/decoder_test.go | 2 +- x/slashing/simulation/operations_test.go | 2 +- x/staking/app_test.go | 2 +- x/staking/common_test.go | 2 +- x/staking/genesis_test.go | 2 +- x/staking/keeper/common_test.go | 2 +- x/staking/keeper/delegation_test.go | 2 +- x/staking/keeper/genesis_test.go | 2 +- x/staking/keeper/grpc_query_test.go | 2 +- x/staking/keeper/historical_info_test.go | 2 +- x/staking/keeper/keeper_test.go | 2 +- x/staking/keeper/msg_server_test.go | 2 +- x/staking/keeper/querier_test.go | 2 +- x/staking/keeper/slash_test.go | 2 +- x/staking/keeper/validator_test.go | 2 +- x/staking/module_test.go | 2 +- x/staking/simulation/decoder_test.go | 2 +- x/staking/simulation/operations_test.go | 2 +- x/staking/types/authz_test.go | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-) diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go index abda924aa69d..99054e7dfa54 100644 --- a/x/distribution/keeper/allocation_test.go +++ b/x/distribution/keeper/allocation_test.go @@ -7,7 +7,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" diff --git a/x/distribution/keeper/common_test.go b/x/distribution/keeper/common_test.go index ffe1f0511bbc..807fd45c2520 100644 --- a/x/distribution/keeper/common_test.go +++ b/x/distribution/keeper/common_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index 0c6cd64eeb9e..66d2ef79db9d 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution/types" diff --git a/x/distribution/keeper/grpc_query_test.go b/x/distribution/keeper/grpc_query_test.go index 9813434732fa..902f655e0157 100644 --- a/x/distribution/keeper/grpc_query_test.go +++ b/x/distribution/keeper/grpc_query_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/bank/testutil" diff --git a/x/distribution/keeper/keeper_test.go b/x/distribution/keeper/keeper_test.go index 04a64006a68d..9895e420bf80 100644 --- a/x/distribution/keeper/keeper_test.go +++ b/x/distribution/keeper/keeper_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution/types" diff --git a/x/distribution/keeper/querier_test.go b/x/distribution/keeper/querier_test.go index f9293d3009f0..9e1fe7cccce5 100644 --- a/x/distribution/keeper/querier_test.go +++ b/x/distribution/keeper/querier_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/distribution/keeper" diff --git a/x/distribution/module_test.go b/x/distribution/module_test.go index 64c2b720220a..70e2e50ea8b0 100644 --- a/x/distribution/module_test.go +++ b/x/distribution/module_test.go @@ -10,7 +10,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/distribution/types" ) diff --git a/x/distribution/proposal_handler_test.go b/x/distribution/proposal_handler_test.go index a91debbffed5..24be6c98e5ae 100644 --- a/x/distribution/proposal_handler_test.go +++ b/x/distribution/proposal_handler_test.go @@ -7,7 +7,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution" diff --git a/x/distribution/simulation/decoder_test.go b/x/distribution/simulation/decoder_test.go index d4386779816c..01e986fe53eb 100644 --- a/x/distribution/simulation/decoder_test.go +++ b/x/distribution/simulation/decoder_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/x/distribution/simulation" diff --git a/x/distribution/simulation/operations_test.go b/x/distribution/simulation/operations_test.go index 833dec88965b..299fd9505773 100644 --- a/x/distribution/simulation/operations_test.go +++ b/x/distribution/simulation/operations_test.go @@ -10,7 +10,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/distribution/simulation/proposals_test.go b/x/distribution/simulation/proposals_test.go index 44f685735576..aec70fd832c4 100644 --- a/x/distribution/simulation/proposals_test.go +++ b/x/distribution/simulation/proposals_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/slashing/abci_test.go b/x/slashing/abci_test.go index 3aaf323bb253..7c7954b34a09 100644 --- a/x/slashing/abci_test.go +++ b/x/slashing/abci_test.go @@ -8,7 +8,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index 18c82232631b..79bafe94e189 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" diff --git a/x/slashing/keeper/genesis_test.go b/x/slashing/keeper/genesis_test.go index d7f02eaaaf52..3cea49ea3863 100644 --- a/x/slashing/keeper/genesis_test.go +++ b/x/slashing/keeper/genesis_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/slashing/types" diff --git a/x/slashing/keeper/grpc_query_test.go b/x/slashing/keeper/grpc_query_test.go index 7c07b7e99c7d..ddb6694d0463 100644 --- a/x/slashing/keeper/grpc_query_test.go +++ b/x/slashing/keeper/grpc_query_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index 6077f72ba78b..9b3f4e0e434b 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/staking" diff --git a/x/slashing/keeper/querier_test.go b/x/slashing/keeper/querier_test.go index e606c899de8c..0b9fb6b51a3c 100644 --- a/x/slashing/keeper/querier_test.go +++ b/x/slashing/keeper/querier_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/x/slashing/keeper" "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/slashing/types" diff --git a/x/slashing/keeper/signing_info_test.go b/x/slashing/keeper/signing_info_test.go index 5a2f8139310f..cee32a0d54c4 100644 --- a/x/slashing/keeper/signing_info_test.go +++ b/x/slashing/keeper/signing_info_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) diff --git a/x/slashing/simulation/decoder_test.go b/x/slashing/simulation/decoder_test.go index f879f5a265e9..883b3874d2f7 100644 --- a/x/slashing/simulation/decoder_test.go +++ b/x/slashing/simulation/decoder_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/x/slashing/simulation" diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index 1a5016764554..693f1dac8195 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -14,7 +14,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/staking/app_test.go b/x/staking/app_test.go index a80f49f54b75..64122362d1f2 100644 --- a/x/staking/app_test.go +++ b/x/staking/app_test.go @@ -7,7 +7,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" diff --git a/x/staking/common_test.go b/x/staking/common_test.go index 2d308989a9d2..93193e459ca1 100644 --- a/x/staking/common_test.go +++ b/x/staking/common_test.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/staking/genesis_test.go b/x/staking/genesis_test.go index 2f3035497161..d427ce9ae7c8 100644 --- a/x/staking/genesis_test.go +++ b/x/staking/genesis_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" diff --git a/x/staking/keeper/common_test.go b/x/staking/keeper/common_test.go index 00fc56e73add..bf0aa6128b31 100644 --- a/x/staking/keeper/common_test.go +++ b/x/staking/keeper/common_test.go @@ -7,7 +7,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index 7a4bd5fdc925..38a5906b7185 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/x/staking/keeper/genesis_test.go b/x/staking/keeper/genesis_test.go index 450955487d4e..908e301decfa 100644 --- a/x/staking/keeper/genesis_test.go +++ b/x/staking/keeper/genesis_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" diff --git a/x/staking/keeper/grpc_query_test.go b/x/staking/keeper/grpc_query_test.go index 7b292bc7dce5..402e0dc0f2cd 100644 --- a/x/staking/keeper/grpc_query_test.go +++ b/x/staking/keeper/grpc_query_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/x/staking/keeper/historical_info_test.go b/x/staking/keeper/historical_info_test.go index e3ab422a699e..437269956936 100644 --- a/x/staking/keeper/historical_info_test.go +++ b/x/staking/keeper/historical_info_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index d7c34f61e163..f717528f40d0 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" diff --git a/x/staking/keeper/msg_server_test.go b/x/staking/keeper/msg_server_test.go index 0ed3b5f5a53a..3ec5ecd6f0fb 100644 --- a/x/staking/keeper/msg_server_test.go +++ b/x/staking/keeper/msg_server_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" diff --git a/x/staking/keeper/querier_test.go b/x/staking/keeper/querier_test.go index 8b0115ba5f90..8756208973c9 100644 --- a/x/staking/keeper/querier_test.go +++ b/x/staking/keeper/querier_test.go @@ -9,7 +9,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index ba94a7178874..a8c29e1b0a8c 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index cd86cd8ab6a0..5a28a0d98971 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -11,7 +11,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" diff --git a/x/staking/module_test.go b/x/staking/module_test.go index 313de42620a3..3f1e5d916883 100644 --- a/x/staking/module_test.go +++ b/x/staking/module_test.go @@ -10,7 +10,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) diff --git a/x/staking/simulation/decoder_test.go b/x/staking/simulation/decoder_test.go index da47f2e41622..10c10d2adf2d 100644 --- a/x/staking/simulation/decoder_test.go +++ b/x/staking/simulation/decoder_test.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/x/staking/simulation" diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index 44c211c0016b..994b2f8fac3a 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -11,7 +11,7 @@ import ( tmtypes "github.com/tendermint/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/staking/types/authz_test.go b/x/staking/types/authz_test.go index 11caf2196da7..d1d740e171f8 100644 --- a/x/staking/types/authz_test.go +++ b/x/staking/types/authz_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) From 0e8e5c6c2c3ea43a35e12dbe6a25721cc7dd964b Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 12 Aug 2022 17:58:08 +0200 Subject: [PATCH 4/4] undo staking import change --- x/distribution/types/expected_keepers.go | 1 - x/slashing/abci_test.go | 1 - x/slashing/app_test.go | 1 - x/slashing/keeper/genesis.go | 1 - x/slashing/keeper/keeper_test.go | 1 - x/slashing/types/expected_keepers.go | 1 - x/staking/keeper/querier.go | 1 - x/staking/simulation/operations.go | 1 - x/staking/teststaking/helper.go | 1 - x/staking/types/validator_test.go | 1 - 10 files changed, 10 deletions(-) diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index db3e0c11478c..b1a5c0d9429f 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -3,7 +3,6 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) diff --git a/x/slashing/abci_test.go b/x/slashing/abci_test.go index 7c7954b34a09..7fb5a1f6e880 100644 --- a/x/slashing/abci_test.go +++ b/x/slashing/abci_test.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestBeginBlocker(t *testing.T) { diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index 79bafe94e189..5360ace3ee83 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -16,7 +16,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" sdkslashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) diff --git a/x/slashing/keeper/genesis.go b/x/slashing/keeper/genesis.go index ca5a983d3447..fa895e50c1d2 100644 --- a/x/slashing/keeper/genesis.go +++ b/x/slashing/keeper/genesis.go @@ -3,7 +3,6 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/slashing/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // InitGenesis initialize default parameters diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index 9b3f4e0e434b..f198d6aad8f8 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -12,7 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing/testslashing" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // Test a new validator entering the validator set diff --git a/x/slashing/types/expected_keepers.go b/x/slashing/types/expected_keepers.go index 2ed7911c485c..462c1f59763a 100644 --- a/x/slashing/types/expected_keepers.go +++ b/x/slashing/types/expected_keepers.go @@ -6,7 +6,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" auth "github.com/cosmos/cosmos-sdk/x/auth/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // AccountKeeper expected account keeper diff --git a/x/staking/keeper/querier.go b/x/staking/keeper/querier.go index 3e0fd04318fa..262fdb4cca67 100644 --- a/x/staking/keeper/querier.go +++ b/x/staking/keeper/querier.go @@ -11,7 +11,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) // creates a querier for staking REST endpoints diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index 5f6c664267e5..6bc4b1e4ee18 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -12,7 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) const ( diff --git a/x/staking/teststaking/helper.go b/x/staking/teststaking/helper.go index 82fd7911b5a3..783f6e849e5a 100644 --- a/x/staking/teststaking/helper.go +++ b/x/staking/teststaking/helper.go @@ -11,7 +11,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index 3b7a933b6b96..03de78e638ec 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -16,7 +16,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" ) func TestValidatorTestEquivalent(t *testing.T) {