fix: CHAIN_ID in .env was silently ignored — honor it in all three scripts - #4
Merged
Conversation
.env.example documents CHAIN_ID as the chain selector, but none of the three scripts passed it to loadConfig — every scaffold silently targeted the default chain regardless of .env. The scripts (the env boundary per lib/config's environment-agnostic contract) now pass it through. CI gains a template-config job pinning the contract: CHAIN_ID=121214 gen-config must resolve chain 121214 (+ template typecheck).
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.
.env.exampledocumentsCHAIN_IDas the chain selector, butgen-config.ts,deploy.ts, anddemo.tsall calledloadConfig()without passing it — every scaffold silently targeted the default chain (200010) no matter what.envsaid. Deploys/demos aimed at another chain went to the wrong one.(Found by
rome new's works-gate: it pre-wiresCHAIN_ID=121214(martius) and assertsgen-configresolves it — the live red run resolved 200010.)Fix: the three scripts pass
chainId: Number(process.env.CHAIN_ID)through. Deliberately not made lib-level:lib/config.ts's documented contract is environment-agnostic (scripts ownprocess.env).Regression gate: new
template-configCI job —npm ciin template,CHAIN_ID=121214 npm run gen-config | grep "chain 121214", + template typecheck.Evidence: live red→green in a scaffolded app (same
.env,chain 200010→chain 121214); scaffolder suite 2/2 unaffected.