diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a470b16155..c7151e61b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#6256](https://github.com/osmosis-labs/osmosis/pull/6256) Refactor CalcPriceToTick to operate on BigDec price to support new price range. * [#6317](https://github.com/osmosis-labs/osmosis/pull/6317) Remove price return from CL `math.TickToSqrtPrice` +### Client Breaks +* [#6388](https://github.com/osmosis-labs/osmosis/pull/6388) Make cosmwasmpool's create pool cli generic + ## v19.0.0 ### Features diff --git a/x/cosmwasmpool/client/cli/tx.go b/x/cosmwasmpool/client/cli/tx.go index eaceccc4cec..26c8a918c4b 100644 --- a/x/cosmwasmpool/client/cli/tx.go +++ b/x/cosmwasmpool/client/cli/tx.go @@ -17,7 +17,6 @@ import ( "github.com/spf13/pflag" "github.com/osmosis-labs/osmosis/osmoutils/osmocli" - "github.com/osmosis-labs/osmosis/v19/x/cosmwasmpool/cosmwasm/msg" "github.com/osmosis-labs/osmosis/v19/x/cosmwasmpool/model" "github.com/osmosis-labs/osmosis/v19/x/cosmwasmpool/types" ) @@ -32,7 +31,7 @@ func NewCreateCWPoolCmd() (*osmocli.TxCliDesc, *model.MsgCreateCosmWasmPool) { return &osmocli.TxCliDesc{ Use: "create-pool", Short: "create a cosmwasm pool", - Example: "osmosisd tx cosmwasmpool create-pool 1 uion,uosmo --from lo-test1 --keyring-backend test --chain-id localosmosis --fees 875uosmo -b=block", + Example: "osmosisd tx cosmwasmpool create-pool 1 '{\"pool_assets_denom\":[\"uion\",\"uosmo\"]}' --from lo-test1 --keyring-backend test --chain-id localosmosis --fees 875uosmo -b=block", NumArgs: 2, ParseAndBuildMsg: BuildCreatePoolMsg, }, &model.MsgCreateCosmWasmPool{} @@ -44,17 +43,18 @@ func BuildCreatePoolMsg(clientCtx client.Context, args []string, flags *pflag.Fl return nil, err } - denoms := strings.Split(args[1], ",") + instantiateMsg := args[1] - // Construct instantiate msg - instantiateMsg := &msg.InstantiateMsg{ - PoolAssetDenoms: denoms, - } - msgBz, err := json.Marshal(instantiateMsg) + // Check JSON format for instantiateMsg + var jsonCheck map[string]interface{} + err = json.Unmarshal([]byte(instantiateMsg), &jsonCheck) if err != nil { - return nil, err + return nil, fmt.Errorf("invalid JSON format for instantiateMsg: %v", err) } + // Turn instantiateMsg to bytes + msgBz := []byte(instantiateMsg) + return &model.MsgCreateCosmWasmPool{ CodeId: codeId, InstantiateMsg: msgBz,