Commit Graph

15804 Commits

Author SHA1 Message Date
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
Larry Ruane bc1af5fc2d mining: submitblock: log detailed equihash solution error 2022-01-11 12:52:30 -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
zancas fbbdb23214
blake2b/s is integrated into hashlib, drop external python package dependency 2022-01-11 10:16:22 -07:00
str4d 005a8624bf
Merge pull request #5440 from nuttycom/cleanup/sendmany_txbuilder-prereq
Prerequisites for replacing manual transaction construction in asyncrpcoperation_sendmany with the transaction builder.
2022-01-11 15:24:55 +00:00
Kris Nuttycombe 951a44de93 Merge remote-tracking branch 'upstream/master' into cleanup/sendmany_txbuilder-prereq 2022-01-10 19:49:23 -07:00
Kris Nuttycombe ed93cf5aff
Merge pull request #5459 from daira/fix-drop-warning
Avoid a warning by explicitly calling drop
2022-01-10 19:46:40 -07:00
Kris Nuttycombe 41eebce355 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-10 19:46:06 -07:00
Daira Hopwood 0e073a53ee Replace call to drop with zeroization.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-01-10 02:39:25 +00:00
Daira Hopwood 4f7d15508f Avoid a warning by explicitly calling drop.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-01-09 23:54:35 +00:00
Kris Nuttycombe d3b599eac1 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-07 11:49:09 -07:00
Kris Nuttycombe 864cd8622f Improve error messages in the case of taddr decoding failure. 2022-01-07 11:49:09 -07:00
Kris Nuttycombe 9702b47e2a Use libzcash::PaymentAddress instead of std::string in mergetoaddress 2022-01-07 11:49:09 -07:00
Kris Nuttycombe eb91c7869a Remove a use of KeyIO::DecodeDestination in z_shieldcoinbase 2022-01-07 11:49:09 -07:00
Kris Nuttycombe 20266ac911 Remove uses of KeyIO::DecodeDestination 2022-01-07 11:49:07 -07:00
Kris Nuttycombe d376e28382 Replace `DecodeDestination` in `GetMinerAddress` with `DecodePaymentAddress` 2022-01-06 22:29:44 -07:00
Kris Nuttycombe f5d4f6fef1 Remove `RawAddress`
This adds a new `AddrSet` type for use in note retrieval
as a filter, in place of a heterogeneous list of `RawAddress`
values. `RawAddress` will complicate the handling of addresses
within the wallet after the addition of unified addresses,
because it does not contain transparent receiver types, and
if we retain this polymorphism it means a lot of invalid states
are represented in places we don't want them to be. It's better
to figure out what types of addresses we're working with as soon
as possible after parsing, and use monomorphic calls from there
on in.
2022-01-06 22:29:41 -07:00
Kris Nuttycombe 4f2ff2a9f8 Remove spurious variant from asyncrpcoperation_sendmany
The `spendingkey_` field previously used by asyncrpcoperation_sendmany
caused a situation where call sites would assume the type of the
spending key based upon boolean flags that were derived elsewhere.
In attempting to support unified addresses, it is desirable to remove
these boolean deductions and instead work primarily based on the
direct evidence of the data at hand. This commit therefore removes
the `spendingkey_` field that could potentially produce results
that would disagree with these boolean values, in favor of such
direct evidence, making these call sites a bit less error prone.
2022-01-06 15:32:04 -07:00
Kris Nuttycombe 890e1d841d Add raw transparent address types to PaymentAddress
The addition of `UnifiedAddress` to the `PaymentAddress` type
introduced the need for methods that interact with payment addresses
to support transparent receivers as shielded ones, which is somewhat
inconsistent with previous uses of the `PaymentAddress` type.

This commit adds both `CKeyID` and `CScriptID` as new variants
of the `PaymentAddress` type. Following commits will shift encoding
and decoding to use the `PaymentAddress` type exclusively wherever
possible, rather than the current mix of `CDestination` and
`PaymentAddress` that complicates the wallet codebase.
2022-01-06 13:44:45 -07:00
Kris Nuttycombe c35e2b4438 Remove spurious uses of HaveSpendingKeyForPaymentAddress
There's no need to dispatch through this visitor in cases where
the payment address type is already statically known.
2022-01-06 13:44:45 -07:00
Kris Nuttycombe 62b86d6afc Use CKeyID and CScriptID instead of new P2PKH/P2SHAddress classes. 2022-01-06 13:44:45 -07:00
Kris Nuttycombe b305ad2892 Remove the `InvalidEncoding` type from key & address variants.
The presence of this variant results in a situation where more
of the code than necessary needs to be aware of and handle
decoding failures. This change moves all handling of decoding
failures to the point of decoding.
2022-01-06 13:44:45 -07:00
Kris Nuttycombe 89755a114b
Merge pull request #5450 from nuttycom/feature/wallet_unified_addresses-fix_receiver_order
Make address serialization respect encoding order.
2022-01-06 12:17:10 -07:00
Kris Nuttycombe fe777c5624 Fix encoding order of unified addresses. 2022-01-05 18:30:06 -07:00
Kris Nuttycombe 98967e2ec7 Merge remote-tracking branch 'upstream/master' into feature/wallet_unified_addresses 2022-01-05 18:20:31 -07:00
Kris Nuttycombe 0403799be2
Merge pull request #5454 from zcash/hotfix-v4.6.0-1
Hotfix v4.6.0-1
2022-01-05 18:15:33 -07:00