Skip to content

Commit 294ef52

Browse files
authored
Merge pull request #7067 from avorylli/av
docs: clarify comment on chainId format in ProviderWrapper
2 parents 69a1724 + 66225ae commit 294ef52

File tree

1 file changed

+3
-2
lines changed
  • packages/hardhat-core/src/internal/core/providers

1 file changed

+3
-2
lines changed

packages/hardhat-core/src/internal/core/providers/chainId.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ export abstract class ProviderWrapperWithChainId extends ProviderWrapper {
3434
method: "net_version",
3535
})) as string;
3636

37-
// There's a node returning this as decimal instead of QUANTITY.
38-
// TODO: Document here which node does that
37+
// Most Ethereum clients (including Geth, OpenEthereum, and others) return net_version
38+
// as a decimal string (e.g., "1", "3", "8995") according to the JSON-RPC specification,
39+
// while some may return it in QUANTITY format (hexadecimal with "0x" prefix).
3940
return id.startsWith("0x") ? rpcQuantityToNumber(id) : parseInt(id, 10);
4041
}
4142
}

0 commit comments

Comments
 (0)