Skip to content

Commit

Permalink
Merge pull request #183 from valory-xyz/fix/redemption-simulation
Browse files Browse the repository at this point in the history
fix: handle `ContractLogicError` on simulation
  • Loading branch information
0xArdi authored Dec 19, 2023
2 parents 3bbba77 + 5c2bcb4 commit 5317c51
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
12 changes: 6 additions & 6 deletions packages/packages.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion packages/valory/contracts/realitio/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/contracts/realitio/contract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/trader/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
---
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/decision_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/trader_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5317c51

Please sign in to comment.