feat!: deposit to validator rewards pool (#14322)
This commit is contained in:
parent
3aa16ed092
commit
11f1e8d74c
11
CHANGELOG.md
11
CHANGELOG.md
@ -39,19 +39,20 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
### Features
|
||||
|
||||
* (x/slashing, x/staking) [#14363](https://github.com/cosmos/cosmos-sdk/pull/14363) Add the infraction a validator commited type as an argument to a `SlashWithInfractionReason` keeper method.
|
||||
* (x/distribution) [#14322](https://github.com/cosmos/cosmos-sdk/pull/14322) Introduce a new gRPC message handler, `DepositValidatorRewardsPool`, that allows explicit funding of a validator's reward pool.
|
||||
* (x/slashing, x/staking) [#14363](https://github.com/cosmos/cosmos-sdk/pull/14363) Add the infraction a validator committed type as an argument to a `SlashWithInfractionReason` keeper method.
|
||||
* (x/evidence) [#13740](https://github.com/cosmos/cosmos-sdk/pull/13740) Add new proto field `hash` of type `string` to `QueryEvidenceRequest` which helps to decode the hash properly while using query API.
|
||||
* (core) [#13306](https://github.com/cosmos/cosmos-sdk/pull/13306) Add a `FormatCoins` function to in `core/coins` to format sdk Coins following the Value Renderers spec.
|
||||
* (math) [#13306](https://github.com/cosmos/cosmos-sdk/pull/13306) Add `FormatInt` and `FormatDec` functiosn in `math` to format integers and decimals following the Value Renderers spec.
|
||||
* (math) [#13306](https://github.com/cosmos/cosmos-sdk/pull/13306) Add `FormatInt` and `FormatDec` functions in `math` to format integers and decimals following the Value Renderers spec.
|
||||
* (x/staking) [#13122](https://github.com/cosmos/cosmos-sdk/pull/13122) Add `UnbondingCanComplete` and `PutUnbondingOnHold` to `x/staking` module.
|
||||
* [#13437](https://github.com/cosmos/cosmos-sdk/pull/13437) Add new flag `--modules-to-export` in `simd export` command to export only selected modules.
|
||||
* [#13298](https://github.com/cosmos/cosmos-sdk/pull/13298) Add `AddGenesisAccount` helper func in x/auth module which helps adding accounts to genesis state.
|
||||
* (x/authz) [#12648](https://github.com/cosmos/cosmos-sdk/pull/12648) Add an allow list, an optional list of addresses allowed to receive bank assets via authz MsgSend grant.
|
||||
* (sdk.Coins) [#12627](https://github.com/cosmos/cosmos-sdk/pull/12627) Make a Denoms method on sdk.Coins.
|
||||
* (sdk.Coins) [#12627](https://github.com/cosmos/cosmos-sdk/pull/12627) Make a `Denoms` method on sdk.Coins.
|
||||
* (testutil) [#12973](https://github.com/cosmos/cosmos-sdk/pull/12973) Add generic `testutil.RandSliceElem` function which selects a random element from the list.
|
||||
* (client) [#12936](https://github.com/cosmos/cosmos-sdk/pull/12936) Add capability to preprocess transactions before broadcasting from a higher level chain.
|
||||
* (client) [#12936](https://github.com/cosmos/cosmos-sdk/pull/12936) Add capability to pre-process transactions before broadcasting from a higher level chain.
|
||||
* (cli) [#13064](https://github.com/cosmos/cosmos-sdk/pull/13064) Add `debug prefixes` to list supported HRP prefixes via .
|
||||
* (ledger) [#12935](https://github.com/cosmos/cosmos-sdk/pull/12935) Generalize Ledger integration to allow for different apps or keytypes that use SECP256k1.
|
||||
* (ledger) [#12935](https://github.com/cosmos/cosmos-sdk/pull/12935) Generalize Ledger integration to allow for different apps or key types that use SECP256k1.
|
||||
* (x/bank) [#11981](https://github.com/cosmos/cosmos-sdk/pull/11981) Create the `SetSendEnabled` endpoint for managing the bank's SendEnabled settings.
|
||||
* (x/auth) [#13210](https://github.com/cosmos/cosmos-sdk/pull/13210) Add `Query/AccountInfo` endpoint for simplified access to basic account info.
|
||||
* (x/consensus) [#12905](https://github.com/cosmos/cosmos-sdk/pull/12905) Create a new `x/consensus` module that is now responsible for maintaining Tendermint consensus parameters instead of `x/param`. Legacy types remain in order to facilitate parameter migration from the deprecated `x/params`. App developers should ensure that they execute `baseapp.MigrateParams` during their chain upgrade. These legacy types will be removed in a future release.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -46,6 +46,11 @@ type MsgClient interface {
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error)
|
||||
// DepositValidatorRewardsPool defines a method to provide additional rewards
|
||||
// to delegators to a specific validator.
|
||||
//
|
||||
// Since: cosmos-sdk 0.48
|
||||
DepositValidatorRewardsPool(ctx context.Context, in *MsgDepositValidatorRewardsPool, opts ...grpc.CallOption) (*MsgDepositValidatorRewardsPoolResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@ -110,6 +115,15 @@ func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPool
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) DepositValidatorRewardsPool(ctx context.Context, in *MsgDepositValidatorRewardsPool, opts ...grpc.CallOption) (*MsgDepositValidatorRewardsPoolResponse, error) {
|
||||
out := new(MsgDepositValidatorRewardsPoolResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/DepositValidatorRewardsPool", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
// All implementations must embed UnimplementedMsgServer
|
||||
// for forward compatibility
|
||||
@ -138,6 +152,11 @@ type MsgServer interface {
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error)
|
||||
// DepositValidatorRewardsPool defines a method to provide additional rewards
|
||||
// to delegators to a specific validator.
|
||||
//
|
||||
// Since: cosmos-sdk 0.48
|
||||
DepositValidatorRewardsPool(context.Context, *MsgDepositValidatorRewardsPool) (*MsgDepositValidatorRewardsPoolResponse, error)
|
||||
mustEmbedUnimplementedMsgServer()
|
||||
}
|
||||
|
||||
@ -163,6 +182,9 @@ func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*
|
||||
func (UnimplementedMsgServer) CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CommunityPoolSpend not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) DepositValidatorRewardsPool(context.Context, *MsgDepositValidatorRewardsPool) (*MsgDepositValidatorRewardsPoolResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DepositValidatorRewardsPool not implemented")
|
||||
}
|
||||
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
|
||||
|
||||
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
|
||||
@ -284,6 +306,24 @@ func _Msg_CommunityPoolSpend_Handler(srv interface{}, ctx context.Context, dec f
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_DepositValidatorRewardsPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgDepositValidatorRewardsPool)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).DepositValidatorRewardsPool(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cosmos.distribution.v1beta1.Msg/DepositValidatorRewardsPool",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).DepositValidatorRewardsPool(ctx, req.(*MsgDepositValidatorRewardsPool))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -315,6 +355,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "CommunityPoolSpend",
|
||||
Handler: _Msg_CommunityPoolSpend_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DepositValidatorRewardsPool",
|
||||
Handler: _Msg_DepositValidatorRewardsPool_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cosmos/distribution/v1beta1/tx.proto",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cosmos.distribution.v1beta1;
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types";
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types";
|
||||
option (gogoproto.equal_all) = true;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
@ -17,19 +17,23 @@ service Msg {
|
||||
|
||||
// SetWithdrawAddress defines a method to change the withdraw address
|
||||
// for a delegator (or validator self-delegation).
|
||||
rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse);
|
||||
rpc SetWithdrawAddress(MsgSetWithdrawAddress)
|
||||
returns (MsgSetWithdrawAddressResponse);
|
||||
|
||||
// WithdrawDelegatorReward defines a method to withdraw rewards of delegator
|
||||
// from a single validator.
|
||||
rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse);
|
||||
rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward)
|
||||
returns (MsgWithdrawDelegatorRewardResponse);
|
||||
|
||||
// WithdrawValidatorCommission defines a method to withdraw the
|
||||
// full commission to the validator address.
|
||||
rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse);
|
||||
rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission)
|
||||
returns (MsgWithdrawValidatorCommissionResponse);
|
||||
|
||||
// FundCommunityPool defines a method to allow an account to directly
|
||||
// fund the community pool.
|
||||
rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse);
|
||||
rpc FundCommunityPool(MsgFundCommunityPool)
|
||||
returns (MsgFundCommunityPoolResponse);
|
||||
|
||||
// UpdateParams defines a governance operation for updating the x/distribution
|
||||
// module parameters. The authority is defined in the keeper.
|
||||
@ -43,7 +47,15 @@ service Msg {
|
||||
// keeper.
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse);
|
||||
rpc CommunityPoolSpend(MsgCommunityPoolSpend)
|
||||
returns (MsgCommunityPoolSpendResponse);
|
||||
|
||||
// DepositValidatorRewardsPool defines a method to provide additional rewards
|
||||
// to delegators to a specific validator.
|
||||
//
|
||||
// Since: cosmos-sdk 0.48
|
||||
rpc DepositValidatorRewardsPool(MsgDepositValidatorRewardsPool)
|
||||
returns (MsgDepositValidatorRewardsPoolResponse);
|
||||
}
|
||||
|
||||
// MsgSetWithdrawAddress sets the withdraw address for
|
||||
@ -143,7 +155,8 @@ message MsgUpdateParams {
|
||||
// params defines the x/distribution parameters to update.
|
||||
//
|
||||
// NOTE: All parameters must be supplied.
|
||||
Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
|
||||
Params params = 2
|
||||
[(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
|
||||
}
|
||||
|
||||
// MsgUpdateParamsResponse defines the response structure for executing a
|
||||
@ -162,8 +175,8 @@ message MsgCommunityPoolSpend {
|
||||
option (amino.name) = "cosmos-sdk/distr/MsgCommunityPoolSpend";
|
||||
|
||||
// authority is the address of the governance account.
|
||||
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
string recipient = 2;
|
||||
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
string recipient = 2;
|
||||
repeated cosmos.base.v1beta1.Coin amount = 3 [
|
||||
(gogoproto.nullable) = false,
|
||||
(amino.dont_omitempty) = true,
|
||||
@ -176,3 +189,27 @@ message MsgCommunityPoolSpend {
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
message MsgCommunityPoolSpendResponse {}
|
||||
|
||||
// DepositValidatorRewardsPool defines the request structure to provide
|
||||
// additional rewards to delegators from a specific validator.
|
||||
//
|
||||
// Since: cosmos-sdk 0.48
|
||||
message MsgDepositValidatorRewardsPool {
|
||||
option (cosmos.msg.v1.signer) = "authority";
|
||||
|
||||
option (gogoproto.equal) = false;
|
||||
option (gogoproto.goproto_getters) = false;
|
||||
|
||||
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
|
||||
repeated cosmos.base.v1beta1.Coin amount = 3 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
|
||||
];
|
||||
}
|
||||
|
||||
// MsgDepositValidatorRewardsPoolResponse defines the response to executing a
|
||||
// MsgDepositValidatorRewardsPool message.
|
||||
//
|
||||
// Since: cosmos-sdk 0.48
|
||||
message MsgDepositValidatorRewardsPoolResponse {}
|
||||
|
||||
@ -40,8 +40,13 @@ type KeeperTestSuite struct {
|
||||
msgServer types.MsgServer
|
||||
}
|
||||
|
||||
func TestDistributionTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(KeeperTestSuite))
|
||||
}
|
||||
|
||||
func (suite *KeeperTestSuite) SetupTest() {
|
||||
app, err := simtestutil.Setup(testutil.AppConfig,
|
||||
app, err := simtestutil.Setup(
|
||||
testutil.AppConfig,
|
||||
&suite.interfaceRegistry,
|
||||
&suite.bankKeeper,
|
||||
&suite.distrKeeper,
|
||||
@ -672,7 +677,3 @@ func (suite *KeeperTestSuite) TestGRPCCommunityPool() {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestDistributionTestSuite(t *testing.T) {
|
||||
suite.Run(t, new(KeeperTestSuite))
|
||||
}
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
package keeper_test
|
||||
|
||||
import (
|
||||
"cosmossdk.io/math"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
stakingtestutil "github.com/cosmos/cosmos-sdk/x/staking/testutil"
|
||||
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||
)
|
||||
|
||||
func (s *KeeperTestSuite) TestMsgUpdateParams() {
|
||||
@ -206,3 +211,72 @@ func (s *KeeperTestSuite) TestCommunityPoolSpend() {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (s *KeeperTestSuite) TestMsgDepositValidatorRewardsPool() {
|
||||
tstaking := stakingtestutil.NewHelper(s.T(), s.ctx, s.stakingKeeper)
|
||||
tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), math.LegacyNewDec(0))
|
||||
tstaking.CreateValidator(s.valAddrs[1], valConsPk0, sdk.NewInt(100), true)
|
||||
|
||||
// mint a non-staking token and send to an account
|
||||
amt := sdk.NewCoins(sdk.NewInt64Coin("foo", 500))
|
||||
s.bankKeeper.MintCoins(s.ctx, minttypes.ModuleName, amt)
|
||||
s.bankKeeper.SendCoinsFromModuleToAccount(s.ctx, minttypes.ModuleName, s.addrs[0], amt)
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
input *types.MsgDepositValidatorRewardsPool
|
||||
expErr bool
|
||||
expErrMsg string
|
||||
}{
|
||||
{
|
||||
name: "happy path (staking token)",
|
||||
input: &types.MsgDepositValidatorRewardsPool{
|
||||
Authority: s.addrs[0].String(),
|
||||
ValidatorAddress: s.valAddrs[1].String(),
|
||||
Amount: sdk.NewCoins(sdk.NewCoin(s.stakingKeeper.BondDenom(s.ctx), sdk.NewInt(100))),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "happy path (non-staking token)",
|
||||
input: &types.MsgDepositValidatorRewardsPool{
|
||||
Authority: s.addrs[0].String(),
|
||||
ValidatorAddress: s.valAddrs[1].String(),
|
||||
Amount: amt,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "invalid validator",
|
||||
input: &types.MsgDepositValidatorRewardsPool{
|
||||
Authority: s.addrs[0].String(),
|
||||
ValidatorAddress: sdk.ValAddress([]byte("addr1_______________")).String(),
|
||||
Amount: sdk.NewCoins(sdk.NewCoin(s.stakingKeeper.BondDenom(s.ctx), sdk.NewInt(100))),
|
||||
},
|
||||
expErr: true,
|
||||
expErrMsg: "validator does not exist",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
_, err := s.msgServer.DepositValidatorRewardsPool(s.ctx, tc.input)
|
||||
|
||||
if tc.expErr {
|
||||
s.Require().Error(err)
|
||||
s.Require().Contains(err.Error(), tc.expErrMsg)
|
||||
} else {
|
||||
s.Require().NoError(err)
|
||||
|
||||
valAddr, err := sdk.ValAddressFromBech32(tc.input.ValidatorAddress)
|
||||
s.Require().NoError(err)
|
||||
|
||||
// check validator outstanding rewards
|
||||
outstandingRewards := s.distrKeeper.GetValidatorOutstandingRewards(s.ctx, valAddr)
|
||||
for _, c := range tc.input.Amount {
|
||||
x := outstandingRewards.Rewards.AmountOf(c.Denom)
|
||||
s.Require().Equal(x, sdk.NewDecFromInt(c.Amount))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,6 +40,7 @@ func NewTxCmd() *cobra.Command {
|
||||
NewWithdrawAllRewardsCmd(),
|
||||
NewSetWithdrawAddrCmd(),
|
||||
NewFundCommunityPoolCmd(),
|
||||
NewDepositValidatorRewardsPoolCmd(),
|
||||
)
|
||||
|
||||
return distTxCmd
|
||||
@ -254,3 +255,42 @@ $ %s tx distribution fund-community-pool 100uatom --from mykey
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
// NewDepositValidatorRewardsPoolCmd returns a CLI command handler for creating
|
||||
// a MsgDepositValidatorRewardsPool transaction.
|
||||
func NewDepositValidatorRewardsPoolCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "fund-validator-rewards-pool [val_addr] [amount]",
|
||||
Args: cobra.ExactArgs(2),
|
||||
Short: "Fund the validator rewards pool with the specified amount",
|
||||
Example: fmt.Sprintf(
|
||||
"%s tx distribution fund-validator-rewards-pool cosmosvaloper1x20lytyf6zkcrv5edpkfkn8sz578qg5sqfyqnp 100uatom --from mykey",
|
||||
version.AppName,
|
||||
),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
depositorAddr := clientCtx.GetFromAddress()
|
||||
|
||||
valAddr, err := sdk.ValAddressFromBech32(args[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
amount, err := sdk.ParseCoinsNormalized(args[1])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msg := types.NewMsgDepositValidatorRewardsPool(depositorAddr, valAddr, amount)
|
||||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
|
||||
},
|
||||
}
|
||||
|
||||
flags.AddTxFlagsToCmd(cmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@ -153,3 +153,42 @@ func (k msgServer) CommunityPoolSpend(goCtx context.Context, req *types.MsgCommu
|
||||
|
||||
return &types.MsgCommunityPoolSpendResponse{}, nil
|
||||
}
|
||||
|
||||
func (k msgServer) DepositValidatorRewardsPool(goCtx context.Context, req *types.MsgDepositValidatorRewardsPool) (*types.MsgDepositValidatorRewardsPoolResponse, error) {
|
||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
|
||||
authority, err := sdk.AccAddressFromBech32(req.Authority)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// deposit coins from sender's account to the distribution module
|
||||
if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, authority, types.ModuleName, req.Amount); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
valAddr, err := sdk.ValAddressFromBech32(req.ValidatorAddress)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
validator := k.stakingKeeper.Validator(ctx, valAddr)
|
||||
if validator == nil {
|
||||
return nil, errors.Wrapf(types.ErrNoValidatorExists, valAddr.String())
|
||||
}
|
||||
|
||||
// Allocate tokens from the distribution module to the validator, which are
|
||||
// then distributed to the validator's delegators.
|
||||
reward := sdk.NewDecCoinsFromCoins(req.Amount...)
|
||||
k.AllocateTokensToValidator(ctx, validator, reward)
|
||||
|
||||
logger := k.Logger(ctx)
|
||||
logger.Info(
|
||||
"transferred from rewards to validator rewards pool",
|
||||
"authority", req.Authority,
|
||||
"amount", req.Amount.String(),
|
||||
"validator", req.ValidatorAddress,
|
||||
)
|
||||
|
||||
return &types.MsgDepositValidatorRewardsPoolResponse{}, nil
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
legacy.RegisterAminoMsg(cdc, &MsgFundCommunityPool{}, "cosmos-sdk/MsgFundCommunityPool")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/distribution/MsgUpdateParams")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgCommunityPoolSpend{}, "cosmos-sdk/distr/MsgCommunityPoolSpend")
|
||||
legacy.RegisterAminoMsg(cdc, &MsgDepositValidatorRewardsPool{}, "cosmos-sdk/distr/MsgDepositValRewards")
|
||||
|
||||
cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/distribution/Params", nil)
|
||||
}
|
||||
@ -36,11 +37,13 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
&MsgFundCommunityPool{},
|
||||
&MsgUpdateParams{},
|
||||
&MsgCommunityPoolSpend{},
|
||||
&MsgDepositValidatorRewardsPool{},
|
||||
)
|
||||
|
||||
registry.RegisterImplementations(
|
||||
(*govtypes.Content)(nil),
|
||||
&CommunityPoolSpendProposal{})
|
||||
&CommunityPoolSpendProposal{},
|
||||
)
|
||||
|
||||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ const (
|
||||
TypeMsgFundCommunityPool = "fund_community_pool"
|
||||
TypeMsgUpdateParams = "update_params"
|
||||
TypeMsgCommunityPoolSpend = "community_pool_spend"
|
||||
TypeMsgDepositValidatorRewardsPool = "deposit_validator_rewards_pool"
|
||||
)
|
||||
|
||||
// Verify interface at compile time
|
||||
@ -22,6 +23,7 @@ var (
|
||||
_ sdk.Msg = (*MsgWithdrawValidatorCommission)(nil)
|
||||
_ sdk.Msg = (*MsgUpdateParams)(nil)
|
||||
_ sdk.Msg = (*MsgCommunityPoolSpend)(nil)
|
||||
_ sdk.Msg = (*MsgDepositValidatorRewardsPool)(nil)
|
||||
)
|
||||
|
||||
func NewMsgSetWithdrawAddress(delAddr, withdrawAddr sdk.AccAddress) *MsgSetWithdrawAddress {
|
||||
@ -217,3 +219,42 @@ func (msg MsgCommunityPoolSpend) ValidateBasic() error {
|
||||
|
||||
return msg.Amount.Validate()
|
||||
}
|
||||
|
||||
// NewMsgDepositValidatorRewardsPool returns a new MsgDepositValidatorRewardsPool
|
||||
// with a sender and a funding amount.
|
||||
func NewMsgDepositValidatorRewardsPool(depositor sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coins) *MsgDepositValidatorRewardsPool {
|
||||
return &MsgDepositValidatorRewardsPool{
|
||||
Amount: amount,
|
||||
Authority: depositor.String(),
|
||||
ValidatorAddress: valAddr.String(),
|
||||
}
|
||||
}
|
||||
|
||||
// Route returns the MsgDepositValidatorRewardsPool message route.
|
||||
func (msg MsgDepositValidatorRewardsPool) Route() string { return ModuleName }
|
||||
|
||||
// Type returns the MsgDepositValidatorRewardsPool message type.
|
||||
func (msg MsgDepositValidatorRewardsPool) Type() string { return TypeMsgDepositValidatorRewardsPool }
|
||||
|
||||
// GetSigners returns the signer addresses that are expected to sign the result
|
||||
// of GetSignBytes, which is the authority.
|
||||
func (msg MsgDepositValidatorRewardsPool) GetSigners() []sdk.AccAddress {
|
||||
authority, _ := sdk.AccAddressFromBech32(msg.Authority)
|
||||
return []sdk.AccAddress{authority}
|
||||
}
|
||||
|
||||
// GetSignBytes returns the raw bytes for a MsgDepositValidatorRewardsPool message
|
||||
// that the expected signer needs to sign.
|
||||
func (msg MsgDepositValidatorRewardsPool) GetSignBytes() []byte {
|
||||
bz := ModuleCdc.MustMarshalJSON(&msg)
|
||||
return sdk.MustSortJSON(bz)
|
||||
}
|
||||
|
||||
// ValidateBasic performs basic MsgDepositValidatorRewardsPool message validation.
|
||||
func (msg MsgDepositValidatorRewardsPool) ValidateBasic() error {
|
||||
if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil {
|
||||
return sdkerrors.ErrInvalidAddress.Wrapf("invalid authority address: %s", err)
|
||||
}
|
||||
|
||||
return msg.Amount.Validate()
|
||||
}
|
||||
|
||||
@ -568,6 +568,91 @@ func (m *MsgCommunityPoolSpendResponse) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_MsgCommunityPoolSpendResponse proto.InternalMessageInfo
|
||||
|
||||
// DepositValidatorRewardsPool defines the request structure to provide
|
||||
// additional rewards to delegators from a specific validator.
|
||||
//
|
||||
// Since: cosmos-sdk 0.48
|
||||
type MsgDepositValidatorRewardsPool struct {
|
||||
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
|
||||
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
|
||||
Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
|
||||
}
|
||||
|
||||
func (m *MsgDepositValidatorRewardsPool) Reset() { *m = MsgDepositValidatorRewardsPool{} }
|
||||
func (m *MsgDepositValidatorRewardsPool) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgDepositValidatorRewardsPool) ProtoMessage() {}
|
||||
func (*MsgDepositValidatorRewardsPool) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ed4f433d965e58ca, []int{12}
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPool) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgDepositValidatorRewardsPool.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 *MsgDepositValidatorRewardsPool) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgDepositValidatorRewardsPool.Merge(m, src)
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPool) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPool) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgDepositValidatorRewardsPool.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgDepositValidatorRewardsPool proto.InternalMessageInfo
|
||||
|
||||
// MsgDepositValidatorRewardsPoolResponse defines the response to executing a
|
||||
// MsgDepositValidatorRewardsPool message.
|
||||
//
|
||||
// Since: cosmos-sdk 0.48
|
||||
type MsgDepositValidatorRewardsPoolResponse struct {
|
||||
}
|
||||
|
||||
func (m *MsgDepositValidatorRewardsPoolResponse) Reset() {
|
||||
*m = MsgDepositValidatorRewardsPoolResponse{}
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPoolResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MsgDepositValidatorRewardsPoolResponse) ProtoMessage() {}
|
||||
func (*MsgDepositValidatorRewardsPoolResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ed4f433d965e58ca, []int{13}
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPoolResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_MsgDepositValidatorRewardsPoolResponse.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 *MsgDepositValidatorRewardsPoolResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_MsgDepositValidatorRewardsPoolResponse.Merge(m, src)
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPoolResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPoolResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_MsgDepositValidatorRewardsPoolResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_MsgDepositValidatorRewardsPoolResponse proto.InternalMessageInfo
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*MsgSetWithdrawAddress)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddress")
|
||||
proto.RegisterType((*MsgSetWithdrawAddressResponse)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse")
|
||||
@ -581,6 +666,8 @@ func init() {
|
||||
proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.distribution.v1beta1.MsgUpdateParamsResponse")
|
||||
proto.RegisterType((*MsgCommunityPoolSpend)(nil), "cosmos.distribution.v1beta1.MsgCommunityPoolSpend")
|
||||
proto.RegisterType((*MsgCommunityPoolSpendResponse)(nil), "cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse")
|
||||
proto.RegisterType((*MsgDepositValidatorRewardsPool)(nil), "cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool")
|
||||
proto.RegisterType((*MsgDepositValidatorRewardsPoolResponse)(nil), "cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse")
|
||||
}
|
||||
|
||||
func init() {
|
||||
@ -588,59 +675,63 @@ func init() {
|
||||
}
|
||||
|
||||
var fileDescriptor_ed4f433d965e58ca = []byte{
|
||||
// 829 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcd, 0x6b, 0x13, 0x4f,
|
||||
0x18, 0xce, 0xb4, 0xfc, 0x02, 0x99, 0xfe, 0xa0, 0x4d, 0xa8, 0xb4, 0xdd, 0xd6, 0x4d, 0xd9, 0x4a,
|
||||
0x2d, 0xc5, 0xee, 0x92, 0xf8, 0x45, 0xe3, 0x41, 0x4c, 0x6c, 0xc1, 0x43, 0xb0, 0xa4, 0xa8, 0xe0,
|
||||
0xa5, 0x6c, 0xb2, 0xeb, 0x66, 0xb0, 0xbb, 0xb3, 0xec, 0x4c, 0x9a, 0xe6, 0xa6, 0xe2, 0x41, 0x3c,
|
||||
0x88, 0xd4, 0x3f, 0xc0, 0x1e, 0x8b, 0x17, 0x7b, 0xf0, 0x8f, 0x28, 0x82, 0x50, 0x3c, 0x79, 0x52,
|
||||
0x49, 0x0f, 0x15, 0xbc, 0xea, 0x5d, 0xf6, 0x33, 0xbb, 0xd9, 0x4d, 0xd6, 0xd4, 0xaf, 0x4b, 0x5b,
|
||||
0x66, 0xde, 0xe7, 0xd9, 0xe7, 0x79, 0xe6, 0x9d, 0x77, 0x0a, 0xcf, 0xd4, 0x30, 0x51, 0x31, 0x11,
|
||||
0x24, 0x44, 0xa8, 0x81, 0xaa, 0x0d, 0x8a, 0xb0, 0x26, 0x6c, 0xe5, 0xaa, 0x32, 0x15, 0x73, 0x02,
|
||||
0xdd, 0xe6, 0x75, 0x03, 0x53, 0x9c, 0x99, 0xb6, 0xab, 0x78, 0x7f, 0x15, 0xef, 0x54, 0x31, 0xe3,
|
||||
0x0a, 0x56, 0xb0, 0x55, 0x27, 0x98, 0x7f, 0xd9, 0x10, 0x86, 0x75, 0x88, 0xab, 0x22, 0x91, 0x3d,
|
||||
0xc2, 0x1a, 0x46, 0x9a, 0xb3, 0x3f, 0x65, 0xef, 0x6f, 0xd8, 0x40, 0x87, 0xdf, 0xde, 0x9a, 0x70,
|
||||
0xa0, 0x2a, 0x51, 0x84, 0xad, 0x9c, 0xf9, 0xcb, 0xd9, 0x48, 0x8b, 0x2a, 0xd2, 0xb0, 0x60, 0xfd,
|
||||
0x74, 0x96, 0xf8, 0x7e, 0xfa, 0x03, 0x72, 0xad, 0x7a, 0xee, 0x2b, 0x80, 0xa7, 0xca, 0x44, 0x59,
|
||||
0x97, 0xe9, 0x1d, 0x44, 0xeb, 0x92, 0x21, 0x36, 0xaf, 0x49, 0x92, 0x21, 0x13, 0x92, 0x59, 0x81,
|
||||
0x69, 0x49, 0xde, 0x94, 0x15, 0x91, 0x62, 0x63, 0x43, 0xb4, 0x17, 0x27, 0xc1, 0x2c, 0x58, 0x48,
|
||||
0x15, 0x27, 0xdf, 0xbf, 0x59, 0x1a, 0x77, 0x24, 0x3a, 0xe5, 0xeb, 0xd4, 0x40, 0x9a, 0x52, 0x19,
|
||||
0xf3, 0x20, 0x2e, 0x4d, 0x09, 0x8e, 0x35, 0x1d, 0x66, 0x8f, 0x65, 0x28, 0x86, 0x65, 0xb4, 0x19,
|
||||
0xd4, 0x52, 0x58, 0x7d, 0xb2, 0x9b, 0x4d, 0x7c, 0xd9, 0xcd, 0x26, 0x1e, 0x1d, 0xef, 0x2f, 0x86,
|
||||
0x65, 0x3d, 0x3d, 0xde, 0x5f, 0x9c, 0xb3, 0x99, 0x96, 0x88, 0x74, 0x5f, 0x28, 0x13, 0xa5, 0x8c,
|
||||
0x25, 0x74, 0xaf, 0xd5, 0xe5, 0x89, 0xcb, 0xc2, 0xd3, 0x91, 0x66, 0x2b, 0x32, 0xd1, 0xb1, 0x46,
|
||||
0x64, 0xee, 0x3b, 0x80, 0x4c, 0x99, 0x28, 0xee, 0xf6, 0x75, 0xf7, 0x4b, 0x15, 0xb9, 0x29, 0x1a,
|
||||
0xd2, 0xef, 0xca, 0x64, 0x05, 0xa6, 0xb7, 0xc4, 0x4d, 0x24, 0x05, 0x68, 0xe2, 0x42, 0x19, 0xf3,
|
||||
0x20, 0x6e, 0x2a, 0x37, 0xe2, 0x53, 0x99, 0x0f, 0xa6, 0xd2, 0xe5, 0x0b, 0x61, 0xcd, 0x36, 0xc6,
|
||||
0x3d, 0x03, 0x90, 0xeb, 0xed, 0xdb, 0x8d, 0x27, 0x53, 0x87, 0x49, 0x51, 0xc5, 0x0d, 0x8d, 0x4e,
|
||||
0x82, 0xd9, 0xe1, 0x85, 0x91, 0xfc, 0x94, 0xd3, 0x6e, 0xbc, 0xd9, 0xd5, 0xee, 0x05, 0xe0, 0x4b,
|
||||
0x18, 0x69, 0xc5, 0x8b, 0x07, 0x1f, 0xb3, 0x89, 0x57, 0x9f, 0xb2, 0x0b, 0x0a, 0xa2, 0xf5, 0x46,
|
||||
0x95, 0xaf, 0x61, 0xd5, 0xe9, 0x6a, 0xc1, 0xa7, 0x89, 0xb6, 0x74, 0x99, 0x58, 0x00, 0xb2, 0x77,
|
||||
0xbc, 0xbf, 0x08, 0x2a, 0x0e, 0x3f, 0xf7, 0x1a, 0x40, 0xd6, 0x27, 0xe8, 0xb6, 0xeb, 0xbd, 0x84,
|
||||
0x55, 0x15, 0x11, 0x82, 0xb0, 0x16, 0x9d, 0x22, 0x18, 0x38, 0xc5, 0x60, 0x6f, 0x85, 0x18, 0x23,
|
||||
0x7a, 0xcb, 0x27, 0xaa, 0x23, 0x87, 0xdb, 0x01, 0x70, 0xbe, 0xbf, 0xe2, 0x7f, 0x10, 0xe3, 0x37,
|
||||
0x00, 0xc7, 0xcb, 0x44, 0x59, 0x6d, 0x68, 0x92, 0xa9, 0xa3, 0xa1, 0x21, 0xda, 0x5a, 0xc3, 0x78,
|
||||
0xf3, 0xef, 0x49, 0xc8, 0x5c, 0x82, 0x29, 0x49, 0xd6, 0x31, 0x41, 0x14, 0x1b, 0xb1, 0x4d, 0xde,
|
||||
0x29, 0x2d, 0x14, 0xfc, 0xe7, 0xd2, 0x59, 0x37, 0xcf, 0x23, 0x1b, 0x3c, 0x8f, 0x90, 0x3b, 0x8e,
|
||||
0x85, 0x33, 0x51, 0xeb, 0xde, 0x35, 0x7f, 0x07, 0xe0, 0x68, 0x99, 0x28, 0xb7, 0x74, 0x49, 0xa4,
|
||||
0xf2, 0x9a, 0x68, 0x88, 0x2a, 0x31, 0x75, 0x8a, 0x0d, 0x5a, 0xc7, 0x06, 0xa2, 0xad, 0xd8, 0x36,
|
||||
0xea, 0x94, 0x66, 0x56, 0x61, 0x52, 0xb7, 0x18, 0x2c, 0x73, 0x23, 0xf9, 0x39, 0xbe, 0xcf, 0xe3,
|
||||
0xc0, 0xdb, 0x1f, 0x2b, 0xa6, 0xcc, 0x4c, 0x9d, 0x9c, 0x6c, 0x74, 0xa1, 0x60, 0xf9, 0xf4, 0x78,
|
||||
0x4d, 0x9f, 0x67, 0x7d, 0x3e, 0x03, 0x03, 0xbd, 0x4b, 0x3b, 0x37, 0x05, 0x27, 0xba, 0x96, 0x3c,
|
||||
0xab, 0x3b, 0x43, 0xd6, 0x80, 0x0f, 0xe4, 0xb0, 0xae, 0xcb, 0x9a, 0x74, 0x62, 0xc3, 0x33, 0x30,
|
||||
0x65, 0xc8, 0x35, 0xa4, 0x23, 0x59, 0xa3, 0xf6, 0x81, 0x56, 0x3a, 0x0b, 0xbe, 0xc6, 0x1a, 0xfe,
|
||||
0xb3, 0x8d, 0x55, 0x58, 0x0e, 0x07, 0x36, 0xdf, 0x1d, 0x98, 0x10, 0x69, 0xdd, 0x79, 0x07, 0xc2,
|
||||
0x1b, 0x6e, 0x6a, 0xf9, 0xb7, 0x49, 0x38, 0x5c, 0x26, 0x4a, 0xe6, 0x31, 0x80, 0x99, 0x88, 0xb7,
|
||||
0x31, 0xdf, 0xf7, 0x8c, 0x23, 0x9f, 0x18, 0xa6, 0x30, 0x38, 0xc6, 0x1b, 0x18, 0x2f, 0x00, 0x9c,
|
||||
0xe8, 0xf5, 0x26, 0x5d, 0x8e, 0xe3, 0xed, 0x01, 0x64, 0xae, 0x9e, 0x10, 0xe8, 0xa9, 0x7a, 0x09,
|
||||
0xe0, 0x74, 0xbf, 0x01, 0x7d, 0xe5, 0x67, 0x3f, 0x10, 0x01, 0x66, 0x4a, 0xbf, 0x00, 0xf6, 0x14,
|
||||
0x3e, 0x04, 0x30, 0x1d, 0x9e, 0x7d, 0xb9, 0x38, 0xea, 0x10, 0x84, 0x59, 0x1e, 0x18, 0xe2, 0x69,
|
||||
0x30, 0xe0, 0xff, 0x81, 0x39, 0x73, 0x2e, 0x8e, 0xca, 0x5f, 0xcd, 0x5c, 0x18, 0xa4, 0xda, 0xfb,
|
||||
0xa6, 0xd9, 0xb6, 0x11, 0x37, 0x3e, 0xb6, 0x6d, 0xc3, 0x98, 0xf8, 0xb6, 0xed, 0x7d, 0x8b, 0x98,
|
||||
0xff, 0x1e, 0x98, 0x17, 0xb6, 0x78, 0x73, 0xaf, 0xcd, 0x82, 0x83, 0x36, 0x0b, 0x0e, 0xdb, 0x2c,
|
||||
0xf8, 0xdc, 0x66, 0xc1, 0xf3, 0x23, 0x36, 0x71, 0x78, 0xc4, 0x26, 0x3e, 0x1c, 0xb1, 0x89, 0xbb,
|
||||
0xb9, 0xbe, 0xb7, 0x7f, 0x3b, 0x38, 0xf8, 0xac, 0x61, 0x50, 0x4d, 0x5a, 0xff, 0xbb, 0x9e, 0xff,
|
||||
0x11, 0x00, 0x00, 0xff, 0xff, 0x3b, 0xc9, 0x2e, 0x04, 0xad, 0x0b, 0x00, 0x00,
|
||||
// 895 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0xe3, 0x44,
|
||||
0x18, 0xcd, 0xb4, 0xa2, 0x28, 0x53, 0xa4, 0x36, 0x56, 0xa1, 0xad, 0x5b, 0x9c, 0xca, 0x45, 0x25,
|
||||
0xaa, 0xa8, 0x4d, 0xc2, 0x2f, 0x35, 0x1c, 0x10, 0x49, 0x5b, 0x89, 0x43, 0x44, 0x95, 0x0a, 0x90,
|
||||
0xb8, 0x54, 0x4e, 0x6c, 0x9c, 0x11, 0xb5, 0xc7, 0xf2, 0x4c, 0x9a, 0xe6, 0x06, 0x88, 0x03, 0xe2,
|
||||
0x80, 0x50, 0xb9, 0x22, 0xd1, 0x63, 0xc5, 0x85, 0x1e, 0xf8, 0x23, 0x7a, 0x41, 0xaa, 0x38, 0x71,
|
||||
0x02, 0x94, 0x1e, 0x8a, 0xc4, 0x1e, 0x77, 0xef, 0x2b, 0xff, 0x9a, 0xd8, 0xb1, 0x63, 0x37, 0xdd,
|
||||
0xee, 0xee, 0xa5, 0x8d, 0x66, 0xbe, 0xf7, 0xfc, 0xbe, 0xe7, 0x37, 0xdf, 0x24, 0xf0, 0xb5, 0x36,
|
||||
0x26, 0x06, 0x26, 0xb2, 0x8a, 0x08, 0xb5, 0x51, 0xab, 0x4b, 0x11, 0x36, 0xe5, 0xe3, 0x72, 0x4b,
|
||||
0xa3, 0x4a, 0x59, 0xa6, 0x27, 0x92, 0x65, 0x63, 0x8a, 0xb9, 0x15, 0xaf, 0x4a, 0x0a, 0x57, 0x49,
|
||||
0x7e, 0x15, 0xbf, 0xa0, 0x63, 0x1d, 0xbb, 0x75, 0xb2, 0xf3, 0xc9, 0x83, 0xf0, 0x82, 0x4f, 0xdc,
|
||||
0x52, 0x88, 0xc6, 0x08, 0xdb, 0x18, 0x99, 0xfe, 0xfe, 0xb2, 0xb7, 0x7f, 0xe8, 0x01, 0x7d, 0x7e,
|
||||
0x6f, 0x6b, 0xd1, 0x87, 0x1a, 0x44, 0x97, 0x8f, 0xcb, 0xce, 0x3f, 0x7f, 0xa3, 0xa0, 0x18, 0xc8,
|
||||
0xc4, 0xb2, 0xfb, 0xd7, 0x5f, 0x92, 0xd2, 0xf4, 0x47, 0xe4, 0xba, 0xf5, 0xe2, 0xff, 0x00, 0xbe,
|
||||
0xdc, 0x20, 0xfa, 0x81, 0x46, 0x3f, 0x43, 0xb4, 0xa3, 0xda, 0x4a, 0xef, 0x43, 0x55, 0xb5, 0x35,
|
||||
0x42, 0xb8, 0x5d, 0x58, 0x50, 0xb5, 0x23, 0x4d, 0x57, 0x28, 0xb6, 0x0f, 0x15, 0x6f, 0x71, 0x09,
|
||||
0xac, 0x81, 0x52, 0xbe, 0xb6, 0xf4, 0xe7, 0xef, 0x5b, 0x0b, 0xbe, 0x44, 0xbf, 0xfc, 0x80, 0xda,
|
||||
0xc8, 0xd4, 0x9b, 0xf3, 0x0c, 0x12, 0xd0, 0xd4, 0xe1, 0x7c, 0xcf, 0x67, 0x66, 0x2c, 0x53, 0x19,
|
||||
0x2c, 0x73, 0xbd, 0xa8, 0x96, 0xea, 0xde, 0x77, 0x67, 0xc5, 0xdc, 0x7f, 0x67, 0xc5, 0xdc, 0x37,
|
||||
0x37, 0x17, 0x9b, 0x71, 0x59, 0xdf, 0xdf, 0x5c, 0x6c, 0xae, 0x7b, 0x4c, 0x5b, 0x44, 0xfd, 0x52,
|
||||
0x6e, 0x10, 0xbd, 0x81, 0x55, 0xf4, 0x45, 0x7f, 0xa4, 0x27, 0xb1, 0x08, 0x5f, 0x4d, 0x6c, 0xb6,
|
||||
0xa9, 0x11, 0x0b, 0x9b, 0x44, 0x13, 0x1f, 0x01, 0xc8, 0x37, 0x88, 0x1e, 0x6c, 0xef, 0x04, 0x4f,
|
||||
0x6a, 0x6a, 0x3d, 0xc5, 0x56, 0xef, 0xcb, 0x93, 0x5d, 0x58, 0x38, 0x56, 0x8e, 0x90, 0x1a, 0xa1,
|
||||
0xc9, 0x32, 0x65, 0x9e, 0x41, 0x02, 0x57, 0x3e, 0xca, 0x76, 0x65, 0x23, 0xea, 0xca, 0x48, 0x5f,
|
||||
0x08, 0x9b, 0x5e, 0x63, 0xe2, 0x0f, 0x00, 0x8a, 0xe3, 0xfb, 0x0e, 0xec, 0xe1, 0x3a, 0x70, 0x46,
|
||||
0x31, 0x70, 0xd7, 0xa4, 0x4b, 0x60, 0x6d, 0xba, 0x34, 0x5b, 0x59, 0xf6, 0xe3, 0x26, 0x39, 0xa9,
|
||||
0x0e, 0x0e, 0x80, 0x54, 0xc7, 0xc8, 0xac, 0xbd, 0x73, 0xf9, 0x77, 0x31, 0xf7, 0xeb, 0x3f, 0xc5,
|
||||
0x92, 0x8e, 0x68, 0xa7, 0xdb, 0x92, 0xda, 0xd8, 0xf0, 0x53, 0x2d, 0x87, 0x34, 0xd1, 0xbe, 0xa5,
|
||||
0x11, 0x17, 0x40, 0xce, 0x6f, 0x2e, 0x36, 0x41, 0xd3, 0xe7, 0x17, 0x7f, 0x03, 0x50, 0x08, 0x09,
|
||||
0xfa, 0x34, 0xe8, 0xbd, 0x8e, 0x0d, 0x03, 0x11, 0x82, 0xb0, 0x99, 0xec, 0x22, 0x98, 0xd8, 0xc5,
|
||||
0x68, 0xb6, 0x62, 0x8c, 0x09, 0xd9, 0x0a, 0x89, 0x1a, 0xca, 0x11, 0x4f, 0x01, 0xdc, 0x48, 0x57,
|
||||
0xfc, 0x1c, 0x6c, 0x7c, 0x08, 0xe0, 0x42, 0x83, 0xe8, 0x7b, 0x5d, 0x53, 0x75, 0x74, 0x74, 0x4d,
|
||||
0x44, 0xfb, 0xfb, 0x18, 0x1f, 0x3d, 0x3b, 0x09, 0xdc, 0xbb, 0x30, 0xaf, 0x6a, 0x16, 0x26, 0x88,
|
||||
0x62, 0x3b, 0x33, 0xe4, 0xc3, 0xd2, 0x6a, 0x35, 0xfc, 0x5e, 0x86, 0xeb, 0xce, 0xfb, 0x28, 0x46,
|
||||
0xdf, 0x47, 0xac, 0x3b, 0x51, 0x80, 0xab, 0x49, 0xeb, 0xec, 0x98, 0xff, 0x01, 0xe0, 0x5c, 0x83,
|
||||
0xe8, 0x9f, 0x58, 0xaa, 0x42, 0xb5, 0x7d, 0xc5, 0x56, 0x0c, 0xe2, 0xe8, 0x54, 0xba, 0xb4, 0x83,
|
||||
0x6d, 0x44, 0xfb, 0x99, 0x31, 0x1a, 0x96, 0x72, 0x7b, 0x70, 0xc6, 0x72, 0x19, 0xdc, 0xe6, 0x66,
|
||||
0x2b, 0xeb, 0x52, 0xca, 0xe5, 0x20, 0x79, 0x0f, 0xab, 0xe5, 0x1d, 0x4f, 0x7d, 0x9f, 0x3c, 0x74,
|
||||
0xb5, 0xea, 0xf6, 0xc9, 0x78, 0x9d, 0x3e, 0x5f, 0x0f, 0xf5, 0x19, 0x19, 0xe8, 0x23, 0xda, 0xc5,
|
||||
0x65, 0xb8, 0x38, 0xb2, 0xc4, 0x5a, 0x3d, 0x9d, 0x72, 0x07, 0x7c, 0xc4, 0x87, 0x03, 0x4b, 0x33,
|
||||
0xd5, 0x3b, 0x37, 0xbc, 0x0a, 0xf3, 0xb6, 0xd6, 0x46, 0x16, 0xd2, 0x4c, 0xea, 0xbd, 0xd0, 0xe6,
|
||||
0x70, 0x21, 0x14, 0xac, 0xe9, 0xa7, 0x1b, 0xac, 0xea, 0x76, 0xdc, 0xb0, 0x8d, 0x51, 0xc3, 0xe4,
|
||||
0xc4, 0xd6, 0xfd, 0x7b, 0x20, 0xbe, 0xc1, 0x5c, 0xfb, 0x79, 0xca, 0x1d, 0x3f, 0x3b, 0x5e, 0xea,
|
||||
0xd8, 0x59, 0xf6, 0xc6, 0x21, 0x71, 0x4f, 0xd0, 0x5d, 0xed, 0xbb, 0x9f, 0xe1, 0xcf, 0xb5, 0x6f,
|
||||
0xef, 0xf3, 0x9b, 0x93, 0xfa, 0xcc, 0x2c, 0x7e, 0x25, 0x72, 0x06, 0x59, 0x0f, 0x62, 0xc9, 0x1d,
|
||||
0x75, 0x29, 0xee, 0x04, 0x46, 0x56, 0x1e, 0xbc, 0x08, 0xa7, 0x1b, 0x44, 0xe7, 0xbe, 0x05, 0x90,
|
||||
0x4b, 0xf8, 0x92, 0x51, 0x49, 0x3d, 0x2c, 0x89, 0x77, 0x35, 0x5f, 0x9d, 0x1c, 0xc3, 0x26, 0xef,
|
||||
0x4f, 0x00, 0x2e, 0x8e, 0xbb, 0xdc, 0xdf, 0xcb, 0xe2, 0x1d, 0x03, 0xe4, 0x3f, 0xb8, 0x23, 0x90,
|
||||
0xa9, 0xfa, 0x05, 0xc0, 0x95, 0xb4, 0x9b, 0xee, 0xfd, 0xdb, 0x3e, 0x20, 0x01, 0xcc, 0xd7, 0x9f,
|
||||
0x00, 0xcc, 0x14, 0x7e, 0x0d, 0x60, 0x21, 0x7e, 0x89, 0x94, 0xb3, 0xa8, 0x63, 0x10, 0x7e, 0x7b,
|
||||
0x62, 0x08, 0xd3, 0x60, 0xc3, 0x97, 0x22, 0x03, 0xfb, 0x8d, 0x2c, 0xaa, 0x70, 0x35, 0xff, 0xf6,
|
||||
0x24, 0xd5, 0xec, 0x99, 0x4e, 0x6c, 0x13, 0x46, 0x67, 0x66, 0x6c, 0xe3, 0x98, 0xec, 0xd8, 0x8e,
|
||||
0x1f, 0x47, 0x6e, 0x40, 0xd2, 0x66, 0x51, 0x66, 0x40, 0x52, 0xc0, 0xd9, 0x01, 0xb9, 0xc5, 0x39,
|
||||
0xe7, 0x5f, 0xf8, 0xca, 0x99, 0xcd, 0xb5, 0x8f, 0xcf, 0x07, 0x02, 0xb8, 0x1c, 0x08, 0xe0, 0x6a,
|
||||
0x20, 0x80, 0x7f, 0x07, 0x02, 0xf8, 0xf1, 0x5a, 0xc8, 0x5d, 0x5d, 0x0b, 0xb9, 0xbf, 0xae, 0x85,
|
||||
0xdc, 0xe7, 0xe5, 0xd4, 0x01, 0x74, 0x12, 0xbd, 0xe3, 0xdc, 0x79, 0xd4, 0x9a, 0x71, 0x7f, 0xa6,
|
||||
0xbc, 0xf5, 0x38, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x28, 0x9c, 0xe1, 0x98, 0x0d, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (this *MsgSetWithdrawAddressResponse) Equal(that interface{}) bool {
|
||||
@ -847,6 +938,27 @@ func (this *MsgCommunityPoolSpendResponse) Equal(that interface{}) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (this *MsgDepositValidatorRewardsPoolResponse) Equal(that interface{}) bool {
|
||||
if that == nil {
|
||||
return this == nil
|
||||
}
|
||||
|
||||
that1, ok := that.(*MsgDepositValidatorRewardsPoolResponse)
|
||||
if !ok {
|
||||
that2, ok := that.(MsgDepositValidatorRewardsPoolResponse)
|
||||
if ok {
|
||||
that1 = &that2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if that1 == nil {
|
||||
return this == nil
|
||||
} else if this == nil {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
@ -884,6 +996,11 @@ type MsgClient interface {
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error)
|
||||
// DepositValidatorRewardsPool defines a method to provide additional rewards
|
||||
// to delegators to a specific validator.
|
||||
//
|
||||
// Since: cosmos-sdk 0.48
|
||||
DepositValidatorRewardsPool(ctx context.Context, in *MsgDepositValidatorRewardsPool, opts ...grpc.CallOption) (*MsgDepositValidatorRewardsPoolResponse, error)
|
||||
}
|
||||
|
||||
type msgClient struct {
|
||||
@ -948,6 +1065,15 @@ func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPool
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgClient) DepositValidatorRewardsPool(ctx context.Context, in *MsgDepositValidatorRewardsPool, opts ...grpc.CallOption) (*MsgDepositValidatorRewardsPoolResponse, error) {
|
||||
out := new(MsgDepositValidatorRewardsPoolResponse)
|
||||
err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/DepositValidatorRewardsPool", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// MsgServer is the server API for Msg service.
|
||||
type MsgServer interface {
|
||||
// SetWithdrawAddress defines a method to change the withdraw address
|
||||
@ -974,6 +1100,11 @@ type MsgServer interface {
|
||||
//
|
||||
// Since: cosmos-sdk 0.47
|
||||
CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error)
|
||||
// DepositValidatorRewardsPool defines a method to provide additional rewards
|
||||
// to delegators to a specific validator.
|
||||
//
|
||||
// Since: cosmos-sdk 0.48
|
||||
DepositValidatorRewardsPool(context.Context, *MsgDepositValidatorRewardsPool) (*MsgDepositValidatorRewardsPoolResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
|
||||
@ -998,6 +1129,9 @@ func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateP
|
||||
func (*UnimplementedMsgServer) CommunityPoolSpend(ctx context.Context, req *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CommunityPoolSpend not implemented")
|
||||
}
|
||||
func (*UnimplementedMsgServer) DepositValidatorRewardsPool(ctx context.Context, req *MsgDepositValidatorRewardsPool) (*MsgDepositValidatorRewardsPoolResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DepositValidatorRewardsPool not implemented")
|
||||
}
|
||||
|
||||
func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
|
||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||
@ -1111,6 +1245,24 @@ func _Msg_CommunityPoolSpend_Handler(srv interface{}, ctx context.Context, dec f
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Msg_DepositValidatorRewardsPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(MsgDepositValidatorRewardsPool)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgServer).DepositValidatorRewardsPool(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/cosmos.distribution.v1beta1.Msg/DepositValidatorRewardsPool",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgServer).DepositValidatorRewardsPool(ctx, req.(*MsgDepositValidatorRewardsPool))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "cosmos.distribution.v1beta1.Msg",
|
||||
HandlerType: (*MsgServer)(nil),
|
||||
@ -1139,6 +1291,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "CommunityPoolSpend",
|
||||
Handler: _Msg_CommunityPoolSpend_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DepositValidatorRewardsPool",
|
||||
Handler: _Msg_DepositValidatorRewardsPool_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "cosmos/distribution/v1beta1/tx.proto",
|
||||
@ -1549,6 +1705,80 @@ func (m *MsgCommunityPoolSpendResponse) MarshalToSizedBuffer(dAtA []byte) (int,
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgDepositValidatorRewardsPool) 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 *MsgDepositValidatorRewardsPool) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgDepositValidatorRewardsPool) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = 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] = 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
|
||||
}
|
||||
if len(m.Authority) > 0 {
|
||||
i -= len(m.Authority)
|
||||
copy(dAtA[i:], m.Authority)
|
||||
i = encodeVarintTx(dAtA, i, uint64(len(m.Authority)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *MsgDepositValidatorRewardsPoolResponse) 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 *MsgDepositValidatorRewardsPoolResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *MsgDepositValidatorRewardsPoolResponse) 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
|
||||
@ -1730,6 +1960,38 @@ func (m *MsgCommunityPoolSpendResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgDepositValidatorRewardsPool) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Authority)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
l = len(m.ValidatorAddress)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
if len(m.Amount) > 0 {
|
||||
for _, e := range m.Amount {
|
||||
l = e.Size()
|
||||
n += 1 + l + sovTx(uint64(l))
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *MsgDepositValidatorRewardsPoolResponse) 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
|
||||
}
|
||||
@ -2793,6 +3055,204 @@ func (m *MsgCommunityPoolSpendResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *MsgDepositValidatorRewardsPool) 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: MsgDepositValidatorRewardsPool: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgDepositValidatorRewardsPool: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Authority", 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.Authority = 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
|
||||
}
|
||||
m.Amount = append(m.Amount, types.Coin{})
|
||||
if err := m.Amount[len(m.Amount)-1].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 *MsgDepositValidatorRewardsPoolResponse) 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: MsgDepositValidatorRewardsPoolResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: MsgDepositValidatorRewardsPoolResponse: 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 skipTx(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user