Commit Graph

671 Commits

Author SHA1 Message Date
Kris Nuttycombe adc75566a0 zcash_client_backend: Add Orchard support to transaction proposals. 2024-01-05 16:59:54 -07:00
Kris Nuttycombe 56f2ac573c zcash_client_backend: Add Orchard support to change strategies.
This modifies the `compute_balance` method to operate in a
bundle-oriented fashion, which simplifies the API and makes it easier to
elide Orchard functionality in the case that the `orchard` feature is
not enabled.
2024-01-05 16:59:54 -07:00
Kris Nuttycombe 1b036f1e0d zcash_client_backend: rename `WalletNote` to `Note` 2024-01-05 09:13:53 -07:00
Kris Nuttycombe 28319ffc38
Merge pull request #1085 from nuttycom/wallet/common_input_source
Replace SaplingInputSource and TransparentInputSource with InputSource
2024-01-04 15:07:23 -07:00
Kris Nuttycombe 5126fd6b5f
Merge pull request #1086 from zcash/docs-rs-feature-flags
Show feature flags in documentation
2024-01-04 14:34:40 -07:00
Kris Nuttycombe d4aa2d6f06 Replace SaplingInputSource and TransparentInputSource with InputSource
This unification allows us to better isolate transparent-input dependent
functionality. Previously, `TransparentInputSource` could not be placed
under a feature flag because the interface was needed for proposal
deserialization; by instead making the transparent input source methods
flag-dependent, we can correctly produce an error when proposal
deserializaiton attempts to select transparent inputs and the feature
flag is off.
2024-01-04 14:00:20 -07:00
Jack Grigg 3989ee9926 Show feature flags in documentation
This can be rendered locally with:
    RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --no-deps --workspace --all-features
2024-01-04 19:07:22 +00:00
Kris Nuttycombe 967fd36d39
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2024-01-04 11:56:59 -07:00
Kris Nuttycombe 857e44a11c zcash_client_backend: Use a polymorphic type for `ScannedBlock` note commitment and nullifier data. 2024-01-04 11:19:22 -07:00
Kris Nuttycombe f18d082aa3 zcash_client_backend: Introduce an "orchard-client" feature flag.
We plan to also introduce a similar flag to gate access to Sapling
functionality. Since introduction of Orchard functionality is still
nascent, it's the correct time to introduce this isolation, before
there's more functionality that needs to be isolated in this fashion.
2024-01-03 17:05:20 -07:00
Jack Grigg 2ea83243a7 Document the feature flags 2024-01-03 20:15:21 +00:00
Jack Grigg 0df4c6f043 Remove implicit feature flags for optional dependencies
All optional dependencies are enabled as part of dedicated feature
flags.
2024-01-03 20:15:21 +00:00
Jack Grigg b7bba9bbb2 zcash_primitives: Remove `keys` module 2024-01-03 17:29:59 +00:00
Kris Nuttycombe 704e8e1144 zcash_primitives: Updates to reflect `sapling-crypto` and `orchard` builder changes. 2024-01-02 13:00:11 -07:00
Kris Nuttycombe 1ef6bf6656
Merge pull request #1066 from nuttycom/wallet/common_fee_logic
Factor out common logic from zip317 and fixed-fee single output change strategies.
2023-12-20 20:50:53 -07:00
str4d 20f8b97195
Merge pull request #1063 from nuttycom/backend/parsed_address
zcash_client_backend: Rename `RecipientAddress` to `Address`
2023-12-15 17:40:22 +00:00
Kris Nuttycombe d74f635d9d zcash_client_backend: Factor out common single-output change strategy logic. 2023-12-14 12:55:34 -07:00
Jack Grigg b6907b14e6 Use `sapling-crypto` crate directly outside `zcash_primitives` 2023-12-12 19:50:26 +00:00
Kris Nuttycombe 9ac3594bbb zcash_client_backend: Rename RecipientAddress to Address 2023-12-08 11:34:27 -07:00
Kris Nuttycombe aab9938b53 zcash_client_backend: Rename `RecipientAddress::Shielded` to `RecipientAddress::Sapling` 2023-12-07 15:24:47 -07:00
Kris Nuttycombe 4eaa41affa zcash_primitives: Remove and relocate `InputView` traits. 2023-12-06 20:17:43 -07:00
Jack Grigg d332aacf98 Merge branch 'main' into 1044-extract-zip32 2023-12-06 18:04:36 +00:00
Jack Grigg 3dfd478141 Migrate to published `zip32` crate outside this repository 2023-12-06 18:04:09 +00:00
Kris Nuttycombe ca54b3489d Apply suggestions from code review
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2023-12-05 15:55:52 -07:00
Kris Nuttycombe cad4f25b75 zcash_client_backend: Replace `ReceivedSaplingNote` with `ReceivedNote`
`ReceivedNote` now allows Orchard notes to be represented as received
notes. As part of this change, received notes now track whether they
were received using internally- or externally-scoped viewing keys.
This eliminates the need to trial-regenerate notes using the wallet's
IVKs to determine scope at spend time.
2023-12-05 10:55:06 -07:00
Kris Nuttycombe 6b10a6dc86 zcash_client_backend: Move essential wallet types into the `wallet` module. 2023-12-05 10:55:04 -07:00
Kris Nuttycombe 8c1480304e zcash_client_backend: Wrap entire Sapling note in `SaplingReceivedNote` 2023-12-05 10:49:35 -07:00
Jack Grigg 54e8dd35c1 zcash_primitives: Remove old Sapling re-exports from `zip32` module 2023-12-05 17:31:17 +00:00
Kris Nuttycombe 214a3750c5 zcash_client_backend: Make `Balance` and `AccountBalance` fields private.
Public methods for mutation of these fields have been provided that
perform checking for overflow of the valid monetary range as part
of their operation.
2023-12-04 13:53:27 -07:00
Kris Nuttycombe 9aec53eec9 zcash_client_backend: Add Orchard components to `ScannedBlock` 2023-11-30 13:08:17 -07:00
Kris Nuttycombe c0babd54cd zcash_client_backend: Expose Orchard value in balance API 2023-11-30 12:17:19 -07:00
Kris Nuttycombe 1e5d253c9c Fix dependencies to repair `cargo -p` subproject builds. 2023-11-29 12:37:18 -07:00
Kris Nuttycombe 28174e1ba3 zcash_client_backend: refactor select_key_for_note to avoid needing the extsk
This is in preparation for generalizing how we choose the spending key
for a note to serve `Orchard`.
2023-11-28 10:54:06 -07:00
Kris Nuttycombe 7f3d057a1b zcash_primitives: Avoid passing duplicate diversifier information to Sapling builder.
The note provided to `add_sapling_spend` contains the recipient address,
and we can extract the diversifier from this address, so we should not
pass it separately.
2023-11-28 10:54:06 -07:00
Jack Grigg 0d06e561bb Update Sapling imports to migrate off re-exports at old paths 2023-11-28 03:40:41 +00:00
Jack Grigg 106f5a353a Remove `MemoBytes` usage from `zcash_primitives::sapling` 2023-11-28 03:25:14 +00:00
Jack Grigg 7badba29ea zcash_primitives: Move `zip32::sapling` to `sapling::zip32` 2023-11-28 01:38:53 +00:00
Jack Grigg 61bb18d97f zcash_primitives: Refactor `zip32::ChildIndex` to be an opaque struct 2023-11-28 01:38:53 +00:00
Jack Grigg eb0b5a1b24 zcash_primitives: Remove `consensus::Parameters` from `sapling` module
Part of zcash/librustzcash#1044.
2023-11-22 04:29:36 +00:00
Jack Grigg c6263d2470 Fix generated protobuf file to match source
A comment change to the source file was made in zcash/librustzcash#891
before merging, but the generated file was not updated to match.
2023-11-21 02:15:12 +00:00
Kris Nuttycombe c5f48f50e1 Apply suggestions from code review
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <thestr4d@gmail.com>
2023-11-15 10:53:23 -07:00
Kris Nuttycombe 7aab6fd7a7 zcash_client_backend: add `Display` and `Error` impls for proposal parsing errors. 2023-11-14 12:59:40 -07:00
Kris Nuttycombe aeb405ef5d Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-11-14 12:58:22 -07:00
Kris Nuttycombe 33169719ce zcash_client_backend: Add serialization & parsing for protobuf Proposal representation. 2023-11-09 20:07:16 -07:00
sasha 572563338b Add a protobuf representation for transaction proposals.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2023-11-09 20:02:36 -07:00
Kris Nuttycombe 2d6a02eb2d
Merge pull request #1039 from zcash/736-refactor-sapling-components
Refactor Sapling components and builder into `zcash_primitives::sapling`
2023-11-09 20:00:32 -07:00
Kris Nuttycombe 7720a4fc58 zcash_client_backend::scanning: Use `checked_sub` instead of manual check.
Co-authored-by: str4d <thestr4d@gmail.com>
2023-11-09 15:09:54 -07:00
Kris Nuttycombe 09e37bcc8d Fix comment in zcash_client_backend::scanning
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-11-09 14:00:50 -07:00
Kris Nuttycombe b9ac7c5eda zcash_client_backend: Fix off-by-one in tree heights at NU activation. 2023-11-09 09:44:57 -07:00
Jack Grigg 54eb03e34e zcash_primitives: Move Sapling bundle types into `sapling` module 2023-11-09 04:04:07 +00:00