From a8a217a4e15602571ae4b42325d7117e68e8f57f Mon Sep 17 00:00:00 2001 From: slush Date: Tue, 19 Nov 2024 18:03:50 -0600 Subject: [PATCH] fix: adds attributes back to __init__ --- ape_optimism/__init__.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ape_optimism/__init__.py b/ape_optimism/__init__.py index a1d4af9..87a4227 100644 --- a/ape_optimism/__init__.py +++ b/ape_optimism/__init__.py @@ -1,3 +1,5 @@ +from typing import Any + from ape import plugins @@ -46,3 +48,23 @@ def providers(): yield "optimism", network_name, Node yield "optimism", LOCAL_NETWORK_NAME, LocalProvider + + +def __getattr__(name: str) -> Any: + if name == "NETWORKS": + from .ecosystem import NETWORKS + + return NETWORKS + + elif name == "Optimism": + from .ecosystem import Optimism + + return Optimism + + elif name == "OptimismConfig": + from .ecosystem import OptimismConfig + + return OptimismConfig + + else: + raise AttributeError(name)