onionwire: outbound tip() appends the sender's own [tip] chat line #96

Merged
sirius merged 1 commit from wt/t_c8441534 into main 2026-09-17 21:27:04 +00:00
Owner

What

The outbound tip path (Node::tip, src/node.rs) signs and sends a receipt
frame and a tip frame, inserts the payment row and appended
pay::receipt_chat_line — a line written from the recipient's perspective.
The payer's own chat therefore showed only [receipt] 0.5 XMR for money they
had just spent, while the inbound path (ingest_tip) renders
pay::tip_chat_line for an incoming tip.

This appends pay::tip_chat_line(atomic, memo, false) right after the receipt
line, so the sender sees [tip] 0.5 XMR -- lunch (pending). verified = false
is correct: the recipient has not confirmed anything back yet.

One hunk, src/node.rs only — no change to pay.rs, tui.rs, the wallet
client or any SDK surface, so no signature moved and the SDK workspace is
untouched (no lockfile regeneration needed).

Test

outbound_tip_appends_the_senders_own_tip_chat_line drives the shipped
tip() end to end and asserts the full chat row list (receipt line, then tip
line). RED first: with the append removed the test fails with
left: [("out", "[receipt] 0.5 XMR")] and no tip row.

Placement deviation, disclosed: the card asked for tests/wallet.rs, but
tests/*.rs see only the public API and Node::start / start_with_passphrase
are the only constructors — both bootstrap Tor and publish an onion service. A
Node can only be built offline from inside src/node.rs's #[cfg(test)] mod tests, so the test lives there (the same call as the ratchet cards). It
attaches a mock wallet child on loopback (Digest challenge, then one
transfer) plus a deliverer that accepts the frame, because one-shot payment
sends stay fail closed.

Verification

  • cargo test --locked — 291 passed, 0 failed, 4 ignored
  • cargo clippy --locked --all-targets -- -D warnings — clean (exit 0)
  • rustfmt --edition 2024 --check src/node.rs reports 7 hunks, exactly the 7
    the same check reports on origin/main — all inherited, none added.
## What The outbound tip path (`Node::tip`, `src/node.rs`) signs and sends a receipt frame and a tip frame, inserts the payment row and appended `pay::receipt_chat_line` — a line written from the *recipient's* perspective. The payer's own chat therefore showed only `[receipt] 0.5 XMR` for money they had just spent, while the inbound path (`ingest_tip`) renders `pay::tip_chat_line` for an incoming tip. This appends `pay::tip_chat_line(atomic, memo, false)` right after the receipt line, so the sender sees `[tip] 0.5 XMR -- lunch (pending)`. `verified = false` is correct: the recipient has not confirmed anything back yet. One hunk, `src/node.rs` only — no change to `pay.rs`, `tui.rs`, the wallet client or any SDK surface, so no signature moved and the SDK workspace is untouched (no lockfile regeneration needed). ## Test `outbound_tip_appends_the_senders_own_tip_chat_line` drives the shipped `tip()` end to end and asserts the full chat row list (receipt line, then tip line). RED first: with the append removed the test fails with `left: [("out", "[receipt] 0.5 XMR")]` and no tip row. Placement deviation, disclosed: the card asked for `tests/wallet.rs`, but `tests/*.rs` see only the public API and `Node::start` / `start_with_passphrase` are the only constructors — both bootstrap Tor and publish an onion service. A `Node` can only be built offline from inside `src/node.rs`'s `#[cfg(test)] mod tests`, so the test lives there (the same call as the ratchet cards). It attaches a mock wallet child on loopback (Digest challenge, then one `transfer`) plus a deliverer that accepts the frame, because one-shot payment sends stay fail closed. ## Verification - `cargo test --locked` — 291 passed, 0 failed, 4 ignored - `cargo clippy --locked --all-targets -- -D warnings` — clean (exit 0) - `rustfmt --edition 2024 --check src/node.rs` reports 7 hunks, exactly the 7 the same check reports on `origin/main` — all inherited, none added.
onionwire: outbound tip() appends the sender's own [tip] chat line
All checks were successful
ci / test (pull_request) Successful in 5m0s
ci / sdk (pull_request) Successful in 1m9s
android-ci / android (pull_request) Successful in 8m44s
2ec88b0ce5
The outbound tip path signed and sent a receipt frame and a tip frame and
logged the receipt line, but never the tip line, so the payer's own chat
showed only `[receipt] 0.5 XMR` — the recipient's view — for what they
had just spent. Append `pay::tip_chat_line(atomic, memo, false)` after the
receipt line so the sender sees `[tip] 0.5 XMR — memo (pending)`.

Test: outbound_tip_appends_the_senders_own_tip_chat_line in src/node.rs's
`#[cfg(test)] mod tests` — the only place a `Node` can be built offline
(Node::start bootstraps Tor). It drives the shipped tip() against a mock
wallet child (Digest challenge + one transfer) and asserts both chat rows.
sirius merged commit ad1b994c08 into main 2026-09-17 21:27:04 +00:00
sirius deleted branch wt/t_c8441534 2026-09-17 22:01:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!96
No description provided.