Move inline test helper contracts into dedicated test/concrete/ files#321
Conversation
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>
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ 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 |
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>
What
Resolves the pre-existing convention violations found by the repo-wide audit in #314: four
.t.solfiles each declared a helper contract inline alongside their test contract. This extracts each helper into its owntest/concrete/<ContractName>.sol(one contract per file, named after the contract) and imports it back into the.t.sol.AlwaysAuthorizetest/src/concrete/vault/OffchainAssetReceiptVault.authorize.t.soltest/concrete/AlwaysAuthorize.solMutableMetadataReceipttest/src/concrete/receipt/ERC20PriceOracleReceipt.metadata.t.soltest/concrete/MutableMetadataReceipt.solPriceOracleV2TestImpltest/src/abstract/PriceOracleV2.t.soltest/concrete/PriceOracleV2TestImpl.solTestOwnerFreezabletest/src/abstract/OwnerFreezable.ownerFreezeUntil.t.soltest/concrete/TestOwnerFreezable.solHow
Pure relocation, no logic change:
.t.solnow imports the helper and declares only its own test contract; imports that were used solely by the inline helper were removed.After this change, no
test/**/*.t.soldeclares more than one contract.Verify
forge buildclean (only pre-existingmissing-zero-checklint warnings on the unrelated#309helpers).forge testfor 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