Skip to content

Commit

Permalink
bugfixes for tenderly_event_exchanges setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewcasale committed Sep 28, 2023
1 parent c4e6844 commit 7439083
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions fastlane_bot/data/tokens.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4177,3 +4177,4 @@
4175,PXLDY-F051,PXLDY,PXLDY,0xbC91A632E78db7c74508Ea26e91B266aa235F051,18
4176,AURA-16bE,AURA,AURA,0x6047e101aaa9Ab9b02fe5Cbc1DD03c2C7C8516bE,18
4177,REMIO-Fdbc,REMIO,REMIO,0xa35Bd2246978Dfbb1980DFf8Ff0f5834335dFdbc,18
4178,RNB-e743,RNB,RNB,0x2A039B1D9bBDccBb91be28691b730ca893e5e743,18
13 changes: 8 additions & 5 deletions fastlane_bot/events/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ def handle_tenderly_event_exchanges(cfg: Config, exchanges: str, tenderly_fork_i
if not tenderly_fork_id:
return []

if not exchanges or exchanges == "None":
return []

exchanges = exchanges.split(",") if exchanges else []
cfg.logger.info(f"Running data fetching for exchanges: {exchanges}")
return exchanges
Expand Down Expand Up @@ -1033,16 +1036,16 @@ def get_latest_events(
List[Any]
A list of the latest events.
"""
tenderly_tenderly_events = []
tenderly_pol_events = []

if mgr.tenderly_fork_id:
if mgr.tenderly_fork_id and 'bancor_pol' in mgr.tenderly_event_exchanges:
tenderly_pol_events = get_tenderly_pol_events(
mgr=mgr,
start_block=start_block,
current_block=current_block,
tenderly_fork_id=mgr.tenderly_fork_id,
)
mgr.cfg.logger.info(f"carbon_pol_events: {len(tenderly_tenderly_events)}")
mgr.cfg.logger.info(f"carbon_pol_events: {len(tenderly_pol_events)}")

# Get all event filters, events, and flatten them
events = [
Expand All @@ -1060,8 +1063,8 @@ def get_latest_events(
latest_events = filter_latest_events(mgr, events)

if mgr.tenderly_fork_id:
if tenderly_tenderly_events:
latest_tenderly_events = filter_latest_events(mgr, tenderly_tenderly_events)
if tenderly_pol_events:
latest_tenderly_events = filter_latest_events(mgr, tenderly_pol_events)
latest_events += latest_tenderly_events

# remove the events from any mgr.tenderly_event_exchanges exchanges
Expand Down

0 comments on commit 7439083

Please sign in to comment.