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.
This commit is contained in:
@@ -281,11 +281,11 @@ double benchmark_try_decrypt_notes(size_t nAddrs)
|
||||
{
|
||||
CWallet wallet;
|
||||
for (int i = 0; i < nAddrs; i++) {
|
||||
auto sk = libzcash::SpendingKey::random();
|
||||
auto sk = libzcash::SproutSpendingKey::random();
|
||||
wallet.AddSpendingKey(sk);
|
||||
}
|
||||
|
||||
auto sk = libzcash::SpendingKey::random();
|
||||
auto sk = libzcash::SproutSpendingKey::random();
|
||||
auto tx = GetValidReceive(*pzcashParams, sk, 10, true);
|
||||
|
||||
struct timeval tv_start;
|
||||
@@ -299,7 +299,7 @@ double benchmark_increment_note_witnesses(size_t nTxs)
|
||||
CWallet wallet;
|
||||
ZCIncrementalMerkleTree tree;
|
||||
|
||||
auto sk = libzcash::SpendingKey::random();
|
||||
auto sk = libzcash::SproutSpendingKey::random();
|
||||
wallet.AddSpendingKey(sk);
|
||||
|
||||
// First block
|
||||
|
||||
Reference in New Issue
Block a user