diff --git a/ape_bsc/ecosystem.py b/ape_bsc/ecosystem.py index fcdcc55..b9efc8e 100644 --- a/ape_bsc/ecosystem.py +++ b/ape_bsc/ecosystem.py @@ -17,9 +17,11 @@ } -def _create_config(block_time: int = 3) -> NetworkConfig: +def _create_config(block_time: int = 3, **kwargs) -> NetworkConfig: return create_network_config( - block_time=block_time, default_transaction_type=TransactionType.STATIC + block_time=block_time, + default_transaction_type=TransactionType.STATIC, + **kwargs, ) @@ -30,7 +32,7 @@ class BSCConfig(BaseEthereumConfig): testnet: NetworkConfig = _create_config() # opBNB is really fast, hence the low block time. - opbnb: NetworkConfig = _create_config(block_time=1) + opbnb: NetworkConfig = _create_config(block_time=1, is_mainnet=True) opbnb_testnet: NetworkConfig = _create_config(block_time=1) diff --git a/tests/test_ecosystem.py b/tests/test_ecosystem.py index 50088ac..4aa1d48 100644 --- a/tests/test_ecosystem.py +++ b/tests/test_ecosystem.py @@ -55,3 +55,10 @@ def test_encode_transaction(tx_type, bsc, eth_tester_provider): address = "0x274b028b03A250cA03644E6c578D81f019eE1323" actual = bsc.encode_transaction(address, abi, sender=address, type=tx_type) assert actual.gas_limit == eth_tester_provider.max_gas + + +def test_is_mainnet(bsc): + assert bsc.mainnet.is_mainnet + assert bsc.opbnb.is_mainnet + assert not bsc.testnet.is_mainnet + assert not bsc.opbnb_testnet.is_mainnet