test(security): Tier 1 unit tests for untested security-critical modules - #7
Draft
Hans1132 wants to merge 1 commit into
Draft
test(security): Tier 1 unit tests for untested security-critical modules#7Hans1132 wants to merge 1 commit into
Hans1132 wants to merge 1 commit into
Conversation
…modules Close the highest-risk coverage gaps surfaced by the test-coverage analysis: - validation/address: chain-gating regex + PublicKey off-curve branch (10) - enrichment/token-extensions: Token-2022 TLV parser, PermanentDelegate/ TransferHook severity + truncated-buffer fuzz (12) - enrichment/goplus: circuit-breaker state machine + field normalization (8) - crypto/sign-timeout: semaphore release on every exit path, no pool deadlock under failure bursts (5) - monitor/webhook-auth: Helius webhook auth gate (5) All offline (db/fetch/spawn mocked); wired into the npm test chain. https://claude.ai/code/session_013zuzbRSW4G4L1CrReKpLpf
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus 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 |
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.
Context
Follow-up to a test-coverage analysis of the codebase. The suite is strong on the IRIS scoring/accuracy path and a handful of security primitives, but several large, security-sensitive modules had zero dedicated unit tests. This PR closes the Tier 1 (highest-risk) gaps. Tests only — no production behavior changes.
What's added (+40 tests, all offline)
tests/validation/address.test.js(10)src/validation/address.jsPublicKeyoff-curve try/catch branchtests/enrichment/token-extensions.test.js(12)src/enrichment/token-extensions.jstests/enrichment/goplus.test.js(8)src/enrichment/goplus.jstoBool/toFloatnormalization,is_maliciousheuristic, timeout pathtests/crypto/sign-timeout.test.js(5)src/crypto/sign.jstests/monitor/webhook-auth.test.js(5)src/monitor/webhook-receiver.jsAll external dependencies (db,
fetch,child_processspawn) are mocked/stubbed — no network, no secrets. Wired into thenpm testchain inpackage.json.Note for review
lib/helius-poller.js. I verified it is not a bug —totalPages++runs before the fetch as the sharp-edge note requires. The real gap there (untested pagination) is queued for Tier 2, not this PR.sign-timeoutuses realpython3stub scripts (with a skip-guard if absent), matching the prod pipeline.Verification
https://claude.ai/code/session_013zuzbRSW4G4L1CrReKpLpf
Generated by Claude Code