Skip to content

Commit

Permalink
bug: send non osmo txfees to community pool instead of stakers (#6426)
Browse files Browse the repository at this point in the history
* fix non osmo txfees to community pool instead of stakers

* update changelog

* update fee decorator test

* change version to alpine

* add comment

* uncomment test

* fix script to pull alpine image

* update README

* Update empty_upgrade_handler_gen.sh

---------

Co-authored-by: devbot-wizard <[email protected]>
  • Loading branch information
czarcas7ic and devbot-wizard authored Sep 18, 2023
1 parent a5aeccf commit 2bb6be9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#6334](https://github.com/osmosis-labs/osmosis/pull/6334) fix: enable taker fee cli
* [#6352](https://github.com/osmosis-labs/osmosis/pull/6352) Reduce error blow-up in CalcAmount0Delta by changing the order of math operations.
* [#6368](https://github.com/osmosis-labs/osmosis/pull/6368) Stricter rounding behavior in CL math's CalcAmount0Delta and GetNextSqrtPriceFromAmount0InRoundingUp
* [#6426](https://github.com/osmosis-labs/osmosis/pull/6426) bug: send non osmo txfees to community pool instead of stakers


### API Breaks
Expand Down
2 changes: 1 addition & 1 deletion scripts/empty_upgrade_handler_gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ sed -i "s/E2E_UPGRADE_VERSION := ${bracks}v$latest_version$bracks/E2E_UPGRADE_VE

# bumps up prev e2e version
e2e_file=./tests/e2e/containers/config.go
PREV_OSMOSIS_DEV_TAG=$(curl -L -s 'https://registry.hub.docker.com/v2/repositories/osmolabs/osmosis-dev/tags?page=1&page_size=100' | jq -r '.results[] | .name | select(.|test("^(?:v|)[0-9]+\\.[0-9]+(?:$|\\.[0-9]+$)"))' | grep --max-count=1 "")
PREV_OSMOSIS_DEV_TAG=$(curl -L -s 'https://registry.hub.docker.com/v2/repositories/osmolabs/osmosis/tags?page=1&page_size=100' | jq -r '.results[] | .name | select(.|test("^(?:v|)[0-9]+\\.0\\.0-alpine$"))' | grep --max-count=1 "")
PREV_OSMOSIS_E2E_TAG=$(curl -L -s 'https://registry.hub.docker.com/v2/repositories/osmolabs/osmosis-e2e-init-chain/tags?page=1&page_size=100' | jq -r '.results[] | .name | select(.|test("^(?:v|)[0-9]+\\.[0-9]+(?:$|\\.[0-9]+$)"))' | grep --max-count=1 "")

# previousVersionOsmoTag = PREV_OSMOSIS_DEV_TAG
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ Conceptually, we can split the e2e setup into 2 parts:
If with the upgrade, the same `chain.Init(...)` function is run inside a Docker container
of the previous Osmosis version, inside `configurer/upgrade.go`. This is
needed to initialize chain configs and the genesis of the previous version that
we are upgrading from.
we are upgrading from. Note, we use the alpine image of the previous version,
as functionality such as copying mnemonics across containers in unavailable in the
stripped down images.

The decision of what configuration type to use is decided by the `Configurer`.
This is an interface that has `CurrentBranchConfigurer` and `UpgradeConfigurer` implementations.
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/containers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
// It should be uploaded to Docker Hub. OSMOSIS_E2E_SKIP_UPGRADE should be unset
// for this functionality to be used.
previousVersionOsmoRepository = "osmolabs/osmosis"
previousVersionOsmoTag = "19.0"
previousVersionOsmoTag = "19.0.0-alpine"
// Pre-upgrade repo/tag for osmosis initialization (this should be one version below upgradeVersion)
previousVersionInitRepository = "osmolabs/osmosis-e2e-init-chain"
previousVersionInitTag = "19.0.0"
Expand Down
4 changes: 2 additions & 2 deletions x/txfees/keeper/feedecorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ func DeductFees(txFeesKeeper types.TxFeesKeeper, bankKeeper types.BankKeeper, ct
return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error())
}
} else {
// sends to FeeCollectorForStakingRewardsName module account
err := bankKeeper.SendCoinsFromAccountToModule(ctx, acc.GetAddress(), types.FeeCollectorForStakingRewardsName, fees)
// sends to FeeCollectorForCommunityPoolName module account
err := bankKeeper.SendCoinsFromAccountToModule(ctx, acc.GetAddress(), types.FeeCollectorForCommunityPoolName, fees)
if err != nil {
return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion x/txfees/keeper/feedecorator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (s *KeeperTestSuite) TestFeeDecorator() {
if !tc.txFee.IsZero() {
moduleName := types.FeeCollectorName
if tc.txFee[0].Denom != baseDenom {
moduleName = types.FeeCollectorForStakingRewardsName
moduleName = types.FeeCollectorForCommunityPoolName
}
moduleAddr := s.App.AccountKeeper.GetModuleAddress(moduleName)
s.Require().Equal(tc.txFee[0], s.App.BankKeeper.GetBalance(s.Ctx, moduleAddr, tc.txFee[0].Denom), tc.name)
Expand Down

0 comments on commit 2bb6be9

Please sign in to comment.