Skip to content

test: drop duplicate MockAddressRevertingFactory import - #123

Merged
thedavidmeister merged 1 commit into
mainfrom
2026-08-15-issue-71-double-import
Aug 16, 2026
Merged

test: drop duplicate MockAddressRevertingFactory import#123
thedavidmeister merged 1 commit into
mainfrom
2026-08-15-issue-71-double-import

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Closes #71

test/src/lib/LibRainDeploy.t.sol imported MockAddressRevertingFactory from ../../concrete/MockAddressRevertingFactory.sol at line 9 and again, byte-identically, at line 12. This deletes the line-12 copy. One line, nothing else in the diff.

The symbol is still used — new MockAddressRevertingFactory() at what are now lines 400 and 1142 — so this removes a redundant duplicate line, not a live import. solc tolerates a repeated identical declaration, so nothing about compilation, runtime or behaviour changes. The whole cost was a reader having to diff two lines to conclude they are the same, which is also why it survived: nothing fails, so nothing points at it.

Category, not just the cited line

The issue names one file and one symbol. The rule behind it is one import per symbol per file, so I checked that property across the repo rather than only the two cited lines: over every *.sol tracked in git, flattening each import's braced symbol list (multi-line import blocks included, so a symbol split across lines is still counted) and looking for any symbol imported twice in the same file returns exactly one hit — this file, this symbol. There is nothing else in the category, so the one-line fix is the whole fix.

Why nothing caught it

nix develop -c forge fmt --check exits 0 on the tree with the duplicate present, so the formatter neither flags nor removes it; slither.config.json is not configured for it; solc is silent by design. None of the three CI matrix tasks would have failed on this. This PR does not add a guard — that is scope beyond the issue — but the gap is worth stating rather than leaving implied.

QA

  • Discriminating tests: n/a, and deliberately. This diff deletes a redundant duplicate declaration; it has no reachable behaviour to assert, so a test asserting it would assert nothing. The compiler is the only oracle that can discriminate here, and it is exercised under "Mutations applied" below. Existing coverage is unchanged: LibRainDeployTest still compiles and still exercises MockAddressRevertingFactory at both call sites.
  • Mutations applied: test/src/lib/LibRainDeploy.t.sol line 9 — delete the surviving import as well, so the file has zero imports of MockAddressRevertingFactory against two usages -> killed by nix develop -c forge build, which fails with Error (7920): Identifier not found or not unique. pointing at line 400. That is the mutation that matters for this change: it proves the line the PR keeps is load-bearing and the line the PR deletes is not, which is exactly the claim "this was a duplicate, not a dead import". The inverse direction is already established and is why the issue exists — restoring the duplicate leaves the build, the formatter and slither all green, so no mutant on the deleted line can be killed by anything.
  • Oracle: solc symbol resolution, independent of this repo's own test assertions — the compiler decides whether MockAddressRevertingFactory resolves at lines 400 and 1142, and it is not consulted about which of two identical import lines provided it. The duplicate's own cited location came from the issue and was re-read against source before editing.
  • Category check: issue asks for exactly one thing — delete the duplicate import at line 12. Covered, plus the repo-wide scan above confirming this is the only symbol imported twice in any file, so no sibling instance is left behind.

Test runs. nix develop -c forge fmt --check exits 0. Full nix develop -c forge test with the five documented public RPC endpoints in .env: 202 passed across 17 suites, 16 suites fully green. The 13 failures were confined to LibRainDeploy.t.sol, and every one of the 26 [FAIL] lines is an HTTP 429 public-RPC rate limit (Public RPC Rate Limit Hit / over rate limit) from the shared free endpoints — zero assertion failures, and no failure mentions the import, the mock, or anything this diff touches.

Re-running that one suite with --threads 1 takes it to 53 passed / 1 failed of 54, the single remaining failure again a 429 from arb1.arbitrum.io. Failures fall 13 -> 1 purely by lowering RPC concurrency, with no source change between the two runs, which is what identifies rate limiting rather than the diff as the cause. CI runs with real RPC secrets and is the verdict that counts.

`test/src/lib/LibRainDeploy.t.sol` imported `MockAddressRevertingFactory`
from the same path at lines 9 and 12, byte-identically. solc tolerates a
repeated identical declaration, so it compiled and nothing failed, which
is why it survived — the cost was a reader having to diff two lines to
conclude they are the same.

The symbol is used, so this is a redundant duplicate line rather than a
dead import. A repo-wide scan of imported symbols per file finds this as
the only case.

Closes #71

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Aug 15, 2026
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thedavidmeister, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 11 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ab3f908c-eebb-4b14-80dc-b5267aa3951e

📥 Commits

Reviewing files that changed from the base of the PR and between 86f8d96 and 9c4eab2.

📒 Files selected for processing (1)
  • test/src/lib/LibRainDeploy.t.sol

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thedavidmeister

Copy link
Copy Markdown
Contributor Author

Reviewed 9c4eab2: ready — Closes #71. Read the diff.

One line removed: MockAddressRevertingFactory was imported twice from the same path, and the second import at line 13 goes. The first, at line 10, stays, so every use in the file still resolves. Nothing else in the diff.

CI green (rainix static/legal/test), 0 unresolved threads — qualified, since the CodeRabbit check reports Review rate limited, which is a green check with no review behind it, so that zero is vacuous rather than clean. Base has moved under this PR since its checks ran (#92 and #125 merged into the same file's directory), and GitHub reports MERGEABLE/CLEAN against current main; a duplicate-import removal cannot conflict semantically with tests added elsewhere in the file.

@thedavidmeister
thedavidmeister merged commit e6686a4 into main Aug 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MockAddressRevertingFactory is imported twice in the same file

1 participant