Skip to content

Commit 59c4318

Browse files
authored
Merge pull request #329 from dbluhm/fix/indy-networks-base-url
fix: point to hl indy-did-networks repo
2 parents 7fc06f8 + ef54fbc commit 59c4318

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

wrappers/python/indy_vdr/utils.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import os
2-
from typing import Dict, List
2+
from typing import Dict, List, Optional
33
import urllib.request
4+
import urllib.error
45

56

67
INDY_NETWORKS_GITHUB_RAW_BASE = (
7-
"https://raw.githubusercontent.com/IDunion/indy-did-networks/main"
8+
"https://raw.githubusercontent.com/hyperledger/indy-did-networks/main"
89
)
910
GENESIS_FILENAME = "pool_transactions_genesis.json"
1011

1112

1213
def get_genesis_txns_from_did_indy_folder(
13-
path: str, genesis_filename: str = None
14+
path: str, genesis_filename: Optional[str] = None
1415
) -> Dict[str, str]:
1516
"""Retrieves mapping from local folder.
1617
@@ -40,7 +41,7 @@ def get_genesis_txns_from_did_indy_folder(
4041
sub_entries = os.listdir(os.path.join(path, entry))
4142

4243
for sub_entry in sub_entries:
43-
44+
4445
sub_entry_p = os.path.join(entry_p, sub_entry)
4546
sub_namespace = sub_entry if os.path.isdir(sub_entry_p) else None
4647

@@ -57,12 +58,15 @@ def get_genesis_txns_from_did_indy_folder(
5758

5859

5960
def get_genesis_txns_from_did_indy_repo_by_name(
60-
namespaces: List[str], genesis_filename: str = None
61+
namespaces: List[str], genesis_filename: Optional[str] = None,
62+
*,
63+
repo_base_url: Optional[str] = None,
6164
) -> Dict[str, str]:
6265
"""Retrieves genesis txn from standard indy networks repo given their names."""
6366
genesis_map = dict()
6467

6568
genesis_filename = genesis_filename if genesis_filename else GENESIS_FILENAME
69+
repo_base_url = repo_base_url or INDY_NETWORKS_GITHUB_RAW_BASE
6670

6771
base_dir = "networks"
6872

@@ -73,7 +77,7 @@ def get_genesis_txns_from_did_indy_repo_by_name(
7377
main = next(parts, None)
7478
sub = next(parts, None)
7579

76-
genesis_file_url = f"{INDY_NETWORKS_GITHUB_RAW_BASE}/networks/{name}/{genesis_filename}"
80+
genesis_file_url = f"{repo_base_url}/networks/{name}/{genesis_filename}"
7781
target_local_path = f"{base_dir}/{name}/{genesis_filename}"
7882
try:
7983
urllib.request.urlretrieve(genesis_file_url, target_local_path)

0 commit comments

Comments
 (0)