This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Init web3-rpc-methods package
#5441
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Your Render PR Server URL is https://web3js-docs-pr-5441.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-cch7slqrrk02bi4tu4l0. |
spacesailor24
commented
Sep 16, 2022
spacesailor24
commented
Sep 16, 2022
spacesailor24
commented
Sep 16, 2022
spacesailor24
commented
Sep 16, 2022
spacesailor24
commented
Sep 16, 2022
spacesailor24
commented
Sep 16, 2022
avkos
approved these changes
Sep 19, 2022
Contributor
avkos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 💪
luu-alex
reviewed
Sep 20, 2022
luu-alex
approved these changes
Sep 20, 2022
nikoulai
approved these changes
Sep 23, 2022
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 asweb3-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 viapackage.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 aweb3-transaction-utilspackageWhat This PR Does
CHANGELOG.mds with specific changes are provided below, but as a high level overview:rpc_method_wrappers.tsthat provide niceties such as formatting) are moved from packages:web3-eth,web3-eth-net, andweb3-eth-personalto a new package:web3-rpc-methodsweb3-test-utilsfrom Initweb3-test-utilsPackage #5426) to use the RPC method wrappers without having to import packages such asweb3-ethor having to write one-off RPC method wrappers like so)EthPersonalAPIWeb3EthExecutionAPIWeb3NetAPIinto
web3-typesfrom their original packages (web3-eth-personal,web3-eth, andweb3-netrespectively)web3-eth-ensChanged
Web3NetAPIis now imported fromweb3-typesinstead ofweb3-types(Initweb3-rpc-methodspackage #5441)web3-eth-personalAdded
web3-rpc-methodsdependency (Initweb3-rpc-methodspackage #5441)Changed
EthPersonalAPIfromweb3-typesinstead of local import (Initweb3-rpc-methodspackage #5441)rcp_methods.tswithpersonalRpcMethodsimports fromweb3-rpc-methods(Initweb3-rpc-methodspackage #5441)EthPersonalAPIManagerwithWeb3RequestManager<EthPersonalAPI>(Initweb3-rpc-methodspackage #5441)Removed
EthPersonalAPIManager,EthPersonalAPIis not exported viaweb3-types(Initweb3-rpc-methodspackage #5441)web3-ethAdded
web3-rpc-methodsdependency (Initweb3-rpc-methodspackage #5441)Changed
Web3EthExecutionAPIis now imported viaweb3-typesinstead ofweb3_eth_execution_api.ts(Initweb3-rpc-methodspackage #5441)rpc_methods.tswithethRpcMethodsimports fromweb3-rpc-methods(Initweb3-rpc-methodspackage #5441)Web3NetAPIis now imported fromweb3-typesinstead ofweb3-net(Initweb3-rpc-methodspackage #5441)rpc_methodstests toweb3-rpc-methods(Initweb3-rpc-methodspackage #5441)web3-netAdded
web3-rpc-methodsdependency (Initweb3-rpc-methodspackage #5441)Changed
Web3NetAPIis now imported fromweb3-typesinstead ofweb3_net_api.ts(Initweb3-rpc-methodspackage #5441)rpc_methods.tswithnetRpcMethodsimports fromweb3-rpc-methods(Initweb3-rpc-methodspackage #5441)Removed
rpcMethodsexport, these methods are now exported viaweb3-rpc-methodsasnetRpcMethods(Initweb3-rpc-methodspackage #5441)Web3NetAPIexport, now exported viaweb3-typesasWeb3NetAPI(Initweb3-rpc-methodspackage #5441)web3-typesAdded
Web3EthExecutionAPIexport (Initweb3-rpc-methodspackage #5441)Web3NetAPIexport (Initweb3-rpc-methodspackage #5441)EthPersonalAPIexport (Initweb3-rpc-methodspackage #5441)