Skip to content

Commit 28c7751

Browse files
authored
Add sepolia (#2639)
* Add Sepolia testnet * Add Sepolia to ethpm validation error message
1 parent 6f4a6ab commit 28c7751

File tree

6 files changed

+20
-1
lines changed

6 files changed

+20
-1
lines changed

ethpm/constants.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
3: "ropsten",
1616
4: "rinkeby",
1717
5: "goerli",
18+
11155111: "sepolia",
1819
}

ethpm/validation/uri.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def validate_registry_uri_authority(auth: str) -> None:
103103
if not is_supported_chain_id(to_int(text=chain_id)):
104104
raise EthPMValidationError(
105105
f"Chain ID: {chain_id} is not supported. Supported chain ids include: "
106-
"1 (mainnet), 3 (ropsten), 4 (rinkeby), and 5 (goerli)"
106+
"1 (mainnet), 3 (ropsten), 4 (rinkeby), 5 (goerli), and 11155111 (sepolia)."
107107
"Please try again with a valid registry URI."
108108
)
109109

newsfragments/2639.feature.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add Sepolia auto provider

tests/ethpm/_utils/test_chain_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def test_parse_BIP122_uri(value, expected_resource_type):
4949
(3, True),
5050
(4, True),
5151
(5, True),
52+
(11155111, True),
5253
(2, False),
5354
("1", False),
5455
({}, False),

web3/auto/infura/endpoints.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
INFURA_ROPSTEN_DOMAIN = "ropsten.infura.io"
2121
INFURA_GOERLI_DOMAIN = "goerli.infura.io"
2222
INFURA_RINKEBY_DOMAIN = "rinkeby.infura.io"
23+
INFURA_SEPOLIA_DOMAIN = "sepolia.infura.io"
2324

2425
WEBSOCKET_SCHEME = "wss"
2526
HTTP_SCHEME = "https"

web3/auto/infura/sepolia.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from web3 import Web3
2+
from web3.providers.auto import (
3+
load_provider_from_uri,
4+
)
5+
6+
from .endpoints import (
7+
INFURA_SEPOLIA_DOMAIN,
8+
build_http_headers,
9+
build_infura_url,
10+
)
11+
12+
_headers = build_http_headers()
13+
_infura_url = build_infura_url(INFURA_SEPOLIA_DOMAIN)
14+
15+
w3 = Web3(load_provider_from_uri(_infura_url, _headers))

0 commit comments

Comments
 (0)