From e3e89f52607b9d205e1ddea4af2d47e98e0ff2b1 Mon Sep 17 00:00:00 2001 From: Anil Kumar Kammari Date: Tue, 4 May 2021 14:30:54 +0530 Subject: [PATCH] Rename memo to note inside CLI (#9134) * rename Memo to note * update change log * typo * address review changes Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: atheesh Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> --- CHANGELOG.md | 1 + client/flags/flags.go | 4 ++-- client/tx/factory.go | 2 +- x/auth/client/testutil/suite.go | 2 +- x/auth/tx/service_test.go | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff23cb0311..655edefcfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ if input key is empty, or input data contains empty key. * CLI: removed `--text` flag from `show-node-id` command; the text format for public keys is not used any more - instead we use ProtoJSON. * (types) [\#9079](https://github.com/cosmos/cosmos-sdk/issues/9079) Add `AddAmount`/`SubAmount` methods to `sdk.Coin`. * [\#8628](https://github.com/cosmos/cosmos-sdk/issues/8628) Commands no longer print outputs using `stderr` by default +* [\#9134](https://github.com/cosmos/cosmos-sdk/pull/9134) Renamed the CLI flag `--memo` to `--note`. * [\#9139](https://github.com/cosmos/cosmos-sdk/pull/9139) Querying events: * via `ServiceMsg` TypeURLs (e.g. `message.action='/cosmos.bank.v1beta1.Msg/Send'`) does not work anymore, * via legacy `msg.Type()` (e.g. `message.action='send'`) is being deprecated, new `Msg`s won't emit these events. diff --git a/client/flags/flags.go b/client/flags/flags.go index fa13642127..629929bb08 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -50,7 +50,7 @@ const ( FlagName = "name" FlagAccountNumber = "account-number" FlagSequence = "sequence" - FlagMemo = "memo" + FlagNote = "note" FlagFees = "fees" FlagGas = "gas" FlagGasPrices = "gas-prices" @@ -97,7 +97,7 @@ func AddTxFlagsToCmd(cmd *cobra.Command) { cmd.Flags().String(FlagFrom, "", "Name or address of private key with which to sign") cmd.Flags().Uint64P(FlagAccountNumber, "a", 0, "The account number of the signing account (offline mode only)") cmd.Flags().Uint64P(FlagSequence, "s", 0, "The sequence number of the signing account (offline mode only)") - cmd.Flags().String(FlagMemo, "", "Memo to send along with transaction") + cmd.Flags().String(FlagNote, "", "Note to add a description to the transaction (previously `--memo`)") cmd.Flags().String(FlagFees, "", "Fees to pay along with transaction; eg: 10uatom") cmd.Flags().String(FlagGasPrices, "", "Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)") cmd.Flags().String(FlagNode, "tcp://localhost:26657", ": to tendermint rpc interface for this chain") diff --git a/client/tx/factory.go b/client/tx/factory.go index b10d728d6b..2cb951922d 100644 --- a/client/tx/factory.go +++ b/client/tx/factory.go @@ -44,7 +44,7 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) Factory { accNum, _ := flagSet.GetUint64(flags.FlagAccountNumber) accSeq, _ := flagSet.GetUint64(flags.FlagSequence) gasAdj, _ := flagSet.GetFloat64(flags.FlagGasAdjustment) - memo, _ := flagSet.GetString(flags.FlagMemo) + memo, _ := flagSet.GetString(flags.FlagNote) timeoutHeight, _ := flagSet.GetUint64(flags.FlagTimeoutHeight) gasStr, _ := flagSet.GetString(flags.FlagGas) diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go index dfda9f4425..f176716cfb 100644 --- a/x/auth/client/testutil/suite.go +++ b/x/auth/client/testutil/suite.go @@ -515,7 +515,7 @@ func (s *IntegrationTestSuite) TestCLIEncode() { val1, val1.Address, sdk.NewCoins(sendTokens), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), - fmt.Sprintf("--%s=deadbeef", flags.FlagMemo), + fmt.Sprintf("--%s=deadbeef", flags.FlagNote), ) s.Require().NoError(err) savedTxFile := testutil.WriteToNewTempFile(s.T(), normalGeneratedTx.String()) diff --git a/x/auth/tx/service_test.go b/x/auth/tx/service_test.go index 6519eed5a3..547186603a 100644 --- a/x/auth/tx/service_test.go +++ b/x/auth/tx/service_test.go @@ -73,7 +73,7 @@ func (s *IntegrationTestSuite) SetupSuite() { fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), fmt.Sprintf("--gas=%d", flags.DefaultGasLimit), - fmt.Sprintf("--%s=foobar", flags.FlagMemo), + fmt.Sprintf("--%s=foobar", flags.FlagNote), ) s.Require().NoError(err) s.Require().NoError(val.ClientCtx.JSONCodec.UnmarshalJSON(out.Bytes(), &s.txRes)) @@ -529,7 +529,7 @@ func (s *IntegrationTestSuite) TestSimMultiSigTx() { fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), - fmt.Sprintf("--%s=foobar", flags.FlagMemo), + fmt.Sprintf("--%s=foobar", flags.FlagNote), ) s.Require().NoError(err)