mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +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:
@@ -102,3 +102,12 @@ def account_balance(n, account_id):
|
||||
|
||||
def first_channel_id(n1, n2):
|
||||
return only_one(only_one(n1.rpc.listpeers(n2.info['id'])['peers'])['channels'])['channel_id']
|
||||
|
||||
|
||||
def basic_fee(feerate):
|
||||
if False: # FIXME-anchor
|
||||
# option_anchor_outputs
|
||||
weight = 1124
|
||||
else:
|
||||
weight = 724
|
||||
return (weight * feerate) // 1000
|
||||
|
||||
Reference in New Issue
Block a user