Skip to content

Commit fffdd15

Browse files
committed
Refactor Registry
1 parent 3a7dca9 commit fffdd15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def load_all_contracts(self) -> List[dict]:
3636
raise FileNotFoundError(
3737
"File with contracts ABIs registry_contracts.json not found")
3838

39-
def load_contract_by_name(self, contract_name: str) -> dict:
39+
def load_contract_by_name(self, contract_name: str, contract_address: str = None) -> dict:
4040
"""
4141
Get contract address from Registry contract by name
4242
@@ -47,7 +47,7 @@ def load_contract_by_name(self, contract_name: str) -> dict:
4747
"""
4848
try:
4949
account_contract_address = self.registry.functions.getAddressForString(
50-
contract_name).call()
50+
contract_name).call() if contract_address == None else contract_address
5151
with open('sdk/registry_contracts.json') as json_file:
5252
contracts_data = json.load(json_file)
5353
return {"address": account_contract_address, "abi": contracts_data[contract_name]["ABI"]}

0 commit comments

Comments
 (0)