fix: consolidate MockDripsContract into tests/common/mod.rs - #299
Merged
N-thnI merged 3 commits intoAug 30, 2026
Merged
Conversation
Closes Vero-protocol#199 MockDripsContract was independently defined in both tests/purge_reward_stream.rs and tests/test.rs with identical start_stream stubs. Any future change to the mocked Drips interface would have required updating two separate definitions with no guarantee they stayed in sync. - Add tests/common/mod.rs with the single canonical MockDripsContract - Update tests/purge_reward_stream.rs to import from common - Update tests/test.rs to import from common
Contributor
|
please ensure all checks pass |
The multi-line empty-body function signature in tests/common/mod.rs was rejected by `cargo fmt --check` (CI Format check step). rustfmt collapses empty-body functions with params that fit on one line into a single-line form. No logic change — stub body remains empty.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #199
MockDripsContractwas independently defined in bothtests/purge_reward_stream.rsandtests/test.rswith an identicalstart_streamstub. Any future change to the mocked Drips interface would require updating two separate definitions with no guarantee they stayed in sync.Changes
tests/common/mod.rs— single canonicalMockDripsContractdefinitiontests/purge_reward_stream.rs— remove local definition, import fromcommontests/test.rs— remove local definition, import fromcommonTesting
Both test suites are structurally unchanged. Only the source of the mock moved; no test logic was modified.