Commit Graph

15676 Commits

Author SHA1 Message Date
Kris Nuttycombe 1733c6bc0c Use a BIP 44 change address for change when sending from legacy t-addrs. 2022-01-27 21:29:37 -07:00
Kris Nuttycombe b46d85976d Implement derivation of the internal Sapling spending key. 2022-01-27 21:27:43 -07:00
Kris Nuttycombe 3ddbe1fa06 Implement OVK selection for z_sendmany. 2022-01-27 21:27:43 -07:00
Kris Nuttycombe bdcb12e445 Add a first-class type for transparent full viewing keys. 2022-01-27 21:27:43 -07:00
Kris Nuttycombe c21ffff790 Add correct selection of change addresses to z_sendmany
This also alters `TransactionBuilder::SendChangeTo` to take a
`libzcash::ChangeAddress` value and thus avoids the invalid
t-addr case of CTxDestination.
2022-01-27 21:27:43 -07:00
str4d 992a47103d
Merge pull request #5500 from str4d/ua-wallet-balance-rpcs
Implement balance RPC methods that support Unified Addresses
2022-01-27 20:11:38 +00:00
Kris Nuttycombe d17a0bb9de Merge remote-tracking branch 'upstream/master' into feature/wallet_unified_addresses 2022-01-25 20:27:33 -07:00
Jack Grigg 756f4fc840 wallet: Implement `z_getbalanceforaddress`
Closes zcash/zcash#5182.
2022-01-26 00:34:45 +00:00
Jack Grigg 77c46933aa wallet: Fix account generation bug
When generating a new account, we were setting up the map from account
ID to UFVK ID, but were not setting up the reverse map from UFVK ID to
account ID. The latter map is needed in order to verify that a note in
the wallet belongs to the account. We were correctly loading it from the
account metadata on node start, but between account generation and first
restart, z_getbalanceforaccount would always return zero.

We now initialize the UFVK address metadata map with the account ID when
the account is generated.
2022-01-26 00:02:58 +00:00
Jack Grigg ca0dad0a8c wallet: Implement `z_getbalanceforaccount`
Closes zcash/zcash#5183.
2022-01-25 23:54:30 +00:00
Kris Nuttycombe 443136c137
Merge pull request #5485 from nuttycom/feature/wallet_unified_addresses-z_sendmany-prereq
Shared utility code needed for z_sendmany and other UA balance-related RPCs.
2022-01-25 12:42:57 -07:00
Kris Nuttycombe 28eddb7c21
Merge pull request #5474 from LarryRuane/2022-01-disable-sprout-addr-gen
rpc: Disable Sprout address generation at Canopy #5368
2022-01-25 10:05:44 -07:00
Charlie O'Keefe 19bfc2f3b8
Merge pull request #5463 from zingolabs/drop_pyblake2_dep
Drop pyblake2 dependency
2022-01-25 09:32:08 -07:00
Kris Nuttycombe b93155c460 Add documentation for `UnifiedAddress::GetPreferredRecipientAddress` 2022-01-25 09:15:51 -07:00
Kris Nuttycombe db104a6329 Use `ZTXOSelector::IncludesSapling` rather than selector internals. 2022-01-25 09:13:08 -07:00
Kris Nuttycombe b8a5131af9 Clarify documentation of CWallet::FindAccountForSelector 2022-01-25 09:08:52 -07:00
Kris Nuttycombe beb0f2bc1f Make `FindSpendableInputs` respect `ZTXOSelector::RequireSpendingKeys()` 2022-01-25 09:00:28 -07:00
Kris Nuttycombe c15f6a9cad Rename ZTXOSelector::SpendingKeysAvailable -> RequireSpendingKeys 2022-01-25 07:39:22 -07:00
Kris Nuttycombe ddb34f612d Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-24 20:01:41 -07:00
Kris Nuttycombe babc11eb52 Use libzcash::RecipientAddress for z_sendmany recipients. 2022-01-24 13:10:31 -07:00
Kris Nuttycombe 0abe07c73b Add RecipientAddress type. 2022-01-24 13:10:31 -07:00
Kris Nuttycombe 18282040f5 Add CWallet::FindAccountForSelector 2022-01-24 13:10:31 -07:00
Kris Nuttycombe c4a74087b7 Modify CWallet::FindSpendableInputs to use ZTXOSelector 2022-01-24 13:10:31 -07:00
str4d a6f9c9c0bc Merge pull request #5458 from nuttycom/cleanup/sendmany_txbuilder
Use the transaction builder to implement z_sendmany.
2022-01-21 20:14:58 -07:00
Kris Nuttycombe a43dbb4925 Replace `HaveSpendingKeyForAddress` with checks at ZTXOSelector construction. 2022-01-19 14:37:54 -07:00
Kris Nuttycombe e419899a29 Add support for unified addresses to CWallet::ToZTXOSelector 2022-01-19 13:53:33 -07:00
Kris Nuttycombe f850e89449 Replace the badly-named `PaymentSource` with `ZTXOSelector`
The ZTXOSelector type allows selection of previous Zcash
transaction outputs (both transparent outputs and shielded notes)
on the basis of either a (legacy) bare address, or for a
BIP-44 account.
2022-01-19 13:35:38 -07:00
Kris Nuttycombe c4a7f5c95c Move FindSpendableInputs to CWallet 2022-01-19 13:11:24 -07:00
str4d 6b335ecb4c
Merge pull request #5484 from str4d/5466-ua-validation
Fully-validate contents of UAs and UFVKs on parsing
2022-01-19 02:35:46 +00:00
str4d a5b0725f89
Merge pull request #5475 from str4d/ua-wallet-rpcs
Implement wallet UA RPCs
2022-01-19 00:04:31 +00:00
Jack Grigg 714f14168c rust: Add missing checks for transparent UFVK items 2022-01-18 21:32:33 +00:00
Jack Grigg 9b61806cc6 rust: Add missing checks for shielded UFVK items 2022-01-18 21:32:32 +00:00
Jack Grigg f2e0a8d1f3 rust: Add missing Orchard receiver check in UA parsing
We didn't add it at the time because the necessary API did not exist in
the `orchard` crate. The API has since been added.
2022-01-18 21:31:52 +00:00
Jack Grigg 96c9333b74 wallet: Reverse order of arguments to z_getaddressforaccount
We now use the empty array of pools to indicate that the default pools
should be used when providing a diversifier index parameter, instead of
needing a default sentinel value for the diversifier index parameter
(which was previously suggested as '*' which would have caused issues
for defining a consistent type for that parameter).
2022-01-18 20:02:13 +00:00
Jack Grigg ff0e9f6b95 wallet: Show UAs owned by the wallet in `z_viewtransaction`
Part of zcash/zcash#5186.
2022-01-18 19:44:33 +00:00
Jack Grigg baaa3c4ac0 wallet: Implement `z_listunifiedreceivers`
Closes zcash/zcash#5181.
2022-01-18 19:44:33 +00:00
Jack Grigg 8617622e0d wallet: Implement `z_getaddressforaccount`
Closes zcash/zcash#5180.
2022-01-18 19:43:27 +00:00
Jack Grigg fe384eeb1f wallet: Implement `z_getnewaccount`
Closes zcash/zcash#5178.
2022-01-13 22:35:08 +00:00
str4d 6118432712
Merge pull request #5468 from nuttycom/merge/master_ua
Merge master branch back to the wallet/feature_unified_addresses branch.
2022-01-13 14:15:15 +00:00
Kris Nuttycombe cc392c70a6 Merge branch 'master' into feature/wallet_unified_addresses 2022-01-12 16:54:12 -07:00
str4d 423489c5e8
Merge pull request #5458 from nuttycom/cleanup/sendmany_txbuilder
Use the transaction builder to implement z_sendmany.
2022-01-12 23:50:09 +00:00
Kris Nuttycombe de58fc0b16 Update release notes to reflect z_sendmany changes 2022-01-12 10:45:58 -07:00
Kris Nuttycombe 528ae6d180 Return z_sendmany errors synchronously when possible. 2022-01-12 10:45:58 -07:00
Kris Nuttycombe 0ca7d49626 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-12 10:45:46 -07:00
Kris Nuttycombe 9554ed2dc4 Require an explicit flag to allow cross-pool transfers in z_sendmany.
This adds an `allowRevealedAmounts` argument to z_sendmany. This
flag must be present to allow an amount-revealing cross-pool transfer
to be constructed.
2022-01-11 19:40:02 -07:00
Kris Nuttycombe 322aee238a Fix conditions around dust thresholds. 2022-01-11 19:40:02 -07:00
Kris Nuttycombe b54a63bf18 Transaction builder must not set consensus branch ID for V4 transactions. 2022-01-11 13:28:34 -07:00
Kris Nuttycombe f9477a4499 Use transaction builder for asyncrpcoperation_sendmany.
This replaces the old implementation of asyncrpcoperation_sendmany
with one where all transaction construction is delegated to the
transaction builder. The capabilities of z_sendmany are somewhat
modified in the process:

* z_sendmany now permits sending funds from a Sprout address to
  both transparent and Sapling addresses. PRIVACY NOTE: When
  user sends a Sprout->Sapling transaction, the amount of the
  transaction is publicly revealed.
* z_sendmany no longer supports transactions sending funds into
  the Sprout pool, with the exception of change amounts when
  sending from a Sprout address.
* When sending transparent coinbase funds to a set of shielded
  addresses, the amount sent to recipients must fully consume
  the input value and no change is permitted. This is a slightly
  weaker constraint than was previously implemented; in the past,
  only a single shielded recipient was allowed.
2022-01-11 13:28:34 -07:00
zancas 30abf25148
update doctest in gtest suite to prefer hashlib 2022-01-11 10:32:18 -07:00
Kris Nuttycombe d6525e24db
Merge pull request #5445 from rex4539/typos
Fix typos
2022-01-11 10:31:01 -07:00