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

Add detailed assert info for echidna #2105

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Add detailed assert info for echidna #2105

merged 1 commit into from
Sep 11, 2023

Conversation

montyly
Copy link
Member

@montyly montyly commented Sep 1, 2023

Fix #2104

On

contract A{

        function f() public{
                revert();
                assert(false);
        }

        function g() public{
                assert(true);
                revert();
                assert(false);
        }

        function h() public{
                if(true) assert(false); else assert(true);
        }
}

The printer will now output

            "f()": [
                {
                    "start": 49,
                    "length": 13,
                    "filename_relative": "assert.sol",
                    "filename_absolute": "/private/tmp/assert.sol",
                    "filename_short": "assert.sol",
                    "is_dependency": false,
                    "lines": [
                        5
                    ],
                    "starting_column": 3,
                    "ending_column": 16
                }
            ],
            "g()": [
                {
                    "start": 92,
                    "length": 12,
                    "filename_relative": "assert.sol",
                    "filename_absolute": "/private/tmp/assert.sol",
                    "filename_short": "assert.sol",
                    "is_dependency": false,
                    "lines": [
                        9
                    ],
                    "starting_column": 3,
                    "ending_column": 15
                },
                {
                    "start": 120,
                    "length": 13,
                    "filename_relative": "assert.sol",
                    "filename_absolute": "/private/tmp/assert.sol",
                    "filename_short": "assert.sol",
                    "is_dependency": false,
                    "lines": [
                        11
                    ],
                    "starting_column": 3,
                    "ending_column": 16
                }
            ],
            "h()": [
                {
                    "start": 172,
                    "length": 13,
                    "filename_relative": "assert.sol",
                    "filename_absolute": "/private/tmp/assert.sol",
                    "filename_short": "assert.sol",
                    "is_dependency": false,
                    "lines": [
                        15
                    ],
                    "starting_column": 12,
                    "ending_column": 25
                },
                {
                    "start": 192,
                    "length": 12,
                    "filename_relative": "assert.sol",
                    "filename_absolute": "/private/tmp/assert.sol",
                    "filename_short": "assert.sol",
                    "is_dependency": false,
                    "lines": [
                        15
                    ],
                    "starting_column": 32,
                    "ending_column": 44
                }
            ]

Here:

  • start / length are direct offsets in the file
  • lines / starting_column/ ending_column provide the equivalent info, but through a lines / column approach

@0xalpharush 0xalpharush merged commit f1f4e5b into dev Sep 11, 2023
@0xalpharush 0xalpharush deleted the echidna-printer branch September 11, 2023 22:01
0xalpharush added a commit that referenced this pull request Oct 18, 2023
0xalpharush added a commit that referenced this pull request Oct 18, 2023
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