You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up from PR #2231 review (thread). Quoting @igamigo's approval review:
I'd want to remove the note observer trait and collapse it into the existing OnNoteReceived. The setup feels a bit more complex than it needs to be right now. The alternative could be to remove the traits and hardcode the logic, and try to do a separate PR for making it more generic (e.g., as part of #2209). This way we also reduce the diff.
Problem
The PSWAP tracking work introduced a new NoteObserver trait (crates/rust-client/src/sync/note_observer.rs:16) alongside the pre-existing OnNoteReceived screening callback. They overlap: OnNoteReceived filters notes, while NoteObserver collects filtered notes and applies follow-up logic. This is one abstraction more than necessary.
Proposed work
Fold NoteObserver's responsibilities into OnNoteReceived (or a minimal extension of it), removing the standalone trait.
Re-express PswapChainObserver on top of the unified abstraction.
Context
Follow-up from PR #2231 review (thread). Quoting @igamigo's approval review:
Problem
The PSWAP tracking work introduced a new
NoteObservertrait (crates/rust-client/src/sync/note_observer.rs:16) alongside the pre-existingOnNoteReceivedscreening callback. They overlap:OnNoteReceivedfilters notes, whileNoteObservercollects filtered notes and applies follow-up logic. This is one abstraction more than necessary.Proposed work
NoteObserver's responsibilities intoOnNoteReceived(or a minimal extension of it), removing the standalone trait.PswapChainObserveron top of the unified abstraction.Acceptance criteria
NoteObservertrait removed; PSWAP discovery runs throughOnNoteReceived.pswap_*tests stay green).