test initialize semantics: typed-overload reverts and re-init protection#443
Conversation
Four invariants pinned: 1. `Flow.initialize(EvaluableConfigV3[])` (the typed overload) reverts with `ICloneableV2.InitializeSignatureFn` on the implementation. 2. Same overload reverts on a successfully initialized clone. 3. `_disableInitializers()` in the implementation constructor blocks any direct `initialize(bytes)` on the implementation. 4. A successfully initialized clone rejects a second `initialize(bytes)`. OZ Initializable v4 reverts with the string `"Initializable: contract is already initialized"`. Mutation verified: removing the `initializer` modifier from `initialize(bytes)` makes both re-init tests fail; reverting passes. Closes #322 #323. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 3 minutes and 35 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 (1)
✨ 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 |
Resolve the Flow.construction.t.sol conflict as the union: both branches only appended new test functions to FlowConstructionTest with no overlap. Keeps PR #443's four initialize-semantics tests and main's three flowOutputs/flowInputs guard tests, merges the imports, and adopts main's LibLogHelper.findEvent in the shared testFlowConstructionInitialize. forge fmt applied. Build clean; all 9 tests in the file pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Reviewed a1268c7: test initialize semantics: typed-overload reverts and re-init protection — rebased onto main (test-only union conflict resolution + forge fmt), all checks green. LGTM. |
Summary
Pins four
initializeinvariants onFlow:Flow.initialize(EvaluableConfigV3[])(the typed overload mandated byICloneableV2) reverts withICloneableV2.InitializeSignatureFnon the implementation._disableInitializers()in the implementation constructor blocks any directinitialize(bytes)call on the implementation.initialize(bytes).OZ Initializable v4 reverts with
"Initializable: contract is already initialized".Mutation verified: removing the
initializermodifier frominitialize(bytes)makes both re-init tests fail; reverting passes.Closes #322 #323.
Test plan
initializermodifier → re-init tests fail🤖 Generated with Claude Code