generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pep-625 compliance and type checking performance refactors (#18)
- Loading branch information
1 parent
6bab4a1
commit 2703603
Showing
4 changed files
with
77 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,50 @@ | ||
from ape import plugins | ||
|
||
from .provider import TenderlyConfig, TenderlyForkProvider, TenderlyGatewayProvider | ||
|
||
NETWORKS = { | ||
"ethereum": [ | ||
("mainnet", TenderlyGatewayProvider), | ||
("mainnet-fork", TenderlyForkProvider), | ||
("sepolia", TenderlyGatewayProvider), | ||
("sepolia-fork", TenderlyForkProvider), | ||
], | ||
"polygon": [ | ||
("mainnet", TenderlyGatewayProvider), | ||
("mainnet-fork", TenderlyForkProvider), | ||
("amoy", TenderlyGatewayProvider), | ||
("amoy-fork", TenderlyForkProvider), | ||
], | ||
"arbitrum": [ | ||
("mainnet-fork", TenderlyForkProvider), | ||
("sepolia-fork", TenderlyForkProvider), | ||
], | ||
"optimism": [ | ||
("mainnet", TenderlyGatewayProvider), | ||
("mainnet-fork", TenderlyForkProvider), | ||
("sepolia", TenderlyGatewayProvider), | ||
("sepolia-fork", TenderlyForkProvider), | ||
], | ||
"base": [ | ||
("mainnet", TenderlyGatewayProvider), | ||
("mainnet-fork", TenderlyForkProvider), | ||
("sepolia", TenderlyGatewayProvider), | ||
("sepolia-fork", TenderlyForkProvider), | ||
], | ||
"avalanche": [ | ||
("mainnet-fork", TenderlyForkProvider), | ||
], | ||
"fantom": [ | ||
("opera-fork", TenderlyForkProvider), | ||
], | ||
} | ||
|
||
|
||
@plugins.register(plugins.Config) | ||
def config_class(): | ||
from ape_tenderly.provider import TenderlyConfig | ||
|
||
return TenderlyConfig | ||
|
||
|
||
@plugins.register(plugins.ProviderPlugin) | ||
def providers(): | ||
from ape_tenderly.provider import NETWORKS | ||
|
||
for ecosystem_name in NETWORKS: | ||
for network_name, provider in NETWORKS[ecosystem_name]: | ||
yield ecosystem_name, network_name, provider | ||
|
||
|
||
def __getattr__(name: str): | ||
if name == "NETWORKS": | ||
from ape_tenderly.provider import NETWORKS | ||
|
||
return NETWORKS | ||
|
||
elif name == "TenderlyConfig": | ||
from ape_tenderly.provider import TenderlyConfig | ||
|
||
return TenderlyConfig | ||
|
||
elif name == "TenderlyForkProvider": | ||
from ape_tenderly.provider import TenderlyForkProvider | ||
|
||
return TenderlyForkProvider | ||
|
||
elif name == "TenderlyGatewayProvider": | ||
from ape_tenderly.provider import TenderlyGatewayProvider | ||
|
||
return TenderlyGatewayProvider | ||
|
||
else: | ||
raise AttributeError(name) | ||
|
||
|
||
__all__ = [ | ||
"NETWORKS", | ||
"TenderlyConfig", | ||
"TenderlyForkProvider", | ||
"TenderlyGatewayProvider", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters