Skip to content

Commit

Permalink
feat: op network fix and add testnet (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Oct 15, 2024
1 parent 5222fe1 commit 32828d5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ape_bsc/ecosystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@
# 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):
DEFAULT_TRANSACTION_TYPE: ClassVar[int] = TransactionType.STATIC.value
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):
Expand Down

0 comments on commit 32828d5

Please sign in to comment.