Skip to content

Commit

Permalink
Remove misleading filter (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii authored Oct 9, 2024
1 parent 3beb9a6 commit 142e434
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ def _build_where_statements(
opened_after: t.Optional[DatetimeUTC] = None,
finalized_before: t.Optional[DatetimeUTC] = None,
finalized_after: t.Optional[DatetimeUTC] = None,
finalized: bool | None = None,
resolved: bool | None = None,
liquidity_bigger_than: Wei | None = None,
condition_id_in: list[HexBytes] | None = None,
Expand Down Expand Up @@ -278,12 +277,6 @@ def _build_where_statements(
else:
where_stms["resolutionTimestamp"] = None

if finalized is not None:
if finalized:
where_stms["answerFinalizedTimestamp_not"] = None
else:
where_stms["answerFinalizedTimestamp"] = None

if opened_after:
where_stms["question_"]["openingTimestamp_gt"] = to_int_timestamp(
opened_after
Expand Down Expand Up @@ -363,13 +356,11 @@ def get_omen_binary_markets_simple(
Simplified `get_omen_binary_markets` method, which allows to fetch markets based on the filter_by and sort_by values.
"""
# These values need to be set according to the filter_by value, so they can not be passed as arguments.
finalized: bool | None = None
resolved: bool | None = None
opened_after: DatetimeUTC | None = None
liquidity_bigger_than: Wei | None = None

if filter_by == FilterBy.RESOLVED:
finalized = True
resolved = True
elif filter_by == FilterBy.OPEN:
# We can not use `resolved=False` + `finalized=False` here,
Expand All @@ -386,7 +377,6 @@ def get_omen_binary_markets_simple(

return self.get_omen_binary_markets(
limit=limit,
finalized=finalized,
resolved=resolved,
opened_after=opened_after,
liquidity_bigger_than=liquidity_bigger_than,
Expand All @@ -406,7 +396,6 @@ def get_omen_binary_markets(
opened_after: t.Optional[DatetimeUTC] = None,
finalized_before: t.Optional[DatetimeUTC] = None,
finalized_after: t.Optional[DatetimeUTC] = None,
finalized: bool | None = None,
resolved: bool | None = None,
creator: t.Optional[HexAddress] = None,
creator_in: t.Optional[t.Sequence[HexAddress]] = None,
Expand Down Expand Up @@ -434,7 +423,6 @@ def get_omen_binary_markets(
opened_after=opened_after,
finalized_before=finalized_before,
finalized_after=finalized_after,
finalized=finalized,
resolved=resolved,
condition_id_in=condition_id_in,
id_in=id_in,
Expand Down

0 comments on commit 142e434

Please sign in to comment.