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

add eth_call query command #236

Merged
merged 2 commits into from
Jul 9, 2021
Merged

add eth_call query command #236

merged 2 commits into from
Jul 9, 2021

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Jul 8, 2021

Implement EthCall grpc query api

Closes #229

Description

  • Implement dedicated eth_call grpc query command for eth_call, which is used by both eth_estimateGas and eth_call rpc api.
  • can fix both empty from issue and historical state query issue

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 Jul 8, 2021

Codecov Report

Merging #236 (d97fca6) into main (7951852) will decrease coverage by 8.99%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
- Coverage   47.13%   38.13%   -9.00%     
==========================================
  Files          44       38       -6     
  Lines        3074     2428     -646     
==========================================
- Hits         1449      926     -523     
+ Misses       1545     1451      -94     
+ Partials       80       51      -29     
Impacted Files Coverage Δ
x/evm/keeper/grpc_query.go 73.77% <0.00%> (-8.05%) ⬇️
x/evm/keeper/state_transition.go 0.00% <0.00%> (ø)
x/evm/types/callargs.go 0.00% <0.00%> (ø)
x/evm/types/query.pb.gw.go 0.00% <0.00%> (ø)
app/ante/ante.go
crypto/ethsecp256k1/ethsecp256k1.go
crypto/hd/algorithm.go
app/test_helpers.go
app/app.go
app/export.go
... and 2 more

@thomas-nguy thomas-nguy mentioned this pull request Jul 8, 2021
11 tasks
@yihuang yihuang changed the title [WIP] add eth_call query command add eth_call query command Jul 8, 2021
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, see suggestions for historical query and using the MsgEthereumTx

ethereum/rpc/namespaces/eth/api.go Outdated Show resolved Hide resolved
ethereum/rpc/namespaces/eth/api.go Outdated Show resolved Hide resolved
proto/ethermint/evm/v1alpha1/query.proto Outdated Show resolved Hide resolved
x/evm/keeper/grpc_query.go Outdated Show resolved Hide resolved
x/evm/keeper/grpc_query.go Outdated Show resolved Hide resolved
x/evm/keeper/grpc_query.go Outdated Show resolved Hide resolved
Copy link
Contributor

@leejw51crypto leejw51crypto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yihuang yihuang force-pushed the callapi branch 3 times, most recently from f56fac4 to 18cbf5c Compare July 9, 2021 07:25
Implement EthCall grpc query api

Closes #229

add eth_call query command

fix codec issue

use query client

use grpc status error and codes

validate address length in grpc handler
x/evm/types/callargs.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. Let's open an issue or discussion for the format

@fedekunze fedekunze enabled auto-merge (squash) July 9, 2021 09:02
@yihuang
Copy link
Contributor Author

yihuang commented Jul 9, 2021

ACK. Let's open an issue or discussion for the format

#246

@fedekunze fedekunze merged commit 0020e4f into evmos:main Jul 9, 2021
@yihuang yihuang deleted the callapi branch July 12, 2021 01:50
@fedekunze fedekunze mentioned this pull request Jul 12, 2021
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.

eth_call don't support historical block height
3 participants