0g-storage-node/tests/test_framework/contracts.py
Bo QIU b6972b97af
Some checks are pending
abi-consistent-check / build-and-compare (push) Waiting to run
code-coverage / unittest-cov (push) Waiting to run
rust / check (push) Waiting to run
rust / test (push) Waiting to run
rust / lints (push) Waiting to run
functional-test / test (push) Waiting to run
Adjust default value for testnet configs (#180)
* Adjust default value for testnet configs

* Supports to disable sequential auto sync

* Add py tests for auto sync

* fix py file name

* rm dummy ;py code

* change default block confirm count
2024-09-05 10:09:29 +08:00

12 lines
324 B
Python

from pathlib import Path
import json
def load_contract_metadata(path: str, name: str):
path = Path(path)
try:
found_file = next(path.rglob(f"{name}.json"))
return json.loads(open(found_file, "r").read())
except StopIteration:
raise Exception(f"Cannot found contract {name}'s metadata")