Skip to content

Commit

Permalink
Fix verbose mode in get transactions endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Mar 4, 2025
1 parent 9e2b2dd commit 349f021
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion counterparty-core/counterpartycore/lib/api/verbose.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def inject_details(ledger_db, state_db, result, table=None):
result_list = [result]
result_is_dict = True

if table == "transactions":
if table in ["transactions", "all_transactions"]:

Check warning on line 543 in counterparty-core/counterpartycore/lib/api/verbose.py

View check run for this annotation

Codecov / codecov/patch

counterparty-core/counterpartycore/lib/api/verbose.py#L543

Added line #L543 was not covered by tests
result_list = inject_transactions_events(ledger_db, state_db, result_list)
result_list = inject_unpacked_data(ledger_db, result_list)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,11 @@ def unpack_mock(*args):
assert "unpacked_data" in result[0]
assert "error" in result[0]["unpacked_data"]
assert result[0]["unpacked_data"]["error"] == "Could not unpack data"


def test_get_all_transactions_verbose(apiv2_client):
url = "/v2/transactions?verbose=true&show_unconfirmed=true"
result = apiv2_client.get(url).json["result"]
for tx in result:
assert "unpacked_data" in tx
assert "message_data" in tx["unpacked_data"]
1 change: 1 addition & 0 deletions release-notes/release-notes-v11.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ counterparty-server start

- Fix verbose mode when unpack fails
- Handle correctly `DatabaseError` on API calls
- Fix verbose mode in get transactions endpoints

## Codebase

Expand Down

0 comments on commit 349f021

Please sign in to comment.