Repository navigation
Fix cluster_api_url("mainnet") raising AttributeError - #707
Merged
michaelhly merged 1 commit intoOct 12, 2026
Merged
Conversation
The cluster was renamed from mainnet-beta to mainnet in michaelhly#699, but cluster_api_url still looked the URL up by the cluster name, and the ClusterUrls field is mainnet_beta. Every call with "mainnet" failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #707 +/- ##
=======================================
Coverage 95.30% 95.31%
=======================================
Files 25 25
Lines 1917 1919 +2
=======================================
+ Hits 1827 1829 +2
Misses 90 90 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since 0.40.2,
cluster_api_url("mainnet")fails:#699 renamed the cluster literal to
"mainnet", but the function still resolves the URL withgetattr(urls, cluster), and theClusterUrlsfield is stillmainnet_beta."mainnet"is the only value the type allows for that cluster, so there is no way to get the mainnet URL from this helper.Change
cluster_api_urlmaps"mainnet"to themainnet_betafield. I leftClusterUrlsas it is so the public model does not change; renaming the field would be the alternative if you prefer it, and I can switch to that.Tests
tests/unit/test_cluster_api_url.pyonly covered devnet. It now also checks testnet, and a newtest_mainnetcovers"mainnet"with and without TLS.test_mainnetfails onmasterwith the error above and passes with the change.pytest tests/unitpasses (137 tests);ruff format --check,ruff checkandmypyare clean on the touched files. Added aFixedentry under Unreleased in the changelog.🤖 Generated with Claude Code