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 verbose mode in get transactions endpoints #3066

Merged
merged 1 commit into from
Mar 4, 2025
Merged
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
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 @@
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
Loading