Skip to content

Commit 58fae47

Browse files
rustyrussellcdecker
authored andcommitted
test_lightningd.py: more minor flake8 fixes.
Looks like rebasing the flake8 branch caused breakage, as new violations had occurred since that check was written Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent fba2bdb commit 58fae47

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/test_lightningd.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,23 +2762,23 @@ def test_withdraw(self):
27622762
assert(c.fetchone()[0] == 10)
27632763

27642764
# Renable when the bitcoin wallet can generate a "bcrt1" address
2765-
#waddr = l1.bitcoin.rpc.getnewaddress()
2765+
# waddr = l1.bitcoin.rpc.getnewaddress()
27662766
# Instead for now, Use an address from l3
27672767
waddr = l3.rpc.newaddr('bech32')['address']
27682768
# Now attempt to withdraw some (making sure we collect multiple inputs)
27692769
self.assertRaises(ValueError, l1.rpc.withdraw, 'not an address', amount)
27702770
self.assertRaises(ValueError, l1.rpc.withdraw, waddr, 'not an amount')
27712771
self.assertRaises(ValueError, l1.rpc.withdraw, waddr, -amount)
27722772

2773-
out = l1.rpc.withdraw(waddr, 2 * amount)
2773+
l1.rpc.withdraw(waddr, 2 * amount)
27742774

27752775
# Make sure bitcoind received the withdrawal
2776-
unspent = l1.bitcoin.rpc.listunspent(0)
2777-
withdrawal = [u for u in unspent if u['txid'] == out['txid']]
27782776
# Skip these checks because the withdrawal was made to a lightning wallet
27792777
# Renable when the bitcoin wallet can generate a "bcrt1" address
2780-
#assert(len(withdrawal) == 1)
2781-
#assert(withdrawal[0]['amount'] == Decimal('0.02'))
2778+
# unspent = l1.bitcoin.rpc.listunspent(0)
2779+
# withdrawal = [u for u in unspent if u['txid'] == out['txid']]
2780+
# assert(len(withdrawal) == 1)
2781+
# assert(withdrawal[0]['amount'] == Decimal('0.02'))
27822782

27832783
# Now make sure two of them were marked as spent
27842784
c = db.cursor()
@@ -2788,7 +2788,7 @@ def test_withdraw(self):
27882788
# Now send some money to l2.
27892789
# lightningd uses P2SH-P2WPKH
27902790
waddr = l2.rpc.newaddr('bech32')['address']
2791-
out = l1.rpc.withdraw(waddr, 2 * amount)
2791+
l1.rpc.withdraw(waddr, 2 * amount)
27922792
l1.bitcoin.rpc.generate(1)
27932793

27942794
# Make sure l2 received the withdrawal.
@@ -2807,7 +2807,7 @@ def test_withdraw(self):
28072807
self.assertRaises(ValueError, l1.rpc.withdraw, 'xx1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx', 2 * amount)
28082808
self.assertRaises(ValueError, l1.rpc.withdraw, 'tb1pw508d6qejxtdg4y5r3zarvary0c5xw7kdl9fad', 2 * amount)
28092809
self.assertRaises(ValueError, l1.rpc.withdraw, 'tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxxxxxx', 2 * amount)
2810-
out = l1.rpc.withdraw(waddr, 2 * amount)
2810+
l1.rpc.withdraw(waddr, 2 * amount)
28112811
l1.bitcoin.rpc.generate(1)
28122812
# Now make sure additional two of them were marked as spent
28132813
c = db.cursor()
@@ -2820,7 +2820,7 @@ def test_withdraw(self):
28202820
self.assertRaises(ValueError, l1.rpc.withdraw, 'xx1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7', 2 * amount)
28212821
self.assertRaises(ValueError, l1.rpc.withdraw, 'tb1prp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qsm03tq', 2 * amount)
28222822
self.assertRaises(ValueError, l1.rpc.withdraw, 'tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qxxxxxx', 2 * amount)
2823-
out = l1.rpc.withdraw(waddr, 2 * amount)
2823+
l1.rpc.withdraw(waddr, 2 * amount)
28242824
l1.bitcoin.rpc.generate(1)
28252825
# Now make sure additional two of them were marked as spent
28262826
c = db.cursor()
@@ -2851,13 +2851,13 @@ def test_withdraw(self):
28512851
assert(c.fetchone()[0] == 6)
28522852

28532853
# Test withdrawal to self.
2854-
out = l1.rpc.withdraw(l1.rpc.newaddr('bech32')['address'], 'all')
2854+
l1.rpc.withdraw(l1.rpc.newaddr('bech32')['address'], 'all')
28552855
bitcoind.rpc.generate(1)
28562856
c = db.cursor()
28572857
c.execute('SELECT COUNT(*) FROM outputs WHERE status=0')
28582858
assert(c.fetchone()[0] == 1)
28592859

2860-
out = l1.rpc.withdraw(waddr, 'all')
2860+
l1.rpc.withdraw(waddr, 'all')
28612861
c = db.cursor()
28622862
c.execute('SELECT COUNT(*) FROM outputs WHERE status=0')
28632863
assert(c.fetchone()[0] == 0)

0 commit comments

Comments
 (0)