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

move gauge fees to types #2234

Merged
merged 1 commit into from
Jul 26, 2022
Merged

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Jul 25, 2022

  • move fees to types and export
  • reuse fees in the simulator

@github-actions github-actions bot added C:simulator Edits simulator or simulations C:x/incentives labels Jul 25, 2022
@czarcas7ic
Copy link
Member

RandomSimAccountWithMinCoins should already do this for you no?

@p0mvn p0mvn force-pushed the roman/txfees-simulator branch from 825d735 to 3bfa6ba Compare July 26, 2022 00:43
@p0mvn p0mvn changed the title let simulator filter out accounts with min balance move gauge fees to types Jul 26, 2022
@p0mvn
Copy link
Member Author

p0mvn commented Jul 26, 2022

RandomSimAccountWithMinCoins should already do this for you no?

I was just trying things. The main problem here is that balances are set with "stake" denom in the SDK bank module's GenerateGenesisState(...). So all accounts are guaranteed to not have the "uosmo" denom coins.

I think the cleanest solution would be to propagate txfees keeper to incentives and extract the denom. This can be done in a follow-up PR but not backported to v11.x.

Also, there is no access to RandomSimAccountWithMinCoins from the current simulation setup since it is defined on SimCxt. We would have to refactor simulation via Actions() like token factory to be able to access the SimCtx:

func (am AppModule) Actions() []simtypes.Action {
return []simtypes.Action{
simtypes.NewMsgBasedAction("create token factory token", am.keeper, simulation.RandomMsgCreateDenom),
simtypes.NewMsgBasedAction("mint token factory token", am.keeper, simulation.RandomMsgMintDenom),
}
}

@p0mvn p0mvn marked this pull request as ready for review July 26, 2022 00:56
@p0mvn p0mvn requested a review from a team July 26, 2022 00:56
@p0mvn p0mvn merged commit b2d6437 into roman/txfees-simplified Jul 26, 2022
@p0mvn p0mvn deleted the roman/txfees-simulator branch July 26, 2022 00:56
czarcas7ic added a commit that referenced this pull request Jul 26, 2022
* 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]>
czarcas7ic added a commit that referenced this pull request Jul 26, 2022
* 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]>
czarcas7ic added a commit that referenced this pull request Jul 26, 2022
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:simulator Edits simulator or simulations C:x/incentives
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants