test kvs short-circuit and store.set revert paths in LibFlow.flow#449
Conversation
Two new tests: - testFlowBasicFlowTimeNoStoreSetWhenKvsEmpty: explicit count=0 expectCall on STORE.set when kvs is empty. Pins the existing short-circuit so a future change that drops it is caught. Mutation verified: removing the `kvs.length > 0` guard makes the test fail; reverting passes. - testFlowBasicFlowTimeStoreSetRevertBubbles: when kvs is non-empty and store.set reverts, the revert MUST propagate out of flow(). Closes #329. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughTwo new test cases verify uncovered code paths in ChangesLibFlow.flow edge-case test coverage
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/src/concrete/Flow.time.t.sol`:
- Around line 59-63: Replace the ABI-encoded revert payloads with raw string
literals: in the vm.mockCallRevert call that currently passes
abi.encode("STORE_SET_FAILED") (with IInterpreterStoreV2.set.selector) and in
the vm.expectRevert call that uses abi.encode("STORE_SET_FAILED"), change both
to the raw string "STORE_SET_FAILED" so the mock revert and the expected revert
use the same raw UTF-8 message per Foundry convention.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8cd9ee35-495a-4e6e-ade6-3a31d9623c5b
📒 Files selected for processing (1)
test/src/concrete/Flow.time.t.sol
Per Foundry convention `vm.mockCallRevert(retdata)` and `vm.expectRevert(revertData)` take raw revert bytes; passing `abi.encode("...")` produces ABI-encoded bytes (offset+length+padded data) which are self-consistent here but diverge from idiomatic usage in the Foundry book.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Two new tests pinning
LibFlow.flow's store-side behavior:testFlowBasicFlowTimeNoStoreSetWhenKvsEmpty— explicitcount=0expectCallonSTORE.setwhen kvs is empty. Locks the existing short-circuit so a future change that drops it is caught. Mutation verified: removing thekvs.length > 0guard makes the test fail; reverting passes.testFlowBasicFlowTimeStoreSetRevertBubbles— when kvs is non-empty andstore.setreverts, the revert MUST propagate out offlow()rather than be caught and swallowed.Closes #329.
Test plan
kvs.length > 0guard → empty-kvs test fails🤖 Generated with Claude Code
Summary by CodeRabbit