Commit Graph

15801 Commits

Author SHA1 Message Date
Kris Nuttycombe 13ee447a42 Merge branch 'test_wallet_listreceived' into feature/wallet_unified_addresses-z_sendmany 2022-02-07 15:08:35 -07:00
Kris Nuttycombe fa0d4eb473 Use z_shieldcoinbase for Sprout funds in wallet_listreceived tests.
After release 4.7.0, z_sendmany will no longer support sending
funds to Sprout. By using z_shieldcoinbase, we can avoid this
limitation.
2022-02-07 15:06:19 -07:00
str4d 96912d3152
Merge pull request #5490 from LarryRuane/2022-01-ua-shieldcoinbase
allow UA as z_shieldcoinbase destination
2022-02-03 21:44:29 +00:00
Larry Ruane 1e165b8396 allow UA as z_shieldcoinbase destination 2022-02-03 08:31:26 -07:00
Kris Nuttycombe 741ed52436 Fix nondeterministic test error (checking for the wrong error case). 2022-02-02 17:48:35 -07:00
Kris Nuttycombe 6c9b9a53b5 Update librustzcash dependency. 2022-02-02 17:40:36 -07:00
zancas ca04cb0a58
All implementations of ComparisonTestFramework were overriding num_nodes
Moreover, they were all overriding it to the same value (1).
Set the default to 1 and remove redundant subclass constructor code.
2022-02-01 10:27:16 -07:00
zancas 4dce020678
enforce usage of the get_tests comptool interface as ComparisonTestFramework method
In practice all-and-only subclasses of ComparisonTestFramework implement get_tests.
This commit enforces this relation.
2022-02-01 10:27:10 -07:00
Kris Nuttycombe 214567be2c Add a few additional cases to z_sendmany RPC tests. 2022-02-01 08:24:31 -07:00
Kris Nuttycombe a0c27bf254 Address TODOs in rpc-tests/wallet-accounts.py 2022-02-01 08:24:31 -07:00
Kris Nuttycombe a46720aab1 Add accessor method for Sapling IVKs to SaplingDiversifiableFullViewingKey 2022-02-01 08:24:31 -07:00
Kris Nuttycombe 2209a74f38 Fix a bug in the generation of addresses from UFVKs
The use of `std::optional` for the return type of the
`ZcashdUnifiedFullViewingKey::Address` operation obscured
a potential bug where the requested receiver types for a
unified address could not be satisfied because the UFVK
from which the address was being derived did not contain
all of the requested key types.
2022-02-01 08:24:31 -07:00
Kris Nuttycombe 90e59c3be0 Do not add Sapling addresses to the wallet by default when adding extfvks.
Adding the default address to the wallet automatically made sense
prior to support of diversified addresses, but this is no longer
desirable behavior as we have separated key generation from address
derivation.
2022-01-31 11:31:16 -07:00
Conrado Gouvea 269c5c2e7f Add comment to zcash_script_new_precomputed_tx about references to input buffers 2022-01-31 15:16:35 -03:00
Kris Nuttycombe 66530d97e1 Rename AddSaplingIncomingViewingKey -> AddSaplingPaymentAddress
This operation was poorly named; the wallet already contained
the IVK, and this operation was simply adding the ability to
look up the IVK by a specific diversified address derived
from that IVK.
2022-01-30 17:24:52 -07:00
Kris Nuttycombe b80349d246 GenerateLegacySaplingZKey only needs to return an address, not an extfvk. 2022-01-30 11:26:49 -07:00
Kris Nuttycombe ae2213dcdc Fix variable shadowing in change address derivation & add change IVK to the keystore. 2022-01-30 11:15:50 -07:00
Kris Nuttycombe acacc044fc Add gtest for change address derivation.
Check that derivation of the UFVK change address is consistent
irrespective of the path by which it is derived.
2022-01-30 11:09:06 -07:00
Kris Nuttycombe 9afea4f10b Add failing tests for z_sendmany ANY_TADDR -> UA and UA -> <legacy_taddr> 2022-01-30 11:07:00 -07:00
Kris Nuttycombe 91be2f1875 Simplify determination of valid change types. 2022-01-29 13:53:24 -07:00
Kris Nuttycombe b880ef8a1c Fix z_sendmany handling of transparent OVK derivation in the ANY_TADDR case. 2022-01-27 21:29:40 -07:00
Kris Nuttycombe 71f17fa05c Add a check for internal vs. external outputs to wallet_listreceived test. 2022-01-27 21:29:40 -07:00
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 d8c818bfa5
Merge pull request #5464 from LarryRuane/2022-01-submitblock-log-soln-error
mining: submitblock: log detailed equihash solution error
2022-01-25 12:49:00 -07: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