Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: declare opbnb as a mainnet #29

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.0
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies: [types-setuptools, pydantic]
Expand Down
8 changes: 5 additions & 3 deletions ape_bsc/ecosystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand All @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"lint": [
"black>=24.10.0,<25", # Auto-formatter and linter
"mypy>=1.12.0,<2", # Static type analyzer
"mypy>=1.13.0,<2", # Static type analyzer
"types-setuptools", # Needed for mypy type shed
"flake8>=7.1.1,<8", # Style linter
"flake8-breakpoint>=1.1.0,<2", # Detect breakpoints left in code
Expand Down Expand Up @@ -60,7 +60,7 @@
url="https://github.com/ApeWorX/ape-bsc",
include_package_data=True,
install_requires=[
"eth-ape>=0.8.1,<0.9",
"eth-ape>=0.8.18,<0.9",
],
python_requires=">=3.9,<4",
extras_require=extras_require,
Expand Down
7 changes: 7 additions & 0 deletions tests/test_ecosystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading