Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

fix: Update revert error message and data #437

Merged
merged 1 commit into from
Jul 14, 2022
Merged

Conversation

classicalliu
Copy link
Contributor

eth_call RPC:

Godwoken Web3:

Update revert message format, for hardhat revert message need data.message and data.data,and data.message should in specific format.
For example: Error: call revert exception; VM Exception while processing transaction: reverted with reason string "12341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341"

{
    "jsonrpc": "2.0",
    "id": 2,
    "error": {
        "code": -32099,
        "message": "revert: Error: VM Exception while processing transaction: reverted with reason string '12341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341'",
        "data": {
            "failed_reason": {
                "status_code": "0x2",
                "status_type": "REVERT",
                "message": "Error: VM Exception while processing transaction: reverted with reason string '12341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341'"
            },
            "message": "revert: Error: VM Exception while processing transaction: reverted with reason string '12341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341'",
            "data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000aa313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343100000000000000000000000000000000000000000000"
        }
    }
}

Hardhat node:

{
    "jsonrpc": "2.0",
    "id": 2,
    "error": {
        "code": -32603,
        "message": "Error: VM Exception while processing transaction: reverted with reason string '12341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341'",
        "data": {
            "message": "Error: VM Exception while processing transaction: reverted with reason string '12341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341123411234112341'",
            "data": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000aa313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343131323334313132333431313233343100000000000000000000000000000000000000000000"
        }
    }
}

@classicalliu classicalliu linked an issue Jul 12, 2022 that may be closed by this pull request
@RetricSu RetricSu merged commit 22dcbeb into main Jul 14, 2022
@RetricSu RetricSu deleted the update-error-data branch July 14, 2022 04:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v1.3] hardhat cannot parse eth_call failed information
4 participants