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

Add update fee token gov handler to app.go #731

Merged
merged 2 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
txfees gov handler
  • Loading branch information
sunnya97 committed Jan 7, 2022
commit 6b0bec272a282d752f33a45b89dde3df11ad989b
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)
}