Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions core/types/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,18 @@ func TestTransactionCoding(t *testing.T) {
if err != nil {
t.Fatal(err)
}
assertEqual(parsedTx, tx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO the extra checks done by assertEqual are still useful. We just need to check the error here.

While it is true that the transaction hash covers all other fields, this may change for future transaction types.

if err := assertEqual(parsedTx, tx); err != nil {
t.Fatal(err)
}

// JSON
parsedTx, err = encodeDecodeJSON(tx)
if err != nil {
t.Fatal(err)
}
assertEqual(parsedTx, tx)
if err := assertEqual(parsedTx, tx); err != nil {
t.Fatal(err)
}
}
}

Expand Down