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

feat(invariant): extend the export of failed case to include traces as well #8114

Open
grandizzy opened this issue Jun 8, 2024 · 2 comments
Labels
A-testing Area: testing C-forge Command: forge T-feature Type: feature

Comments

@grandizzy
Copy link
Collaborator

grandizzy commented Jun 8, 2024

#7899 introduced the ability of recording invariant failure (json format) and replaying, per comment below would be nice to include the traces too

          I don't have a strong sense of what the right format would be but it would be nice to extend the export of https://github.com/foundry-rs/foundry/pull/7899 to include the traces of unit tests as well

Originally posted by @0xalpharush in #2552 (comment)

@grandizzy grandizzy changed the title feat: extend the export of failed case to include traces of unit tests as well feat: extend the export of failed case to include traces as well Jun 8, 2024
@grandizzy grandizzy added the T-feature Type: feature label Jun 8, 2024
@grandizzy grandizzy changed the title feat: extend the export of failed case to include traces as well feat(invariant): extend the export of failed case to include traces as well Jun 8, 2024
@grandizzy
Copy link
Collaborator Author

@0xalpharush wdyt if we dump in a invariant_function.trace file the same output as when -vvvv?

@0xalpharush
Copy link
Contributor

The -vvvv may be useful, too, but I meant something different and wasn't clear. I'm asking for unit tests to also be made available in a JSON format such as the one the corpus is in like:

[
  {
    "sender": "0x0000000000000000000000000000000000000003",
    "addr": "0x2e234dae75c793f67a35089c9d99245e1c58470b",
    "calldata": "0x6d4354210000000000000000000000007fa9385be102ac3eac297483dd6233d62b3e14960000000000000000000000000000000000000000000000000000000000000e72",
    "contract_name": "test/Owned.t.sol:Handler",
    "signature": "transferOwnership(address,address)",
    "args": "0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496, 0x0000000000000000000000000000000000000e72"
  },
  {
    "sender": "0x0000000000000000000000000000000000000001",
    "addr": "0x2e234dae75c793f67a35089c9d99245e1c58470b",
    "calldata": "0x51710e450000000000000000000000000000000000000000000000000000000000000e72",
    "contract_name": "test/Owned.t.sol:Handler",
    "signature": "acceptOwnership(address)",
    "args": "0x0000000000000000000000000000000000000e72"
  }
]

@zerosnacks zerosnacks added A-testing Area: testing C-forge Command: forge labels Jul 16, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy grandizzy removed this from the v1.0.0 milestone Oct 1, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing Area: testing C-forge Command: forge T-feature Type: feature
Projects
Status: Todo
Development

No branches or pull requests

3 participants