Skip to content

Commit

Permalink
Add tests for TxDecoder
Browse files Browse the repository at this point in the history
  • Loading branch information
sahith-narahari committed Jun 18, 2020
1 parent 766f808 commit e0cb1d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x/auth/types/client_tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ func TestTxEncoder(t *testing.T) {

// Build a test transaction
fee := authtypes.NewStdFee(50000, sdk.Coins{sdk.NewInt64Coin("atom", 150)})
stdTx := authtypes.NewStdTx([]sdk.Msg{}, fee, []authtypes.StdSignature{}, "foomemo")
stdTx := authtypes.NewStdTx([]sdk.Msg{nil}, fee, []authtypes.StdSignature{}, "foomemo")

// Encode transaction
txBytes, err := clientCtx.TxGenerator.TxEncoder()(stdTx)
require.NoError(t, err)
require.NotNil(t, txBytes)

tx, err := clientCtx.TxGenerator.TxDecoder()(txBytes)
require.NoError(t, err)
require.Equal(t, []sdk.Msg{nil}, tx.GetMsgs())
}

0 comments on commit e0cb1d4

Please sign in to comment.