From d86df334c3cc4d91f70f725bbb4bc663f64b7c7b Mon Sep 17 00:00:00 2001 From: chris-belcher Date: Thu, 23 Jan 2020 21:28:32 +0000 Subject: [PATCH] Rename functions which create multisig scripts --- jmbitcoin/jmbitcoin/secp256k1_transaction.py | 6 +++--- jmclient/test/test_tx_creation.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jmbitcoin/jmbitcoin/secp256k1_transaction.py b/jmbitcoin/jmbitcoin/secp256k1_transaction.py index a4893cf..06ec8d3 100644 --- a/jmbitcoin/jmbitcoin/secp256k1_transaction.py +++ b/jmbitcoin/jmbitcoin/secp256k1_transaction.py @@ -534,7 +534,7 @@ def pubkey_to_p2wpkh_address(pub): script = pubkey_to_p2wpkh_script(pub) return script_to_address(script) -def pubkeys_to_p2wsh_script(pubs): +def pubkeys_to_p2wsh_multisig_script(pubs): """ Given a list of N pubkeys, constructs an N of N multisig scriptPubKey of type pay-to-witness-script-hash. No other scripts than N-N multisig supported as of now. @@ -543,12 +543,12 @@ def pubkeys_to_p2wsh_script(pubs): script = mk_multisig_script(pubs, N) return P2WSH_PRE + bin_sha256(binascii.unhexlify(script)) -def pubkeys_to_p2wsh_address(pubs): +def pubkeys_to_p2wsh_multisig_address(pubs): """ Given a list of N pubkeys, constructs an N of N multisig address of type pay-to-witness-script-hash. No other scripts than N-N multisig supported as of now. """ - script = pubkeys_to_p2wsh_script(pubs) + script = pubkeys_to_p2wsh_multisig_script(pubs) return script_to_address(script) def deserialize_script(scriptinp): diff --git a/jmclient/test/test_tx_creation.py b/jmclient/test/test_tx_creation.py index bfce319..79275ca 100644 --- a/jmclient/test/test_tx_creation.py +++ b/jmclient/test/test_tx_creation.py @@ -244,8 +244,8 @@ def test_spend_p2wsh(setup_tx_creation): privs = [binascii.hexlify(priv).decode('ascii') for priv in privs] pubs = [bitcoin.privkey_to_pubkey(priv) for priv in privs] redeemScripts = [bitcoin.mk_multisig_script(pubs[i:i+2], 2) for i in [0, 2]] - scriptPubKeys = [bitcoin.pubkeys_to_p2wsh_script(pubs[i:i+2]) for i in [0, 2]] - addresses = [bitcoin.pubkeys_to_p2wsh_address(pubs[i:i+2]) for i in [0, 2]] + scriptPubKeys = [bitcoin.pubkeys_to_p2wsh_multisig_script(pubs[i:i+2]) for i in [0, 2]] + addresses = [bitcoin.pubkeys_to_p2wsh_multisig_address(pubs[i:i+2]) for i in [0, 2]] #pay into it wallet_service = make_wallets(1, [[3, 0, 0, 0, 0]], 3)[0]['wallet'] wallet_service.sync_wallet(fast=True)