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

feat(reward): enable empty reward coins for MsgSetRewards #540

Merged
merged 10 commits into from
Feb 23, 2022

Conversation

Pantani
Copy link
Collaborator

@Pantani Pantani commented Feb 18, 2022

What does this PR does?

Enable empty coins reward in MsgSetRewards so we can remove all rewards for a campaign

How to test?

  • Create the chain and set reward
spnd tx profile create-coordinator --from alice && \
spnd tx launch create-chain orbit-1 orbit.com 0xaaa --from alice && \
spnd tx reward set-rewards 1 1000uspn 100000 --from alice
  • Remove the reward
spnd tx reward set-rewards 1 0token 0 --from alice

@Pantani Pantani self-assigned this Feb 18, 2022
@codecov
Copy link

codecov bot commented Feb 18, 2022

Codecov Report

Merging #540 (dce8568) into develop (dfeb8aa) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #540   +/-   ##
========================================
  Coverage    11.05%   11.06%           
========================================
  Files          234      234           
  Lines        54129    54131    +2     
========================================
+ Hits          5985     5987    +2     
+ Misses       47969    47968    -1     
- Partials       175      176    +1     
Impacted Files Coverage Δ
x/reward/types/message_set_reward.go 29.62% <ø> (-7.04%) ⬇️
x/reward/keeper/msg_server_set_reward.go 84.61% <100.00%> (+1.05%) ⬆️

@Pantani Pantani marked this pull request as ready for review February 18, 2022 16:40
@lumtis lumtis linked an issue Feb 18, 2022 that may be closed by this pull request
aljo242
aljo242 previously approved these changes Feb 18, 2022
Copy link
Contributor

@aljo242 aljo242 left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

I think we can totally remove the reward pool from the store if rewards are set to 0

I think we can also have the same behavior when the height is set to 0

Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

CLI works well 👍

x/reward/keeper/msg_server_set_reward_test.go Outdated Show resolved Hide resolved
x/reward/keeper/msg_server_set_reward_test.go Outdated Show resolved Hide resolved
x/reward/keeper/msg_server_set_reward_test.go Outdated Show resolved Hide resolved
@lumtis lumtis merged commit 9b803b7 into develop Feb 23, 2022
@lumtis lumtis deleted the feat/empty-reward-msg branch February 23, 2022 18:10
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.

Remove the reward pool if no reward is set
3 participants