fix: respect local ethereum provider config - #2772
Conversation
e41f635 to
1f381d7
Compare
|
Rebased onto current main and addressed the mypy failure by annotating configured_local in BaseEthereumConfig.local. The previous markdown formatting failure was on an unrelated docs file and is green on the rebased branch.\n\nLocal validation after the update:\n\n- uv run --group lint ruff check src/ape_ethereum/ecosystem.py tests/functional/test_config.py\n- uv run --group lint ruff format --check src/ape_ethereum/ecosystem.py tests/functional/test_config.py\n- uv run --group lint --group test mypy src/ape_ethereum/ecosystem.py\n- uv run --group lint mdformat --check .md docs/**/.md\n- uv run --group test pytest tests/functional/test_config.py -k ethereum_local_network_config |
|
This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days. |
What I changed
BaseEthereumConfig.localto merge configuredethereum.localvalues into the existing local-network defaults instead of always returning the hard-coded default provider.ethereum.local.default_providerwhile preserving local defaults such asgas_limit="max"andrequired_confirmations=0.Why
networks.ethereum.local.default_providercan resolve from config, butproject.config.ethereum.local.default_providerwas still reporting the computed default (test) because the computedlocalconfig ignored the raw configuredlocalsection.Validation
uv run pytest tests/functional/test_config.py -k "ethereum_local_network_config or ethereum_network_configs or network_gas_limit_default"uv run ruff check src/ape_ethereum/ecosystem.py tests/functional/test_config.pyEthereumConfig.model_validate({'local': {'default_provider': 'node'}}).local.default_provider == 'node'andEthereumConfig().local.default_provider == 'test'Closes #2490