Commit Graph

3274 Commits

Author SHA1 Message Date
Matthew Watt 94f2240e08 Provide PoolType to UnsupportedPoolType case; stylistic changes 2023-10-08 19:05:50 -05:00
Matthew Watt a9d18ec2ce Gracefully handle attempted spend to a UA with neither transparent nor sapling recipients 2023-10-07 15:37:35 -05:00
Kris Nuttycombe a47b512f59
Merge pull request #1007 from zcash/sapling-trymapauth-etc
Changes to Sapling bundle mapping
2023-10-07 13:25:24 -06:00
Jack Grigg e1a4238a71 zcash_primitives: Add helper impls of `{Try}MapAuth` for closures 2023-10-06 23:48:27 +00:00
Jack Grigg 65efee1a16 zcash_primitives: Add `sapling::Bundle::try_map_authorization` 2023-10-06 23:46:02 +00:00
Jack Grigg b09b435135 zcash_primitives: Change `sapling::MapAuth` to take `&mut self` 2023-10-06 23:43:43 +00:00
Jack Grigg 241a1a3660 zcash_primitives: Add some more `Clone` and `Debug` impls 2023-10-06 22:05:49 +00:00
str4d 4737839662
Merge pull request #1006 from zcash/spend-output-prover-updates
Updates to `SpendProver` and `OutputProver` traits and impls
2023-10-06 23:01:07 +01:00
Jack Grigg 04aa5a044b zcash_primitives: Add `MockSpendProver` and `MockOutputProver`
These are analogues of `MockTxProver` in that they implement the
corresponding Sapling prover traits.
2023-10-06 20:31:31 +00:00
Jack Grigg 46903fabf5 zcash_proofs: `impl {SpendProver, OutputProver} for LocalTxProver` 2023-10-06 20:28:16 +00:00
Jack Grigg 296f75954b Add `SpendProver::encode_proof` and `OutputProver::encode_proof` 2023-10-06 20:19:41 +00:00
Kris Nuttycombe e6fa567332
Merge pull request #1000 from zingolabs/add_debugs_to_inputs
add Debug to transaction builder-reported types
2023-10-04 09:15:29 -06:00
Kris Nuttycombe b73c51f974
Merge pull request #1004 from zingolabs/add_fee_getter
Add fee getter
2023-10-03 12:04:29 -06:00
zancas b9f8ec8ed2
add pub getter to transaction builder
use getter in original context to DRY

add doc-comment

Minor cleanup & documentation fixes.

Co-Authored-By: Daira Emma Hopwood <daira@jacaranda.org>
2023-10-03 11:13:06 -06:00
str4d ad01585d34
Merge pull request #1001 from zcash/752-separate-sapling-provers
Separate Sapling provers
2023-10-02 18:47:47 +01:00
Jack Grigg 0d46fe72cc zcash_primitives: Introduce an `OutputProver` trait 2023-10-02 16:59:01 +00:00
Jack Grigg 290bfa8b31 zcash_primitives: Introduce a `SpendProver` trait 2023-10-02 16:59:01 +00:00
Jack Grigg ea0fed39eb zcash_proofs: Introduce newtype wrappers for Sapling parameters 2023-10-02 16:59:01 +00:00
Jack Grigg 2bfeef9430 zcash_proofs: Remove immediate verification of created Spend proofs
It can be useful to verify proofs after they have been created, but we
were only doing this for spend proofs, not output proofs. It also
duplicated code from the verifier logic. Once the prover and verifier
have been refactored, it will be easier to just call the verifier
immediately after the prover.
2023-10-02 16:59:01 +00:00
str4d eca7112963
Merge pull request #999 from zcash/737-move-sapling-circuits
Move Sapling circuits from `zcash_proofs` to `zcash_primitives::sapling`
2023-10-02 17:32:19 +01:00
Kris Nuttycombe 868d72030e
Merge pull request #989 from zcash/ci-fix-codecov
CI: Fix Codecov check
2023-10-02 09:23:59 -06:00
zancas b5e24751d6
add Debug to transaction builder-reported types 2023-09-29 12:55:06 -06:00
Jack Grigg db31105067 Move Sapling circuits from `zcash_proofs` to `zcash_primitives::sapling`
Closes zcash/librustzcash#737.
2023-09-29 18:36:54 +00:00
Jack Grigg 0ddcccdbac zcash_primitives: Move Sapling constants into `sapling` module 2023-09-29 17:39:43 +00:00
str4d 430e98b67f
Merge pull request #996 from nuttycom/wallet/scan_summaries
zcash_client_backend: Return summary information from `scan_cached_blocks`
2023-09-29 01:09:02 +01:00
Kris Nuttycombe c16e777222 zcash_client_sqlite: Fix zcash_proofs dev-dependency 2023-09-28 17:39:59 -06:00
Kris Nuttycombe a2e772c93a zcash_client_backend: Return summary information from `scan_cached_blocks`
When scanning, a wallet only needs to update balance and transaction
information shown to users when the scan has resulted in a change to
wallet state. This modifies `scan_cached_blocks` to return the range of
block heights actually scanned, along with the counts of notes spent and
received by the wallet in that range.

Fixes #918
2023-09-28 17:39:59 -06:00
Kris Nuttycombe 70c9d5a889
Merge pull request #997 from zcash/daa-internal-type-safety
zcash_client_sqlite: Replace internal height tuples with `RangeInclusive`
2023-09-28 16:12:30 -06:00
Jack Grigg f6d7714efe zcash_client_sqlite: Replace internal height tuples with `RangeInclusive`
We don't need to iterate over them, but the `*_extrema` internal methods
are semantically returning inclusive ranges, and using `RangeInclusive`
avoids bugs where the wrong half of the tuple is used (instead moving
the location of the tuple handling inside the `*_extrema` methods, which
cuts the number of occurrences from linear in the number of function
calls to constant).
2023-09-27 16:34:58 +00:00
str4d 8d264ac452
Merge pull request #995 from zcash/workspace-dependencies
Move common package and dependency configs into workspace config
2023-09-27 15:29:37 +01:00
Jack Grigg 7b53b711e2 CI: Fix Codecov job command
`cargo tarpaulin` has changed the case of one of its config options.
2023-09-26 23:04:29 +00:00
Jack Grigg 7e89300db9 Move common package and dependency configs into workspace config
The MSRV for the main crates is 1.65, which is higher than the Rust
version that stabilised workplace dependencies (1.64). The implicit MSRV
for the component crates is still lower than this, so we don't migrate
these crates.
2023-09-26 22:01:32 +00:00
Kris Nuttycombe 1b7c49778d
Merge pull request #993 from nuttycom/post-lwsdk-2.0.0-merge
Post-release merge of light wallet SDK v2.0.0 stabilization branch.
2023-09-25 17:10:06 -06:00
Kris Nuttycombe dc62ee149f Merge branch 'release-lwsdk-2.0.0' into post-lwsdk-2.0.0-merge 2023-09-25 16:23:02 -06:00
Kris Nuttycombe 9a36802b32
Merge pull request #992 from zcash/lwsdk-2.0.0-final
`zcash_primitives 0.13.0`, `zcash_proofs 0.13.0`, `zcash_client_backend 0.10.0`, `zcash_client_sqlite 0.8.0`
2023-09-25 14:53:17 -06:00
Jack Grigg 7a47f8494c zcash_client_sqlite 0.8.0 2023-09-25 18:20:44 +00:00
Jack Grigg 4bc65d66b1 zcash_client_backend 0.10.0 2023-09-25 18:19:52 +00:00
Jack Grigg 1a1abb62aa zcash_proofs 0.13.0 2023-09-25 15:11:00 +00:00
Jack Grigg d35d0961ab zcash_primitives 0.13.0 2023-09-25 15:06:57 +00:00
Kris Nuttycombe 9d4863b762
Merge pull request #991 from zcash/wallet/fix_shielding_tx_balance
zcash_client_sqlite: Include spent utxos in v_transactions net value.
2023-09-25 07:18:28 -06:00
Jack Grigg e926151f8f zcash_client_sqlite: Use `Uuid::from_u128` for all UUIDs
Previously we used `Uuid::from_fields` to ensure that the various UUID
fields were correctly constructed, but now that we have a CI lint that
checks this automatically, we can consistently use `Uuid::from_u128`
which is easier to prepare from `uuidgen` output.
2023-09-25 12:05:42 +00:00
Jack Grigg a3332c4267 CI: Add lint to check UUID validity 2023-09-25 11:57:08 +00:00
Jack Grigg 478b5d1858 zcash_client_sqlite: Clean up migrations graph comment 2023-09-25 11:14:24 +00:00
Kris Nuttycombe b90f285359 zcash_client_sqlite: Include spent utxos in v_transactions net value.
This fixes a bug in v_transactions whereby shielding transactions
displayed an incorrect balance.
2023-09-24 21:35:42 -06:00
Jack Grigg 30c58ebfb2 zcash_client_sqlite 0.8.0-rc.5 2023-09-22 23:26:43 +01:00
Jack Grigg 4afc24af6a zcash_client_backend 0.10.0-rc.4 2023-09-22 23:25:19 +01:00
str4d f4fdba23ea
Merge pull request #985 from zcash/983-transparent-balance-fix
`zcash_client_sqlite`: Fix transparent balance APIs
2023-09-22 22:56:20 +01:00
Jack Grigg b76b028b3a zcash_client_sqlite: Set chain tip to truncation height when truncating
We don't know at truncation time what the latest chain tip is; the chain
might have reorged to a shorter heavier chain, or the reorg depth might
only be a few blocks. `WalletDb::chain_height` uses the scan queue as
its source of truth, so the `Verify` range we add during truncation
(to prioritise determining whether the rewind was sufficient) can't
extend beyond the block height we know to exist.

The next call to `WalletDb::update_chain_tip` will add additional ranges
beyond this height, which might include a `Verify` range that ends up
merging with the one added during truncation.
2023-09-22 21:09:23 +00:00
Jack Grigg 513abf8b97 rustfmt 2023-09-22 21:09:23 +00:00
Jack Grigg 625a5ff594 zcash_client_sqlite: Remove is-mined checks from transparent balance
The `LEFT OUTER JOIN` was causing the `tx.block IS NULL` check to alias
two cases: an unspent transparent output, and a transparent output spent
in an unmined transaction. The latter only makes sense to include in the
UTXO count if the transaction is expired, and (due to limitations of the
transparent data model in the current wallet) if that expiry won't be
undone by a reorg. We now handle these two cases directly.

Partly reverts 8828276361.
Closes zcash/librustzcash#983.

Co-authored-by: Kris Nuttycombe <kris@nutty.land>
2023-09-22 21:09:23 +00:00