Update blockchain_test.go

code clean: remove redundant parentheses.
This commit is contained in:
HAPPY 2024-02-22 23:59:22 +08:00 committed by GitHub
parent 71443acbd8
commit 009142570b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1167,7 +1167,7 @@ func testChainTxReorgs(t *testing.T, scheme string) {
} }
// removed tx // removed tx
for i, tx := range (types.Transactions{pastDrop, freshDrop}) { for i, tx := range types.Transactions{pastDrop, freshDrop} {
if txn, _, _, _ := rawdb.ReadTransaction(db, tx.Hash()); txn != nil { if txn, _, _, _ := rawdb.ReadTransaction(db, tx.Hash()); txn != nil {
t.Errorf("drop %d: tx %v found while shouldn't have been", i, txn) t.Errorf("drop %d: tx %v found while shouldn't have been", i, txn)
} }
@ -1176,7 +1176,7 @@ func testChainTxReorgs(t *testing.T, scheme string) {
} }
} }
// added tx // added tx
for i, tx := range (types.Transactions{pastAdd, freshAdd, futureAdd}) { for i, tx := range types.Transactions{pastAdd, freshAdd, futureAdd} {
if txn, _, _, _ := rawdb.ReadTransaction(db, tx.Hash()); txn == nil { if txn, _, _, _ := rawdb.ReadTransaction(db, tx.Hash()); txn == nil {
t.Errorf("add %d: expected tx to be found", i) t.Errorf("add %d: expected tx to be found", i)
} }
@ -1185,7 +1185,7 @@ func testChainTxReorgs(t *testing.T, scheme string) {
} }
} }
// shared tx // shared tx
for i, tx := range (types.Transactions{postponed, swapped}) { for i, tx := range types.Transactions{postponed, swapped} {
if txn, _, _, _ := rawdb.ReadTransaction(db, tx.Hash()); txn == nil { if txn, _, _, _ := rawdb.ReadTransaction(db, tx.Hash()); txn == nil {
t.Errorf("share %d: expected tx to be found", i) t.Errorf("share %d: expected tx to be found", i)
} }