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

Ramain traces in json ouput #7166

Closed
suxnju opened this issue Feb 19, 2024 · 4 comments
Closed

Ramain traces in json ouput #7166

suxnju opened this issue Feb 19, 2024 · 4 comments
Labels
T-feature Type: feature

Comments

@suxnju
Copy link

suxnju commented Feb 19, 2024

Component

Forge

Describe the feature you would like

Ramain traces in json ouput for the latest version 0.2.0 (1bb2d67 2024-02-19T00:17:15.443050638Z) like in old version (e.g., 0.2.0 (638bd2e 2023-05-23T09:59:16.241585900Z).

version: forge 0.2.0 (1bb2d67 2024-02-19T00:17:15.443050638Z)
system: ubuntu
command: forge test --contracts ./test.sol -vvvvv -j --ffi > ./test.json
output:

{
    "test-FFI-diff.sol:DiffFuzzTest": {
        "duration": {
            "secs": 0,
            "nanos": 2566898
        },
        "test_results": {
            "test_diff()": {
                "status": "Success",
                "reason": null,
                "counterexample": null,
                "logs": [],
                "decoded_logs": [],
                "kind": {
                    "Standard": 207879
                },
                "labeled_addresses": {},
                "debug": null,
                "breakpoints": {}
            }
        },
        "warnings": []
    }
}

expected behavior: traces in test_diff()

Additional context

I have a small question, the result display in console and export the json are different, how to achieve consistency?

For example, the returned data of VM::stopAndReturnStateDiff() is structed like
image

But the data in json file is raw data. Here, I used old version 0.2.0 (638bd2e 2023-05-23T09:59:16.241585900Z)`.
image

@suxnju suxnju added the T-feature Type: feature label Feb 19, 2024
@gakonst gakonst added this to Foundry Feb 19, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Feb 19, 2024
@onbjerg
Copy link
Member

onbjerg commented Feb 19, 2024

The JSON output is the raw ABI encoded representation of the return data.

@suxnju
Copy link
Author

suxnju commented Feb 19, 2024

The JSON output is the raw ABI encoded representation of the return data.

Thanks for the reply, do you mean that I can only process the generated raw data in the JSON output? Can I directly utilize the functionality that Foundry has already implemented to make it processed the same as the console?

@DaniPopes
Copy link
Member

DaniPopes commented Feb 19, 2024

@onbjerg I think he means that traces is missing, because it's marked with #[serde(skip)] since last refactor

@onbjerg
Copy link
Member

onbjerg commented Feb 19, 2024

Then it's a duplicate of #6922

@onbjerg onbjerg closed this as completed Feb 19, 2024
@jenpaff jenpaff moved this from Todo to Completed in Foundry Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-feature Type: feature
Projects
Archived in project
Development

No branches or pull requests

3 participants