Rename AddZKey to include sprout
This commit is contained in:
parent
5e360fb29f
commit
a0783bb957
|
@ -63,7 +63,7 @@ TEST(wallet_zkeys_tests, store_and_load_sapling_zkeys) {
|
||||||
/**
|
/**
|
||||||
* This test covers methods on CWallet
|
* This test covers methods on CWallet
|
||||||
* GenerateNewZKey()
|
* GenerateNewZKey()
|
||||||
* AddZKey()
|
* AddSproutZKey()
|
||||||
* LoadZKey()
|
* LoadZKey()
|
||||||
* LoadZKeyMetadata()
|
* LoadZKeyMetadata()
|
||||||
*/
|
*/
|
||||||
|
@ -89,7 +89,7 @@ TEST(wallet_zkeys_tests, store_and_load_zkeys) {
|
||||||
|
|
||||||
// manually add new spending key to wallet
|
// manually add new spending key to wallet
|
||||||
auto sk = libzcash::SproutSpendingKey::random();
|
auto sk = libzcash::SproutSpendingKey::random();
|
||||||
ASSERT_TRUE(wallet.AddZKey(sk));
|
ASSERT_TRUE(wallet.AddSproutZKey(sk));
|
||||||
|
|
||||||
// verify wallet did add it
|
// verify wallet did add it
|
||||||
addr = sk.address();
|
addr = sk.address();
|
||||||
|
|
|
@ -308,7 +308,7 @@ UniValue importwallet_impl(const UniValue& params, bool fHelp, bool fImportZKeys
|
||||||
}
|
}
|
||||||
int64_t nTime = DecodeDumpTime(vstr[1]);
|
int64_t nTime = DecodeDumpTime(vstr[1]);
|
||||||
LogPrint("zrpc", "Importing zaddr %s...\n", EncodePaymentAddress(addr));
|
LogPrint("zrpc", "Importing zaddr %s...\n", EncodePaymentAddress(addr));
|
||||||
if (!pwalletMain->AddZKey(key)) {
|
if (!pwalletMain->AddSproutZKey(key)) {
|
||||||
// Something went wrong
|
// Something went wrong
|
||||||
fGood = false;
|
fGood = false;
|
||||||
continue;
|
continue;
|
||||||
|
@ -580,7 +580,7 @@ public:
|
||||||
} else {
|
} else {
|
||||||
m_wallet->MarkDirty();
|
m_wallet->MarkDirty();
|
||||||
|
|
||||||
if (!m_wallet-> AddZKey(sk)) {
|
if (!m_wallet-> AddSproutZKey(sk)) {
|
||||||
throw JSONRPCError(RPC_WALLET_ERROR, "Error adding spending key to wallet");
|
throw JSONRPCError(RPC_WALLET_ERROR, "Error adding spending key to wallet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,8 +96,8 @@ libzcash::PaymentAddress CWallet::GenerateNewZKey()
|
||||||
int64_t nCreationTime = GetTime();
|
int64_t nCreationTime = GetTime();
|
||||||
mapSproutZKeyMetadata[addr] = CKeyMetadata(nCreationTime);
|
mapSproutZKeyMetadata[addr] = CKeyMetadata(nCreationTime);
|
||||||
|
|
||||||
if (!AddZKey(k))
|
if (!AddSproutZKey(k))
|
||||||
throw std::runtime_error("CWallet::GenerateNewZKey(): AddZKey failed");
|
throw std::runtime_error("CWallet::GenerateNewZKey(): AddSproutZKey failed");
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ bool CWallet::AddSaplingZKey(
|
||||||
|
|
||||||
|
|
||||||
// Add spending key to keystore and persist to disk
|
// Add spending key to keystore and persist to disk
|
||||||
bool CWallet::AddZKey(const libzcash::SproutSpendingKey &key)
|
bool CWallet::AddSproutZKey(const libzcash::SproutSpendingKey &key)
|
||||||
{
|
{
|
||||||
AssertLockHeld(cs_wallet); // mapSproutZKeyMetadata
|
AssertLockHeld(cs_wallet); // mapSproutZKeyMetadata
|
||||||
auto addr = key.address();
|
auto addr = key.address();
|
||||||
|
|
|
@ -1031,7 +1031,7 @@ public:
|
||||||
//! Generates a new zaddr
|
//! Generates a new zaddr
|
||||||
libzcash::PaymentAddress GenerateNewZKey();
|
libzcash::PaymentAddress GenerateNewZKey();
|
||||||
//! Adds spending key to the store, and saves it to disk
|
//! Adds spending key to the store, and saves it to disk
|
||||||
bool AddZKey(const libzcash::SproutSpendingKey &key);
|
bool AddSproutZKey(const libzcash::SproutSpendingKey &key);
|
||||||
//! Adds spending key to the store, without saving it to disk (used by LoadWallet)
|
//! Adds spending key to the store, without saving it to disk (used by LoadWallet)
|
||||||
bool LoadZKey(const libzcash::SproutSpendingKey &key);
|
bool LoadZKey(const libzcash::SproutSpendingKey &key);
|
||||||
//! Load spending key metadata (used by LoadWallet)
|
//! Load spending key metadata (used by LoadWallet)
|
||||||
|
|
Loading…
Reference in New Issue