fix: show the amount that leaves on spending confirm - #1323
Conversation
|
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
jvsena42
left a comment
There was a problem hiding this comment.
No regression. The displayed total now equals what is debited on both paths, verified by a second pass. One pre-existing LOW-MEDIUM inline, about the mechanism this PR touches.
Checked and clean:
- Normal path. Display is
feeSat + miningFeeSats; the pay call sendsorder.feeSatwith the plan's UTXOs and records the same total. - Send-all. Display is
spendableBalance;sendAllToAddress(retainReserve = true)spends exactly that, with the fee taken out of it, and the recorded total matches. - Rows. LSP fee is the saturating
feeSat - clientBalance, so it cannot underflow, and all sat arithmetic goes throughUSat. - Mid-refresh hold.
prepareSpendingConfirmFundingnow only clearsisConfirmFeeReady, so the previous numbers stay on screen instead of flashing zero, and the swipe is disabled throughout. The failure branch still clears all four fields together, which is what greptile's P2 asked for. - Advanced and Default. Both re-quote through the same re-plan, and a changed LSP balance drops the cached order.
- Hardware. Untouched. The grid stays
feeSat + hwMiningFeeSats, the PSBT is composed for exactlyorder.feeSat, andPendingHwFundingBroadcast.matchespins that amount. No send-all there.
Non-blocking, pre-existing and shared with iOS: when dust avoidance triggers send-all, the sweep is wallet-wide rather than limited to the selected inputs, so the overpayment to Blocktank is not bounded by the dust limit. This PR now shows that honestly. Whether Blocktank credits an on-chain overpayment is unverified.
|
QA reviewed on c2122a2. Spending confirm now shows the amount that leaves. On a send-all transfer the total is the spendable balance, and a refresh keeps the previous total on screen until the new plan arrives. Ran on Pixel_6. With 20 000 sats in savings, an 18 600 transfer showed network fee 110, service fee 1 185, to spending 18 600, and total 20 000. Those three rows add up to 19 895, so the total is the whole balance that send-all spends, not the order fee plus the miner fee. Left the app and came back: the same total was still there. Did not swipe. Twin bitkit-ios#772 uses the same total. Not run on a simulator this round. FindingsNo findings. Checked and clean
QA LGTM |
piotr-iohk
left a comment
There was a problem hiding this comment.
Spending confirm shows the amount that leaves. On send-all that is the savings balance. On the normal path it is the order fee plus the miner fee. A refresh keeps the previous total until the new plan arrives.
Ran on Pixel_6 / emulator-5554, regtest, 200 000 in savings.
- 10 000: network fees 422, service fees 2 260, to spending 10 000, total 12 682.
- MAX: network fees 329, service fees 2 047, to spending 197 624, total 200 000. The network-fee row stayed the miner fee.
- Swiped MAX from the grab handle. The total stayed 200 000 until success. Savings went to 0 and spending to 197 624.
Twin bitkit-ios#772 showed the same totals.
The swipe that can pay a different amount than the screen is still bitkit-ios#783. This MAX swipe did not hit it.
Findings
No findings.
QA LGTM
Fixes #1326
Description
Out of Scope
Design
Transfer to Spending Balance From Savings (Channel Opening) › Transfer to Spending Confirm, mapped in
docs/screens-map.md.Preview
N/A — screenshot needs a funded send-all confirm, not captured in this pass.
QA Notes
Journeys
N/A
Manual Tests
Automated Checks
TransferViewModelTest.ktviajust test file "to.bitkit.viewmodels.TransferViewModelTest"— passed, including the send-all total andrepreparing send-all funding keeps the leaving amount until the next plan