From 9793fb1a8743457c929a0a410b6c7bba042f6437 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Tue, 2 Jul 2024 16:35:25 -0400 Subject: [PATCH] Merge bitcoin/bitcoin#30340: test: Added coverage to Block not found error using gettxoutsetinfo 8ec24bdad89e2a72c394060ba5661a91f374b874 test: Added coverage to Block not found error using gettxoutsetinfo (kevkevinpal) Pull request description: #### Description There were no tests that checked for the `Block not found` error called in `ParseHashOrHeight` when using `gettxoutsetinfo`, this change adds coverage to it. You can see there are no tests that do the following by doing the below `grep -nri "Block not found.*gettxoutsetinfo" ./test/functional/` which leads to no results ACKs for top commit: achow101: ACK 8ec24bdad89e2a72c394060ba5661a91f374b874 tdb3: ACK 8ec24bdad89e2a72c394060ba5661a91f374b874 kristapsk: ACK 8ec24bdad89e2a72c394060ba5661a91f374b874 brunoerg: crACK 8ec24bdad89e2a72c394060ba5661a91f374b874 alfonsoromanz: Re ACK 8ec24bdad89e2a72c394060ba5661a91f374b874 Tree-SHA512: 2c61c681e7304c679cc3d7dd13af1b795780e85716c25c7423d68104e253d01271e048e21bc21be35dbc7ec1a4fde94e439542f3cfd669fe5a16478c5fa982ab --- test/functional/feature_coinstatsindex.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/functional/feature_coinstatsindex.py b/test/functional/feature_coinstatsindex.py index e01af97c1f..9c3d8523d6 100755 --- a/test/functional/feature_coinstatsindex.py +++ b/test/functional/feature_coinstatsindex.py @@ -261,6 +261,9 @@ class CoinStatsIndexTest(BitcoinTestFramework): ) self.restart_node(1, extra_args=["-coinstatsindex"]) + self.log.info("Test obtaining info for a non-existent block hash") + assert_raises_rpc_error(-5, "Block not found", index_node.gettxoutsetinfo, hash_type="none", hash_or_height="ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", use_index=True) + def _test_use_index_option(self): self.log.info("Test use_index option for nodes running the index")