Skip to content

Commit

Permalink
Add update fee token gov handler to app.go (#731)
Browse files Browse the repository at this point in the history
* txfees gov handler

* CHANGELOG
  • Loading branch information
sunnya97 authored Jan 7, 2022
1 parent ac37680 commit 115c30e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#655](https://github.com/osmosis-labs/osmosis/pull/655) Make the default genesis for pool-incentives work by default
- [97ac2a8](https://github.com/osmosis-labs/osmosis/commit/97ac2a86303fc8966a4c169107e0945775107e67) Fix InitGenesis bug for gauges
- [#686](https://github.com/osmosis-labs/osmosis/pull/686) Add silence usage to cli to surpress unnecessary help logs
- [#731](https://github.com/osmosis-labs/osmosis/pull/731) Add UpdateFeeToken proposal handler to app.go

## [v6.0.0](https://github.com/osmosis-labs/osmosis/releases/tag/v6.0.0)

Expand Down
4 changes: 3 additions & 1 deletion app/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import (
poolincentives "github.com/osmosis-labs/osmosis/x/pool-incentives"
poolincentiveskeeper "github.com/osmosis-labs/osmosis/x/pool-incentives/keeper"
poolincentivestypes "github.com/osmosis-labs/osmosis/x/pool-incentives/types"
"github.com/osmosis-labs/osmosis/x/txfees"
txfeeskeeper "github.com/osmosis-labs/osmosis/x/txfees/keeper"
txfeestypes "github.com/osmosis-labs/osmosis/x/txfees/types"
)
Expand Down Expand Up @@ -260,7 +261,8 @@ func (app *OsmosisApp) InitNormalKeepers() {
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(*app.UpgradeKeeper)).
AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(poolincentivestypes.RouterKey, poolincentives.NewPoolIncentivesProposalHandler(*app.PoolIncentivesKeeper)).
AddRoute(bech32ibctypes.RouterKey, bech32ibc.NewBech32IBCProposalHandler(*app.Bech32IBCKeeper))
AddRoute(bech32ibctypes.RouterKey, bech32ibc.NewBech32IBCProposalHandler(*app.Bech32IBCKeeper)).
AddRoute(txfeestypes.RouterKey, txfees.NewUpdateFeeTokenProposalHandler(*app.TxFeesKeeper))

govKeeper := govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey],
Expand Down
25 changes: 25 additions & 0 deletions x/txfees/handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package txfees

import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/osmosis-labs/osmosis/x/txfees/keeper"
"github.com/osmosis-labs/osmosis/x/txfees/types"
)

func NewUpdateFeeTokenProposalHandler(k keeper.Keeper) govtypes.Handler {
return func(ctx sdk.Context, content govtypes.Content) error {
switch c := content.(type) {
case *types.UpdateFeeTokenProposal:
return handleUpdateFeeTokenProposal(ctx, k, c)
default:
return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized txfees proposal content type: %T", c)
}
}
}

func handleUpdateFeeTokenProposal(ctx sdk.Context, k keeper.Keeper, p *types.UpdateFeeTokenProposal) error {
return k.HandleUpdateFeeTokenProposal(ctx, p)
}

0 comments on commit 115c30e

Please sign in to comment.