Commit Graph

4036 Commits

Author SHA1 Message Date
Jack Grigg ed688138a7 zcash_client_backend: Remove extra spaces added by auto-wrapping 2024-07-29 19:53:06 +00:00
Jack Grigg ec3d5604bc zcash_client_sqlite: Move imports out of test function
After zcash/librustzcash@7c5ac7b151 we now
need to conditionally import some of them at the module level anyway.
2024-07-29 19:53:06 +00:00
Jack Grigg fa80ef0e14
Merge pull request #1468 from daira/transactional-create_proposed_transactions
Use a single database transaction when storing transactions to be sent
2024-07-29 19:20:22 +01:00
Daira-Emma Hopwood f54ecbd285 Use a single database transaction when storing transactions to be sent.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-29 18:57:31 +01:00
Daira-Emma Hopwood e856430c8e [move only] Move the body of `store_sent_tx` to `zcash_client_sqlite::wallet`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-29 18:48:11 +01:00
Jack Grigg 52de338e16
Merge pull request #1461 from zcash/1046-zcs-identify-shielding
zcash_client_sqlite: Add `is_shielding` to `v_transactions` view
2024-07-29 18:16:55 +01:00
Jack Grigg b42deab857 zcash_client_sqlite: Fix transparent input size in `shield_transparent`
The test was previously shielding a 10,000 zatoshi transparent input,
which was precisely enough to pay the ZIP 317 fee, and resulted in a
"shielding" transaction that had one transparent input, and no outputs
of any kind. Under our new `is_shielding` definition in `v_transactions`
this would not be a shielding transaction (it is effectively a "donate
coin to miners" transaction).
2024-07-29 16:50:05 +00:00
Jack Grigg 04e8d0bad7 zcash_client_sqlite: Add `is_shielding` to `v_transactions` view
Closes zcash/librustzcash#1046.
2024-07-29 16:44:04 +00:00
Jack Grigg 77936f247d
Merge pull request #1469 from daira/fix-rust-analyzer
Tell rust-analyzer to compile using stable
2024-07-29 04:39:45 +01:00
Daira-Emma Hopwood 3e5e4f30cd Tell rust-analyzer to compile using stable, because the Rust version from
`rust-toolchain.toml` is too old for the current proc-macros protocol
(specifically, the `--keep-going` flag was not stable in Rust 1.70, as
can be verified by `cargo +1.70.0 check --keep-going`).

This works around https://github.com/rust-lang/rust-analyzer/issues/17662 ,
and very likely future problems, because the rust-analyzer devs are quite
aggressive in depending on recent versions: "by policy we don't make any
attempts at supporting more than the last couple of stable releases"
according to https://github.com/rust-lang/rust-analyzer/issues/17662#issuecomment-2242265513 .
The toolchain we select in `rust-toolchain.toml` often lags behind that
intentionally, because we want to verify that we build with our MSRV.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-28 23:25:55 +01:00
Kris Nuttycombe f35a894103
Merge pull request #1466 from daira/transactional-create_proposed_transactions 2024-07-27 11:17:05 -06:00
Kris Nuttycombe 5b8c334ad2
Merge pull request #1464 from zcash/improve-outpoint-debug
zcash_primitives: Use `TxId` type inside `transparent::OutPoint`
2024-07-27 07:56:19 -06:00
Daira-Emma Hopwood 163425add6 In `create_proposed_transactions`, store the transactions only after
creating all of them. This avoids undesired retransmissions in case a
transaction is stored and the creation of a subsequent transaction fails.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-27 05:32:48 +01:00
Daira-Emma Hopwood 40358f4b69 Refactor `create_proposed_transaction` to return the information needed
to construct a `SentTransaction`, and then call `wallet_db.store_sent_tx`
outside the `create_proposed_transaction` call.

This should have no semantic effect by itself, but is preparation to move
where we call `store_sent_tx`.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-27 04:50:07 +01:00
Daira-Emma Hopwood 7c5ac7b151 Fix warnings when "transparent-inputs" is disabled.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-07-27 04:44:26 +01:00
Jack Grigg b3dad95de0 zcash_primitives: Use `TxId` type inside `transparent::OutPoint`
This doesn't affect the public API, but it improves the `Debug` impl for
`OutPoint` because `TxId` renders its `[u8; 32]` as byte-reversed hex.
2024-07-27 00:38:22 +00:00
Jack Grigg 4f95bd22d4
Merge pull request #1462 from nuttycom/1434-store_decrypted_tx
zcash_client_sqlite: Store received UTXOs in `store_decrypted_tx`
2024-07-26 23:11:47 +01:00
Jack Grigg 8e2b360db0
Merge pull request #1425 from nerdcash/ufvk_import_support
Add support for importing accounts by UFVK
2024-07-26 23:11:30 +01:00
Kris Nuttycombe 3cec9ee4a7 zcash_client_sqlite: Store received UTXOs in `store_decrypted_tx`.
This fixes an issue wherein transparent outputs of transactions added to
the wallet via `decrypt_and_store_transaction` would not be properly
recorded as UTXOs belonging to the wallet.

Part of #1434
2024-07-26 15:47:16 -06:00
Kris Nuttycombe 5ad3205e58 zcash_client_sqlite: Demonstrate the failure of store_decrypted_tx to persist transparent outputs.
Related to #1434
2024-07-26 15:46:57 -06:00
Kris Nuttycombe 31f8e64483 Fix clippy lint. 2024-07-26 08:55:16 -06:00
Kris Nuttycombe 2021377626 Minor documentation formatting. 2024-07-25 20:05:01 -06:00
Jack Grigg 001f278531
Merge pull request #1460 from zcash/1273-fix-no-default-features
zcash_client_sqlite: Fix `--no-default-features` compilation
2024-07-26 02:21:29 +01:00
Jack Grigg 7c6bf5c9a5 zcash_client_sqlite: Fix `--no-default-features` compilation
Closes zcash/librustzcash#1273.
2024-07-26 00:15:26 +00:00
Kris Nuttycombe 5bee983e6c zcash_client_sqlite: Make `ephemeral_addresses` migration forward-compatible 2024-07-25 16:52:07 -06:00
Kris Nuttycombe e555854f87 Merge remote-tracking branch 'upstream/main' into ufvk_import_support 2024-07-25 16:31:34 -06:00
Jack Grigg b9e37d0e88
Merge pull request #1456 from zcash/devtools-txid-lookup
devtools: Add `--lookup` argument to `zcash-inspect`
2024-07-24 20:21:30 +01:00
Jack Grigg 86409235c2 devtools: Add `--lookup` argument to `zcash-inspect`
This queries `lightwalletd` for things that might be txids, and could be
extended to other queryable formats in future.
2024-07-24 19:07:56 +00:00
Andrew Arnott c9ecc1196a
Record whether imported accounts have a spending key 2024-07-23 23:02:33 -06:00
Andrew Arnott cc39084de4
Improve docs around account creation 2024-07-23 20:32:26 -06:00
Andrew Arnott 664526f74a
Fixes for nearly all PR comments 2024-07-23 19:47:37 -06:00
Kris Nuttycombe 104c0c2aed
Merge pull request #1453 from zcash/fix-tx-view-bug
`zcash_client_sqlite`: Fix bug in `utxos_to_txos` migration
2024-07-23 12:04:43 -06:00
Jack Grigg bbb73b0495 Fix clippy lint 2024-07-23 17:09:59 +00:00
Jack Grigg 1a562fb208 zcash_client_sqlite: Fix bug in `utxos_to_txos` migration
zcash/librustzcash@72d8df8e68 altered the
`v_received_notes` view to include transparent coins (renaming it to
`v_received_outputs`), and updated `v_transactions` to not separately
query transparent coins. The latter queried `v_received_notes` twice,
once to fetch notes received in a transaction, and again to fetch notes
spent in a transaction. The spent notes were obtained by joining on
the junction table `v_received_note_spends` to get the spent-in
transaction's ID. The commit retained the junction table join, but
didn't use it due to a typo, leading to notes being "spent-in" the
transaction they were received in. This bug had several effects:

- `account_balance_delta` showed `+change` for transactions in which a
  change note was received that had not yet been spent.
- `account_balance_delta` showed `0` for transactions in which all
  received notes had been subsequently spent.
- Transactions that spent funds with no change were omitted.
2024-07-23 17:09:59 +00:00
Jack Grigg e29622e972 zcash_client_sqlite: Check that ZIP 320 spend creates expected history 2024-07-23 17:09:59 +00:00
Jack Grigg a5e467f335
Merge pull request #1451 from zcash/devtools
Import `zcash-inspect` from `zcash/zcash` into a `devtools` crate
2024-07-22 19:31:32 +01:00
Kris Nuttycombe eceb8c7ff5
Merge pull request #1442 from hattizai/patch001
chore: remove duplicate words
2024-07-22 11:49:24 -06:00
Jack Grigg 427a3fc918 devtools: Show P2PKH <--> TEX conversion when inspecting one side 2024-07-22 13:56:59 +00:00
Jack Grigg 2c133215d3 devtools: Support parsing TEX addresses 2024-07-22 13:56:59 +00:00
Jack Grigg 8f26eb9de4 devtools: Integrate `zcash-inspect` into workspace 2024-07-22 13:56:59 +00:00
Jack Grigg dc007ef47f devtools: Import `zcash-inspect` tool
Source: zcash/zcash@a0812adb18
2024-07-20 01:57:23 +00:00
Jack Grigg 18bfa38d89
Merge pull request #1450 from zcash/update-deps
cargo update
2024-07-19 16:47:17 +01:00
Jack Grigg 37f41f4b06 cargo update 2024-07-19 03:51:52 +00:00
Jack Grigg 8a7e663343
Merge pull request #1449 from zcash/doc-fix-without-features
zcash_client_backend: Fix `cargo doc` without all features
2024-07-19 03:32:52 +01:00
Andrew Arnott fa5248def0
Fix clippy error 2024-07-18 18:10:04 -06:00
Andrew Arnott 36b3fc866a
Drop the check on the error message 2024-07-18 13:00:18 -06:00
Jack Grigg 1ef11c23b7
Merge pull request #1422 from zcash/zcb-tor
zcash_client_backend: Add a Tor client that can fetch USD/ZEC exchange rates
2024-07-18 19:35:21 +01:00
Jack Grigg ac5bac9969 zcash_client_backend: Add exchanges we know how to query for USD/ZEC
Currently only unauthenticated connections are supported (i.e. no API
keys can be configured). However, AFAICT none of these exchanges provide
non-IP-based rate limits for authenticated connections to public APIs,
so authentication wouldn't help to make connections over Tor more
reliable.
2024-07-18 17:53:58 +00:00
Jack Grigg 739e878c8b zcash_client_backend: Add USD/ZEC exchange rate querying over Tor
This fetches price data from multiple exchanges over Tor, and takes the
median of the successful responses.

Closes zcash/librustzcash#1416.
2024-07-18 17:53:58 +00:00
Andrew Arnott 2ee56f77f2
Merge remote-tracking branch 'upstream/main' into ufvk_import_support 2024-07-17 23:31:08 -06:00