diff --git a/docs/cli/zetacored/zetacored_tx_emissions.md b/docs/cli/zetacored/zetacored_tx_emissions.md index 74996a5e84..95d05cb6dd 100644 --- a/docs/cli/zetacored/zetacored_tx_emissions.md +++ b/docs/cli/zetacored/zetacored_tx_emissions.md @@ -25,5 +25,5 @@ zetacored tx emissions [flags] ### SEE ALSO * [zetacored tx](zetacored_tx.md) - Transactions subcommands -* [zetacored tx emissions create-withdraw-emission](zetacored_tx_emissions_create-withdraw-emission.md) - create a new withdrawEmission +* [zetacored tx emissions withdraw-emission](zetacored_tx_emissions_withdraw-emission.md) - create a new withdrawEmission diff --git a/docs/cli/zetacored/zetacored_tx_emissions_create-withdraw-emission.md b/docs/cli/zetacored/zetacored_tx_emissions_withdraw-emission.md similarity index 95% rename from docs/cli/zetacored/zetacored_tx_emissions_create-withdraw-emission.md rename to docs/cli/zetacored/zetacored_tx_emissions_withdraw-emission.md index 508dec9118..e5c549ae85 100644 --- a/docs/cli/zetacored/zetacored_tx_emissions_create-withdraw-emission.md +++ b/docs/cli/zetacored/zetacored_tx_emissions_withdraw-emission.md @@ -1,9 +1,9 @@ -# tx emissions create-withdraw-emission +# tx emissions withdraw-emission create a new withdrawEmission ``` -zetacored tx emissions create-withdraw-emission [amount] [flags] +zetacored tx emissions withdraw-emission [amount] [flags] ``` ### Options @@ -21,7 +21,7 @@ zetacored tx emissions create-withdraw-emission [amount] [flags] --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) - -h, --help help for create-withdraw-emission + -h, --help help for withdraw-emission --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used --ledger Use a connected Ledger device diff --git a/x/emissions/keeper/msg_server_withdraw_emissions.go b/x/emissions/keeper/msg_server_withdraw_emissions.go index 74a6f59239..a2eabc3d4b 100644 --- a/x/emissions/keeper/msg_server_withdraw_emissions.go +++ b/x/emissions/keeper/msg_server_withdraw_emissions.go @@ -23,7 +23,7 @@ func (k msgServer) WithdrawEmission(goCtx context.Context, msg *types.MsgWithdra if err != nil { return nil, errorsmod.Wrap(types.ErrInvalidAddress, err.Error()) } - + // check if the undistributed rewards pool has enough balance to process this request. // This is just a preliminary check, the actual processing at endblock might still fail if the pool balance gets affected. undistributedRewardsBalance := k.GetBankKeeper().GetBalance(ctx, types.UndistributedObserverRewardsPoolAddress, config.BaseDenom) @@ -35,12 +35,12 @@ func (k msgServer) WithdrawEmission(goCtx context.Context, msg *types.MsgWithdra if err != nil { return nil, errorsmod.Wrap(types.ErrUnableToWithdrawEmissions, fmt.Sprintf("error while removing withdrawable emission for address %s : %s", msg.Creator, err)) } - + err = k.GetBankKeeper().SendCoinsFromModuleToAccount(ctx, types.UndistributedObserverRewardsPool, address, sdk.NewCoins(sdk.NewCoin(config.BaseDenom, msg.Amount))) if err != nil { ctx.Logger().Error(fmt.Sprintf("Error while processing withdraw of emission to adresss %s for amount %s : err %s", address, msg.Amount, err)) return nil, errorsmod.Wrap(types.ErrUnableToWithdrawEmissions, err.Error()) } - + return &types.MsgWithdrawEmissionResponse{}, nil }