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

[v5] Add sepolia (#2639) #2650

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ethpm/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
3: "ropsten",
4: "rinkeby",
5: "goerli",
11155111: "sepolia",
}
2 changes: 1 addition & 1 deletion ethpm/validation/uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def validate_registry_uri_authority(auth: str) -> None:
if not is_supported_chain_id(to_int(text=chain_id)):
raise EthPMValidationError(
f"Chain ID: {chain_id} is not supported. Supported chain ids include: "
"1 (mainnet), 3 (ropsten), 4 (rinkeby), and 5 (goerli)"
"1 (mainnet), 3 (ropsten), 4 (rinkeby), 5 (goerli), and 11155111 (sepolia)."
"Please try again with a valid registry URI."
)

Expand Down
1 change: 1 addition & 0 deletions newsfragments/2650.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add Sepolia auto provider
1 change: 1 addition & 0 deletions tests/ethpm/_utils/test_chain_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def test_parse_BIP122_uri(value, expected_resource_type):
(3, True),
(4, True),
(5, True),
(11155111, True),
(2, False),
("1", False),
({}, False),
Expand Down
1 change: 1 addition & 0 deletions web3/auto/infura/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
INFURA_ROPSTEN_DOMAIN = "ropsten.infura.io"
INFURA_GOERLI_DOMAIN = "goerli.infura.io"
INFURA_RINKEBY_DOMAIN = "rinkeby.infura.io"
INFURA_SEPOLIA_DOMAIN = "sepolia.infura.io"

WEBSOCKET_SCHEME = 'wss'
HTTP_SCHEME = 'https'
Expand Down
15 changes: 15 additions & 0 deletions web3/auto/infura/sepolia.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from web3 import Web3
from web3.providers.auto import (
load_provider_from_uri,
)

from .endpoints import (
INFURA_SEPOLIA_DOMAIN,
build_http_headers,
build_infura_url,
)

_headers = build_http_headers()
_infura_url = build_infura_url(INFURA_SEPOLIA_DOMAIN)

w3 = Web3(load_provider_from_uri(_infura_url, _headers))