1
0

transaction.py: impl taproot key-spends

Add support for key-path-spending taproot utxos into transaction.py.

- no wallet support yet
- add some psbt, and minimal descriptor support
- preliminary work towards script-path spends
This commit is contained in:
SomberNight
2024-05-23 16:09:59 +00:00
parent 7a0bffc3e3
commit 3a305881cc
11 changed files with 978 additions and 152 deletions

View File

@@ -58,7 +58,7 @@ class TestValidPSBT(ElectrumTestCase):
self.assertTrue(tx.inputs()[0].redeem_script is not None)
self.assertTrue(tx.inputs()[0].witness_script is not None)
self.assertEqual(2, len(tx.inputs()[0].bip32_paths))
self.assertEqual(1, len(tx.inputs()[0].part_sigs))
self.assertEqual(1, len(tx.inputs()[0].sigs_ecdsa))
def test_valid_psbt_006(self):
# Case: PSBT with one P2WSH input of a 2-of-2 multisig. witnessScript, keypaths, and global xpubs are available. Contains no signatures. Outputs filled.
@@ -70,7 +70,7 @@ class TestValidPSBT(ElectrumTestCase):
self.assertTrue(tx.inputs()[0].witness_script is not None)
self.assertEqual(2, len(tx.inputs()[0].bip32_paths))
self.assertEqual(2, len(tx.xpubs))
self.assertEqual(0, len(tx.inputs()[0].part_sigs))
self.assertEqual(0, len(tx.inputs()[0].sigs_ecdsa))
def test_valid_psbt_007(self):
# Case: PSBT with unknown types in the inputs.