Skip to content

test: one contract per file (satisfy rainix single-contract gate)#537

Open
thedavidmeister wants to merge 3 commits into
mainfrom
2026-06-15-one-contract-per-file
Open

test: one contract per file (satisfy rainix single-contract gate)#537
thedavidmeister wants to merge 3 commits into
mainfrom
2026-06-15-one-contract-per-file

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

The rainix rainix-sol-single-contract gate (rainix #214) enforces the Rain convention of one contract / abstract contract per .sol file. 14 pre-existing test files declared more than one contract, which fails the gate and reds main.

This PR splits each offending file so every .sol declares exactly one contract. The primary test contract stays in the original file named after it; each helper / mock / secondary contract moves into its own file named after the contract, carrying the SPDX header, pragma, and the imports it needs. Each original file imports the contracts it still references. This is a pure file reorganization: no test logic or contract behavior changed.

Files split (original -> moved contracts in their own new files)

  • test/src/abstract/BaseRainlangExtern.construction.t.sol (5) -> TestableExtern.sol, EmptyPointersExtern.sol, MismatchedExternMoreOpcodes.sol, MismatchedExternMoreIntegrity.sol
  • test/src/abstract/BaseRainlangExtern.ierc165.t.sol (2) -> ChildRainlangExtern.sol
  • test/src/abstract/BaseRainlangExtern.integrityOpcodeRange.t.sol (2) -> TwoOpExtern.sol
  • test/src/abstract/BaseRainlangSubParser.ierc165.t.sol (2) -> ChildRainlangSubParser.sol
  • test/src/abstract/BaseRainlangSubParser.subParseLiteral2.t.sol (4) -> HappyPathLiteralSubParser.sol, NoMatchLiteralSubParser.sol, MismatchedLiteralSubParser.sol
  • test/src/abstract/BaseRainlangSubParser.subParseWord2.t.sol (3) -> MismatchedWordSubParser.sol, EmptyWordParsersSubParser.sol
  • test/src/concrete/RainlangInterpreter.zeroFunctionPointers.t.sol (2) -> ZeroFPRainlangInterpreter.sol
  • test/src/concrete/RainlangParser.parseMemoryOverflow.t.sol (2) -> ModifierTestParser.sol
  • test/src/concrete/RainlangReferenceExtern.subParserIndexOutOfBounds.t.sol (2) -> MockExternBadLiteralIndex.sol
  • test/src/lib/integrity/LibIntegrityCheck.t.sol (3) -> IntegritySingleOp.sol, IntegrityHighwater.sol
  • test/src/lib/parse/LibSubParse.badSubParserResult.t.sol (2) -> BadLengthSubParser.sol
  • test/src/lib/parse/LibSubParse.constantAccumulation.t.sol (3) -> ConstantReturningSubParser.sol, MultiConstantSubParser.sol
  • test/src/lib/parse/LibSubParse.subParseWords.t.sol (2) -> ContextReturningSubParser.sol
  • test/src/lib/state/LibInterpreterStateDataContract.t.sol (2) -> LibInterpreterStateDataContractExtern.sol

14 files split into 22 new single-contract files; contract count is conserved (36 contracts before and after).

Verification

  • rainix-sol-single-contract exits 0 (no violations remain).
  • forge build clean; forge fmt --check clean.
  • forge test: 1524 passed. The only 16 failures are pre-existing fork tests that need RPC env vars (ARBITRUM_RPC_URL, BASE_RPC_URL, etc.) not set in the local sandbox; they fail identically on clean main and are in files this PR does not touch.

Greens main and unblocks coverage PRs #534 and #536.

🤖 Generated with Claude Code

Split each test .sol that declared more than one contract so every file
declares exactly one. The primary test contract stays in the original
file; each helper/mock/secondary contract moves to its own file named
after the contract, with the SPDX header, pragma, and imports it needs.
Each original file imports the contracts it still references.

Pure file reorganization: no test logic or contract behavior changes.
Satisfies the rainix rainix-sol-single-contract gate (rainix #214),
greening main and unblocking coverage PRs #534 and #536.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

More reviews will be available in 45 minutes and 41 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 903207f1-3e1b-4710-bf87-aaecbbf17156

📥 Commits

Reviewing files that changed from the base of the PR and between b3d5081 and e26bc3f.

📒 Files selected for processing (36)
  • test/src/abstract/BaseRainlangExtern.construction.t.sol
  • test/src/abstract/BaseRainlangExtern.ierc165.t.sol
  • test/src/abstract/BaseRainlangExtern.integrityOpcodeRange.t.sol
  • test/src/abstract/BaseRainlangSubParser.ierc165.t.sol
  • test/src/abstract/BaseRainlangSubParser.subParseLiteral2.t.sol
  • test/src/abstract/BaseRainlangSubParser.subParseWord2.t.sol
  • test/src/abstract/ChildRainlangExtern.sol
  • test/src/abstract/ChildRainlangSubParser.sol
  • test/src/abstract/EmptyPointersExtern.sol
  • test/src/abstract/EmptyWordParsersSubParser.sol
  • test/src/abstract/HappyPathLiteralSubParser.sol
  • test/src/abstract/MismatchedExternMoreIntegrity.sol
  • test/src/abstract/MismatchedExternMoreOpcodes.sol
  • test/src/abstract/MismatchedLiteralSubParser.sol
  • test/src/abstract/MismatchedWordSubParser.sol
  • test/src/abstract/NoMatchLiteralSubParser.sol
  • test/src/abstract/TestableExtern.sol
  • test/src/abstract/TwoOpExtern.sol
  • test/src/concrete/MockExternBadLiteralIndex.sol
  • test/src/concrete/ModifierTestParser.sol
  • test/src/concrete/RainlangInterpreter.zeroFunctionPointers.t.sol
  • test/src/concrete/RainlangParser.parseMemoryOverflow.t.sol
  • test/src/concrete/RainlangReferenceExtern.subParserIndexOutOfBounds.t.sol
  • test/src/concrete/ZeroFPRainlangInterpreter.sol
  • test/src/lib/integrity/IntegrityHighwater.sol
  • test/src/lib/integrity/IntegritySingleOp.sol
  • test/src/lib/integrity/LibIntegrityCheck.t.sol
  • test/src/lib/parse/BadLengthSubParser.sol
  • test/src/lib/parse/ConstantReturningSubParser.sol
  • test/src/lib/parse/ContextReturningSubParser.sol
  • test/src/lib/parse/LibSubParse.badSubParserResult.t.sol
  • test/src/lib/parse/LibSubParse.constantAccumulation.t.sol
  • test/src/lib/parse/LibSubParse.subParseWords.t.sol
  • test/src/lib/parse/MultiConstantSubParser.sol
  • test/src/lib/state/LibInterpreterStateDataContract.t.sol
  • test/src/lib/state/LibInterpreterStateDataContractExtern.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-15-one-contract-per-file

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 and usage tips.

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.

1 participant