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
This commit is contained in:
Dev Ojha 2018-06-25 19:37:21 -07:00 committed by Christopher Goes
parent f2a83a07f9
commit 893bb4027d
3 changed files with 3 additions and 5 deletions

View File

@ -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

View File

@ -31,9 +31,6 @@ type Tx interface {
// Gets the Msg.
GetMsgs() []Msg
// Gets the memo.
GetMemo() string
}
//__________________________________________________________

View File

@ -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,