From 8d244f950dc726e44e05140080e541c2354ee237 Mon Sep 17 00:00:00 2001 From: Derek Pierre Date: Thu, 28 Mar 2024 12:23:48 -0400 Subject: [PATCH] feat: add support for Polygon Amoy (#26) * Add polygon amoy as a polygon network. * Update integration test to include amoy as a network. --- ape_polygon/ecosystem.py | 2 ++ tests/test_integration.py | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ape_polygon/ecosystem.py b/ape_polygon/ecosystem.py index a371f1c..bceca33 100644 --- a/ape_polygon/ecosystem.py +++ b/ape_polygon/ecosystem.py @@ -11,6 +11,7 @@ # chain_id, network_id "mainnet": (137, 137), "mumbai": (80001, 80001), + "amoy": (80002, 80002), } @@ -18,6 +19,7 @@ class PolygonConfig(BaseEthereumConfig): NETWORKS: ClassVar[Dict[str, Tuple[int, int]]] = NETWORKS mainnet: NetworkConfig = create_network_config(block_time=2, required_confirmations=1) mumbai: NetworkConfig = create_network_config(block_time=2, required_confirmations=1) + amoy: NetworkConfig = create_network_config(block_time=2, required_confirmations=1) class Polygon(Ethereum): diff --git a/tests/test_integration.py b/tests/test_integration.py index 439fc53..b8bf481 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -4,12 +4,14 @@ EXPECTED_OUTPUT = """ polygon -├── mainnet +├── amoy │ └── geth (default) -├── mumbai +├── local (default) +│ └── test (default) +├── mainnet │ └── geth (default) -└── local (default) - └── test (default) +└── mumbai + └── geth (default) """.strip() @@ -48,6 +50,7 @@ def test_networks(runner, cli, polygon): # Do this in case local env changed it. polygon.mainnet.set_default_provider("geth") polygon.mumbai.set_default_provider("geth") + polygon.amoy.set_default_provider("geth") result = runner.invoke(cli, ["networks", "list"]) assert_rich_text(result.output, EXPECTED_OUTPUT)