Skip to content

Commit

Permalink
fix: Harvests
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Oct 12, 2023
1 parent 3c6c5a0 commit def24bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions yearn/v2/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,23 @@ async def _unpack_results(self, results):


class Harvests(ProcessedEvents[int]):
def __init__(self, strategy: Contract):
def __init__(self, strategy: Strategy):
topics = [
[
encode_hex(event_abi_to_log_topic(event))
for event in strategy.abi
if event["type"] == "event" and event["name"] in STRATEGY_EVENTS
]
]
super().__init__(addresses=[str(strategy)], topics=topics)
super().__init__(addresses=[str(strategy.strategy)], topics=topics)
self.strategy = strategy
def _include_event(self, event: _EventItem) -> bool:
return event.name == "Harvested"
# TODO: work this in somehow:
# logger.info("loaded %d harvests %s in %.3fs", len(self._harvests), self.name, time.time() - start)
def _process_event(self, event: _EventItem) -> int:
block = event.block_number
logger.debug("%s harvested on %d", self.name, block)
logger.debug("%s harvested on %d", self.strategy.name, block)
return


Expand Down

0 comments on commit def24bd

Please sign in to comment.