diff --git a/src/telliot_feeds/reporters/tips/listener/funded_feeds.py b/src/telliot_feeds/reporters/tips/listener/funded_feeds.py index d470c46b..6d32c7bc 100644 --- a/src/telliot_feeds/reporters/tips/listener/funded_feeds.py +++ b/src/telliot_feeds/reporters/tips/listener/funded_feeds.py @@ -78,7 +78,7 @@ async def filtered_funded_feeds( ) # for list of previous values, filter out any that weren't eligible for a tip historical_timestamps_list_filtered = self.filter_historical_submissions( - feeds=feeds_timestsamps_and_values_filtered, month_old=month_old_timestamp + feeds=feeds_timestsamps_and_values_filtered ) # get claim status count for every query ids eligible timestamp diff --git a/src/telliot_feeds/reporters/tips/listener/funded_feeds_filter.py b/src/telliot_feeds/reporters/tips/listener/funded_feeds_filter.py index 68a72e28..994a01f3 100644 --- a/src/telliot_feeds/reporters/tips/listener/funded_feeds_filter.py +++ b/src/telliot_feeds/reporters/tips/listener/funded_feeds_filter.py @@ -132,9 +132,7 @@ async def price_change(self, query_data: bytes, value_before: bytes) -> Optional return _get_price_change(previous_val=value_before_decoded, current_val=self.prices[query_id]) - def filter_historical_submissions( - self, feeds: list[QueryIdandFeedDetails], month_old: int - ) -> list[QueryIdandFeedDetails]: + def filter_historical_submissions(self, feeds: list[QueryIdandFeedDetails]) -> list[QueryIdandFeedDetails]: """Check list of values for older submission would've been eligible for a tip if so the timestamps will be checked later to see if a tip for them has been claimed @@ -150,11 +148,6 @@ def filter_historical_submissions( for current, previous in zip( feed.queryid_timestamps_values_list[::-1], feed.queryid_timestamps_values_list[-2::-1] ): - # if current timestamp is before feed start or - # timestamp to check is older than a month then no need to check - if feed.params.startTime > current.timestamp or current.timestamp < month_old: - feed.queryid_timestamps_values_list.remove(current) - continue in_eligibile_window = self.is_timestamp_first_in_window( timestamp_before=previous.timestamp, timestamp_to_check=current.timestamp, diff --git a/src/telliot_feeds/reporters/tips/multicall_functions/multicall_autopay.py b/src/telliot_feeds/reporters/tips/multicall_functions/multicall_autopay.py index 44e9b3ea..f7c63248 100644 --- a/src/telliot_feeds/reporters/tips/multicall_functions/multicall_autopay.py +++ b/src/telliot_feeds/reporters/tips/multicall_functions/multicall_autopay.py @@ -57,6 +57,11 @@ async def month_of_timestamps_and_values( return None, error_status(note) values = multiple_values_response[values_tup] timestamps = multiple_values_response[timestamps_tup] + # remove old timestamps + if timestamps: + timestamps = [ + timestamp for timestamp in timestamps if timestamp > max_age and timestamp >= feed.params.startTime + ] # short circuit the loop since None means failed response and can't calculate tip accurately if values is None: note = "getMultipleValuesBefore call failed" diff --git a/src/telliot_feeds/reporters/tips/tip_amount.py b/src/telliot_feeds/reporters/tips/tip_amount.py index 7e5338b7..5167bef0 100644 --- a/src/telliot_feeds/reporters/tips/tip_amount.py +++ b/src/telliot_feeds/reporters/tips/tip_amount.py @@ -59,7 +59,7 @@ async def fetch_feed_tip( return tip_amount # filter out query id timestamps not eligible for tip - feeds_with_timestamps_filtered = filtr.filter_historical_submissions(eligible_feeds, month_old) + feeds_with_timestamps_filtered = filtr.filter_historical_submissions(eligible_feeds) unclaimed_count, status = await call.rewards_claimed_status_call(feeds_with_timestamps_filtered) diff --git a/tests/feeds/test_diva_usd_feed.py b/tests/feeds/test_diva_usd_feed.py index 7c422244..abe29c1d 100644 --- a/tests/feeds/test_diva_usd_feed.py +++ b/tests/feeds/test_diva_usd_feed.py @@ -15,7 +15,7 @@ async def test_diva_usd_median_feed(): print(f"DIVA/USD Price: {v}") # Get list of data sources from sources dict - source_prices = [source.latest[0] for source in diva_usd_median_feed] + source_prices = [source.latest[0] for source in diva_usd_median_feed.source.sources] print(source_prices) # Make sure error is less than decimal tolerance