Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix composition with taproot p2tr address #2978

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion counterparty-core/counterpartycore/lib/api/composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions release-notes/release-notest-v10.10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

## Bugfixes

- Fix composition with P2TR addresses

## Codebase

## API
Expand Down
Loading