Add integration test for the full QR payment flow via mock Horizon - #1015
Open
AMV-AUTOS wants to merge 1 commit into
Open
Add integration test for the full QR payment flow via mock Horizon#1015AMV-AUTOS wants to merge 1 commit into
AMV-AUTOS wants to merge 1 commit into
Conversation
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
|
@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! 🚀 |
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
MockBlockchainListener(tests/common/mod.rs), aBlockchainListenerthat hands back a fixed set of synthetic deposits, so the worker's detect/correlate logic can be exercised without a real Stellar node.blockchain::worker::poll_onceto take any&dyn BlockchainListener(was hardcoded toStellarListener) and makes it andprocess_depositpub, giving tests a real seam to drive the worker logic through.tests/payment_request_flow.rscover the full memo-correlation path end-to-end:paidpartialinsteadpending) request still gets correlated by memo — documents that the worker doesn't currently check expiryCloses #984
Test plan
cargo test --test payment_request_flowpasses againstTEST_DATABASE_URL