Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix composition with taproot p2tr address
Browse files Browse the repository at this point in the history
Ouziel committed Jan 30, 2025
1 parent 3db1d0b commit c450b99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion counterparty-core/counterpartycore/lib/api/composer.py
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
from decimal import Decimal as D

from arc4 import ARC4
from bitcoinutils.keys import P2pkhAddress, P2shAddress, P2wpkhAddress, PublicKey
from bitcoinutils.keys import P2pkhAddress, P2shAddress, P2trAddress, P2wpkhAddress, PublicKey
from bitcoinutils.script import Script, b_to_h
from bitcoinutils.transactions import Transaction, TxInput, TxOutput, TxWitnessInput

@@ -91,6 +91,8 @@ def address_to_script_pub_key(address, unspent_list, construct_params):
return multisig_script
try:
return P2wpkhAddress(address).to_script_pub_key()
except TypeError:
return P2trAddress(address).to_script_pub_key()
except ValueError:
pass
try:

0 comments on commit c450b99

Please sign in to comment.