mirror of
				https://github.com/0glabs/0g-storage-node.git
				synced 2025-11-04 08:37:27 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			324 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			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")
 |