From 020305fd20f2b3535dd27c532045491fcd0bff77 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 27 Mar 2024 13:30:15 +0000 Subject: [PATCH] zcash_client_sqlite: Add tests that hit zcash/librustzcash#1326. --- zcash_client_sqlite/src/wallet.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zcash_client_sqlite/src/wallet.rs b/zcash_client_sqlite/src/wallet.rs index e397c7121..6683b81b7 100644 --- a/zcash_client_sqlite/src/wallet.rs +++ b/zcash_client_sqlite/src/wallet.rs @@ -2901,6 +2901,10 @@ mod tests { ).as_deref(), Ok(&[ref ret]) if (ret.outpoint(), ret.txout(), ret.height()) == (utxo.outpoint(), utxo.txout(), height_1) ); + assert_matches!( + st.wallet().get_unspent_transparent_output(utxo.outpoint()), + Ok(Some(ret)) if (ret.outpoint(), ret.txout(), ret.height()) == (utxo.outpoint(), utxo.txout(), height_1) + ); // Change the mined height of the UTXO and upsert; we should get back // the same `UtxoId`. @@ -2917,6 +2921,12 @@ mod tests { Ok(&[]) ); + // We can still look up the specific output, and it has the expected height. + assert_matches!( + st.wallet().get_unspent_transparent_output(utxo2.outpoint()), + Ok(Some(ret)) if (ret.outpoint(), ret.txout(), ret.height()) == (utxo2.outpoint(), utxo2.txout(), height_2) + ); + // If we include `height_2` then the output is returned. assert_matches!( st.wallet()