Skip to content

Commit ff7365e

Browse files
committed
[tests] fix flake8 warnings in zapwallettxes.py
1 parent afd2fca commit ff7365e

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

test/functional/zapwallettxes.py

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313
available, but that the unconfirmed transaction has been zapped.
1414
"""
1515
from test_framework.test_framework import BitcoinTestFramework
16-
from test_framework.util import *
17-
16+
from test_framework.util import (assert_equal,
17+
assert_raises,
18+
bitcoind_processes,
19+
connect_nodes_bi,
20+
JSONRPCException,
21+
)
1822

1923
class ZapWalletTXesTest (BitcoinTestFramework):
2024

@@ -25,56 +29,56 @@ def __init__(self):
2529

2630
def setup_network(self):
2731
super().setup_network()
28-
connect_nodes_bi(self.nodes,0,2)
32+
connect_nodes_bi(self.nodes, 0, 2)
2933

30-
def run_test (self):
34+
def run_test(self):
3135
self.log.info("Mining blocks...")
3236
self.nodes[0].generate(1)
3337
self.sync_all()
3438
self.nodes[1].generate(101)
3539
self.sync_all()
36-
40+
3741
assert_equal(self.nodes[0].getbalance(), 50)
38-
42+
3943
txid0 = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)
4044
txid1 = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)
4145
self.sync_all()
4246
self.nodes[0].generate(1)
4347
self.sync_all()
44-
48+
4549
txid2 = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)
4650
txid3 = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)
47-
51+
4852
tx0 = self.nodes[0].gettransaction(txid0)
49-
assert_equal(tx0['txid'], txid0) #tx0 must be available (confirmed)
50-
53+
assert_equal(tx0['txid'], txid0) # tx0 must be available (confirmed)
54+
5155
tx1 = self.nodes[0].gettransaction(txid1)
52-
assert_equal(tx1['txid'], txid1) #tx1 must be available (confirmed)
53-
56+
assert_equal(tx1['txid'], txid1) # tx1 must be available (confirmed)
57+
5458
tx2 = self.nodes[0].gettransaction(txid2)
55-
assert_equal(tx2['txid'], txid2) #tx2 must be available (unconfirmed)
56-
59+
assert_equal(tx2['txid'], txid2) # tx2 must be available (unconfirmed)
60+
5761
tx3 = self.nodes[0].gettransaction(txid3)
58-
assert_equal(tx3['txid'], txid3) #tx3 must be available (unconfirmed)
59-
62+
assert_equal(tx3['txid'], txid3) # tx3 must be available (unconfirmed)
63+
6064
#restart bitcoind
6165
self.stop_node(0)
6266
self.nodes[0] = self.start_node(0,self.options.tmpdir)
6367

6468
tx3 = self.nodes[0].gettransaction(txid3)
65-
assert_equal(tx3['txid'], txid3) #tx must be available (unconfirmed)
66-
69+
assert_equal(tx3['txid'], txid3) # tx must be available (unconfirmed)
70+
6771
self.stop_node(0)
6872

6973
#restart bitcoind with zapwallettxes
7074
self.nodes[0] = self.start_node(0,self.options.tmpdir, ["-zapwallettxes=1"])
71-
75+
7276
assert_raises(JSONRPCException, self.nodes[0].gettransaction, [txid3])
73-
#there must be an exception because the unconfirmed wallettx0 must be gone by now
77+
# there must be an exception because the unconfirmed wallettx0 must be gone by now
7478

7579
tx0 = self.nodes[0].gettransaction(txid0)
76-
assert_equal(tx0['txid'], txid0) #tx0 (confirmed) must still be available because it was confirmed
80+
assert_equal(tx0['txid'], txid0) # tx0 (confirmed) must still be available because it was confirmed
7781

7882

7983
if __name__ == '__main__':
80-
ZapWalletTXesTest ().main ()
84+
ZapWalletTXesTest().main()

0 commit comments

Comments
 (0)