Repository navigation
fix(core): offline on testnet or mainnet no longer blames a devnet name - #694
Conversation
With no network, every read fails to resolve quorums.testnet.networks.dash.org, and E701 added "if the devnet name is wrong, `--devnet-name testnet` is the one that failed". The hint is for a mistyped devnet name; testnet and mainnet are not devnet names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PastaPastaPasta
left a comment
There was a problem hiding this comment.
Verdict: approve
The hint is now right on all three networks:
- testnet / mainnet:
unresolved_quorum_devnetreturnsNoneforquorums.testnet…/quorums.mainnet…(crates/forge-core/src/user_error.rs:1868), so an offline E701 keeps only its two connection fixes. These are the exact hostsNetwork::quorum_urlbuilds for them (network.rs:92-93), in lowercase, so the case-sensitive match covers them. - real devnets: unchanged. A name that
validate_devnet_nameaccepts can never betestnet/mainnet, so a devnet that won't resolve (a typo or offline) still gets the--devnet-name <name>line from QW3-068. The existingnosuchdevnettests still cover that.
Verified on a clean Linux sandbox: an_offline_testnet_or_mainnet_names_no_devnet passes with the change. With the matches! line removed it fails (left: Some("testnet")). CI is green.
Nit (non-blocking): validate_devnet_name (network.rs:189-192) reserves mainnet | testnet | devnet | local | regtest, compared case-insensitively. This filter lists only two of them. Sharing one reserved-names list would keep the two from drifting, but nothing in the SDK resolves a quorum host for the other three today, so this is cosmetic.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
With no network, every
dgread and everygit fetch/git pushon testnet ends E701 with this extra fix line:There is no devnet involved, and on mainnet the line would name
--devnet-name mainnet. Found in the mainnet-readiness CLI QA, runningdg repo view,dg issue create,git fetchandgit pushin a network namespace with no interfaces.The hint exists for a mistyped devnet name (QW3-068), whose quorum host does not resolve.
testnetandmainnetcan never be devnet names (validate_devnet_namerefuses them), sounresolved_quorum_devnetnow returnsNonefor them, and E701 keeps only its connection fixes.Test:
an_offline_testnet_or_mainnet_names_no_devnet. It fails without the change and passes with it (cargo test -p forge-core --lib user_error, 62 passed). Clippy and fmt are clean.🤖 Generated with Claude Code