tests: promote method to utility file

We'll reuse it later
This commit is contained in:
niftynei
2021-08-05 12:32:38 -05:00
committed by Rusty Russell
parent 9df4234e8f
commit a9de23f993
3 changed files with 9 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ from pyln.testing.utils import SLOW_MACHINE
from utils import (
only_one, sync_blockheight, wait_for, TIMEOUT,
account_balance, first_channel_id, closing_fee, TEST_NETWORK,
scriptpubkey_addr
scriptpubkey_addr, calc_lease_fee
)
import os
@@ -718,14 +718,6 @@ def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams):
assert account_balance(l2, channel_id) == 0
# check that the fee paid is correct
def calc_lease_fee(amt, feerate, rates):
fee = rates['lease_fee_base_msat']
fee += amt * rates['lease_fee_basis'] // 10
fee += rates['funding_weight'] * feerate
return fee
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
@pytest.mark.openchannel('v2')
@pytest.mark.slow_test