swaps: rm support for p2wsh-p2sh lockup scripts
- unused - the client was already refusing to fund such lockup addresses (if the server asked) - no existing unit tests for it, and as the choice is up to the server, it is hard to create tests - no clear reason to want to use p2sh-nested scripts here, aside from curiosity
This commit is contained in:
@@ -124,14 +124,8 @@ def create_claim_tx(
|
|||||||
"""Create tx to either claim successful reverse-swap,
|
"""Create tx to either claim successful reverse-swap,
|
||||||
or to get refunded for timed-out forward-swap.
|
or to get refunded for timed-out forward-swap.
|
||||||
"""
|
"""
|
||||||
assert txin.address is not None
|
txin.script_type = 'p2wsh'
|
||||||
if is_segwit_address(txin.address):
|
txin.script_sig = b''
|
||||||
txin.script_type = 'p2wsh'
|
|
||||||
txin.script_sig = b''
|
|
||||||
else:
|
|
||||||
txin.script_type = 'p2wsh-p2sh' # TODO rm??
|
|
||||||
txin.redeem_script = bytes.fromhex(p2wsh_nested_script(witness_script.hex()))
|
|
||||||
txin.script_sig = bytes.fromhex(push_script(txin.redeem_script.hex()))
|
|
||||||
txin.witness_script = witness_script
|
txin.witness_script = witness_script
|
||||||
txout = PartialTxOutput.from_address_and_value(address, amount_sat)
|
txout = PartialTxOutput.from_address_and_value(address, amount_sat)
|
||||||
tx = PartialTransaction.from_io([txin], [txout], version=2, locktime=locktime)
|
tx = PartialTransaction.from_io([txin], [txout], version=2, locktime=locktime)
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ class TestSwapTxs(TestCaseForTestnet):
|
|||||||
prevout=TxOutpoint(txid=bfh(swap_data.funding_txid), out_idx=0),
|
prevout=TxOutpoint(txid=bfh(swap_data.funding_txid), out_idx=0),
|
||||||
)
|
)
|
||||||
txin._trusted_value_sats = swap_data.onchain_amount
|
txin._trusted_value_sats = swap_data.onchain_amount
|
||||||
txin._trusted_address = swap_data.lockup_address
|
|
||||||
tx = SwapManager._create_and_sign_claim_tx(
|
tx = SwapManager._create_and_sign_claim_tx(
|
||||||
txin=txin,
|
txin=txin,
|
||||||
swap=swap_data,
|
swap=swap_data,
|
||||||
@@ -65,7 +64,6 @@ class TestSwapTxs(TestCaseForTestnet):
|
|||||||
prevout=TxOutpoint(txid=bfh(swap_data.funding_txid), out_idx=0),
|
prevout=TxOutpoint(txid=bfh(swap_data.funding_txid), out_idx=0),
|
||||||
)
|
)
|
||||||
txin._trusted_value_sats = swap_data.onchain_amount
|
txin._trusted_value_sats = swap_data.onchain_amount
|
||||||
txin._trusted_address = swap_data.lockup_address
|
|
||||||
tx = SwapManager._create_and_sign_claim_tx(
|
tx = SwapManager._create_and_sign_claim_tx(
|
||||||
txin=txin,
|
txin=txin,
|
||||||
swap=swap_data,
|
swap=swap_data,
|
||||||
|
|||||||
Reference in New Issue
Block a user