Skip to content

Commit

Permalink
Temporary retry reverted erros (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii authored Feb 25, 2025
1 parent 9434c35 commit 256341f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions prediction_market_agent_tooling/tools/web3_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def _prepare_tx_params(

@tenacity.retry(
# Don't retry on `reverted` messages, as they would always fail again.
retry=tenacity.retry_if_exception_message(match=NOT_REVERTED_ICASE_REGEX_PATTERN),
# TODO: Check this, see https://github.com/gnosis/prediction-market-agent-tooling/issues/625.
# retry=tenacity.retry_if_exception_message(match=NOT_REVERTED_ICASE_REGEX_PATTERN),
wait=tenacity.wait_chain(*[tenacity.wait_fixed(n) for n in range(1, 10)]),
stop=tenacity.stop_after_attempt(9),
after=lambda x: logger.debug(
Expand Down Expand Up @@ -201,7 +202,8 @@ def send_function_on_contract_tx(

@tenacity.retry(
# Don't retry on `reverted` messages, as they would always fail again.
retry=tenacity.retry_if_exception_message(match=NOT_REVERTED_ICASE_REGEX_PATTERN),
# TODO: Check this, see https://github.com/gnosis/prediction-market-agent-tooling/issues/625.
# retry=tenacity.retry_if_exception_message(match=NOT_REVERTED_ICASE_REGEX_PATTERN),
wait=tenacity.wait_chain(*[tenacity.wait_fixed(n) for n in range(1, 10)]),
stop=tenacity.stop_after_attempt(5),
after=lambda x: logger.debug(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "prediction-market-agent-tooling"
version = "0.59.0"
version = "0.59.1"
description = "Tools to benchmark, deploy and monitor prediction market agents."
authors = ["Gnosis"]
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def test_contract_implements_function(
)


@pytest.mark.skip(
reason="See https://github.com/gnosis/prediction-market-agent-tooling/issues/625"
)
def test_wont_retry(local_web3: Web3, accounts: list[TestAccount]) -> None:
value = xdai_to_wei(xDai(10))
from_account = accounts[0]
Expand Down

0 comments on commit 256341f

Please sign in to comment.