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

feat: add error code mapping for gw/polyjuice/evmc #591

Merged
merged 3 commits into from
Jan 5, 2023

Conversation

RetricSu
Copy link
Contributor

@RetricSu RetricSu commented Dec 15, 2022

some examples:

contract revert

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": -32000,
        "message": "execution reverted: here is a simple revert reason",
        "data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e6865726520697320612073696d706c652072657665727420726561736f6e0000",
        "extra": {
            "exit_code": "0x2",
            "message": "revert",
            "stack": "EVMC"
        }
    }
}

max cycles

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": -32000,
        "message": "out of gas(vm reached max cycles)",
        "extra": {
            "exit_code": "0xff",
            "message": "vm reached max cycles",
            "stack": "GODWOKEN"
        }
    }
}

solidity call baseFee opcode

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": -32000,
        "message": "undefined instruction",
        "extra": {
            "exit_code": "0x5",
            "message": "undefined instruction",
            "stack": "EVMC"
        }
    }
}

@RetricSu RetricSu changed the title feat: complement the error code from gw and polyjuice feat: add error code mapping for gw/polyjuice/evmc Dec 15, 2022
@RetricSu RetricSu marked this pull request as ready for review December 15, 2022 16:06
@RetricSu RetricSu requested review from Flouse and classicalliu and removed request for Flouse December 15, 2022 16:07
@Flouse Flouse requested a review from magicalne December 18, 2022 12:55
packages/api-server/src/methods/exit-code.ts Outdated Show resolved Hide resolved
packages/api-server/src/methods/exit-code.ts Outdated Show resolved Hide resolved
packages/api-server/src/methods/gw-error.ts Outdated Show resolved Hide resolved
@RetricSu RetricSu requested a review from classicalliu January 3, 2023 10:13
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.

4 participants