Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: emit rewards_withdrawn event #166

Merged
merged 3 commits into from Oct 14, 2021

Conversation

hallazzang
Copy link
Contributor

Description

Keeper.WithdrawRewards is called in several places:

  • Keeper.Harvest
  • Keeper.ProcessQueuedCoins
  • Keeper.Unstake

so instead of emitting harvest event in Keeper.Harvest,
emit rewards_withdrawn event in these places.

note that this new event will be emitted
multiple times for a farmer(for each staking coin denom
the farmer has).

closes: #164


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Appropriate labels applied
  • Targeted PR against correct branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

`Keeper.WithdrawRewards` is called in several places:
- `Keeper.Harvest`
- `Keeper.ProcessQueuedCoins`
- `Keeper.Unstake`

so instead of emitting `harvest` event in `Keeper.Harvest`,
emit `rewards_withdrawn` event in these places.

note that this new event will be emitted
multiple times for a farmer(for each staking coin denom
the farmer has).
@hallazzang hallazzang self-assigned this Oct 14, 2021
Copy link
Contributor

@dongsam dongsam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x/farming/keeper/reward.go Outdated Show resolved Hide resolved
instead of `reward_coins` attribute, use `staking_coin_denoms`
@dongsam dongsam merged commit 1b9d82a into tendermint:master Oct 14, 2021
dongsam added a commit to dongsam/farming that referenced this pull request Oct 21, 2021
* commit '305f2fb7da43f1050dd6aa591b43bbdadefa63bd': (23 commits)
  chore: bump Cosmos SDK version to 0.44.2
  fix: emit `rewards_withdrawn` event (tendermint#166)
  chore: fix linter issue
  feat: refactor validating EpochAmount, EpochRatio
  feat: refactory ValidateStakingCoinTotalWeights
  fix: apply suggestions from review
  fix: terminate plan when deleting public plan proposal (tendermint#162)
  fix: change the logic to determine what the request is for
  chore: fix typo and use nil EpochRatio instead of zero
  chore: change error message
  test: update proposal handler tests
  fix: allow optional fields in UpdateRequestProposal
  fix: more strict validation and allow optional addrs
  fix: EpochAmount/EpochRatio fields can be both empty
  fix: allow empty plan name in UpdateRequestProposal
  fix!: forbid empty plan name and allow empty weights
  test: change expected error messages
  test: add tests for proposal validation
  test: add TestValidateStakingCoinTotalWeights
  fix: fix proposal validation logic
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: Emit event when withdrawing
2 participants