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

Retrieve revert reason for EthCall #859

Merged
merged 5 commits into from Mar 11, 2019

Conversation

Projects
None yet
3 participants
@MDhondt
Copy link
Contributor

MDhondt commented Jan 21, 2019

What does this PR do?

Retrieves the revert reason from an eth_call if it is present. This is issue #858.

Where should the reviewer start?

Check Solidity changes adding the require() and revert() reason at https://github.com/ethereum/solidity/pull/3364/files.

Use following contract to trigger a reverting call:

pragma solidity ^0.4.22;

contract Web3j858 {
    function willRevert() public pure {
        require(1 > 2, "Solidity uses state-reverting exceptions to handle errors. The require function should be used to ensure valid conditions, such as inputs, or contract state variables are met, or to validate return values from calls to external contracts.");
    }
}

Why is it needed?

Because the information is already there, web3j just doesn't interpret it.

@MDhondt MDhondt requested review from conor10 and iikirilov as code owners Jan 21, 2019

@MDhondt MDhondt changed the base branch from master to release/4.1 Jan 21, 2019

MDhondt added some commits Jan 21, 2019

@iikirilov

This comment has been minimized.

Copy link
Member

iikirilov commented Feb 23, 2019

LGTM

@snazha-blkio snazha-blkio changed the base branch from release/4.1 to release/4.2 Mar 11, 2019

@snazha-blkio snazha-blkio added this to the 4.2.0 milestone Mar 11, 2019

@snazha-blkio snazha-blkio merged commit 5e56333 into web3j:release/4.2 Mar 11, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

snazha-blkio added a commit that referenced this pull request Mar 11, 2019

Merge pull request #859 from MDhondt/get-revert-reason
Retrieve revert reason for EthCall

snazha-blkio added a commit that referenced this pull request Mar 14, 2019

Merge pull request #859 from MDhondt/get-revert-reason
Retrieve revert reason for EthCall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.