-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 hardhat_getForkedChainId JSON-RPC method #1592
add hardhat_getForkedChainId JSON-RPC method #1592
Conversation
packages/hardhat-core/src/internal/hardhat-network/provider/utils/makeForkClient.ts
Outdated
Show resolved
Hide resolved
@alcuadrado this is ready (assuming tests will pass). The only thing I'm not sure about is the returned value of the new method. Right now it returns a number, while |
})) as string; | ||
|
||
// There's a node returning this as decimal instead of QUANTITY. | ||
// TODO: Document here which node does that |
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.
I tested the eth_chainId
and net_version
methods in geth, nethermind and OE, and they all return a quantity and a decimal, respectively.
I'm ok with erring on the side of safety here, but maybe we can update this comment to say something like:
// Most nodes seem to return a decimal instead of a QUANTITY for this method, but we accept QUANTITYs too just to be extra safe
I think this is no longer necessary since we implemented #3382? Sorry @aftermathdigital for not merging it 😞 |
No worries, was fun to work on it all the same. Congratulations on the football! |
website
branch, and this PR uses thewebsite
branch as its base branch.Add the
hardhat_getForkedChainId
JSON-RPC method - which:Includes a documentation update describing the functionality.