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

Init web3-rpc-methods package #5441

Merged
merged 20 commits into from
Sep 24, 2022
Merged

Conversation

spacesailor24
Copy link
Contributor

@spacesailor24 spacesailor24 commented Sep 15, 2022

Note There are a huge amount of files changed, but most of these files are tests where the only change was an import change to import { ethRpcMethods } from 'web3-rpc-methods';

This PR pulls out necessary changes for #5426 into a separate PR to reduce the amount of changes that need to be reviewed in a single PR

Why This PR Exists

One of the first problems I ran into when working on #5426 was circular dependencies. This was primarily because certain test utils (e.g. creating and funding accounts) needed to send RPC request to fetch accounts and send transactions (imported via web3-eth). Naturally, the test utils that currently exist and the refactor (#5426) are intended to be used by packages such as web3-eth, and this is where the circular dependencies start to show up: web3-test-utils -> web3-eth -> web3-test-utils (Note circular dependencies currently exist with current test utils, they just aren't reported via Lerna/Yarn because the test utils are symlinked into each package instead of actually being apart of each package with their dependencies declared via package.json). This PR alone does not address all the circular dependency issues I discovered while working on #5426, there will be a subsequent PR that depends on this one that will address other issues via a web3-transaction-utils package

What This PR Does

CHANGELOG.mds with specific changes are provided below, but as a high level overview:

  • Bare bone RPC method wrapper functions (not the rpc_method_wrappers.ts that provide niceties such as formatting) are moved from packages: web3-eth, web3-eth-net, and web3-eth-personal to a new package: web3-rpc-methods
    • This helps alleviate circular dependency issues by allowing other packages (e.g. web3-test-utils from Init web3-test-utils Package #5426) to use the RPC method wrappers without having to import packages such as web3-eth or having to write one-off RPC method wrappers like so)
  • Moves:
    • EthPersonalAPI
    • Web3EthExecutionAPI
    • Web3NetAPI
      into web3-types from their original packages (web3-eth-personal, web3-eth, and web3-net respectively)

web3-eth-ens

Changed

web3-eth-personal

Added

Changed

Removed

web3-eth

Added

Changed

web3-net

Added

Changed

Removed

web3-types

Added

@spacesailor24 spacesailor24 added the 4.x 4.0 related label Sep 15, 2022
@spacesailor24 spacesailor24 self-assigned this Sep 15, 2022
@render
Copy link

render bot commented Sep 15, 2022

@spacesailor24 spacesailor24 marked this pull request as ready for review September 15, 2022 16:02
Copy link
Contributor

@avkos avkos left a comment

Choose a reason for hiding this comment

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

Great 💪

@spacesailor24 spacesailor24 merged commit 84766ae into 4.x Sep 24, 2022
@spacesailor24 spacesailor24 deleted the wyatt/4.x/init-web3-rpc-methods branch September 24, 2022 07:05
@jdevcs jdevcs mentioned this pull request Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants