Skip to content

Commit

Permalink
generate files
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Mar 4, 2024
1 parent 037e3ec commit 22b423e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/cli/zetacored/zetacored_tx_emissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions x/emissions/keeper/msg_server_withdraw_emissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}

0 comments on commit 22b423e

Please sign in to comment.