feat(network): --explorer override for custom networks (stop inheriting base explorer)#393
Merged
Merged
Conversation
…ng the base explorer A custom network profile inherited its base chain's block explorer (e.g. a pre-clarke profile based on bradbury showed explorer-bradbury.genlayer.com in `network info`) — misleading, since that explorer never indexed the custom deployment's transactions. - Add `--explorer <url>` to `network add` (validated http(s); stored on the profile as overrides.explorer). - applyCustomNetworkProfile no longer inherits the base explorer for custom profiles: it sets blockExplorers ONLY from --explorer, otherwise blanks it. Built-in networks are unaffected (they don't go through this path). Also fixes two pre-existing tsc errors in the touched files (a narrowing cast in parseDeploymentObject; a spy typing in the getNetwork test). Tests: 778 passed (+3 explorer cases: stores+applies override, no-inherit default, invalid-URL rejection).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Member
Author
|
/run-e2e |
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
A custom network profile inherited its base chain's block explorer. So a pre-clarke profile based on
testnet-bradburyshowedexplorer-bradbury.genlayer.comingenlayer network info— misleading, because that explorer never indexed the custom deployment's transactions. An operator clicking through would look for their pre-clarke txs in the wrong place.Fix
--explorer <url>ongenlayer network add— validated (http/https), stored on the profile asoverrides.explorer.applyCustomNetworkProfilesetsblockExplorersonly from--explorer; when omitted, it blanks it (sonetwork infoshows no misleading link). Built-in networks are unaffected — they don't go through the custom-profile path.Notes
tscerrors in the touched files (a narrowing cast inparseDeploymentObject; a spy typing in thegetNetworktest).Test
778 passed (+3 explorer cases: stores + applies the override via
resolveNetwork; verifies a custom network does not inherit the base explorer; rejects an invalid URL). tsc clean on the changed files; build inlines fine.