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.
This commit is contained in:
@@ -118,7 +118,3 @@ bool IsValidPaymentAddress(const libzcash::PaymentAddress& zaddr) {
|
||||
bool IsValidViewingKey(const libzcash::ViewingKey& vk) {
|
||||
return vk.which() != 0;
|
||||
}
|
||||
|
||||
bool IsValidSpendingKey(const libzcash::SpendingKey& zkey) {
|
||||
return zkey.which() != 0;
|
||||
}
|
||||
|
||||
@@ -220,7 +220,6 @@ public:
|
||||
|
||||
typedef boost::variant<InvalidEncoding, SproutPaymentAddress, SaplingPaymentAddress> PaymentAddress;
|
||||
typedef boost::variant<InvalidEncoding, SproutViewingKey> ViewingKey;
|
||||
typedef boost::variant<InvalidEncoding, SproutSpendingKey, SaplingSpendingKey> SpendingKey;
|
||||
|
||||
}
|
||||
|
||||
@@ -230,7 +229,4 @@ bool IsValidPaymentAddress(const libzcash::PaymentAddress& zaddr);
|
||||
/** Check whether a ViewingKey is not an InvalidEncoding. */
|
||||
bool IsValidViewingKey(const libzcash::ViewingKey& vk);
|
||||
|
||||
/** Check whether a SpendingKey is not an InvalidEncoding. */
|
||||
bool IsValidSpendingKey(const libzcash::SpendingKey& zkey);
|
||||
|
||||
#endif // ZC_ADDRESS_H_
|
||||
|
||||
@@ -137,3 +137,7 @@ libzcash::SaplingPaymentAddress SaplingExtendedSpendingKey::DefaultAddress() con
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool IsValidSpendingKey(const libzcash::SpendingKey& zkey) {
|
||||
return zkey.which() != 0;
|
||||
}
|
||||
|
||||
@@ -116,6 +116,11 @@ struct SaplingExtendedSpendingKey {
|
||||
}
|
||||
};
|
||||
|
||||
typedef boost::variant<InvalidEncoding, SproutSpendingKey, SaplingExtendedSpendingKey> SpendingKey;
|
||||
|
||||
}
|
||||
|
||||
/** Check whether a SpendingKey is not an InvalidEncoding. */
|
||||
bool IsValidSpendingKey(const libzcash::SpendingKey& zkey);
|
||||
|
||||
#endif // ZCASH_ZIP32_H
|
||||
|
||||
Reference in New Issue
Block a user