From 2eeb464939cc784ac40f501107e35b3b5513eb7e Mon Sep 17 00:00:00 2001 From: Anil Kumar Kammari Date: Thu, 6 May 2021 14:17:02 +0530 Subject: [PATCH] Update `memo` usage docs (#9265) * Update `memo` usage docs * update doc Co-authored-by: Aaron Craelius * update doc Co-authored-by: Aaron Craelius Co-authored-by: Aaron Craelius --- docs/core/proto-docs.md | 2 +- docs/core/transactions.md | 2 +- proto/cosmos/tx/v1beta1/tx.proto | 4 +++- types/tx/tx.pb.go | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 82652f8fd1..c1fe46098e 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -7589,7 +7589,7 @@ TxBody is the body of a transaction that all signers sign over. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | messages is a list of messages to be executed. The required signers of those messages define the number and order of elements in AuthInfo's signer_infos and Tx's signatures. Each required signer address is added to the list only the first time it occurs. By convention, the first required signer (usually from the first message) is referred to as the primary signer and pays the fee for the whole transaction. | -| `memo` | [string](#string) | | memo is any arbitrary memo to be added to the transaction | +| `memo` | [string](#string) | | memo is any arbitrary note/comment to be added to the transaction. In clients, any public exposing text should not be called as memo, should use `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). | | `timeout_height` | [uint64](#uint64) | | timeout is the block height after which this transaction will not be processed by the chain | | `extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can't be handled, the transaction will be rejected | | `non_critical_extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can't be handled, they will be ignored | diff --git a/docs/core/transactions.md b/docs/core/transactions.md index 529fd0d17a..f0b5acb0f4 100644 --- a/docs/core/transactions.md +++ b/docs/core/transactions.md @@ -93,7 +93,7 @@ The `TxBuilder` interface contains data closely related with the generation of t - `Msg`s, the array of [messages](#messages) included in the transaction. - `GasLimit`, option chosen by the users for how to calculate how much gas they will need to pay. -- `Memo`, to send with the transaction. +- `Memo`, a note or comment to send with the transaction. - `FeeAmount`, the maximum amount the user is willing to pay in fees. - `TimeoutHeight`, block height until which the transaction is valid. - `Signatures`, the array of signatures from all signers of the transaction. diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto index 2b02874cc1..6d5caf12c7 100644 --- a/proto/cosmos/tx/v1beta1/tx.proto +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -74,7 +74,9 @@ message TxBody { // transaction. repeated google.protobuf.Any messages = 1; - // memo is any arbitrary memo to be added to the transaction + // memo is any arbitrary note/comment to be added to the transaction. + // WARNING: in clients, any publicly exposed text should not be called memo, + // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). string memo = 2; // timeout is the block height after which this transaction will not diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index a552c7a083..bdb6feaa04 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -254,7 +254,9 @@ type TxBody struct { // is referred to as the primary signer and pays the fee for the whole // transaction. Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` - // memo is any arbitrary memo to be added to the transaction + // memo is any arbitrary note/comment to be added to the transaction. + // In clients, any public exposing text should not be called as memo, + // should use `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` // timeout is the block height after which this transaction will not // be processed by the chain