Reset unchecked tx fields
This commit is contained in:
parent
e0a5c44314
commit
79c0882d8b
@ -172,15 +172,15 @@ func (rt *Test) TestGetTransactionForMempool(t *testing.T) {
|
|||||||
rt.skipUnconnected(t)
|
rt.skipUnconnected(t)
|
||||||
|
|
||||||
for txid, want := range rt.TestData.TxDetails {
|
for txid, want := range rt.TestData.TxDetails {
|
||||||
// reset fields that are not parsed
|
// reset fields that are not parsed by BlockChainParser
|
||||||
want.Confirmations = 0
|
want.Confirmations, want.Blocktime, want.Time = 0, 0, 0
|
||||||
want.Blocktime = 0
|
|
||||||
want.Time = 0
|
|
||||||
|
|
||||||
got, err := rt.Client.GetTransactionForMempool(txid)
|
got, err := rt.Client.GetTransactionForMempool(txid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
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) {
|
if !reflect.DeepEqual(got, want) {
|
||||||
t.Errorf("GetTransactionForMempool() got %v, want %v", got, want)
|
t.Errorf("GetTransactionForMempool() got %v, want %v", got, want)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user