Skip to content

test: add deterministic deposit consolidation integration tests#60

Merged
lpahlavi merged 3 commits intomainfrom
lpahlavi/deterministic-consolidation-tests
Mar 23, 2026
Merged

test: add deterministic deposit consolidation integration tests#60
lpahlavi merged 3 commits intomainfrom
lpahlavi/deterministic-consolidation-tests

Conversation

@lpahlavi
Copy link
Copy Markdown
Contributor

(DEFI-2670) Add deterministic integration tests with mocked HTTP outcalls for the deposit consolidation timer task.

@lpahlavi lpahlavi marked this pull request as ready for review March 23, 2026 13:10
@lpahlavi lpahlavi requested a review from a team as a code owner March 23, 2026 13:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds deterministic integration coverage for the deposit consolidation timer task by introducing reusable JSON-RPC HTTP mock fixtures and a helper to drive PocketIC time/ticks until mocked outcalls are executed.

Changes:

  • Add a new consolidation_tests integration test that advances time to trigger the consolidation timer and asserts expected events.
  • Introduce Setup::execute_http_mocks to repeatedly tick/advance time while executing pending HTTP outcall mocks.
  • Move/extend HTTP mock helpers into integration_tests::fixtures (getSlot/getBlock/sendTransaction + shared getTransaction mocks).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
integration_tests/tests/tests.rs Adds consolidation integration test and per-RPC mock setup for the timer-triggered flow.
integration_tests/src/lib.rs Adds execute_http_mocks helper and re-exports PocketIC REST types for test/mocking ergonomics.
integration_tests/src/fixtures.rs Centralizes and expands JSON-RPC mock builders used by integration tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread integration_tests/tests/tests.rs Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lpahlavi lpahlavi merged commit 0e6ebe1 into main Mar 23, 2026
10 checks passed
@lpahlavi lpahlavi deleted the lpahlavi/deterministic-consolidation-tests branch March 23, 2026 16:19
lpahlavi added a commit that referenced this pull request Mar 24, 2026
(DEFI-2670) Add timer task that resubmits all expired submitted
transactions with a new blockhash.

Deterministic integration tests similar to the ones for deposit
consolidation task added in #60 will be added in a follow-up PR.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.

3 participants