From 6b0bec272a282d752f33a45b89dde3df11ad989b Mon Sep 17 00:00:00 2001 From: Sunny Aggarwal Date: Fri, 7 Jan 2022 00:00:59 -0400 Subject: [PATCH 1/2] txfees gov handler --- app/keepers.go | 4 +++- x/txfees/handler.go | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 x/txfees/handler.go diff --git a/app/keepers.go b/app/keepers.go index 5b6465433af..03da59b789d 100644 --- a/app/keepers.go +++ b/app/keepers.go @@ -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" ) @@ -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], diff --git a/x/txfees/handler.go b/x/txfees/handler.go new file mode 100644 index 00000000000..c8b141f07a1 --- /dev/null +++ b/x/txfees/handler.go @@ -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) +} From a6e03038d32556acf2f7453962cca9e1a10a5353 Mon Sep 17 00:00:00 2001 From: Sunny Aggarwal Date: Fri, 7 Jan 2022 00:03:33 -0400 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bd0b665581..4964f48603b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)