Skip to content

Commit

Permalink
[test] refs #279 - Add `TestSkycoinPendingTransactionEncodeSkycoinTra…
Browse files Browse the repository at this point in the history
…nsaction`
  • Loading branch information
e1Ru1o committed Jan 24, 2020
1 parent e95ee2c commit 52a962f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/coin/skycoin/models/coin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,3 +784,21 @@ func Test_serializeCreatedTransaction(t *testing.T) {
require.NoError(t, err)
require.Equal(t, expected, ser)
}

func TestSkycoinPendingTransactionEncodeSkycoinTransaction(t *testing.T) {
date, _ := time.Parse(time.RFC3339, "2012-11-01T22:08:41+00:00")
sTxn := &SkycoinPendingTransaction{
Transaction: &readable.UnconfirmedTransactionVerbose{
Transaction: readable.BlockTransactionVerbose{
InnerHash: "0000000000000000000000000000000000000000000000000000000000000000",
Hash: "78877fa898f0b4c45c9c33ae941e40617ad7c8657a307db62bc5691f92f4f60e",
},
Announced: date,
},
}
ser, err := sTxn.EncodeSkycoinTransaction()
require.NoError(t, err)
exp, err := serializeCreatedTransaction(sTxn)
require.NoError(t, err)
require.Equal(t, exp, ser)
}

0 comments on commit 52a962f

Please sign in to comment.