-
Notifications
You must be signed in to change notification settings - Fork 607
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(incentives)!: create gauge and add to gauge fee charge #2227
Conversation
* test create gauge fees * add mod account to test * test create gauge fees * add mod account to test * move to msg server * merge
…osis into roman/txfees-simplified
…osis into roman/txfees-simplified
Simulator was failing because we are essentially explicitly requiring the "uosmo" denom for the fees and we use the "stake" denom for the simulator. Normally I would just change the parameters from uosmo to stake, but because we are defining this directly in the msg_server, I am unable to override it. Regardless, I added a check in the simulator to only allow account with enough tokens in fees to create/add to gauges. Because no account has uosmo all attempts fail but the simulator will pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, we should eventually fix the fact that a user will still pay the add to gauge fee if they submit an add to gauge message with a gaugeID that does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* feat(incentives)!: create gauge and add to gauge fee charge * initialize txfees keeper before incentives * finish TestChargeFee * refactor to charge fee in message server * more tests * clean up * test balances * test create gauge fees (#2228) * test create gauge fees * add mod account to test * test create gauge fees * add mod account to test * move to msg server * merge * add comments * account keeper comment * fix TestCreateGaugeFee * apply appparams.BaseCoinUnit * remove txfees keeper from incentives and revert order * clean up * remove unused keepers fromm incentives keeper * Update x/incentives/keeper/gauge.go * Update x/incentives/keeper/gauge.go * clean up * fixture names * chargeFeeIfSufficientFeeDenomBalance test name * changelog * comment * finished tests (#2230) * finished tests * use keeper instead of math * remove unused tests * clean up * sim only allow accounts with enough to pay fee * lint * move fee to types and reuse in simulation (#2234) Co-authored-by: Adam Tucker <[email protected]> Co-authored-by: Adam Tucker <[email protected]>
…2227) (#2237) * feat(incentives)!: create gauge and add to gauge fee charge (#2227) * feat(incentives)!: create gauge and add to gauge fee charge * initialize txfees keeper before incentives * finish TestChargeFee * refactor to charge fee in message server * more tests * clean up * test balances * test create gauge fees (#2228) * test create gauge fees * add mod account to test * test create gauge fees * add mod account to test * move to msg server * merge * add comments * account keeper comment * fix TestCreateGaugeFee * apply appparams.BaseCoinUnit * remove txfees keeper from incentives and revert order * clean up * remove unused keepers fromm incentives keeper * Update x/incentives/keeper/gauge.go * Update x/incentives/keeper/gauge.go * clean up * fixture names * chargeFeeIfSufficientFeeDenomBalance test name * changelog * comment * finished tests (#2230) * finished tests * use keeper instead of math * remove unused tests * clean up * sim only allow accounts with enough to pay fee * lint * move fee to types and reuse in simulation (#2234) Co-authored-by: Adam Tucker <[email protected]> Co-authored-by: Adam Tucker <[email protected]> * merge gauge fee changes * go mod updates Co-authored-by: Roman <[email protected]>
Closes: #2191
What is the purpose of the change
This change introduces a message fee for creating and adding to gauge.
Create gauge has a fee of 50 OSMO while adding to gauge 25. The feel is always subtracted in OSMO.
If the user does not have enough OSMO to create/add to gauge + pay the fee, no action is done and the message server returns an error.
Brief Changelog
chargeFeeIfSufficientFeeDenomBalance
method create on the keeperchargeFeeIfSufficientFeeDenomBalance
CreateGauge
in theincentives
message serverchargeFeeIfSufficientFeeDenomBalance
is called fromCreateGauge
inincentives
message serverAddToGauge
in theincentives
message serverchargeFeeIfSufficientFeeDenomBalance
is called fromAddToGauge
inincentives
message serverTesting and Verifying
This change added tests and can be verified as follows:
TestCreateGauge_Fee
TestAddToGauge_Fee
TestChargeFeeIfSufficientFeeDenomBalance
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? yes