Skip to content

Move inline test helper contracts into dedicated test/concrete/ files#321

Merged
thedavidmeister merged 3 commits into
mainfrom
2026-06-14-issue-314
Jun 16, 2026
Merged

Move inline test helper contracts into dedicated test/concrete/ files#321
thedavidmeister merged 3 commits into
mainfrom
2026-06-14-issue-314

Conversation

@thedavidmeister

Copy link
Copy Markdown
Collaborator

What

Resolves the pre-existing convention violations found by the repo-wide audit in #314: four .t.sol files each declared a helper contract inline alongside their test contract. This extracts each helper into its own test/concrete/<ContractName>.sol (one contract per file, named after the contract) and imports it back into the .t.sol.

Helper Moved from Moved to
AlwaysAuthorize test/src/concrete/vault/OffchainAssetReceiptVault.authorize.t.sol test/concrete/AlwaysAuthorize.sol
MutableMetadataReceipt test/src/concrete/receipt/ERC20PriceOracleReceipt.metadata.t.sol test/concrete/MutableMetadataReceipt.sol
PriceOracleV2TestImpl test/src/abstract/PriceOracleV2.t.sol test/concrete/PriceOracleV2TestImpl.sol
TestOwnerFreezable test/src/abstract/OwnerFreezable.ownerFreezeUntil.t.sol test/concrete/TestOwnerFreezable.sol

How

Pure relocation, no logic change:

  • Each moved contract body is byte-identical to its origin (verified by diff).
  • The new files add only the SPDX header / pragma / imports each contract needs.
  • The corresponding .t.sol now imports the helper and declares only its own test contract; imports that were used solely by the inline helper were removed.
  • No test logic touched.

After this change, no test/**/*.t.sol declares more than one contract.

Verify

  • forge build clean (only pre-existing missing-zero-check lint warnings on the unrelated #309 helpers).
  • forge test for the four affected suites: 37 passed, 0 failed, 0 skipped.

Note: the second checkbox in #314 (a CI/lint guard against regressions) is intentionally out of scope here — this PR only performs the relocation. Happy to follow up with the guard separately.

Closes #314

Extract the four inline helper contracts flagged by the repo-wide audit in
#314 into their own one-contract-per-file modules under test/concrete/, and
import them back into the respective .t.sol files. Each moved contract body is
relocated verbatim; only the SPDX/pragma/imports the new file needs were added,
and the now-unused imports left behind in the .t.sol files were removed. No test
logic changed.

- AlwaysAuthorize       <- OffchainAssetReceiptVault.authorize.t.sol
- MutableMetadataReceipt <- ERC20PriceOracleReceipt.metadata.t.sol
- PriceOracleV2TestImpl  <- PriceOracleV2.t.sol
- TestOwnerFreezable     <- OwnerFreezable.ownerFreezeUntil.t.sol

Closes #314

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

coderabbitai Bot commented Jun 14, 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 26 minutes and 33 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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: bed71e2c-6e2b-46f0-9037-26f9b1128902

📥 Commits

Reviewing files that changed from the base of the PR and between e1feaa6 and ef5f602.

📒 Files selected for processing (10)
  • test/concrete/AlwaysAuthorize.sol
  • test/concrete/MutableMetadataReceipt.sol
  • test/concrete/PriceOracleV2TestImpl.sol
  • test/concrete/TestOwnerFreezable.sol
  • test/concrete/TestReceiptManager.sol
  • test/concrete/TestReceiptManagerAsset.sol
  • test/src/abstract/OwnerFreezable.ownerFreezeUntil.t.sol
  • test/src/abstract/PriceOracleV2.t.sol
  • test/src/concrete/receipt/ERC20PriceOracleReceipt.metadata.t.sol
  • test/src/concrete/vault/OffchainAssetReceiptVault.authorize.t.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-14-issue-314

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.

thedavidmeister and others added 2 commits June 15, 2026 16:11
test/concrete/TestReceiptManager.sol declared two contracts, which the
rainix single-contract convention check rejects (one contract per file).
Move the TestReceiptManagerAsset helper into its own file and import it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thedavidmeister

Copy link
Copy Markdown
Collaborator Author

Reviewed ef5f602: approved by maintainer; re-triggered against fixed rainix main (LICENSE symlink #232) — single-contract gate + license-staging now green, mergeable. Merging.

@thedavidmeister thedavidmeister merged commit 8f68b12 into main Jun 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.

Move inline test helper contracts into dedicated test/concrete/ files

1 participant