From 6efdff26c3816dd9db9debacb4816d733289c1f1 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 11:05:10 -0500 Subject: [PATCH] fix: enable taker fee cli (#6334) (#6335) * enable prop cli * update changelog --------- Co-authored-by: devbot-wizard <141283918+devbot-wizard@users.noreply.github.com> (cherry picked from commit ea8307152112afd5805c455057a50e94ed265b1d) Co-authored-by: Adam Tucker --- CHANGELOG.md | 4 ++++ app/keepers/modules.go | 2 ++ x/poolmanager/client/cli/tx.go | 1 + x/poolmanager/client/proposal_handler.go | 12 ++++++++++++ x/poolmanager/client/rest/tx.go | 20 ++++++++++++++++++++ 5 files changed, 39 insertions(+) create mode 100644 x/poolmanager/client/proposal_handler.go create mode 100644 x/poolmanager/client/rest/tx.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e01e39e8c2..a3e6dfcec4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Bug Fixes + +* [#6334](https://github.com/osmosis-labs/osmosis/pull/6334) fix: enable taker fee cli + ### API Breaks * [#6256](https://github.com/osmosis-labs/osmosis/pull/6256) Refactor CalcPriceToTick to operate on BigDec price to support new price range. diff --git a/app/keepers/modules.go b/app/keepers/modules.go index b3875966948..d305eb48f7b 100644 --- a/app/keepers/modules.go +++ b/app/keepers/modules.go @@ -43,6 +43,7 @@ import ( "github.com/osmosis-labs/osmosis/v19/x/mint" poolincentives "github.com/osmosis-labs/osmosis/v19/x/pool-incentives" poolincentivesclient "github.com/osmosis-labs/osmosis/v19/x/pool-incentives/client" + poolmanagerclient "github.com/osmosis-labs/osmosis/v19/x/poolmanager/client" poolmanager "github.com/osmosis-labs/osmosis/v19/x/poolmanager/module" "github.com/osmosis-labs/osmosis/v19/x/protorev" superfluid "github.com/osmosis-labs/osmosis/v19/x/superfluid" @@ -89,6 +90,7 @@ var AppModuleBasics = []module.AppModuleBasic{ cwpoolclient.UploadCodeIdAndWhitelistProposalHandler, cwpoolclient.MigratePoolContractsProposalHandler, txfeesclient.SubmitUpdateFeeTokenProposalHandler, + poolmanagerclient.DenomPairTakerFeeProposalHandler, )..., ), params.AppModuleBasic{}, diff --git a/x/poolmanager/client/cli/tx.go b/x/poolmanager/client/cli/tx.go index c41ff646fd3..98174561a08 100644 --- a/x/poolmanager/client/cli/tx.go +++ b/x/poolmanager/client/cli/tx.go @@ -34,6 +34,7 @@ func NewTxCmd() *cobra.Command { osmocli.AddTxCmd(txCmd, NewSwapExactAmountOutCmd) osmocli.AddTxCmd(txCmd, NewSplitRouteSwapExactAmountIn) osmocli.AddTxCmd(txCmd, NewSplitRouteSwapExactAmountOut) + txCmd.AddCommand(NewSetDenomPairTakerFeeCmd()) txCmd.AddCommand( NewCreatePoolCmd(), diff --git a/x/poolmanager/client/proposal_handler.go b/x/poolmanager/client/proposal_handler.go new file mode 100644 index 00000000000..8ac1788cdf5 --- /dev/null +++ b/x/poolmanager/client/proposal_handler.go @@ -0,0 +1,12 @@ +package client + +import ( + "github.com/osmosis-labs/osmosis/v19/x/poolmanager/client/cli" + "github.com/osmosis-labs/osmosis/v19/x/poolmanager/client/rest" + + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" +) + +var ( + DenomPairTakerFeeProposalHandler = govclient.NewProposalHandler(cli.NewCmdHandleDenomPairTakerFeeProposal, rest.ProposalDenomPairTakerFeeRESTHandler) +) diff --git a/x/poolmanager/client/rest/tx.go b/x/poolmanager/client/rest/tx.go new file mode 100644 index 00000000000..def4d83f901 --- /dev/null +++ b/x/poolmanager/client/rest/tx.go @@ -0,0 +1,20 @@ +package rest + +import ( + "net/http" + + "github.com/cosmos/cosmos-sdk/client" + govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest" +) + +func ProposalDenomPairTakerFeeRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "denom-pair-taker-fee", + Handler: emptyHandler(clientCtx), + } +} + +func emptyHandler(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + } +}