From 32828d5dc873fac410542d5c941564955e464720 Mon Sep 17 00:00:00 2001 From: antazoey Date: Tue, 15 Oct 2024 17:29:17 -0500 Subject: [PATCH] feat: op network fix and add testnet (#28) --- ape_bsc/ecosystem.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ape_bsc/ecosystem.py b/ape_bsc/ecosystem.py index bd9c560..fcdcc55 100644 --- a/ape_bsc/ecosystem.py +++ b/ape_bsc/ecosystem.py @@ -12,12 +12,15 @@ # chain_id, network_id "mainnet": (56, 56), "testnet": (97, 97), - "opBNB": (204, 204), + "opbnb": (204, 204), + "opbnb-testnet": (5611, 5611), } -def _create_config() -> NetworkConfig: - return create_network_config(block_time=3, default_transaction_type=TransactionType.STATIC) +def _create_config(block_time: int = 3) -> NetworkConfig: + return create_network_config( + block_time=block_time, default_transaction_type=TransactionType.STATIC + ) class BSCConfig(BaseEthereumConfig): @@ -25,7 +28,10 @@ class BSCConfig(BaseEthereumConfig): NETWORKS: ClassVar[dict[str, tuple[int, int]]] = NETWORKS mainnet: NetworkConfig = _create_config() testnet: NetworkConfig = _create_config() - opBNB: NetworkConfig = _create_config() + + # opBNB is really fast, hence the low block time. + opbnb: NetworkConfig = _create_config(block_time=1) + opbnb_testnet: NetworkConfig = _create_config(block_time=1) class BSC(Ethereum):