Commit Graph

173 Commits

Author SHA1 Message Date
Kris Nuttycombe 120cc70a6d Fix type of default_address 2021-10-11 16:34:37 -06:00
Jack Grigg 65e1d32774 ff 0.11, group 0.11, etc. 2021-09-09 18:20:37 +01:00
Jack Grigg 0f15743200 Disable default benchmark harness for all workspace crates
This is necessary in order to provide criterion-specific arguments to
`cargo bench`, such as `--profile-time`.
2021-08-05 22:39:36 +01:00
Kris Nuttycombe 1a5aad723b Use generalized signature_hash for transaction builder. 2021-06-04 15:45:39 -06:00
Kris Nuttycombe 55d1090f70 Add v5 txid & signature hashing. 2021-06-04 15:45:39 -06:00
Jack Grigg 1222391dd7 Migrate to bitvec 0.22, ff 0.10, etc.
Requires patching three dependencies:

- bellman is pending a new release.
- nom is part of the funty breakage; we are blocking on a new release.
- orchard is in development.
2021-06-04 22:02:48 +01:00
Kris Nuttycombe 84e8952ec3 Move Sapling components to a bundle within TransactionData 2021-06-03 18:46:38 -06:00
Kris Nuttycombe 76999eb5c7 Make txid contents private & use txid for TzeOutPoint 2021-06-01 07:03:31 -06:00
Kris Nuttycombe 4efb21d1c7 Make amount addition and subtraction traits use checked operations. 2021-06-01 07:03:31 -06:00
Jack Grigg 5623e02a7c Migrate to ff 0.9 et al. 2021-05-19 18:29:37 +01:00
Kris Nuttycombe fae1a1517a Simplify try_sapling_output_recovery. 2021-04-12 18:40:17 -06:00
Kris Nuttycombe 324fc36521 Use ShieldedOutput trait for note encryption/decryption.
This change modifies note encryption and decryption functions
to treat a shielded output as a single value instead of handling
the parts of an output as independent arguments.
2021-04-12 12:59:06 -06:00
Kris Nuttycombe cfdbafe2e3 Add myself to crate contributors. 2021-04-08 10:13:04 -06:00
Kris Nuttycombe e77839232d Generalize note encryption and decryption.
This commit introduces a `Domain` trait which defines the types
and operations that are shared between Sapling and Orchard note
encryption and decryption processes.
2021-04-08 08:19:10 -06:00
Kris Nuttycombe 5baccdf052 Move note_encryption into the sapling module. 2021-04-08 08:19:10 -06:00
Jack Grigg 636845d0f9 Renames to use lower-case abbreviations (matching Rust convention)
As of our MSRV bump to 1.51.0, we get lints for this.
2021-03-27 19:01:03 +13:00
Kris Nuttycombe 4086df772c Move sapling-specific primitives into the sapling module. 2021-03-27 16:18:21 +13:00
Kris Nuttycombe 88d58aac0a Move relevant utils into sapling module. 2021-03-27 16:18:21 +13:00
Kris Nuttycombe 16948d9d78 Move zcash_primitives::prover to sapling module 2021-03-27 16:18:21 +13:00
Jack Grigg 38f7a0330c Fix various clippy lints
The remainder will be fixed after the refactor PRs are merged.
2021-03-27 08:50:40 +13:00
Jack Grigg 9d9c0579f8 Use new name for broken_intra_doc_links lint
We also add the lint to crates in the workspace that didn't have it.

Closes zcash/librustzcash#279.
2021-03-27 08:27:17 +13:00
Jack Grigg afa0b29e62 Bump MSRV to 1.51.0
This is the MSRV for the orchard crate, which we will be depending on
soon.
2021-03-27 08:21:45 +13:00
Jack Grigg 4ff0a81a7f zcash_client_sqlite 0.3.0 2021-03-26 19:01:04 +13:00
Jack Grigg acc650cc17 zcash_client_backend 0.5.0 2021-03-26 18:54:42 +13:00
Jack Grigg 813525f0b5 zcash_proofs 0.5.0 2021-03-26 18:53:42 +13:00
Jack Grigg 725699c76b zcash_primitives 0.5.0 2021-03-26 18:51:35 +13:00
str4d 78f6432be6
zcash_client_sqlite: Minor tweaks to documentation 2021-03-26 18:47:59 +13:00
Kris Nuttycombe 88fbd9f423 Add docstrings for zcash_client_sqlite. 2021-03-25 22:22:45 -06:00
Jack Grigg c3c7bd1d9c bech32 0.8 2021-03-26 13:31:20 +13:00
Jack Grigg 0166cb6487 cargo fmt 2021-03-26 13:10:46 +13:00
Jack Grigg cb631a58ba zcash_client_sqlite: Add no-change fixes to changelog 2021-03-26 10:12:10 +13:00
Jack Grigg 55e73d7910 Fix clippy lints 2021-03-26 10:07:20 +13:00
Kris Nuttycombe 42f15a575e
Merge pull request #359 from str4d/356-create_spend_to_address-assumption
zcash_client_backend: Use correct output index for t-addr recipients
2021-03-25 07:58:53 -06:00
Kris Nuttycombe 309d83af57 Retrieve nullifiers for all unconfirmed notes.
Previously we were retrieving nullifiers for notes that were not
marked spent, but not checking against whether the spending
transaction had been included in a block.
2021-03-24 16:18:54 -06:00
Jack Grigg cb6a993840 zcash_client_backend: Use correct output index for t-addr recipients
`create_spend_to_address` was originally written only for sending to
Sapling addresses. It was later amended to support sending to
transparent addresses, but the assumption about there being a Sapling
output was not removed. This was not an issue for most transactions
because there would be change, but in the case of a z->t transaction
with no change, `create_spend_to_address` would reliably panic.

This commit fixes the bug by setting the output index for transparent
recipients to 0. The `output_index` field of `SentTransaction` is also
documented to correctly reflect its dependency on the type of
`recipient_address`.
2021-03-24 19:01:35 +13:00
Jack Grigg 7c8b29e693 zcash_client_sqlite: Add test that exposes the no-change bug 2021-03-24 18:46:55 +13:00
Kris Nuttycombe 334442c505 Address comments from review. 2021-03-17 09:21:10 -06:00
Jack Grigg 8a84203685 Remove Default impl from MemoBytes
Memo fields have two ways to encode an empty memo:

- 0xF6 followed by all-zeroes, encoding "there is no memo".
- All-zeroes, encoding the empty UTF-8 string.

In almost all cases you want the former, but users thinking about byte
slices may expect MemoBytes::default() to result in the latter. To
ensure clarity, we now require calling either MemoBytes::default() or
MemoBytes::from_bytes(&[]) to be explicit.

No such confusion exists for the Memo enum, because the two types are
visibly separated as different enum cases, and Memo::Empty makes sense
as the default.
2021-03-17 21:16:01 +13:00
Jack Grigg c7a3ef0e88 Split memo-handling into MemoBytes struct and Memo enum
The MemoBytes struct is a minimal wrapper around the memo bytes, and only
imposes the existence of null-padding for shorter memos. The only error
case is attempting to construct a memo that is too long. MemoBytes is
guaranteed to be round-trip encodable (modulo null padding).

The Memo enum implements the additional memo rules defined in ZIP 302,
interpreting the contents of a memo (for example, parsing it as text).
2021-03-17 21:05:50 +13:00
Jack Grigg 48f7ef84a4 Move Memo into zcash_primitives::memo 2021-03-17 19:58:40 +13:00
Kris Nuttycombe 5a9b29a75a Address comments from code review. 2021-03-11 13:01:22 -07:00
Kris Nuttycombe 0e022f2283 Allow block scanning using either IVKs or FVKs. 2021-03-09 21:00:40 -07:00
Kris Nuttycombe 16289750e8 Remove WalletWrite::transactionally 2021-03-09 20:59:57 -07:00
Kris Nuttycombe a74cc8b231 Remove sqlite-specific data organization from data access api. 2021-03-09 20:59:57 -07:00
Kris Nuttycombe b5bbbb6f5a Factor out nullifier update from database actions in scan_cached_blocks 2021-03-09 20:59:57 -07:00
Jack Grigg 463e252af4 Fix more intra-doc links 2021-03-04 23:01:42 +00:00
Jack Grigg 464b533937 Bump MSRV to 1.47.0
We'll be needing it shortly for ff et al.
2021-03-04 17:32:57 +00:00
Jack Grigg 5242718b8f bs58 0.4 2021-03-04 17:03:14 +00:00
Jack Grigg 1f6f45bbe7 Add details of unreleased changes to changelogs 2021-02-22 16:59:07 +00:00
str4d 9f14c757e6
Merge pull request #340 from str4d/changelogs
Add changelogs to the crates
2021-02-14 02:34:20 +13:00