Reset unchecked tx fields

This commit is contained in:
Jakub Matys 2018-06-29 15:01:55 +02:00
parent e0a5c44314
commit 79c0882d8b

View File

@ -172,15 +172,15 @@ func (rt *Test) TestGetTransactionForMempool(t *testing.T) {
rt.skipUnconnected(t)
for txid, want := range rt.TestData.TxDetails {
// reset fields that are not parsed
want.Confirmations = 0
want.Blocktime = 0
want.Time = 0
// reset fields that are not parsed by BlockChainParser
want.Confirmations, want.Blocktime, want.Time = 0, 0, 0
got, err := rt.Client.GetTransactionForMempool(txid)
if err != nil {
t.Fatal(err)
}
// transactions parsed from JSON may contain additional data
got.Confirmations, got.Blocktime, got.Time = 0, 0, 0
if !reflect.DeepEqual(got, want) {
t.Errorf("GetTransactionForMempool() got %v, want %v", got, want)
}