Skip to content

Commit

Permalink
perf: load
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Nov 8, 2024
1 parent 4c1a49c commit 14eee5b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
30 changes: 25 additions & 5 deletions ape_arbitrum/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
from ape import plugins
from ape.api.networks import LOCAL_NETWORK_NAME, ForkedNetworkAPI, NetworkAPI, create_network_type
from ape_node import Node
from ape_test import LocalProvider

from .ecosystem import NETWORKS, Arbitrum, ArbitrumConfig


@plugins.register(plugins.Config)
def config_class():
from .ecosystem import ArbitrumConfig

return ArbitrumConfig


@plugins.register(plugins.EcosystemPlugin)
def ecosystems():
from .ecosystem import Arbitrum

yield Arbitrum


@plugins.register(plugins.NetworkPlugin)
def networks():
from ape.api.networks import (
LOCAL_NETWORK_NAME,
ForkedNetworkAPI,
NetworkAPI,
create_network_type,
)

from .ecosystem import NETWORKS

for network_name, network_params in NETWORKS.items():
yield "arbitrum", network_name, create_network_type(*network_params)
yield "arbitrum", f"{network_name}-fork", ForkedNetworkAPI
Expand All @@ -28,7 +36,19 @@ def networks():

@plugins.register(plugins.ProviderPlugin)
def providers():
from ape.api.networks import LOCAL_NETWORK_NAME
from ape_node import Node
from ape_test import LocalProvider

from .ecosystem import NETWORKS

for network_name in NETWORKS:
yield "arbitrum", network_name, Node

yield "arbitrum", LOCAL_NETWORK_NAME, LocalProvider


def __getattr__(name: str):
import ape_arbitrum.ecosystem as module

return getattr(module, name)
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[flake8]
max-line-length = 100
ignore = E704,W503,PYD002
ignore = E704,W503,PYD002,TC003,TC006
exclude =
.venv*
venv*
.eggs
docs
build
type-checking-pydantic-enabled = True

0 comments on commit 14eee5b

Please sign in to comment.