Skip to content

Commit

Permalink
Tweak docs; more tests; fix regtest
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Jan 3, 2025
1 parent d1ed85d commit 5854ac3
Show file tree
Hide file tree
Showing 10 changed files with 4,692 additions and 9,339 deletions.
6,754 changes: 2,445 additions & 4,309 deletions apiary.apib

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions counterparty-core/counterpartycore/lib/api/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ def prepare_route_args(function):
for arg_name, arg in function_args.items():
if arg_name == "construct_params":
for carg_name, carg_info in composer.CONSTRUCT_PARAMS.items():
if carg_name in composer.DEPRECATED_CONSTRUCT_PARAMS:
continue
args.append(
{
"name": carg_name,
Expand Down
28 changes: 15 additions & 13 deletions counterparty-core/counterpartycore/lib/composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ def get_dummy_witness(script_pub_key):
elif output_type == "P2TR":
witness = [DUMMY_SCHNORR_SIG]
if witness is not None:
print("WITNESS", witness)
return TxWitnessInput(witness)
return None

Expand Down Expand Up @@ -960,6 +961,19 @@ def check_transaction_sanity(tx_info, composed_tx, construct_params):
"p2sh_pretx_txid": (str, None, "Ignored, P2SH disabled"),
"segwit": (bool, False, "Ignored, Segwit automatically detected"),
}
DEPRECATED_CONSTRUCT_PARAMS = [
"fee_per_kb",
"fee_provided",
"dust_return_pubkey",
"return_psbt",
"regular_dust_size",
"multisig_dust_size",
"extended_tx_info",
"old_style_api",
"p2sh_pretx_txid",
"segwit",
"unspent_tx_hash",
]


def prepare_construct_params(construct_params):
Expand All @@ -979,19 +993,7 @@ def prepare_construct_params(construct_params):
cleaned_construct_params.pop(deprecated_param)
# add warnings for deprecated parameters
warnings = []
for field in [
"fee_per_kb",
"fee_provided",
"dust_return_pubkey",
"return_psbt",
"regular_dust_size",
"multisig_dust_size",
"extended_tx_info",
"old_style_api",
"p2sh_pretx_txid",
"segwit",
"unspent_tx_hash",
]:
for field in DEPRECATED_CONSTRUCT_PARAMS:
if field in construct_params and construct_params[field] not in [None, False]:
warnings.append(f"The `{field}` parameter is {CONSTRUCT_PARAMS[field][2].lower()}")

Expand Down
Loading

0 comments on commit 5854ac3

Please sign in to comment.