Commit Graph

28 Commits

Author SHA1 Message Date
Eirik Ogilvie-Wigley
83c4e360da Address need not be optional when adding sapling keys 2018-09-27 15:44:04 -06:00
Jack Grigg
b33a7ec46e wallet: Don't allow an HDSeed to be overwritten
We can maybe relax this restriction later once we have worked out the UX
implications.
2018-09-03 10:45:37 +01:00
Jack Grigg
70b4ad2dcd wallet: Switch from SaplingSpendingKey to SaplingExtendedSpendingKey
The wallet now only stores Sapling extended spending keys, and thus can
only be used with keys generated from an HDSeed via ZIP 32.

Note that not all Sapling keys in the wallet will correspond to the
wallet's HDSeed, as a standalone Sapling xsk can be imported via
z_importkey. However, it must have been generated from a seed itself,
and thus is more likely to be backed up elsewhere.
2018-09-03 10:45:37 +01:00
Jack Grigg
ec653523ad Store HDSeed in CCryptoKeyStore 2018-09-03 10:45:33 +01:00
Jack Grigg
70c8c25e4b Store HDSeed in CBasicKeyStore 2018-09-03 10:27:52 +01:00
Jack Grigg
25d5e80cbe Rename *SpendingKey -> *SproutSpendingKey
Also GetPaymentAddresses -> GetSproutPaymentAddresses
2018-08-03 10:10:26 +01:00
Jack Grigg
4c77517772 Rename *ViewingKey* -> *SproutViewingKey* 2018-08-03 02:23:38 +01:00
Jack Grigg
5175a7f07b Pass SaplingPaymentAddress to store through the CKeyStore 2018-08-03 01:01:45 +01:00
Jay Graber
8e91ebf76c Change default_address to return SaplingPaymentAddr and not boost::optional 2018-07-05 14:52:51 -07:00
Jay Graber
f82a864dc1 Add StoreAndRetrieveSaplingSpendingKey test 2018-07-05 14:52:51 -07:00
Jay Graber
052d640cb0 Add json test vectors for Sapling key components. 2018-06-13 10:38:32 -07:00
Jay Graber
dd099401a3 Fix default_address() 2018-06-01 04:03:27 -07:00
Jay Graber
521a6f1fc0 Minimal sapling key test 2018-06-01 02:32:17 -07:00
Jack Grigg
e5eab182b5 Use boost::variant to represent shielded addresses and keys
libzcash::PaymentAddress has been renamed to libzcash::SproutPaymentAddress,
and a new typedef boost::variant is now libzcash::PaymentAddress. Similarly
for ViewingKey and SpendingKey.

A new class InvalidEncoding is introduced as the default boost::variant
option for each address and key type; it is used during decoding instead
of boost::optional.

All address and key storage functions in the wallet have been modified to
refer specifically to the Sprout types, as they are used very precisely.
In most other cases, the more general type is leveraged as much as possible,
and we convert to the Sprout type when necessary. This will be subsequently
wrapped in, or replaced with, context-specific functions once Sapling
types are implemented.
2018-05-11 17:14:49 -04:00
Jack Grigg
44e37656bf Add watch-only support to Zcash RPC methods
Balance totals do not include spends linked to viewing key addresses, as
nullifiers cannot be calculated and therefore spends cannot be detected.
2017-12-20 00:46:37 +00:00
Jack Grigg
aa666c9673 Implement viewing key storage in the keystore 2017-12-04 17:17:18 +00:00
Jack Grigg
642a1caf93 ViewingKey -> ReceivingKey per zcash/zips#117 2017-12-04 17:17:18 +00:00
Jack Grigg
6daab5b4fc Only run wallet tests when wallet is enabled 2016-12-16 10:52:37 +13:00
Jack Grigg
ad041fceec Cache note decryptors in encrypted keystore 2016-09-29 11:34:59 +13:00
Jack Grigg
3bbf2c1422 Test that invalid keys fail to unlock the keystore 2016-09-28 12:52:53 +13:00
Jack Grigg
6ae516f10b Check we haven't trashed the first key entry with the second 2016-09-13 14:21:49 +12:00
Jack Grigg
16d140f4a2 Add support for encrypting spending keys 2016-09-13 14:21:49 +12:00
Jack Grigg
73db0c12b9 Increase coverage of GetNoteDecryptor() 2016-09-01 14:44:01 +12:00
Jack Grigg
be86b6c332 Add test for GetNoteDecryptor() 2016-08-31 18:57:32 +12:00
Jack Grigg
a4f4fa8fe9 ASSERT -> EXPECT in test to get more info per test run about future regressions 2016-08-18 12:25:01 +12:00
Jack Grigg
04dfc3c569 Rework test to check for failure to return a spending key 2016-08-18 12:22:30 +12:00
Jack Grigg
b5c06c83b0 Consistent parameter naming 2016-08-12 14:37:17 +12:00
Jack Grigg
7c929cf5bc Add support for spending keys to the basic key store 2016-08-09 17:38:25 +12:00