Skip to content

Commit

Permalink
refactor: remove invalid instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantios committed Oct 30, 2023
1 parent 4e3eb1b commit 986cac7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/valory/contracts/conditional_tokens/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def check_redeemed(
) -> JSONLike:
"""Filter to find out whether a position has already been redeemed."""
earliest_block = DEFAULT_FROM_BLOCK
earliest_condition_id = HexBytes("")

for condition_id, from_block in from_block_numbers.items():
if (
Expand All @@ -64,7 +63,6 @@ def check_redeemed(
or earliest_block == DEFAULT_FROM_BLOCK
):
earliest_block = from_block
earliest_condition_id = condition_id

contract_instance = cls.get_instance(ledger_api, contract_address)
to_checksum = ledger_api.api.to_checksum_address
Expand All @@ -90,11 +88,9 @@ def check_redeemed(
except (Urllib3ReadTimeoutError, RequestsReadTimeoutError):
msg = (
"The RPC timed out! This usually happens if the filtering is too wide. "
f"The service tried to filter from block {earliest_block} to latest, "
f"The service tried to filter from block {earliest_block} to latest, with a step {chunk_size},"
f"as the earliest market creation transaction took place at block {earliest_block}. "
f"Did the creation happen too long in the past?\n"
f"The market with condition id {earliest_condition_id!r} "
f"is the oldest one and the block filtering was set based on it."
f"If this issue persists, please try lowering the step size!"
)
return dict(error=msg)

Expand Down

0 comments on commit 986cac7

Please sign in to comment.