Repository navigation
feat(cli): close a settled payment with a lightning bolt, below its record - #110
Conversation
27a6f48 to
9b83312
Compare
9b83312 to
20f6e15
Compare
20f6e15 to
6faa0ec
Compare
tee8z
left a comment
There was a problem hiding this comment.
Approved 6faa0ec against feat/cli-look-10-qr (#109 d674fb9), on its own diff. closing() draws the bolt only for Outcome::Completed. A failed payment goes through unsuccessful, so it gets no bolt. reached uses notice_line, so --quiet and redirected stderr leave it out, and it never reaches stdout or JSON. The record is now written before the closing line, so a failed write prints no closing line. The tests and output.md match.
This PR builds on #109, whose expiration P1 still blocks the stack.
Nonblocking:
- When
--qrimplies--wait readyon a receive that has already completed, the order is the record,⚡ … completed, then "Scan to pay" with a QR for an invoice that is already paid. Skipping the QR onCompletedwould be clearer. ⚡is East Asian Wide, so its width varies by terminal.
Validation on this head, in nix develop: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata, cargo test --locked (184 unit, 140 integration) and python3 scripts/check-coverage.py passed. CRAP: 798 measured functions, none at or above 20, highest table at 17.00. CI is green.
6faa0ec to
9f04598
Compare
…ecord On a terminal, a payment wait that ends completed closes with "⚡ Payment ID completed" in bold yellow instead of a check mark. An invoice that is only ready keeps the check mark, and the ASCII fallback is "ok". The closing line now prints after the payment's record, so the outcome is the last thing on screen; a ready invoice's QR code follows it.
9f04598 to
a0ab94e
Compare
tee8z
left a comment
There was a problem hiding this comment.
Re-approved a0ab94e, a rebase onto #109 8280881. The patch matches 6faa0ec, which I approved; only context lines from #109's new qr::check changed. With #109's P1 fixed, nothing in the stack below blocks it now.
Validation on this head, in nix develop: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata, cargo test --locked (186 unit, 141 integration) and python3 scripts/check-coverage.py passed. CI is green. I did not run the CRAP report for this re-review.
Stack position: 11 of 13 in the look-and-feel stack. Base:
feat/cli-look-10-qr(#109).Problem
A settled Lightning payment, the moment a payment tool exists for, ended on the same
✓as any finished step. The closing line also printed above the payment's ~30-line record, so it scrolled off screen right when the payment settled.Behavior
On a terminal, a payment wait that ends
completedcloses with:readyinvoice (not yet paid) keeps✓ Payment … ready, because nothing was paid yet.ok, as✓already was. Redirected stderr has no closing line, as before.--qr, the order is the record, then✓ … ready, then the code.--jsonand piped output are unchanged. Hiding or shortening the record behind a--detailflag was considered and set aside, because it would change what every humanpaymentscommand shows.Try it on staging
Setup: Try a pull request on staging (added by #97). This creates a receive invoice (
--execute): pay it from another test-network wallet to see the bolt. Find a wallet ID withvoltage wallets list --account me.Expect: once you pay it, the payment record, then
⚡ Payment … completed · …in bold yellow as the last line.Expect: the record, then
✓ Payment … ready · 0s(no bolt, because it's only ready), then the QR code last.Validation
cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo machete --with-metadata,cargo test --locked(168 unit and 131 integration tests), andpython3 scripts/check-coverage.pyall pass.⚡, ready gives a green✓, and both areokin ASCII. The PTY tests now expect⚡ Payment … completedin the timeline and wait tests, with its exact bold yellow sequence. A new test with every stream on a terminal checks that the record comes first and the⚡line is last, and the ready-invoice test checks the record, then✓ ready, then the code.src/cli.rsendpoint, untouched).Docs
docs/reference/output.mdandCHANGELOG.md.