Skip to content

feat!: memo-policy slice — lossless typed memos in the canonical summaries - #2616

Open
zancas wants to merge 2 commits into
viewmodel_seedfrom
memo_policy
Open

feat!: memo-policy slice — lossless typed memos in the canonical summaries#2616
zancas wants to merge 2 commits into
viewmodel_seedfrom
memo_policy

Conversation

@zancas

@zancas zancas commented Aug 4, 2026

Copy link
Copy Markdown
Member

Stacked on #2611 (base viewmodel_seed; retarget to dev when the seed merges). The second slice of the perspective migration: the canonical layer carries every memo losslessly typed, and the text-only display policy becomes an editorial fact in zingo-perspective.

What this does

The three summary memo fields (BasicNoteSummary, NoteSummary, OutgoingNoteSummary) become zcash_protocol::memo::Memo, and the seven if let Memo::Text filters at transaction-summary construction are deleted — the canonical snapshot stops editorializing what it carries. The policy lands where it belongs: text_memo and received_text_memos in zingo-perspective drive the transfer memos and the memo-to-self classification, and received_memos leaves zingolib entirely (it was the policy wearing a canonical method's clothes, with the perspective crate as its only caller).

By the renderer ruling, zingolib's own Display/JSON impls stay bug-compatible: a text memo renders as before, and a non-text memo renders exactly as the previously-dropped memo did (empty string in Display, null in JSON). No canonical output bytes change anywhere, and the rendering opinion stays confined to the renderers, where the future rendering slice retires it wholesale.

Contract safety

All eight golden fixtures hold byte-identical — the pin that the policy's output moved without moving. A new derivation test pins what the goldens cannot see: an arbitrary-bytes memo is present and typed on the TransactionSummary while the derived value transfer shows nothing for it. The expected-summary literals in the mock-chain and unit-test-twins suites convert to typed memos; the quick_send Option<&str> memo arguments are untouched.

Verification

Workspace --all-targets, clippy, rustfmt, and the feature combinations including unit_test_twins are clean. Test runs: 12/12 zingo-perspective (goldens byte-identical), 14/14 zingolib summary and mock-chain, 167/167 zingo-cli.

🤖 Generated with Claude Code

@zancas
zancas marked this pull request as ready for review August 4, 2026 01:42
The three summary memo fields become zcash_protocol Memo and the
text-only filters leave transaction-summary construction, so the
canonical layer stops editorializing what it carries. The text-only
display policy moves to zingo-perspective, which now derives transfer
memos and the memo-to-self classification through its own text_memo
view. zingolib's summary renderers stay bug-compatible, rendering a
non-text memo exactly as the previously-dropped memo rendered, so no
canonical output bytes change and every golden fixture holds
byte-identical. A new derivation test pins the typed memo present on
the summary while the derived value transfer hides it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant