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

Add Pantheon JSON-RPC eth_chainId method #766

Conversation

lucassaldanha
Copy link
Contributor

@lucassaldanha lucassaldanha commented Nov 2, 2018

What does this PR do?

Recently we implemented EIP-695 on Pantheon (Pantheon PR link).

In this PR, we are introducing Pantheon module with the factory for the Pantheon object that contains methods implemented by Pantheon that haven't made their way into the main JSON-RPC spec.

Where should the reviewer start?

Probably start by reviewing the tests to understand the expected behaviour. After that, review the plumbing code to ensure I didn't miss something.

Why is it needed?

As we add methods to Pantheon JSON-RPC API, it would be great to have them available on Web3j so users can keep using the library to interact with Pantheon nodes.
We are about to release Pantheon nodes running on Infura so it would be great to make things easier for the users.

@codecov
Copy link

codecov bot commented Nov 2, 2018

Codecov Report

Merging #766 into master will decrease coverage by 0.12%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #766      +/-   ##
============================================
- Coverage     77.38%   77.26%   -0.13%     
- Complexity     1851     1854       +3     
============================================
  Files           241      244       +3     
  Lines          6814     6821       +7     
  Branches       1012     1012              
============================================
- Hits           5273     5270       -3     
- Misses         1291     1301      +10     
  Partials        250      250
Impacted Files Coverage Δ Complexity Δ
...rg/web3j/protocol/pantheon/JsonRpc2_0Pantheon.java 100% <100%> (ø) 2 <2> (?)
.../pantheon/methods/response/EthChainIdResponse.java 100% <100%> (ø) 2 <2> (?)
...ain/java/org/web3j/protocol/pantheon/Pantheon.java 100% <100%> (ø) 1 <1> (?)
...n/java/org/web3j/protocol/core/filters/Filter.java 53.12% <0%> (-14.07%) 8% <0%> (-2%)
...org/web3j/protocol/websocket/WebSocketService.java 85.26% <0%> (-1.06%) 50% <0%> (-1%)
core/src/main/java/org/web3j/utils/Flowables.java 88% <0%> (+4%) 11% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6160282...8e089ed. Read the comment docs.

@lucassaldanha
Copy link
Contributor Author

I'm closing this PR to let others work on this during the hackathon. I'm happy to reopen it later to integrate other Pantheon methods on Web3j.

@iikirilov
Copy link
Contributor

Work was started in the hackathon #767

@fcorneli
Copy link
Contributor

Seems like eth_chainId is also supported by both geth and parity. This could live within core I guess...
See also:
e-Contract/ethereum-resource-adapter@1d3d060

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants