Add test for CWalletTx::SetSaplingNoteData()

This commit is contained in:
Simon 2018-08-02 19:13:24 -07:00
parent f12daeb44a
commit 28d3dc8532
1 changed files with 13 additions and 0 deletions

View File

@ -350,6 +350,19 @@ TEST(WalletTests, SetInvalidNoteAddrsInCWalletTx) {
EXPECT_THROW(wtx.SetSproutNoteData(noteData), std::logic_error);
}
// Cannot add note data for an index which does not exist in tx.vShieldedOutput
TEST(WalletTests, SetInvalidSaplingNoteDataInCWalletTx) {
CWalletTx wtx;
EXPECT_EQ(0, wtx.mapSaplingNoteData.size());
mapSaplingNoteData_t noteData;
SaplingOutPoint op {uint256(), 1};
SaplingNoteData nd;
noteData.insert(std::make_pair(op, nd));
EXPECT_THROW(wtx.SetSaplingNoteData(noteData), std::logic_error);
}
TEST(WalletTests, GetSproutNoteNullifier) {
CWallet wallet;