diff --git a/CHANGELOG.md b/CHANGELOG.md index d40997acc1..56af5fc32f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * Remove deleted marker send deny entries [#1666](https://github.com/provenance-io/provenance/issues/1666). +* Deprecate marker proposal transaction [#1797](https://github.com/provenance-io/provenance/issues/1797). ### Dependencies diff --git a/x/marker/client/cli/cli_test.go b/x/marker/client/cli/cli_test.go index c407ec461c..041306667a 100644 --- a/x/marker/client/cli/cli_test.go +++ b/x/marker/client/cli/cli_test.go @@ -1240,21 +1240,21 @@ func (s *IntegrationTestSuite) TestMarkerTxGovProposals() { "IncreaseSupply", fmt.Sprintf(`{"title":"test mint marker","description":"description","manager":"%s", "amount":{"denom":"propcoin","amount":"10"}}`, s.testnet.Validators[0].Address.String()), - false, &sdk.TxResponse{}, 0, + true, &sdk.TxResponse{}, 0, }, { "burn marker proposal", "DecreaseSupply", fmt.Sprintf(`{"title":"test burn marker","description":"description","manager":"%s", "amount":{"denom":"propcoin","amount":"10"}}`, s.testnet.Validators[0].Address.String()), - false, &sdk.TxResponse{}, 0, + true, &sdk.TxResponse{}, 0, }, { "change status marker proposal", "ChangeStatus", `{"title":"test change marker status","description":"description","denom":"propcoin", "new_status":"MARKER_STATUS_CANCELLED"}`, - false, &sdk.TxResponse{}, 0, + true, &sdk.TxResponse{}, 0, }, { "add admin marker proposal", @@ -1262,7 +1262,7 @@ func (s *IntegrationTestSuite) TestMarkerTxGovProposals() { fmt.Sprintf(`{"title":"test add admin to marker","description":"description", "denom":"propcoin","access":[{"address":"%s", "permissions": [1,2,3,4,5,6]}]}`, s.testnet.Validators[0].Address.String()), - false, &sdk.TxResponse{}, 0, + true, &sdk.TxResponse{}, 0, }, { "remove admin marker proposal", @@ -1270,7 +1270,7 @@ func (s *IntegrationTestSuite) TestMarkerTxGovProposals() { fmt.Sprintf(`{"title":"test remove marker admin","description":"description", "denom":"propcoin","removed_address":["%s"]}`, s.testnet.Validators[0].Address.String()), - false, &sdk.TxResponse{}, 0, + true, &sdk.TxResponse{}, 0, }, { "withdraw escrow marker proposal", @@ -1278,7 +1278,7 @@ func (s *IntegrationTestSuite) TestMarkerTxGovProposals() { fmt.Sprintf(`{"title":"test withdraw marker","description":"description","target_address":"%s", "denom":"%s", "amount":[{"denom":"%s","amount":"1"}]}`, s.testnet.Validators[0].Address.String(), s.cfg.BondDenom, s.cfg.BondDenom), - false, &sdk.TxResponse{}, 0x5, + true, &sdk.TxResponse{}, 0x5, // The gov module now has its own set of errors. // This /should/ fail due to insufficient funds, and it does, but then the gov module erroneously wraps it again. // Insufficient funds is 0x5 in the main SDK's set of errors. diff --git a/x/marker/client/cli/tx.go b/x/marker/client/cli/tx.go index 08304d3b64..eb8e1f2fc6 100644 --- a/x/marker/client/cli/tx.go +++ b/x/marker/client/cli/tx.go @@ -1,10 +1,8 @@ package cli import ( - "encoding/json" "errors" "fmt" - "os" "strconv" "strings" "time" @@ -25,7 +23,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/feegrant" govcli "github.com/cosmos/cosmos-sdk/x/gov/client/cli" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types" channelutils "github.com/cosmos/ibc-go/v6/modules/core/04-channel/client/utils" @@ -99,111 +96,12 @@ func GetCmdMarkerProposal() *cobra.Command { Use: "proposal [type] [proposal-file] [deposit]", Args: cobra.ExactArgs(3), Short: "Submit a marker proposal along with an initial deposit", - Long: strings.TrimSpace(`Submit a marker proposal along with an initial deposit. -Proposal title, description, deposit, and marker proposal params must be set in a provided JSON file. - -Where proposal.json contains: - -{ - "title": "Test Proposal", - "description": "My awesome proposal", - "denom": "denomstring" - // additional properties based on type here -} - - -Valid Proposal Types (and associated parameters): - -- AddMarker - "amount": 100, - "manager": "pb1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk", - "status": "active", // [proposed, finalized, active] - "marker_type": "COIN", // COIN, RESTRICTED - "access_list": [ {"address":"pb1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk", "permissions": [1,2,3]} ], - "supply_fixed": true, - "allow_governance_control": true, - -- IncreaseSupply - "amount": {"denom":"coin", "amount":"10"} - -- DecreaseSupply - "amount": {"denom":"coin", "amount":"10"} - -- SetAdministrator - "access": [{"address":"pb1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk", "permissions": [1,2,3]}] - -- RemoveAdministrator - "removed_address": ["pb1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk"] - -- ChangeStatus - "new_status": "MARKER_STATUS_ACTIVE" // [finalized, active, cancelled, destroyed] - -- WithdrawEscrow - "amount": "100coin" - "target_address": "pb1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk" - -- SetDenomMetadata - "metadata": { - "description": "description text", - "base": "basedenom", - "display": "displaydenom", - "name": "Denom Name", - "symbol": "DSYMB", - "denom_units": [ - {"denom":"basedenom","exponent":0,"aliases":[]}, - {"denom":"otherdenomunit","exponent":9,"aliases":[]} - ] - } + Long: strings.TrimSpace(`This command has been deprecated, and is no longer functional. +Please use 'gov proposal submit-proposal instead. `, ), - Example: fmt.Sprintf(`$ %s tx marker proposal AddMarker "path/to/proposal.json" 1000%s --from mykey`, version.AppName, sdk.DefaultBondDenom), RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - contents, err := os.ReadFile(args[1]) - if err != nil { - return err - } - - var proposal govtypesv1beta1.Content - - switch args[0] { - case types.ProposalTypeIncreaseSupply: - proposal = &types.SupplyIncreaseProposal{} - case types.ProposalTypeDecreaseSupply: - proposal = &types.SupplyDecreaseProposal{} - case types.ProposalTypeSetAdministrator: - proposal = &types.SetAdministratorProposal{} - case types.ProposalTypeRemoveAdministrator: - proposal = &types.RemoveAdministratorProposal{} - case types.ProposalTypeChangeStatus: - proposal = &types.ChangeStatusProposal{} - case types.ProposalTypeWithdrawEscrow: - proposal = &types.WithdrawEscrowProposal{} - case types.ProposalTypeSetDenomMetadata: - proposal = &types.SetDenomMetadataProposal{} - default: - return fmt.Errorf("unknown proposal type %s", args[0]) - } - err = json.Unmarshal(contents, proposal) - if err != nil { - return err - } - - deposit, err := sdk.ParseCoinsNormalized(args[2]) - if err != nil { - return err - } - - callerAddr := clientCtx.GetFromAddress() - msg, err := govtypesv1beta1.NewMsgSubmitProposal(proposal, deposit, callerAddr) - if err != nil { - return fmt.Errorf("invalid governance proposal. Error: %w", err) - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + return fmt.Errorf("this command has been deprecated, and is no longer functional. Please use 'gov proposal submit-proposal' instead") }, } flags.AddTxFlagsToCmd(cmd)