Auto merge of #1233 - str4d:1199-note-tracking, r=str4d

Add Note tracking

This PR extends the existing transaction tracking in the wallet to track spendable Notes.

Closes #1199
This commit is contained in:
zkbot
2016-09-01 08:17:07 +00:00
20 changed files with 1103 additions and 20 deletions

View File

@@ -27,3 +27,17 @@ TEST(keystore_tests, store_and_retrieve_spending_key) {
EXPECT_EQ(1, addrs.size());
EXPECT_EQ(1, addrs.count(addr));
}
TEST(keystore_tests, store_and_retrieve_note_decryptor) {
CBasicKeyStore keyStore;
ZCNoteDecryption decOut;
auto sk = libzcash::SpendingKey::random();
auto addr = sk.address();
EXPECT_FALSE(keyStore.GetNoteDecryptor(addr, decOut));
keyStore.AddSpendingKey(sk);
EXPECT_TRUE(keyStore.GetNoteDecryptor(addr, decOut));
EXPECT_EQ(ZCNoteDecryption(sk.viewing_key()), decOut);
}