feat(forge): Add call tracing support by brockelmore · Pull Request #192 · foundry-rs/foundry (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation25 Commits40 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

brockelmore

Adds a CallTrace struct that is built up inside a cheatcode executor. This PR tracks the status

[x] Accumulates all calls
[x] Accumulates all logs
[x] Logs are correctly placed in order relative to calls (may not be possible with sputnik)
[x] Pretty print call tree
[x] Pretty print call inputs
[x] Pretty print logs
[x] Report gas
[x] Parse contract bytecode into contract name

transmissions11, jparklev, odyslam, gakonst, tarrencev, DiveInto, zerosnacks, mds1, nanexcool, mattsse, and 4 more reacted with heart emoji joshieDo, nanexcool, and refcell reacted with rocket emoji

@brockelmore

@brockelmore

@brockelmore

@brockelmore

@brockelmore

colored prints, better dev ux, verbosity > 2 trace printing

@brockelmore

@brockelmore

I think this is ready for review - some improvements still needed like pretty printing ethers::abi::Token.

Traces will be printed if verbosity > 2.

Screen Shot 2021-12-11 at 9 48 48 PM

@brockelmore brockelmore changed the title[WIP] Add call tracing support feat: Add call tracing support

Dec 12, 2021

brockelmore

brockelmore

@brockelmore

@brockelmore brockelmore changed the titlefeat: Add call tracing support feat(forge): Add call tracing support

Dec 17, 2021

@brockelmore

@brockelmore

Once this issue is fixed, this should be production ready

@brockelmore

Here is what it looks like once the above issue is fixed (or with an empty out directory):
Screen Shot 2021-12-23 at 10 27 00 AM

Here is what it looks like without the fix (& for contracts that can't be identified):
Screen Shot 2021-12-23 at 10 27 17 AM

gakonst

gakonst

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFG

@brockelmore

@brockelmore

gakonst

@brockelmore

@mds1 mds1 mentioned this pull request

Dec 27, 2021

8 tasks

clifton pushed a commit to clifton/foundry that referenced this pull request

Dec 27, 2021

@brockelmore @clifton

colored prints, better dev ux, verbosity > 2 trace printing

2 participants

@brockelmore @gakonst