Replace GetTxid() with GetHash() after rebase on latest.
This commit is contained in:
parent
33264f5b46
commit
fa511e1084
|
@ -153,7 +153,7 @@ TEST(wallet_tests, note_data_serialisation) {
|
||||||
auto nullifier = note.nullifier(sk);
|
auto nullifier = note.nullifier(sk);
|
||||||
|
|
||||||
mapNoteData_t noteData;
|
mapNoteData_t noteData;
|
||||||
JSOutPoint jsoutpt {wtx.GetTxid(), 0, 1};
|
JSOutPoint jsoutpt {wtx.GetHash(), 0, 1};
|
||||||
CNoteData nd {sk.address(), nullifier};
|
CNoteData nd {sk.address(), nullifier};
|
||||||
ZCIncrementalMerkleTree tree;
|
ZCIncrementalMerkleTree tree;
|
||||||
nd.witnesses.push_front(tree.witness());
|
nd.witnesses.push_front(tree.witness());
|
||||||
|
@ -177,7 +177,7 @@ TEST(wallet_tests, set_note_addrs_in_cwallettx) {
|
||||||
EXPECT_EQ(0, wtx.mapNoteData.size());
|
EXPECT_EQ(0, wtx.mapNoteData.size());
|
||||||
|
|
||||||
mapNoteData_t noteData;
|
mapNoteData_t noteData;
|
||||||
JSOutPoint jsoutpt {wtx.GetTxid(), 0, 1};
|
JSOutPoint jsoutpt {wtx.GetHash(), 0, 1};
|
||||||
CNoteData nd {sk.address(), nullifier};
|
CNoteData nd {sk.address(), nullifier};
|
||||||
noteData[jsoutpt] = nd;
|
noteData[jsoutpt] = nd;
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ TEST(wallet_tests, set_invalid_note_addrs_in_cwallettx) {
|
||||||
|
|
||||||
mapNoteData_t noteData;
|
mapNoteData_t noteData;
|
||||||
auto sk = libzcash::SpendingKey::random();
|
auto sk = libzcash::SpendingKey::random();
|
||||||
JSOutPoint jsoutpt {wtx.GetTxid(), 0, 1};
|
JSOutPoint jsoutpt {wtx.GetHash(), 0, 1};
|
||||||
CNoteData nd {sk.address(), uint256()};
|
CNoteData nd {sk.address(), uint256()};
|
||||||
noteData[jsoutpt] = nd;
|
noteData[jsoutpt] = nd;
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ TEST(wallet_tests, find_note_in_tx) {
|
||||||
auto noteMap = wallet.FindMyNotes(wtx);
|
auto noteMap = wallet.FindMyNotes(wtx);
|
||||||
EXPECT_EQ(2, noteMap.size());
|
EXPECT_EQ(2, noteMap.size());
|
||||||
|
|
||||||
JSOutPoint jsoutpt {wtx.GetTxid(), 0, 1};
|
JSOutPoint jsoutpt {wtx.GetHash(), 0, 1};
|
||||||
CNoteData nd {sk.address(), nullifier};
|
CNoteData nd {sk.address(), nullifier};
|
||||||
EXPECT_EQ(1, noteMap.count(jsoutpt));
|
EXPECT_EQ(1, noteMap.count(jsoutpt));
|
||||||
EXPECT_EQ(nd, noteMap[jsoutpt]);
|
EXPECT_EQ(nd, noteMap[jsoutpt]);
|
||||||
|
@ -229,8 +229,8 @@ TEST(wallet_tests, get_conflicted_notes) {
|
||||||
|
|
||||||
auto wtx2 = GetValidSpend(sk, note, 5);
|
auto wtx2 = GetValidSpend(sk, note, 5);
|
||||||
auto wtx3 = GetValidSpend(sk, note, 10);
|
auto wtx3 = GetValidSpend(sk, note, 10);
|
||||||
auto hash2 = wtx2.GetTxid();
|
auto hash2 = wtx2.GetHash();
|
||||||
auto hash3 = wtx3.GetTxid();
|
auto hash3 = wtx3.GetHash();
|
||||||
|
|
||||||
// No conflicts for no spends
|
// No conflicts for no spends
|
||||||
EXPECT_EQ(0, wallet.GetConflicts(hash2).size());
|
EXPECT_EQ(0, wallet.GetConflicts(hash2).size());
|
||||||
|
@ -299,7 +299,7 @@ TEST(wallet_tests, navigate_from_nullifier_to_note) {
|
||||||
auto nullifier = note.nullifier(sk);
|
auto nullifier = note.nullifier(sk);
|
||||||
|
|
||||||
mapNoteData_t noteData;
|
mapNoteData_t noteData;
|
||||||
JSOutPoint jsoutpt {wtx.GetTxid(), 0, 1};
|
JSOutPoint jsoutpt {wtx.GetHash(), 0, 1};
|
||||||
CNoteData nd {sk.address(), nullifier};
|
CNoteData nd {sk.address(), nullifier};
|
||||||
noteData[jsoutpt] = nd;
|
noteData[jsoutpt] = nd;
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ TEST(wallet_tests, navigate_from_nullifier_to_note) {
|
||||||
|
|
||||||
wallet.AddToWallet(wtx, true, NULL);
|
wallet.AddToWallet(wtx, true, NULL);
|
||||||
EXPECT_EQ(1, wallet.mapNullifiersToNotes.count(nullifier));
|
EXPECT_EQ(1, wallet.mapNullifiersToNotes.count(nullifier));
|
||||||
EXPECT_EQ(wtx.GetTxid(), wallet.mapNullifiersToNotes[nullifier].hash);
|
EXPECT_EQ(wtx.GetHash(), wallet.mapNullifiersToNotes[nullifier].hash);
|
||||||
EXPECT_EQ(0, wallet.mapNullifiersToNotes[nullifier].js);
|
EXPECT_EQ(0, wallet.mapNullifiersToNotes[nullifier].js);
|
||||||
EXPECT_EQ(1, wallet.mapNullifiersToNotes[nullifier].n);
|
EXPECT_EQ(1, wallet.mapNullifiersToNotes[nullifier].n);
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ TEST(wallet_tests, spent_note_is_from_me) {
|
||||||
EXPECT_FALSE(wallet.IsFromMe(wtx2));
|
EXPECT_FALSE(wallet.IsFromMe(wtx2));
|
||||||
|
|
||||||
mapNoteData_t noteData;
|
mapNoteData_t noteData;
|
||||||
JSOutPoint jsoutpt {wtx.GetTxid(), 0, 1};
|
JSOutPoint jsoutpt {wtx.GetHash(), 0, 1};
|
||||||
CNoteData nd {sk.address(), nullifier};
|
CNoteData nd {sk.address(), nullifier};
|
||||||
noteData[jsoutpt] = nd;
|
noteData[jsoutpt] = nd;
|
||||||
|
|
||||||
|
@ -355,8 +355,8 @@ TEST(wallet_tests, cached_witnesses_empty_chain) {
|
||||||
auto nullifier2 = note2.nullifier(sk);
|
auto nullifier2 = note2.nullifier(sk);
|
||||||
|
|
||||||
mapNoteData_t noteData;
|
mapNoteData_t noteData;
|
||||||
JSOutPoint jsoutpt {wtx.GetTxid(), 0, 0};
|
JSOutPoint jsoutpt {wtx.GetHash(), 0, 0};
|
||||||
JSOutPoint jsoutpt2 {wtx.GetTxid(), 0, 1};
|
JSOutPoint jsoutpt2 {wtx.GetHash(), 0, 1};
|
||||||
CNoteData nd {sk.address(), nullifier};
|
CNoteData nd {sk.address(), nullifier};
|
||||||
CNoteData nd2 {sk.address(), nullifier2};
|
CNoteData nd2 {sk.address(), nullifier2};
|
||||||
noteData[jsoutpt] = nd;
|
noteData[jsoutpt] = nd;
|
||||||
|
@ -407,7 +407,7 @@ TEST(wallet_tests, cached_witnesses_chain_tip) {
|
||||||
auto nullifier = note.nullifier(sk);
|
auto nullifier = note.nullifier(sk);
|
||||||
|
|
||||||
mapNoteData_t noteData;
|
mapNoteData_t noteData;
|
||||||
JSOutPoint jsoutpt {wtx.GetTxid(), 0, 1};
|
JSOutPoint jsoutpt {wtx.GetHash(), 0, 1};
|
||||||
CNoteData nd {sk.address(), nullifier};
|
CNoteData nd {sk.address(), nullifier};
|
||||||
noteData[jsoutpt] = nd;
|
noteData[jsoutpt] = nd;
|
||||||
wtx.SetNoteData(noteData);
|
wtx.SetNoteData(noteData);
|
||||||
|
@ -430,7 +430,7 @@ TEST(wallet_tests, cached_witnesses_chain_tip) {
|
||||||
auto nullifier = note.nullifier(sk);
|
auto nullifier = note.nullifier(sk);
|
||||||
|
|
||||||
mapNoteData_t noteData;
|
mapNoteData_t noteData;
|
||||||
JSOutPoint jsoutpt {wtx.GetTxid(), 0, 1};
|
JSOutPoint jsoutpt {wtx.GetHash(), 0, 1};
|
||||||
CNoteData nd {sk.address(), nullifier};
|
CNoteData nd {sk.address(), nullifier};
|
||||||
noteData[jsoutpt] = nd;
|
noteData[jsoutpt] = nd;
|
||||||
wtx.SetNoteData(noteData);
|
wtx.SetNoteData(noteData);
|
||||||
|
|
|
@ -621,7 +621,7 @@ void CWallet::IncrementNoteWitnesses(const CBlockIndex* pindex,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const CTransaction& tx : pblock->vtx) {
|
for (const CTransaction& tx : pblock->vtx) {
|
||||||
auto hash = tx.GetTxid();
|
auto hash = tx.GetHash();
|
||||||
bool txIsOurs = mapWallet.count(hash);
|
bool txIsOurs = mapWallet.count(hash);
|
||||||
for (size_t i = 0; i < tx.vjoinsplit.size(); i++) {
|
for (size_t i = 0; i < tx.vjoinsplit.size(); i++) {
|
||||||
const JSDescription& jsdesc = tx.vjoinsplit[i];
|
const JSDescription& jsdesc = tx.vjoinsplit[i];
|
||||||
|
@ -1039,7 +1039,7 @@ void CWallet::EraseFromWallet(const uint256 &hash)
|
||||||
mapNoteData_t CWallet::FindMyNotes(const CTransaction& tx) const
|
mapNoteData_t CWallet::FindMyNotes(const CTransaction& tx) const
|
||||||
{
|
{
|
||||||
LOCK(cs_SpendingKeyStore);
|
LOCK(cs_SpendingKeyStore);
|
||||||
uint256 hash = tx.GetTxid();
|
uint256 hash = tx.GetHash();
|
||||||
|
|
||||||
mapNoteData_t noteData;
|
mapNoteData_t noteData;
|
||||||
libzcash::SpendingKey key;
|
libzcash::SpendingKey key;
|
||||||
|
|
Loading…
Reference in New Issue