From a6da0b03dab684c89504dc1ec761ea47a8af3539 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 2 Jan 2019 13:23:28 +0000 Subject: [PATCH] Set Sprout note data in WalletTest.WriteWitnessCache --- src/wallet/gtest/test_wallet.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wallet/gtest/test_wallet.cpp b/src/wallet/gtest/test_wallet.cpp index bf9e0c139..7c7fdb404 100644 --- a/src/wallet/gtest/test_wallet.cpp +++ b/src/wallet/gtest/test_wallet.cpp @@ -1559,6 +1559,14 @@ TEST(WalletTests, WriteWitnessCache) { wallet.AddSproutSpendingKey(sk); auto wtx = GetValidReceive(sk, 10, true); + auto note = GetNote(sk, wtx, 0, 1); + auto nullifier = note.nullifier(sk); + + mapSproutNoteData_t noteData; + JSOutPoint jsoutpt {wtx.GetHash(), 0, 1}; + SproutNoteData nd {sk.address(), nullifier}; + noteData[jsoutpt] = nd; + wtx.SetSproutNoteData(noteData); wallet.AddToWallet(wtx, true, NULL); // TxnBegin fails