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

Btc bal2 #739

Merged
merged 3 commits into from
Jan 30, 2024
Merged
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
5 changes: 5 additions & 0 deletions src/telliot_feeds/sources/btc_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ async def get_response(self) -> Optional[Any]:
logger.info("No transactions for this address")
return 0

for tx in data["txs"]:
if not tx.get("block_height") or not isinstance(tx["block_height"], int):
logger.error("Invalid transaction found: missing or non-integer block_height")
return None

# Sort transactions by time in ascending order
sorted_txs = sorted(data["txs"], key=lambda tx: (tx["block_height"], tx["tx_index"]))

Expand Down
Loading