Extract the shared amount parameter into a reusable payments type#535
Merged
Conversation
dannywillems
force-pushed
the
dw/extract-amount-parameter
branch
from
July 1, 2026 14:46
43f6c99 to
b6a100b
Compare
dannywillems
marked this pull request as draft
July 1, 2026 14:54
Move the `AmountParameter` request type out of `z_send_many` into `json_rpc::payments` (with accessor methods) and extract the shared `build_request` amount-parsing helper, so the type and parsing can be reused by other send-path RPC methods. Update the method trait and OpenRPC generation to reference the relocated type, and keep the `AmountParameter` import in the wallet-gated block so the merchant-terminal build still compiles. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dannywillems
force-pushed
the
dw/extract-amount-parameter
branch
2 times, most recently
from
July 1, 2026 15:05
2be1e92 to
2c4056d
Compare
dannywillems
marked this pull request as ready for review
July 1, 2026 15:07
Add a `payments::arb` test module with reusable constructors for `AmountParameter` (`amount`, `amount_with_memo`), a mixed-protocol address pool, and a zatoshi/ZEC formatting helper, so the send-path RPC method tests can share them instead of redefining fixtures. Move the `build_request` unit tests and the multi-recipient, mixed-protocol proptests next to `build_request` in `payments`, using those helpers. Add `proptest` as a dev-dependency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dannywillems
force-pushed
the
dw/extract-amount-parameter
branch
from
July 1, 2026 15:11
2c4056d to
081abb3
Compare
nuttycom
approved these changes
Jul 1, 2026
nuttycom
left a comment
Contributor
There was a problem hiding this comment.
utACK; essentially move-only.
sellout
added a commit
that referenced
this pull request
Jul 11, 2026
Extract the propose/validate pipeline that z_sendmany and pczt_create had in common into a shared payments::propose_and_check helper: the privacy-policy validation loop, propose_transfer with the standard change strategy and input selector, privacy-policy enforcement, and the Orchard-action-limit check. Both call sites now share one implementation. Also have pczt_create reuse the recently-added payments::AmountParameter type and payments::build_request (upstream #535), instead of its own AmountParam struct and inline recipient parsing. And tidy pczt_create's signing hints: drop the unused zallet.v1.network proprietary field (pczt_sign never reads it) and collapse the two Updater passes into one chained pass. Finally, centralize the `zallet.v1.*` signing-hint keys and the key-scope encoding in `pczt_common`, so the `pczt_create` writer and the `pczt_sign` reader share one definition rather than duplicating the string keys and the scope-to-u32 mapping.
sellout
added a commit
that referenced
this pull request
Jul 11, 2026
Extract the propose/validate pipeline that z_sendmany and pczt_create had in common into a shared payments::propose_and_check helper: the privacy-policy validation loop, propose_transfer with the standard change strategy and input selector, privacy-policy enforcement, and the Orchard-action-limit check. Both call sites now share one implementation. Also have pczt_create reuse the recently-added payments::AmountParameter type and payments::build_request (upstream #535), instead of its own AmountParam struct and inline recipient parsing. And tidy pczt_create's signing hints: drop the unused zallet.v1.network proprietary field (pczt_sign never reads it) and collapse the two Updater passes into one chained pass. Finally, centralize the `zallet.v1.*` signing-hint keys and the key-scope encoding in `pczt_common`, so the `pczt_create` writer and the `pczt_sign` reader share one definition rather than duplicating the string keys and the scope-to-u32 mapping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracting logic from #531. The idea is to have !531 as small as possible, and merge relatively unrelated changes to main, to decrease the reviewer time on the actual feature, while we're merging NU6.3 related changes.
Move the
AmountParameterrequest type out ofz_send_manyintojson_rpc::payments(with accessor methods) and extract the sharedbuild_requestamount-parsing helper, so the type and parsing can be reused by other send-path RPC methods. Updatez_sendmany, the method trait, and the OpenRPC generation to reference the relocated type.