Upgrade of TestGetTransactionForMempool - mempool isn't necessary

This commit is contained in:
Jakub Matys 2018-06-27 21:35:29 +02:00
parent a7c128d806
commit d744b23c39

View File

@ -195,17 +195,19 @@ func (rt *Test) getMempoolTransaction(t *testing.T, txid string) *bchain.Tx {
func (rt *Test) TestGetTransactionForMempool(t *testing.T) { func (rt *Test) TestGetTransactionForMempool(t *testing.T) {
rt.skipUnconnected(t) rt.skipUnconnected(t)
txs := rt.getMempool(t) for txid, want := range rt.TestData.TxDetails {
txid := txs[rand.Intn(len(txs))] // reset fields that are not parsed
got := rt.getMempoolTransaction(t, txid) want.Confirmations = 0
want.Blocktime = 0
want.Time = 0
want, err := rt.Client.GetTransaction(txid) got, err := rt.Client.GetTransactionForMempool(txid)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
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) }
} }
} }