Skip to content

Commit

Permalink
fix: print exception when failed to collect logs from blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
platonfloria authored and zavelevsky committed May 21, 2024
1 parent 504ae10 commit bf3fca8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fastlane_bot/events/event_gatherer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import asyncio
import traceback
from itertools import chain
from typing import Dict, List

import asyncio
import nest_asyncio

from web3 import AsyncWeb3
Expand Down Expand Up @@ -94,4 +95,6 @@ async def _get_logs_recursive(self, from_block: int, to_block: int, topics: List
self._get_logs_recursive(mid_block + 1, to_block, topics)
)
return [log for log_list in log_lists for log in log_list]
else:
traceback.print_exc(e)
return []
3 changes: 3 additions & 0 deletions run_blockchain_terraformer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import math
import traceback
from typing import Tuple, List, Dict

import pandas as pd
Expand Down Expand Up @@ -685,6 +686,8 @@ def get_events_recursive(get_logs: any, start_block: int, end_block: int) -> lis
event_list_1 = get_events_recursive(get_logs, start_block, mid_block)
event_list_2 = get_events_recursive(get_logs, mid_block + 1, end_block)
return event_list_1 + event_list_2
else:
traceback.print_exc(e)
return []


Expand Down

0 comments on commit bf3fca8

Please sign in to comment.