You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
validateStellarNetwork — the one env function documented as 'too consequential to guess a default for' — has zero test coverage #420
src/lib/env.test.ts is 41 lines long and contains exactly one describe block: "validateApiUrl — scheme restriction", with 8 test cases thoroughly covering validateApiUrl. validateStellarNetwork has zero test coverage — grep -n "validateStellarNetwork" src/lib/env.test.ts returns nothing.
This is the more consequential of the two functions in this file, by its own doc comment's own admission:
/** * Validates `NEXT_PUBLIC_STELLAR_NETWORK`. Deliberately has no default — * unlike `NEXT_PUBLIC_API_URL` below, the wrong value here doesn't just * point at the wrong backend, it makes `wallet.ts#signTransaction` sign * with the wrong network passphrase (testnet passphrase in what's meant to * be a production build, or the reverse), which fails confusingly at the * Soroban contract layer at best. Network selection is too consequential * to guess a default for, so an unset or misspelled value fails the build * instead of silently picking one. */exportfunctionvalidateStellarNetwork(raw: string|undefined): StellarNetwork{if(raw===undefined||raw===""){thrownewEnvValidationError(...);}if(!VALID_STELLAR_NETWORKS.includes(rawasStellarNetwork)){thrownewEnvValidationError(...);}returnrawasStellarNetwork;}
It has three distinct branches (each documented as intentional and each throwing a distinct, carefully-worded EnvValidationError message) — unset/empty, invalid-but-non-empty (the doc comment even calls out "MAINNET" and lowercase "public" as "common near-misses that are not accepted"), and valid — and none of them is exercised by a test.
Impact
This function is the single build-time safeguard against exactly the failure mode its own comment describes as worst-case: a build silently signing transactions with the wrong Stellar network passphrase. validateApiUrl (the less consequential of the two functions, by the file's own reasoning) has 8 tests; the function whose entire reason for existing is "too consequential to guess a default for" has none. A regression here — e.g. accidentally allowing a case-insensitive match, or silently adding a default — would defeat the exact protection #26 was filed to establish, with no test to catch it.
Suggested fix
Add a describe("validateStellarNetwork") block to env.test.ts covering: throws with "is not set" for undefined/""; throws with "is not a valid Stellar network" for "MAINNET", "public" (lowercase), and other near-misses; and returns the value unchanged for exactly "TESTNET" and "PUBLIC".
I would like to resolve this issue. Here is my proposed execution plan:
Implementation: Add comprehensive test coverage for validateStellarNetwork — the one env function documented as 'too consequential to guess a default for' — has zero test coverage verifying edge cases and failure scenarios.
Testing: Ensure zero flake and 100% green pass rate across the test suite.
I can start working on this right away. Please assign!
@oniololade60-coder has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
Hello Maintainer, I’ve gone through the issue details and I’m confident I can deliver a solution that fully meets the project requirements. I’d appreciate being assigned to this task.
Congratulations, @chinoyenmose! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @chinoyenmose: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
😎 @chinoyenmose: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
Activity
test(env): add comprehensive unit test coverage for validateStellarNe…
ranjeet150 commentedon Sep 18, 2026
Hi there,
I would like to resolve this issue. Here is my proposed execution plan:
validateStellarNetwork — the one env function documented as 'too consequential to guess a default for' — has zero test coverageverifying edge cases and failure scenarios.I can start working on this right away. Please assign!
oniololade60-coder commentedon Sep 23, 2026
@oniololade60-coder has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @oniololade60-coder to this issue.
Dev-Dare4 commentedon Sep 23, 2026
@badmusdare4 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @badmusdare4 to this issue.
olamidemutiat300-debug commentedon Sep 23, 2026
@olamidemutiat300-debug has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @olamidemutiat300-debug to this issue.
chinoyenmose commentedon Sep 23, 2026
@chinoyenmose has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @chinoyenmose to this issue.
drips-wave commentedon Sep 23, 2026
Congratulations, @chinoyenmose! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @chinoyenmose: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
fix: add test coverage, a11y feedback for buttons (#420-#423)
Merge pull request #539 from chinoyenmose/fix/test-coverage-a11y-420-…
drips-wave commentedon Sep 25, 2026
This issue has been completed by @chinoyenmose as part of the Stellar Wave Program's 9th Wave 🥳
😎 @chinoyenmose: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
fix: surface inert team-split validation, milestone funding amount, p…