mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
wallet: switch over to withdraw in module, remove lots of unused code.
This removes the reservation cleanup at startup, too, now they're all using 'reserved_til'. This changes test_withdraw, since it asserted that outputs were marked spent as soon as we broadcast a transaction: now they're reserved until it's mined. Similarly, test_addfunds_from_block assumed we'd see funds as soon as we broadcast the tx. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Changed: JSON-RPC: `withdraw` now randomizes input and output order, not BIP69.
This commit is contained in:
@@ -522,7 +522,7 @@ def test_withdraw_misc(node_factory, bitcoind, chainparams):
|
||||
l1.rpc.withdraw(waddr, 'not an amount')
|
||||
with pytest.raises(RpcError):
|
||||
l1.rpc.withdraw(waddr, -amount)
|
||||
with pytest.raises(RpcError, match=r'Cannot afford transaction'):
|
||||
with pytest.raises(RpcError, match=r'Could not afford'):
|
||||
l1.rpc.withdraw(waddr, amount * 100)
|
||||
|
||||
out = l1.rpc.withdraw(waddr, amount)
|
||||
@@ -638,7 +638,7 @@ def test_withdraw_misc(node_factory, bitcoind, chainparams):
|
||||
assert l1.db_query('SELECT COUNT(*) as c FROM outputs WHERE status=0')[0]['c'] == 0
|
||||
|
||||
# This should fail, can't even afford fee.
|
||||
with pytest.raises(RpcError, match=r'Cannot afford transaction'):
|
||||
with pytest.raises(RpcError, match=r'Could not afford'):
|
||||
l1.rpc.withdraw(waddr, 'all')
|
||||
|
||||
bitcoind.generate_block(1)
|
||||
|
||||
Reference in New Issue
Block a user