swapwallet: Hide boarding sweep fee ledger rows#833
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the ledger row classification in swapwallet/history.go to ignore internal boarding-sweep chain costs (ledger.EventBoardingSweepFeePaid) by classifying them as unspecified and unexported. It also adds a corresponding unit test TestHistoryHidesBoardingSweepFeeLedgerLeg in swapwallet/history_test.go to verify this behavior. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
6470c25 to
f967348
Compare
|
@claude review this with the context of the issue it references |
|
Claude finished @ellemouton's task in 3m 19s —— View job Review: PR #833 — Hide boarding sweep fee ledger rows
I traced the full ledger → Why the fix is rightA confirmed boarding sweep books several ledger legs in
So among all the sweep's ledger legs, only the fee leg mapped to The canonical row is safe from the new filterThe visible exit comes from the Filtering vs. de-duping was the correct choice
Test
One observation (minor, likely out of scope)
Fix this → (optional — confirm desired behavior first) VerdictLGTM. The root-cause analysis in the PR description matches the code, the fix is surgical, and the regression test pins the reported case. |
666cf64 to
7e9262d
Compare
The boarding_sweeps table already provides the canonical user-facing exit row for a confirmed boarding sweep. The ledger's boarding_sweep_fee_paid event is an internal clearing leg. The same projection issue applies to unilateral-exit onchain_fee_paid rows. Filter ledger-sourced sweep rows from activity and onchain history projection, and add regression tests covering both fee-leg shapes.
7e9262d to
063b582
Compare
|
@ellemouton, remember to re-request review from reviewers when ready |
Fixes #826.
Root Cause
Confirmed boarding sweeps already have a canonical wallet activity row from
the
boarding_sweepstable. The history projector also treatedledger-sourced sweep rows as user-facing sweeps, even though those rows are
internal fee-clearing legs.
For the issue's reported transaction, that internal leg was
139sats ofminer fee plus the
330sat anchor, so it surfaced as a bogus secondEXIT PENDING -469row.The same projection bug also applies to unilateral-exit
onchain_fee_paidrows, which are ledger-sourced sweep fee legs with no user-facing chain txid
or confirmation lifecycle.
Changes
history.
boarding_sweepsrow as the visible exit entry.50_000 / 139 / 469shape.onchain_fee_paidrows.with empty txids.
Validation
make unit-swapruntime pkg=./swapwallet case=TestHistoryHidesBoardingSweepFeeLedgerLegmake unit-swapruntime pkg=./swapwallet case=TestHistoryHidesUnilateralExitFeeLedgerLegmake unit-swapruntime pkg=./swapwallet case=TestListViewOnchainFlattensLedgerRowsmake unit-swapruntime pkg=./swapwalletmake lint-changed-localgit diff --check