Skip to content

Add integration test for the full QR payment flow via mock Horizon - #1015

Open
AMV-AUTOS wants to merge 1 commit into
kellymusk:masterfrom
AMV-AUTOS:test/qr-payment-flow-mock-horizon
Open

Add integration test for the full QR payment flow via mock Horizon#1015
AMV-AUTOS wants to merge 1 commit into
kellymusk:masterfrom
AMV-AUTOS:test/qr-payment-flow-mock-horizon

Conversation

@AMV-AUTOS

@AMV-AUTOS AMV-AUTOS commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • Adds MockBlockchainListener (tests/common/mod.rs), a BlockchainListener that hands back a fixed set of synthetic deposits, so the worker's detect/correlate logic can be exercised without a real Stellar node.
  • Generalizes blockchain::worker::poll_once to take any &dyn BlockchainListener (was hardcoded to StellarListener) and makes it and process_deposit pub, giving tests a real seam to drive the worker logic through.
  • New tests in tests/payment_request_flow.rs cover the full memo-correlation path end-to-end:
    • a matching deposit marks the payment request paid
    • an underpaid deposit marks it partial instead
    • a late deposit on an already-expired (but still DB-pending) request still gets correlated by memo — documents that the worker doesn't currently check expiry

Closes #984

Test plan

  • cargo test --test payment_request_flow passes against TEST_DATABASE_URL

Adds MockBlockchainListener (tests/common/mod.rs), a BlockchainListener
that hands back a fixed set of synthetic deposits, so the worker's
detect/correlate logic can be exercised without a real Stellar node.

Generalizes blockchain::worker::poll_once to take any
`&dyn BlockchainListener` (was hardcoded to StellarListener) and makes
it and process_deposit pub, giving tests a real seam to drive.

New tests in tests/payment_request_flow.rs cover the full memo-
correlation path end-to-end:
- a matching deposit marks the payment request paid
- an underpaid deposit marks it partial instead
- a late deposit on an already-expired (but still DB-pending) request
  still gets correlated by memo, documenting that the worker doesn't
  currently check expiry

Closes kellymusk#984.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011J7cMjp4iB1hfJ3128XfEF
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@AMV-AUTOS Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Testing: add integration test for the full QR payment flow end-to-end with mock Horizon

1 participant