Commit Graph

27 Commits

Author SHA1 Message Date
Kris Nuttycombe d2aa6cfc7f Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2024-04-22 14:41:50 -06:00
Daira-Emma Hopwood ea82dbeb64
Apply straightforward suggestions from code review 2024-04-18 01:12:13 +01:00
Kris Nuttycombe b60600a4c3 zcash_client_sqlite: Use `ZcashAddress` for persistence of sent note addresses
Prior to this change, the recipient of a sent transaction would always
be shown as the protocol-level address, instead of any unified address
intended as the recipient. Now, instead of reencoding the recipient
address, we use the original `ZcashAddress` value from the payment
request.
2024-04-05 16:48:13 -06:00
Kris Nuttycombe 3ea7d84183 zcash_client_backend: Update to use extracted `zip321` crate 2024-04-05 16:25:21 -06:00
Kris Nuttycombe d982d7826a zip321: Replace dependencies on `zcash_keys` types with `zcash_address` 2024-04-05 16:10:22 -06:00
Jack Grigg 22271145a7 zcash_address: Improve documentation 2024-01-12 04:53:39 +00:00
Jack Grigg 3f006bffac zcash_address: Remove private type aliases for raw data sizes
These served no type safety purpose; they were just to make developing
the crate easier. However, while docs.rs correctly shows these in trait
APIs as their plain `[u8; N]` form, editor LSPs like `rust-analyzer`
assume the crate-private types are public and auto-create stubs that
reference them, which is not good UX for downstream developers.
2024-01-12 00:15:55 +00:00
Kris Nuttycombe 34a7abd653 Update unified address test vectors
This updates unified address test vectors after
https://github.com/zcash-hackworks/zcash-test-vectors/pull/89
to check addresses across multiple diversifier indices, and also
removes the superfluous binary encoding of UA strings.
2022-10-07 19:50:32 -06:00
Kris Nuttycombe 8d34e62114 Clean up proptest generation for unified containers. 2022-01-04 15:31:20 -07:00
Kris Nuttycombe 2fa73ed368 Remove `Ord` instances for sealed items.
There are two canonical orderings for sealed items: preference
order and encoding order. Removing the `Ord` instances means
that a user can't accidentally choose the wrong ordering;
these orderings are replaced by explicit `preference_order`
and `encoding_order` comparison functions.
2022-01-04 11:48:23 -07:00
Kris Nuttycombe e413f12fb5 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-04 11:48:23 -07:00
Kris Nuttycombe 4c4c0b1e63 Makes unified container parsing enforce typecode order.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-04 11:48:23 -07:00
Kris Nuttycombe 4e906508ae Make unified container construction correctly sort items.
Newly constructed unified containers now obey ZIP 316 item
ordering rules, while parsing and reserialization preserve
order.
2021-12-07 11:07:15 -07:00
Kris Nuttycombe cc8c2868eb Ensure that unknown typecodes don't duplicate known typecodes. 2021-12-07 09:16:55 -07:00
Kris Nuttycombe cccc493067 Add unknown typecodes to UA proptests. 2021-12-06 11:34:12 -07:00
Kris Nuttycombe e30f4bd094 Fix incorrect ordering of receivers in writing raw encoding. 2021-12-06 08:32:07 -07:00
Kris Nuttycombe a6420858f4 Fix clippy lints. 2021-12-03 14:21:40 -07:00
Kris Nuttycombe ba3ff42e13 Address comments from code review. 2021-12-03 12:07:26 -07:00
Kris Nuttycombe 914363f9b7 Rename "to_bytes" internal method to "to_jumbled_bytes" 2021-12-02 14:44:38 -07:00
Kris Nuttycombe 7e629db29f Adds high-level encoding and decoding functions for unified types.
This renames the `FromReceivers` trait to `UnifiedEncoding` and makes
its public methods (as well as the private to_bytes method) function in
terms of network values rather than explicit HRP arguments. It also adds
high-level encoding and decoding methods that handle conversion to and
from the Bech32m-encoded transport format for all supported types, and
then delegates to these from locations that previously used lower-level
utilities.
2021-12-02 14:44:38 -07:00
therealyingtong c4ceb8e9df Test both Sapling and Orchard receivers in arb_shielded_* proptests. 2021-12-02 14:44:38 -07:00
Kris Nuttycombe 82be04dfaf Generalize the naming of unified containers and items. 2021-12-02 09:10:03 -07:00
therealyingtong da1c6224f8 kind::unified: Split Unified trait into FromReceivers, ToReceivers.
This allows us to move to_bytes() into the private::SealedContainer
trait without introducing a circular dependency. This also lets us
move the Receivers type to a public trait.
2021-11-29 14:21:43 -05:00
therealyingtong c31db1b839 Move HRPs into from public Unified trait to SealedContainer trait.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-11-29 13:49:24 -05:00
therealyingtong b8ff3d2d48 kind::unified: Introduce private::SealedContainer and Unified traits.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-11-28 18:56:24 -05:00
therealyingtong 18393eefa8 kind::unified: Introduce private::SealedReceiver trait.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-11-28 18:55:37 -05:00
therealyingtong 406e62e7e5 [move-only] Move Receiver and test code into kind::unified::address.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-11-28 17:09:59 -05:00