test(registry): pin mutation-coverage gaps in LibFlareContractRegistry - #112
thedavidmeister wants to merge 6 commits into
Conversation
The registry suite only asserted getFtsoRegistry. Mutating the FtsoV2 / FeeCalculator lookup names survived (no test referenced those functions). Add exact-address assertions at the pinned fork block so a wrong/bogus canonical name (which the registry resolves to address(0)) is caught. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ssing The Flare contract registry returns address(0) for unknown names; the library has no zero-address guard, so a missing name yields a typed interface wrapping address(0) instead of reverting. Pin this current behavior for all three lookups via a mocked registry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe test file for ChangesLibFlareContractRegistry test coverage expansion
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/src/lib/registry/LibFlareContractRegistry.t.sol`:
- Around line 17-18: The import statement for IFlareContractRegistry is split
across two lines, which causes the formatter check to fail. Consolidate the
import statement into a single line by moving the path string onto the same line
as the import keyword and module name, so the entire import declaration for
IFlareContractRegistry is on one line.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5511a10f-2a43-492b-9917-06a18a59781b
📒 Files selected for processing (1)
test/src/lib/registry/LibFlareContractRegistry.t.sol
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The test pinned return-zero-on-missing-name behavior which is a footgun; PR #153 (issue #45) fixes the library to revert ContractNotRegistered on missing name instead. Keep testGetFtsoRegistry/testGetFtsoV2LTS/ testGetFeeCalculator which test the happy path. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Union of both sides in LibFlareContractRegistry.t.sol: keeps the address-pinning getter tests from this branch alongside main's registry name literal test. Co-Authored-By: Claude <noreply@anthropic.com>
|
🤖 ai:producer |
|
🤖 ai:producer |
|
👤 human Issue 75 STAYS OPEN and is not resolved by this close. Two of its three mutation-coverage rows landed on main via sibling changes. The third row -- the missing-name address(0) passthrough -- is pinned by no test on main, and was dropped from this branch on purpose in commit 0f4810b, because pinning it would entrench the behaviour that issue 45 wants changed. #153 is still open and main still passes address(0) through with no revert, so that row belongs to 153, not to a test pin. Do not treat 75 as covered. Routing correction for the producer, the second on this pattern today. This was ai:close-candidate, not ai:design: the reason given -- I cannot close a PR -- is true of every close-candidate ever filed, so it does not distinguish a design question. And the empty-diff check does not establish supersession. Merging main in, resolving every conflict to mains side, and diffing against main returns empty whatever the branch held, because resolving to mains side IS discarding the branch. This note also stated that testGetFeeCalculator differs from main in a local variable name, which the same check reported as byte-for-byte empty; both cannot be measurements of the same thing, and the direct comparison above shows three real differences. Compare file contents against main. |
Closes #75
Adds two discriminating tests to
test/src/lib/registry/LibFlareContractRegistry.t.solthat kill all 3 surviving mutants insrc/lib/registry/LibFlareContractRegistry.sol:testGetFtsoV2LTS/testGetFeeCalculator— pin the exact resolved addresses, killing the name-string swap mutationstestGetterReturnsZeroAddressWhenNameMissing— mocks the Flare registry to returnaddress(0)for all three names; asserts all three lib getters returnaddress(0)(unguarded passthrough), pinning the missing-name behaviorNo Dinero tests needed — existing exact-value assertions already kill every
LibDineroFlrEthmutation.All 52 tests pass. Tests-only change, no bytecode impact.
Co-Authored-By: Claude noreply@anthropic.com
Summary by CodeRabbit