Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverts in constructor aren't correctly handled #251

Open
hacker-DOM opened this issue Jun 26, 2023 · 2 comments
Open

Reverts in constructor aren't correctly handled #251

hacker-DOM opened this issue Jun 26, 2023 · 2 comments

Comments

@hacker-DOM
Copy link
Contributor

Consider:

// A.sol
contract A {
    constructor() { revert(); }
}
# script.py
from woke.testing import *
from pytypes.A import A

@default_chain.connect()
def script():
    default_chain.set_default_accounts(default_chain.accounts[0])
    with must_revert() as e:
        a = A.deploy()

script()

I would expect the error to be caught (correct me if my estimate is wrong). Instead, I get

Launching anvil --prune-history 100 --transaction-block-keeper 10 --steps-tracing --silent --port 59103
Traceback (most recent call last):
  File "script.py", line 10, in <module>
    script()
  ...
  File "/Users/dteiml/.virtualenvs/23-06-rs-sudoku/lib/python3.8/site-packages/woke/development/transactions.py", line 460, in raw_error
    self._trace_transaction[0]["result"]["output"][2:]
KeyError: 'output'
@michprev
Copy link
Member

This is a bug in Anvil (+ ethers-rs):
foundry-rs/foundry#4853
gakonst/ethers-rs#2392

@michprev
Copy link
Member

Implemented a workaround in 0b7ba19 at a cost of decreased performance (we need to fetch debug_traceTransaction instead of trace_transaction).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants