Draft
Conversation
Refactor KyotoClient to use a KyotoClientHandle struct instead of Box<LightClient>. Previously, the Box<LightClient> was consumed when destructured in sync_kyoto_client, preventing the function from being called multiple times or borrowed. With the handle pattern, sync_kyoto_client now takes &mut KyotoClientHandle, allowing it to be borrowed and reused. This also allows the node to be started at creation time in new_blockchain_client rather than during sync, making the client ready for use immediately after creation. - Add KyotoClientHandle struct containing requester and update_subscriber - Move node startup and logger spawning to new_blockchain_client - Update sync_kyoto_client to accept &mut KyotoClientHandle instead of consuming Box<LightClient>
Update function signatures to accept &BlockchainClient instead of taking ownership. This refactoring to allow the client to be Referenced across multiple operations including repeated calls to sync_kyoto_client. - Update handle_online_wallet_subcommand signature - Update all PayjoinManager methods to use &BlockchainClient - Fix parameter dereferencing in full_scan calls - Update all call sites to pass references
Replace single sync-and-check with periodic polling loop. This allows multiple sync operations since sync_wallet now accepts a reference to BlockchainClient, enabling proper long-running monitoring instead of a one-time check.
Replace Error::Generic with specific Payjoin error variants using #[from] derives for applicable places, enabling automatic conversion and eliminating verbose .map_err() calls.
- Create db.rs with Database, SenderPersister and ReceiverPersister - Implement SessionPersister trait for both sender and receiver - Add session ID management and query methods - Add input deduplication tracking to prevent probing attacks - Add timestamp formatting utilities
- Add database initialization in handlers - Replace NoopSessionPersister with real persisters - Implement session resumption for existing sessions - Add input-seen-before tracking in receiver flow - Remove verbose error wrapping (use ? operator)
- Implement resume_payjoins() to continue pending sessions - Add history() to display all session states - Add session status text helpers for UI display - Support filtering by session ID
- Document resume and history commands - Add sqlite dependecy for payjoin
Pull Request Test Coverage Report for Build 22068931916Details
💛 - Coveralls |
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.
Description
Open as draft cause #230 needs to be merged first
Address #149 also follow up to #200
This PR adds persistance to existing async payjoin integration
This introduces neccessary database model for tables, add commad for resume and history also to reume a particular session
Notes to the reviewers
Review for this PR can start at 8614e22
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: