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

fix: more source traceback improvements [APE-1335] #1636

Merged

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Aug 29, 2023

What I did

This helps in the case when a transaction fails before a dev message and a user gets confuses as like ape is not actually finding the dev message when actually the line it is failing on earlier. This PR shows the source traceback in that case.

before it was this:

/Users/jules/ApeProjects/yearn-vesting-escrow/tests/functional/VestingEscrowFactory/test_deploy_escrow.py:269: in test_vyper_donation
    with ape.reverts(dev_message="dev: lost donation"):

now it looks like this:

/Users/jules/ApeProjects/yearn-vesting-escrow/tests/functional/VestingEscrowFactory/test_deploy_escrow.py:269: in test_vyper_donation
    with ape.reverts(dev_message="dev: lost donation"):
E   AssertionError: Could not find the source of the revert.
E   Traceback (most recent call last)
E     File /Users/jules/ApeProjects/yearn-vesting-escrow/contracts/VestingEscrowFactory.vy, in deploy_vesting_contract
E     -->  92         vesting_start + vesting_duration,
E          93         cliff_length,
E          94         open_claim,
E          95     )
E          96     # skip transferFrom and approve and send directly to escrow
E          97     assert token.transferFrom(msg.sender, escrow, amount, default_return_value=True)  # dev: funding failed

How I did it

How to verify it

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@vany365 vany365 changed the title fix: show source traceback when can't find dev message fix: show source traceback when can't find dev message [APE-1335] Aug 29, 2023
@antazoey antazoey changed the title fix: show source traceback when can't find dev message [APE-1335] fix: more source traceback improvements [APE-1335] Aug 29, 2023
@antazoey
Copy link
Member Author

Please help me merge :<

@antazoey antazoey merged commit 0429b36 into ApeWorX:main Aug 29, 2023
15 checks passed
@antazoey antazoey deleted the feat/show-source-tb-on-fail-dev-message branch August 29, 2023 22:30
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

Successfully merging this pull request may close these issues.

2 participants