prediction-market-agent-tooling 0.48.4__py3-none-any.whl → 0.48.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,9 +60,7 @@ def tavily_search(
60
60
  return response_parsed
61
61
 
62
62
 
63
- @tenacity.retry(
64
- stop=tenacity.stop_after_attempt(3), wait=tenacity.wait_fixed(1), reraise=True
65
- )
63
+ @tenacity.retry(stop=tenacity.stop_after_attempt(3), wait=tenacity.wait_fixed(1))
66
64
  def _tavily_search(
67
65
  query: str,
68
66
  search_depth: t.Literal["basic", "advanced"],
@@ -28,6 +28,7 @@ from prediction_market_agent_tooling.loggers import logger
28
28
  ONE_NONCE = Nonce(1)
29
29
  ONE_XDAI = xdai_type(1)
30
30
  ZERO_BYTES = HexBytes(HASH_ZERO)
31
+ NOT_REVERTED_ICASE_REGEX_PATTERN = "(?i)(?!.*reverted.*)"
31
32
 
32
33
 
33
34
  def private_key_to_public_key(private_key: SecretStr) -> ChecksumAddress:
@@ -154,11 +155,8 @@ def _prepare_tx_params(
154
155
 
155
156
 
156
157
  @tenacity.retry(
157
- # Retry only for the transaction errors that match the given patterns,
158
- # add other retrieable errors gradually to be safe.
159
- retry=tenacity.retry_if_exception_message(
160
- match="(.*wrong transaction nonce.*)|(.*Invalid.*)|(.*OldNonce.*)"
161
- ),
158
+ # Don't retry on `reverted` messages, as they would always fail again.
159
+ retry=tenacity.retry_if_exception_message(match=NOT_REVERTED_ICASE_REGEX_PATTERN),
162
160
  wait=tenacity.wait_chain(*[tenacity.wait_fixed(n) for n in range(1, 10)]),
163
161
  stop=tenacity.stop_after_attempt(9),
164
162
  after=lambda x: logger.debug(
@@ -194,11 +192,8 @@ def send_function_on_contract_tx(
194
192
 
195
193
 
196
194
  @tenacity.retry(
197
- # Retry only for the transaction errors that match the given patterns,
198
- # add other retrieable errors gradually to be safe.
199
- retry=tenacity.retry_if_exception_message(
200
- match="(.*wrong transaction nonce.*)|(.*Invalid.*)|(.*OldNonce.*)"
201
- ),
195
+ # Don't retry on `reverted` messages, as they would always fail again.
196
+ retry=tenacity.retry_if_exception_message(match=NOT_REVERTED_ICASE_REGEX_PATTERN),
202
197
  wait=tenacity.wait_chain(*[tenacity.wait_fixed(n) for n in range(1, 10)]),
203
198
  stop=tenacity.stop_after_attempt(9),
204
199
  after=lambda x: logger.debug(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.48.4
3
+ Version: 0.48.5
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.12
@@ -74,11 +74,11 @@ prediction_market_agent_tooling/tools/safe.py,sha256=h0xOO0eNtitClf0fPkn-0oTc6A_
74
74
  prediction_market_agent_tooling/tools/singleton.py,sha256=CiIELUiI-OeS7U7eeHEt0rnVhtQGzwoUdAgn_7u_GBM,729
75
75
  prediction_market_agent_tooling/tools/streamlit_user_login.py,sha256=NXEqfjT9Lc9QtliwSGRASIz1opjQ7Btme43H4qJbzgE,3010
76
76
  prediction_market_agent_tooling/tools/tavily_storage/tavily_models.py,sha256=dr-N-G67f4au6s5xLwZPNbKhe4BFaEuYpQTn0KZ4EKg,4377
77
- prediction_market_agent_tooling/tools/tavily_storage/tavily_storage.py,sha256=QLcDiYIdtJPxvHlRODSjt9GH3WqWCEmODr4C7SpaMAg,3214
77
+ prediction_market_agent_tooling/tools/tavily_storage/tavily_storage.py,sha256=eln3BygdfsDf8WOlSQPL7qH946QnGnThRkazRZKBA8o,3194
78
78
  prediction_market_agent_tooling/tools/utils.py,sha256=JE9YWtPPhnTgLiOyGAZDNG5K8nCwUY9IZEuAlm9UcxA,6611
79
- prediction_market_agent_tooling/tools/web3_utils.py,sha256=nKRHmdLnWSKd3wpo-cysXGvhhrJ2Yf69sN2FFQfSt6s,10578
80
- prediction_market_agent_tooling-0.48.4.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
81
- prediction_market_agent_tooling-0.48.4.dist-info/METADATA,sha256=IDncr-pN2VX2yh_Pge35GzRyMTTUds8PcUBcAm52U7o,7810
82
- prediction_market_agent_tooling-0.48.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
83
- prediction_market_agent_tooling-0.48.4.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
84
- prediction_market_agent_tooling-0.48.4.dist-info/RECORD,,
79
+ prediction_market_agent_tooling/tools/web3_utils.py,sha256=euq_MH-LhTowACq42colks2IXxZQjqjuisYl91EYZtU,10440
80
+ prediction_market_agent_tooling-0.48.5.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
81
+ prediction_market_agent_tooling-0.48.5.dist-info/METADATA,sha256=T6nk1eHBTZTrt6UXFqHHb2gPP7K_2TEe_orSRBQIuCM,7810
82
+ prediction_market_agent_tooling-0.48.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
83
+ prediction_market_agent_tooling-0.48.5.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
84
+ prediction_market_agent_tooling-0.48.5.dist-info/RECORD,,