Skip to content

Commit

Permalink
Merge PR cosmos#1377: types: remove GetMemo from Tx
Browse files Browse the repository at this point in the history
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 cosmos#1375
  • Loading branch information
ValarDragon authored and cwgoes committed Jun 26, 2018
1 parent f2a83a0 commit 893bb40
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions types/tx_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ type Tx interface {

// Gets the Msg.
GetMsgs() []Msg

// Gets the memo.
GetMemo() string
}

//__________________________________________________________
Expand Down
4 changes: 2 additions & 2 deletions x/auth/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 893bb40

Please sign in to comment.