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 support for CustomError #947

Merged
merged 14 commits into from
Nov 30, 2021
Merged

Add support for CustomError #947

merged 14 commits into from
Nov 30, 2021

Conversation

montyly
Copy link
Member

@montyly montyly commented Sep 22, 2021

The CI test is currently

pragma solidity ^0.8.4;

struct St{
    uint v;
}

error ErrorSimple();
error ErrorWithArgs(uint, uint);
error ErrorWithStruct(St s);

contract VendingMachine {

    function err0() public {
        revert ErrorSimple();
    }
    function err1() public {
        St memory s;
        revert ErrorWithStruct(s);
    }
    function err2() public{
        revert ErrorWithArgs(10+10, 10);
    }
    function err3() public{
        revert('test');
    }
}

But I want to stress a bit more the parsing before merging the PR

- Create a new CustomError core object, and associated parsing classes
- Create a specific solidity funciton to handle the revert CustomError
call
- Fix #919, Fix #893
@lgtm-com
Copy link

lgtm-com bot commented Sep 22, 2021

This pull request introduces 2 alerts when merging c8ee69c into 8236010 - view on LGTM.com

new alerts:

  • 1 for `__eq__` not overridden when adding attributes
  • 1 for Missing call to `__init__` during object initialization

@lgtm-com
Copy link

lgtm-com bot commented Sep 23, 2021

This pull request introduces 2 alerts when merging cc4877e into 8236010 - view on LGTM.com

new alerts:

  • 1 for `__eq__` not overridden when adding attributes
  • 1 for Missing call to `__init__` during object initialization

@lgtm-com
Copy link

lgtm-com bot commented Sep 23, 2021

This pull request introduces 2 alerts when merging 041f393 into 8236010 - view on LGTM.com

new alerts:

  • 1 for `__eq__` not overridden when adding attributes
  • 1 for Missing call to `__init__` during object initialization

@lgtm-com
Copy link

lgtm-com bot commented Sep 23, 2021

This pull request introduces 2 alerts when merging 234dcd6 into 8236010 - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization
  • 1 for Comparison of identical values

@lgtm-com
Copy link

lgtm-com bot commented Sep 23, 2021

This pull request introduces 1 alert when merging f028c57 into 8236010 - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization

@montyly
Copy link
Member Author

montyly commented Oct 14, 2021

Errors defined within a contract are not yet supported, for example:

contract A{

    error MyError(uint);

}

@lgtm-com
Copy link

lgtm-com bot commented Oct 14, 2021

This pull request introduces 1 alert when merging 2367da7 into a9e9b30 - view on LGTM.com

new alerts:

  • 1 for Missing call to `__init__` during object initialization

@montyly montyly mentioned this pull request Nov 29, 2021
21 tasks
@lgtm-com
Copy link

lgtm-com bot commented Nov 29, 2021

This pull request introduces 2 alerts when merging 486bc2f into 154dd9f - view on LGTM.com

new alerts:

  • 2 for Missing call to `__init__` during object initialization

@lgtm-com
Copy link

lgtm-com bot commented Nov 30, 2021

This pull request introduces 2 alerts when merging 55db069 into 154dd9f - view on LGTM.com

new alerts:

  • 2 for Missing call to `__init__` during object initialization

@lgtm-com
Copy link

lgtm-com bot commented Nov 30, 2021

This pull request introduces 2 alerts when merging 0ccde2e into 154dd9f - view on LGTM.com

new alerts:

  • 2 for Missing call to `__init__` during object initialization

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.

1 participant