From 5c2bcb46ef8d423a7412227c71bc577b91ffbc0b Mon Sep 17 00:00:00 2001 From: Ardian Date: Fri, 15 Dec 2023 17:15:51 +0100 Subject: [PATCH] fix: handle `ContractLogicError` on simulation --- packages/packages.json | 12 ++++++------ packages/valory/agents/trader/aea-config.yaml | 8 ++++---- packages/valory/contracts/realitio/contract.py | 3 ++- packages/valory/contracts/realitio/contract.yaml | 2 +- packages/valory/services/trader/service.yaml | 2 +- .../valory/skills/decision_maker_abci/skill.yaml | 2 +- packages/valory/skills/trader_abci/skill.yaml | 4 ++-- .../skills/tx_settlement_multiplexer_abci/skill.yaml | 2 +- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 1eaf51333..9d3829635 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,15 +1,15 @@ { "dev": { "skill/valory/market_manager_abci/0.1.0": "bafybeiei62pni5gej5wzf3wp3olwnxxrahqvlnlupedgjwvwgj3v7pnraq", - "skill/valory/decision_maker_abci/0.1.0": "bafybeihpno55l2qntzgxg4nkjlig5lcnnmwdkpy3udkdjwtsmyscvnxini", - "skill/valory/trader_abci/0.1.0": "bafybeifmqlvqhsiqhhq3udlgqwzpzlxb7yq4obnpwjpnnroxgzh3tocapm", + "skill/valory/decision_maker_abci/0.1.0": "bafybeidjsnb373piss6mhrcb2arrfqdrtsxsk7gbdmhlvzzreud5pzqjoa", + "skill/valory/trader_abci/0.1.0": "bafybeifhrrqnx362tzpjrwxrmwn7imzeqe6ovdgyi5tjylf4g5wetfnlmq", "contract/valory/market_maker/0.1.0": "bafybeiehszwvmurz5b5vpqbxbvcm5ty4z553jqpsnernqwdq6d62r3z5wa", - "agent/valory/trader/0.1.0": "bafybeidkh3i2sjau77f5v3p4qi3xyatzbu2zn7gbyfu2tjvpg3r6agvfya", - "service/valory/trader/0.1.0": "bafybeigsis5lrhzox43cgt4ydooighjjxfli5v7xybavfpodvxdplrsvtq", + "agent/valory/trader/0.1.0": "bafybeidxhwzmm5e5eti5c3uxsgpgj2wsk5e4aydm2l4iajzqpsk47kh6gy", + "service/valory/trader/0.1.0": "bafybeich7ewea6a7x3sgo26y5bjn4qqgjxbnr5sofvd46gkoebv6w74tau", "contract/valory/erc20/0.1.0": "bafybeihisiakfcftxs2hwx7yxzovao4qjuk3kqbzntiekzv5v75vpax3ui", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeib3rfkqpers7wrlunrifoeecz4rglhj7t6ggv23tpzq7j6wmjj24e", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeib6ndzgd25ujflzb37hg7yozmqv5tubxdipgnnppaygz4nv545r3m", "contract/valory/mech/0.1.0": "bafybeigvha4ya64ccjl7tbroa3zjqlxm64wxsqx5k2cz2xs3a7igu5qgxa", - "contract/valory/realitio/0.1.0": "bafybeiblpni6gvg6vyw5tsyxwllfitnre7waz6eeoyutt2qmox7zvjat6q", + "contract/valory/realitio/0.1.0": "bafybeic5ie4oodetj4krdogydvbfxg4qggc3matpiflocah626tpevpreq", "contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4", "contract/valory/conditional_tokens/0.1.0": "bafybeigucumqbsk74nj4rpm4p2cpiky4dj6uws7nfmgpimuviaxcamwqnu", "contract/valory/agent_registry/0.1.0": "bafybeicznp6b7t7n6gju35xa2mr2vo3vshtj72l5odwhtdvz3uard27csq", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index f27fe5106..901c6ed0a 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -23,7 +23,7 @@ contracts: - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeigvha4ya64ccjl7tbroa3zjqlxm64wxsqx5k2cz2xs3a7igu5qgxa - valory/conditional_tokens:0.1.0:bafybeigucumqbsk74nj4rpm4p2cpiky4dj6uws7nfmgpimuviaxcamwqnu -- valory/realitio:0.1.0:bafybeiblpni6gvg6vyw5tsyxwllfitnre7waz6eeoyutt2qmox7zvjat6q +- valory/realitio:0.1.0:bafybeic5ie4oodetj4krdogydvbfxg4qggc3matpiflocah626tpevpreq - valory/realitio_proxy:0.1.0:bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4 - valory/agent_registry:0.1.0:bafybeicznp6b7t7n6gju35xa2mr2vo3vshtj72l5odwhtdvz3uard27csq - valory/service_staking_token:0.1.0:bafybeifrbsyszkg6hhqnx32ha2wwyidi2nzaece74niopsnzmb4szbpahi @@ -43,10 +43,10 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeidzajbe3erygeh2xbd6lrjv7nsptznjuzrt24ykgvhgotdeyhfnba - valory/termination_abci:0.1.0:bafybeie4zvjfxvdu7qrulmur3chpjz3kpj5m4bjsxvpk4gvj5zbyyayfaa - valory/transaction_settlement_abci:0.1.0:bafybeiaefgqbs7zsn5xe5kdwrujj7ivygkn3ujpw6crnvi3knvxw75qmja -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeib3rfkqpers7wrlunrifoeecz4rglhj7t6ggv23tpzq7j6wmjj24e +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeib6ndzgd25ujflzb37hg7yozmqv5tubxdipgnnppaygz4nv545r3m - valory/market_manager_abci:0.1.0:bafybeiei62pni5gej5wzf3wp3olwnxxrahqvlnlupedgjwvwgj3v7pnraq -- valory/decision_maker_abci:0.1.0:bafybeihpno55l2qntzgxg4nkjlig5lcnnmwdkpy3udkdjwtsmyscvnxini -- valory/trader_abci:0.1.0:bafybeifmqlvqhsiqhhq3udlgqwzpzlxb7yq4obnpwjpnnroxgzh3tocapm +- valory/decision_maker_abci:0.1.0:bafybeidjsnb373piss6mhrcb2arrfqdrtsxsk7gbdmhlvzzreud5pzqjoa +- valory/trader_abci:0.1.0:bafybeifhrrqnx362tzpjrwxrmwn7imzeqe6ovdgyi5tjylf4g5wetfnlmq - valory/staking_abci:0.1.0:bafybeiebu4qeblyjbacjvkiiiorxb4p3yy4nuhvsssgbailmqqtgrhwcca default_ledger: ethereum required_ledgers: diff --git a/packages/valory/contracts/realitio/contract.py b/packages/valory/contracts/realitio/contract.py index 946ba9732..827da4404 100644 --- a/packages/valory/contracts/realitio/contract.py +++ b/packages/valory/contracts/realitio/contract.py @@ -29,6 +29,7 @@ from eth_typing import ChecksumAddress from requests.exceptions import ReadTimeout as RequestsReadTimeoutError from urllib3.exceptions import ReadTimeoutError as Urllib3ReadTimeoutError +from web3.exceptions import ContractLogicError ClaimParamsType = Tuple[ List[bytes], List[ChecksumAddress], List[int], List[bytes] @@ -161,7 +162,7 @@ def simulate_claim_winnings( } ) simulation_ok = True - except ValueError as e: + except (ValueError, ContractLogicError) as e: _logger.info(f"Simulation failed: {str(e)}") simulation_ok = False return dict(data=simulation_ok) diff --git a/packages/valory/contracts/realitio/contract.yaml b/packages/valory/contracts/realitio/contract.yaml index 1035fad94..8222c8064 100644 --- a/packages/valory/contracts/realitio/contract.yaml +++ b/packages/valory/contracts/realitio/contract.yaml @@ -8,7 +8,7 @@ aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeictahkgfmlqv5kksvj6klmxtmjdpeq4sp3x7dp2yr5x4kmzbcihse build/Realitio.json: bafybeiagi7zoeoy5s7duhg4oeuekj2s6z5mad2z6g2pn3n5elsvze25qiu - contract.py: bafybeih4zkq2kb25rqtzmjkqemykh46rndfyqqrurbpoojgwqqj6ui5ohm + contract.py: bafybeibqoyx5qde7orx7ftgmzn2crhetujsqd3xtuwrgqegkfdihrv2bn4 fingerprint_ignore_patterns: [] class_name: RealitioContract contract_interface_paths: diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index c90cfc9a0..808566c31 100644 --- a/packages/valory/services/trader/service.yaml +++ b/packages/valory/services/trader/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeidkh3i2sjau77f5v3p4qi3xyatzbu2zn7gbyfu2tjvpg3r6agvfya +agent: valory/trader:0.1.0:bafybeidxhwzmm5e5eti5c3uxsgpgj2wsk5e4aydm2l4iajzqpsk47kh6gy number_of_agents: 4 deployment: {} --- diff --git a/packages/valory/skills/decision_maker_abci/skill.yaml b/packages/valory/skills/decision_maker_abci/skill.yaml index 28518e50a..a2ad3db86 100644 --- a/packages/valory/skills/decision_maker_abci/skill.yaml +++ b/packages/valory/skills/decision_maker_abci/skill.yaml @@ -56,7 +56,7 @@ contracts: - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y - valory/mech:0.1.0:bafybeigvha4ya64ccjl7tbroa3zjqlxm64wxsqx5k2cz2xs3a7igu5qgxa - valory/conditional_tokens:0.1.0:bafybeigucumqbsk74nj4rpm4p2cpiky4dj6uws7nfmgpimuviaxcamwqnu -- valory/realitio:0.1.0:bafybeiblpni6gvg6vyw5tsyxwllfitnre7waz6eeoyutt2qmox7zvjat6q +- valory/realitio:0.1.0:bafybeic5ie4oodetj4krdogydvbfxg4qggc3matpiflocah626tpevpreq - valory/realitio_proxy:0.1.0:bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4 - valory/agent_registry:0.1.0:bafybeicznp6b7t7n6gju35xa2mr2vo3vshtj72l5odwhtdvz3uard27csq protocols: diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 95ce670a0..11c4768cc 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -25,8 +25,8 @@ skills: - valory/transaction_settlement_abci:0.1.0:bafybeiaefgqbs7zsn5xe5kdwrujj7ivygkn3ujpw6crnvi3knvxw75qmja - valory/termination_abci:0.1.0:bafybeie4zvjfxvdu7qrulmur3chpjz3kpj5m4bjsxvpk4gvj5zbyyayfaa - valory/market_manager_abci:0.1.0:bafybeiei62pni5gej5wzf3wp3olwnxxrahqvlnlupedgjwvwgj3v7pnraq -- valory/decision_maker_abci:0.1.0:bafybeihpno55l2qntzgxg4nkjlig5lcnnmwdkpy3udkdjwtsmyscvnxini -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeib3rfkqpers7wrlunrifoeecz4rglhj7t6ggv23tpzq7j6wmjj24e +- valory/decision_maker_abci:0.1.0:bafybeidjsnb373piss6mhrcb2arrfqdrtsxsk7gbdmhlvzzreud5pzqjoa +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeib6ndzgd25ujflzb37hg7yozmqv5tubxdipgnnppaygz4nv545r3m - valory/staking_abci:0.1.0:bafybeiebu4qeblyjbacjvkiiiorxb4p3yy4nuhvsssgbailmqqtgrhwcca behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 9f0d894ae..8c3e505c0 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -21,7 +21,7 @@ protocols: - valory/ledger_api:1.0.0:bafybeige5agrztgzfevyglf7mb4o7pzfttmq4f6zi765y4g2zvftbyowru skills: - valory/abstract_round_abci:0.1.0:bafybeiaqcl7h2famylusiffigwem7tevkcsyocdu5xd42jkmgq6kvowzgq -- valory/decision_maker_abci:0.1.0:bafybeihpno55l2qntzgxg4nkjlig5lcnnmwdkpy3udkdjwtsmyscvnxini +- valory/decision_maker_abci:0.1.0:bafybeidjsnb373piss6mhrcb2arrfqdrtsxsk7gbdmhlvzzreud5pzqjoa - valory/staking_abci:0.1.0:bafybeiebu4qeblyjbacjvkiiiorxb4p3yy4nuhvsssgbailmqqtgrhwcca behaviours: main: