@@ -2762,23 +2762,23 @@ def test_withdraw(self):
2762
2762
assert (c .fetchone ()[0 ] == 10 )
2763
2763
2764
2764
# Renable when the bitcoin wallet can generate a "bcrt1" address
2765
- #waddr = l1.bitcoin.rpc.getnewaddress()
2765
+ # waddr = l1.bitcoin.rpc.getnewaddress()
2766
2766
# Instead for now, Use an address from l3
2767
2767
waddr = l3 .rpc .newaddr ('bech32' )['address' ]
2768
2768
# Now attempt to withdraw some (making sure we collect multiple inputs)
2769
2769
self .assertRaises (ValueError , l1 .rpc .withdraw , 'not an address' , amount )
2770
2770
self .assertRaises (ValueError , l1 .rpc .withdraw , waddr , 'not an amount' )
2771
2771
self .assertRaises (ValueError , l1 .rpc .withdraw , waddr , - amount )
2772
2772
2773
- out = l1 .rpc .withdraw (waddr , 2 * amount )
2773
+ l1 .rpc .withdraw (waddr , 2 * amount )
2774
2774
2775
2775
# 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' ]]
2778
2776
# Skip these checks because the withdrawal was made to a lightning wallet
2779
2777
# 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'))
2782
2782
2783
2783
# Now make sure two of them were marked as spent
2784
2784
c = db .cursor ()
@@ -2788,7 +2788,7 @@ def test_withdraw(self):
2788
2788
# Now send some money to l2.
2789
2789
# lightningd uses P2SH-P2WPKH
2790
2790
waddr = l2 .rpc .newaddr ('bech32' )['address' ]
2791
- out = l1 .rpc .withdraw (waddr , 2 * amount )
2791
+ l1 .rpc .withdraw (waddr , 2 * amount )
2792
2792
l1 .bitcoin .rpc .generate (1 )
2793
2793
2794
2794
# Make sure l2 received the withdrawal.
@@ -2807,7 +2807,7 @@ def test_withdraw(self):
2807
2807
self .assertRaises (ValueError , l1 .rpc .withdraw , 'xx1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx' , 2 * amount )
2808
2808
self .assertRaises (ValueError , l1 .rpc .withdraw , 'tb1pw508d6qejxtdg4y5r3zarvary0c5xw7kdl9fad' , 2 * amount )
2809
2809
self .assertRaises (ValueError , l1 .rpc .withdraw , 'tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxxxxxx' , 2 * amount )
2810
- out = l1 .rpc .withdraw (waddr , 2 * amount )
2810
+ l1 .rpc .withdraw (waddr , 2 * amount )
2811
2811
l1 .bitcoin .rpc .generate (1 )
2812
2812
# Now make sure additional two of them were marked as spent
2813
2813
c = db .cursor ()
@@ -2820,7 +2820,7 @@ def test_withdraw(self):
2820
2820
self .assertRaises (ValueError , l1 .rpc .withdraw , 'xx1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7' , 2 * amount )
2821
2821
self .assertRaises (ValueError , l1 .rpc .withdraw , 'tb1prp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qsm03tq' , 2 * amount )
2822
2822
self .assertRaises (ValueError , l1 .rpc .withdraw , 'tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qxxxxxx' , 2 * amount )
2823
- out = l1 .rpc .withdraw (waddr , 2 * amount )
2823
+ l1 .rpc .withdraw (waddr , 2 * amount )
2824
2824
l1 .bitcoin .rpc .generate (1 )
2825
2825
# Now make sure additional two of them were marked as spent
2826
2826
c = db .cursor ()
@@ -2851,13 +2851,13 @@ def test_withdraw(self):
2851
2851
assert (c .fetchone ()[0 ] == 6 )
2852
2852
2853
2853
# 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' )
2855
2855
bitcoind .rpc .generate (1 )
2856
2856
c = db .cursor ()
2857
2857
c .execute ('SELECT COUNT(*) FROM outputs WHERE status=0' )
2858
2858
assert (c .fetchone ()[0 ] == 1 )
2859
2859
2860
- out = l1 .rpc .withdraw (waddr , 'all' )
2860
+ l1 .rpc .withdraw (waddr , 'all' )
2861
2861
c = db .cursor ()
2862
2862
c .execute ('SELECT COUNT(*) FROM outputs WHERE status=0' )
2863
2863
assert (c .fetchone ()[0 ] == 0 )
0 commit comments