From 893bb4027da0bf2ef172f4355fdca45f4bc349bd Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Mon, 25 Jun 2018 19:37:21 -0700 Subject: [PATCH] Merge PR #1377: types: remove GetMemo from Tx This method is an unneccessary requirement on Tx. Auth casts the Tx to StdTx, so the memo can be obtained in previous usecases from StdTx. This also makes it more clear for when something is implementing StdTx vs Tx. Resolves #1375 --- CHANGELOG.md | 1 + types/tx_msg.go | 3 --- x/auth/ante.go | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 789361078b..f46d009494 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ BREAKING CHANGES * Signers of a transaction now only sign over their account and sequence number * Removed MsgChangePubKey from auth * Removed setPubKey from account mapper +* Removed GetMemo from Tx (it is still on StdTx) FEATURES * [gaiacli] You can now attach a simple text-only memo to any transaction, with the `--memo` flag diff --git a/types/tx_msg.go b/types/tx_msg.go index 0ed49906f0..12146f5b73 100644 --- a/types/tx_msg.go +++ b/types/tx_msg.go @@ -31,9 +31,6 @@ type Tx interface { // Gets the Msg. GetMsgs() []Msg - - // Gets the memo. - GetMemo() string } //__________________________________________________________ diff --git a/x/auth/ante.go b/x/auth/ante.go index 946a278e61..616ffd2cf2 100644 --- a/x/auth/ante.go +++ b/x/auth/ante.go @@ -38,7 +38,7 @@ func NewAnteHandler(am AccountMapper, fck FeeCollectionKeeper) sdk.AnteHandler { true } - memo := tx.GetMemo() + memo := stdTx.GetMemo() if len(memo) > maxMemoCharacters { return ctx, @@ -85,7 +85,7 @@ func NewAnteHandler(am AccountMapper, fck FeeCollectionKeeper) sdk.AnteHandler { signerAddr, sig := signerAddrs[i], sigs[i] // check signature, return account with incremented nonce - signBytes := StdSignBytes(ctx.ChainID(), accNums[i], sequences[i], fee, msgs, tx.GetMemo()) + signBytes := StdSignBytes(ctx.ChainID(), accNums[i], sequences[i], fee, msgs, stdTx.GetMemo()) signerAcc, res := processSig( ctx, am, signerAddr, sig, signBytes,