Skip to content

refactor(test): extract shared MockCorporateActions fixture (audit #207)#226

Closed
hardyjosh wants to merge 1 commit into
fix/audit-prodfork-hardeningfrom
fix/audit-mock-corporate-actions-dedup
Closed

refactor(test): extract shared MockCorporateActions fixture (audit #207)#226
hardyjosh wants to merge 1 commit into
fix/audit-prodfork-hardeningfrom
fix/audit-mock-corporate-actions-dedup

Conversation

@hardyjosh

Copy link
Copy Markdown
Collaborator

Three separate test files each defined their own MockCorporateActions
mock of ICorporateActionsV1, with subtly different setter signatures.
Drift across these copies has already burned us — PR #221 had to
update the no-match sentinel in all three; a future ICorporateActionsV1
interface change risks updating only two of three.

Extracts the mock to test/mocks/MockCorporateActions.sol using the
most expressive of the three signatures (3-arg setters with
caller-supplied cursor). All three call sites now import the shared
mock. Behaviour unchanged: NODE_NONE no-match sentinel preserved from
PR #221; existing test assertions still pass.

Closes #207.

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6bd37d05-9d7f-478b-9a68-6edf2481107c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/audit-mock-corporate-actions-dedup

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.

hardyjosh commented May 11, 2026

Copy link
Copy Markdown
Collaborator Author

Three separate test files each defined their own MockCorporateActions
mock of ICorporateActionsV1, with subtly different setter signatures.
Drift across these copies has already burned us — PR #221 had to
update the no-match sentinel in all three; a future ICorporateActionsV1
interface change risks updating only two of three.

Extracts the mock to `test/mocks/MockCorporateActions.sol` using the
most expressive of the three signatures (3-arg setters with
caller-supplied cursor). All three call sites now import the shared
mock. Behaviour unchanged: NODE_NONE no-match sentinel preserved from
PR #221; existing test assertions still pass.

Closes #207.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hardyjosh hardyjosh force-pushed the fix/audit-prodfork-hardening branch from e30bfc0 to 6903113 Compare May 11, 2026 20:42
@hardyjosh hardyjosh force-pushed the fix/audit-mock-corporate-actions-dedup branch from 44287c9 to 1776f5f Compare May 11, 2026 20:42
@hardyjosh

Copy link
Copy Markdown
Collaborator Author

Folded into PRs #22, #23, #24 — the shared test/mocks/MockCorporateActions.sol fixture now ships from the start with PR #22, and each adapter test imports it directly instead of defining a local mock.

@hardyjosh hardyjosh closed this May 11, 2026
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