Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

fix(rpc): add revert reason for eth_estimateGas #1722

Closed
wants to merge 11 commits into from

Conversation

mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Mar 22, 2023

Description

To align response for reverted methods as Ethereum:

# revertWithMsg
{
    "jsonrpc": "2.0",
    "id": 0,
    "error": {
        "code": 3,
        "data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a46756e6374696f6e20686173206265656e207265766572746564000000000000",
        "message": "execution reverted: Function has been reverted"
    }
}
# revertWithoutMsg
{
    "jsonrpc": "2.0",
    "id": 0,
    "error": {
        "code": -32000,
        "message": "execution reverted"
    }
}

For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Merging #1722 (c657fbb) into main (2e6e863) will decrease coverage by 0.08%.
The diff coverage is 10.52%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1722      +/-   ##
==========================================
- Coverage   67.94%   67.86%   -0.08%     
==========================================
  Files         112      112              
  Lines       10209    10223      +14     
==========================================
+ Hits         6936     6938       +2     
- Misses       2865     2875      +10     
- Partials      408      410       +2     
Impacted Files Coverage Δ
x/evm/keeper/grpc_query.go 85.33% <0.00%> (-0.57%) ⬇️
rpc/backend/call_tx.go 59.55% <13.33%> (-1.51%) ⬇️

@mmsqe mmsqe marked this pull request as ready for review March 22, 2023 15:44
@mmsqe mmsqe requested a review from a team as a code owner March 22, 2023 15:44
@mmsqe mmsqe requested review from austinchandra and GAtom22 and removed request for a team March 22, 2023 15:44
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days-before-close if no further activity occurs.

@github-actions github-actions bot closed this May 19, 2023
mmsqe added a commit to crypto-org-chain/ethermint that referenced this pull request Jun 14, 2023
…rt: evmos#1722) (#270)

* fix(rpc): align block number input behaviour for eth_getProof (backport: evmos#1772) (#233)

* add estimate_gas test

* add ret and vm_error for revert reason

* compare with eth

* test revertWithoutMsg

* align revertWithoutMsg response for eth_estimateGas

* align revertWithoutMsg response for eth_call

* add change doc

* separate contract to avoid gas change

* update mod

* fix resolve

* fix doc
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant