mirror of https://github.com/nucypher/nucypher.git
Use `nucypher-contracts:main` as the canonical source for contract registries.
Add test to ensure github raw path is actually correct.remotes/origin/v7.4.x
parent
6e1113aa2d
commit
ddc1b454e5
|
@ -60,7 +60,7 @@ class RegistrySource(ABC):
|
|||
|
||||
class GithubRegistrySource(RegistrySource):
|
||||
|
||||
_PUBLICATION_REPO = "nucypher/nucypher"
|
||||
_PUBLICATION_REPO = "nucypher/nucypher-contracts"
|
||||
_BASE_URL = f'https://raw.githubusercontent.com/{_PUBLICATION_REPO}'
|
||||
|
||||
name = "GitHub Registry Source"
|
||||
|
@ -74,7 +74,7 @@ class GithubRegistrySource(RegistrySource):
|
|||
|
||||
def get_publication_endpoint(self) -> str:
|
||||
"""Get the GitHub endpoint for the registry publication."""
|
||||
url = f"{self._BASE_URL}/main/nucypher/blockchain/eth/contract_registry/{self.registry_name}"
|
||||
url = f"{self._BASE_URL}/main/deployment/artifacts/{self.registry_name}"
|
||||
return url
|
||||
|
||||
def decode(self, response: Response, endpoint: str) -> RegistryData:
|
||||
|
|
|
@ -4,6 +4,7 @@ import pytest
|
|||
import requests
|
||||
from requests import Response
|
||||
|
||||
from nucypher.blockchain.eth import domains
|
||||
from nucypher.blockchain.eth.registry import (
|
||||
EmbeddedRegistrySource,
|
||||
GithubRegistrySource,
|
||||
|
@ -58,6 +59,13 @@ def test_github_registry_source(registry_data):
|
|||
assert data == source.data
|
||||
|
||||
|
||||
@pytest.mark.parametrize("domain", list(domains.SUPPORTED_DOMAINS.values()))
|
||||
def test_get_actual_github_registry_file(domain):
|
||||
source = GithubRegistrySource(domain=domain)
|
||||
assert str(domain.eth_chain.id) in source.data
|
||||
assert str(domain.polygon_chain.id) in source.data
|
||||
|
||||
|
||||
def test_local_registry_source(registry_data, test_registry_filepath):
|
||||
source = LocalRegistrySource(
|
||||
filepath=test_registry_filepath, domain=TEMPORARY_DOMAIN
|
||||
|
|
Loading…
Reference in New Issue