Skip to content

Commit

Permalink
test with broadcast instead send
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Oct 2, 2024
1 parent 23a35de commit ea9fb36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion counterparty-core/counterpartycore/lib/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def check_transaction_sanity(db, source, tx_info, unsigned_tx_hex, encoding, inp
if encoding == "p2sh":
# make_canonical can't determine the address, so we blindly change the desired to the parsed
desired_source = parsed_source
desired_destination = parsed_destination
except exceptions.BTCOnlyError:
# Skip BTC‐only transactions.
return
Expand Down
18 changes: 10 additions & 8 deletions counterparty-core/counterpartycore/test/regtest/testp2sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ def send_funds_to_address(address):

# generate unsigned pretx
unsigned_pretx_hex = api_call(
f"addresses/{str(address)}/compose/send",
f"addresses/{str(address)}/compose/broadcast",
{
"asset": "XCP",
"quantity": 5000,
"destination": destination_address,
"value": 1,
"fee_fraction": 0.5,
"timestamp": 4003903985,
"text": "un broadcast avec une transaction p2sh",
"encoding": "p2sh",
"fee_per_kb": 1000,
"pubkeys": secret_key.pub.hex(),
Expand All @@ -172,11 +173,12 @@ def send_funds_to_address(address):

# generate final tx
unsigned_finaltx_hex = api_call(
f"addresses/{str(address)}/compose/send",
f"addresses/{str(address)}/compose/broadcast",
{
"asset": "XCP",
"quantity": 5000,
"destination": destination_address,
"value": 1,
"fee_fraction": 0.5,
"timestamp": 4003903985,
"text": "un broadcast avec une transaction p2sh",
"encoding": "p2sh",
"fee_per_kb": 1000,
"pubkeys": secret_key.pub.hex(),
Expand Down

0 comments on commit ea9fb36

Please sign in to comment.