Commit Graph

104 Commits

Author SHA1 Message Date
str4d d4f4f5ad91
Merge pull request #658 from nuttycom/wallet/builder_explicit_change
Update the transaction builder to make change outputs explicit
2022-11-04 00:42:31 +00:00
Kris Nuttycombe 9496fc6118 Add fee calculator to the transaction builder.
This adds a fee calculation strategy abstraction that can be used to
dynamically compute fees so that the total fees required may be taken
taken into account during note selection, and also removes automatic
change creation from the transaction builder.

Change outputs must now be directly created by the caller by the caller.
This is a necessary prerequisite for permitting fees to adjust based
upon the contents of the transaction being constructed.

The initial implementation of the fee strategy simply uses the current
default fee.
2022-11-02 08:28:16 -06:00
Jack Grigg 17a4830c70 zcash_client_backend: Add gRPC bindings behind feature flag
The lightwalletd service file is sourced from:
  Git: https://github.com/zcash/lightwalletd
  Rev: ad5ecda5fbb5e12799f926b8cd785d54fdd250c8

Closes zcash/librustzcash#585.
2022-11-02 06:22:02 +00:00
Jack Grigg 379b703e6b zcash_client_backend: Switch from `protobuf 2` to `prost 0.11`
The latter is maintained by the Tokio developers, and has easy
integration with the `tonic` gRPC library which is actively maintained.
2022-11-02 06:21:38 +00:00
Kris Nuttycombe efa95fcb39 Add `get_transparent_balances` to data api. 2022-10-25 12:53:54 -06:00
Kris Nuttycombe 8cb16d878e Require a source transparent address to shield transparent funds.
Previously, `shield_transparent_funds` was only shielding funds
associated with the legacy default transparent address. This meant
that transparent funds sent to unified addresses could not reliably
be shielded, as a unified address will frequently be constructed
using a diversifier index greater than zero.

This modifies the `get_transparent_receivers` method to return address
metadata containing the account ID and diversifier index used to derive
each address along with the receiver.
2022-10-25 12:53:54 -06:00
Sean Bowe 176e21b015
Update zcash_primitives to orchard 0.3; release zcash_primitives and zcash_proofs 0.8. 2022-10-19 13:32:51 -06:00
Kris Nuttycombe c773ea3b3e Make the internals of `WalletTransparentOutput` private. 2022-10-14 12:38:55 -06:00
Kris Nuttycombe 47a0d0d2b7 Remove the `WalletReadTransparent` and `WalletWriteTransparent` extension traits.
These traits introduce a problem, in that constraints on a method cannot
be conditionally required based upon the presence or absence of a
feature flag. Instead, we make the methods previously introduced by
the removed traits present in all cases on the `WalletRead` and
`WalletWrite` traits, but ensure that their implementations return
an error if the caller attempts to use them in a wallet that has not
been configured with support for transparent inputs functionality.
2022-10-13 21:05:49 -06:00
Kris Nuttycombe f7a3b9bda3
Merge pull request #661 from nuttycom/wallet/spend_with_usk
Use unified spending keys for spends & shielding.
2022-10-12 12:15:34 -06:00
Kris Nuttycombe fd1640c242 Update CHANGELOGs 2022-10-11 13:08:15 -06:00
Kris Nuttycombe 3c837381db Disallow invalid pool/address combinations with `Recipient`. 2022-10-11 12:52:44 -06:00
Kris Nuttycombe c5b9219f00 Look up the account by the UFVK corresponding to the USK when spending. 2022-10-05 14:35:51 -06:00
Kris Nuttycombe d0062a87d4 Add WalletWrite::create_account function 2022-09-13 18:58:28 -06:00
Kris Nuttycombe b5908dc964
Merge pull request #632 from nuttycom/data_api/get_next_address
Replace `get_address` with `get_current_address` and `get_next_available_address`
2022-09-12 18:43:38 -06:00
Kris Nuttycombe 03b0ff7e0a Replace `get_address` with `get_current_address` and `get_next_available_address`
This updates the data access API to provide diversified address
functionality. In order to support this change, the addresses table
is updated to store diversifier index information in big-endian order
to allow sorting by diversifier index, and account initialization
is updated to store the diversifier index accordingly. The currently
unreleased `addresses_table` migration is updated to reflect this
change.
2022-09-12 17:58:22 -06:00
Kris Nuttycombe 95610f7b4f Add fee to the transactions table & compute correct net_value in v_transactions. 2022-09-09 16:12:29 -06:00
Jack Grigg a32714043b zcash_client_backend: Change `WalletRead::get_address` to return UA 2022-09-08 18:49:13 +00:00
Kris Nuttycombe 8439f1a4f7 Add binary encoding for unified spending keys.
This encoding is wallet-internal-only and is currently
guarded under the `unstable` feature flag.
2022-09-08 11:05:59 -06:00
Jack Grigg 4f5d757883 zcash_client_backend: Change to `WalletWrite::remove_unmined_tx`
This fixes a bug in the logic ported from the Android SDK: it was
possible to remove a transaction in the middle of a chain, which would
cause a long-spent note to become unspent and cause the wallet balance
to be over-counted. We now restrict transaction removal to unmined
transactions, which is sufficient for the Android SDK use cases.
2022-08-30 22:54:58 +00:00
Jack Grigg 586b7e5bb0 zcash_client_backend: Add `WalletWrite::remove_tx` method
This is to replace the database mutations in the Android SDK. It is
placed behind an `unstable` feature flag until we are satisfied that it
is suitable as a general-purpose API (or replace it).
2022-08-29 21:32:18 +00:00
Kris Nuttycombe 880076b38f Improve error reporting for address & viewing key decoding. 2022-08-18 10:15:58 -06:00
Kris Nuttycombe 73314dc682 Use batch decryption in wallet scanning.
This modifies wallet scanning to perform per-block batched
decryption. It also alters the structure of the `ScanningKey`
trait to correctly include internal (change) keys in the scan
process.
2022-07-28 17:28:31 -06:00
Kris Nuttycombe 0142a3db1b
Merge pull request #570 from zcash/387-migrate-from-extfvk-to-ufvk
`zcash_client_*`: Migrate from `ExtendedFullViewingKey` to `UnifiedFullViewingKey`
2022-06-28 10:49:37 -06:00
Jack Grigg e952ff637e zcash_primitives 0.7.0 2022-06-24 17:00:39 +00:00
Jack Grigg 1ce289e568 zcash_client_backend: Pass UFVKs into `decrypt_transaction` 2022-06-17 10:03:17 +00:00
Jack Grigg c0e8ee0fa0 zcash_client_backend: Return UFVKs from `WalletRead` instead of ExtFVKs 2022-06-17 10:03:17 +00:00
Jack Grigg ed6016857e zcash_client_backend: Add `RecipientAddress::Unified` 2022-06-10 17:16:59 +00:00
Jack Grigg 144512b547 Migrate to `ff 0.12` 2022-05-06 20:03:49 +00:00
Jack Grigg 91d9a42a08 Merge branch 'non-consensus-changes-on-branchid-37519621' into merge-non-consensus-changes-3 2022-02-28 23:22:40 +00:00
Kris Nuttycombe 600c06a408 Update MSRV to 1.56.1 2022-02-24 12:26:14 -07:00
str4d efe63ad62b
Merge pull request #515 from str4d/update-compact-proto
zcash_client_backend: Bring in latest `compact_formats.proto`
2022-02-18 00:59:42 +00:00
Jack Grigg cceae3ac34 zcash_client_backend: Address compact_formats.proto comments 2022-02-17 23:58:20 +00:00
Jack Grigg 18562c71dc zcash_client_backend: Bring in latest `compact_formats.proto`
Source: 83bb19918f/walletrpc/compact_formats.proto
2022-02-17 02:44:20 +00:00
Jack Grigg f822d7aabc Bump MSRV to 1.54.0
This is the MSRV for the orchard crate version that contains the changes
to the Orchard circuit.

Closes zcash/librustzcash#513.
2022-02-15 16:39:29 +00:00
Kris Nuttycombe 6b189f18ff Correct the changelog relating to `store_decrypted_tx` 2022-02-02 10:33:44 -07:00
Kris Nuttycombe 9c2d485c80 Address comments from code review.
Co-authored-by: str4d <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-02-02 10:33:41 -07:00
Kris Nuttycombe 2f1d3da26d Update changelogs. 2022-01-27 16:25:01 -07:00
Kris Nuttycombe 3a20176092 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-27 15:00:37 -07:00
Kris Nuttycombe d43a893c72 Apply suggestions from code review & update changelog
Co-authored-by: str4d <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-10-01 12:03:06 -06:00
Kris Nuttycombe d49a20e6d2 Modify WalletTransparentOutput to wrap TxOut directly. 2021-10-01 11:42:04 -06:00
Jack Grigg 65e1d32774 ff 0.11, group 0.11, etc. 2021-09-09 18:20:37 +01:00
Jack Grigg 0facec094f Update changelogs with `EphemeralKeyBytes` changes 2021-08-09 21:45:16 +01: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
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 acc650cc17 zcash_client_backend 0.5.0 2021-03-26 18:54:42 +13:00
str4d 1bea40de88
zcash_client_backend: Add ScanningKey trait to changelog 2021-03-26 10:06:30 +13:00
Kris Nuttycombe c41c71c514
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2021-03-25 15:00:54 -06:00
Kris Nuttycombe ebdd6cf976 Add SaplingIvk newtype to changelogs. 2021-03-24 18:39:21 -06:00
Jack Grigg 46872e2590 Update changelogs with Memo changes 2021-03-18 10:00:27 +13: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 1f6f45bbe7 Add details of unreleased changes to changelogs 2021-02-22 16:59:07 +00:00
Jack Grigg bd3e18984c Changelogs: s/project/library 2021-02-04 15:16:32 +00:00
Jack Grigg b5c7d7f1e7 Add changelogs to the crates
The changelogs are accurate for the 0.4.0 release tag, but don't yet
include changes before or after that tag.
2021-02-04 15:13:22 +00:00