mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: generalize tests.
Anchor outputs break many assumptions in our tests: 1. Remove some hardcoded numbers in favor of a fee calc, so we only have to change in one place. FIXME: This should also be done for elements! 2. Do binary search to get feerate for a given closing fee. 3. Don't assume output #0: anchor outputs perturb them. 4. Don't assume we can make 1ksat channels (anchors cost 660 sats!). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1211,9 +1211,9 @@ def test_bcli(node_factory, bitcoind, chainparams):
|
||||
|
||||
l1.fundwallet(10**5)
|
||||
l1.connect(l2)
|
||||
fc = l1.rpc.fundchannel(l2.info["id"], 10**4)
|
||||
fc = l1.rpc.fundchannel(l2.info["id"], 10**4 * 2)
|
||||
txo = l1.rpc.call("getutxout", {"txid": fc['txid'], "vout": fc['outnum']})
|
||||
assert (Millisatoshi(txo["amount"]) == Millisatoshi(10**4 * 10**3)
|
||||
assert (Millisatoshi(txo["amount"]) == Millisatoshi(10**4 * 2 * 10**3)
|
||||
and txo["script"].startswith("0020"))
|
||||
l1.rpc.close(l2.info["id"])
|
||||
# When output is spent, it should give us null !
|
||||
|
||||
Reference in New Issue
Block a user