From 7de76853728b423339d17f39224cf20305da1832 Mon Sep 17 00:00:00 2001 From: pablomartin4btc Date: Thu, 9 Nov 2023 18:54:27 -0300 Subject: test, assumeutxo: Use assert_debug_log for error details This is a follow-up on the invalid hash dump fix PR #28698. https://github.com/bitcoin/bitcoin/pull/28698#pullrequestreview-1698178157 --- test/functional/feature_assumeutxo.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/functional/feature_assumeutxo.py b/test/functional/feature_assumeutxo.py index ab2e6c4d0b..d1232c5133 100755 --- a/test/functional/feature_assumeutxo.py +++ b/test/functional/feature_assumeutxo.py @@ -118,8 +118,14 @@ class AssumeutxoTest(BitcoinTestFramework): chainstate_snapshot_path.mkdir() with open(chainstate_snapshot_path / "base_blockhash", 'wb') as f: f.write(b'z' * 32) - expected_error = f"Error: A fatal internal error occurred, see debug.log for details" - self.nodes[0].assert_start_raises_init_error(expected_msg=expected_error) + + def expected_error(log_msg="", error_msg=""): + with self.nodes[0].assert_debug_log([log_msg]): + self.nodes[0].assert_start_raises_init_error(expected_msg=error_msg) + + expected_error_msg = f"Error: A fatal internal error occurred, see debug.log for details" + error_details = f"Assumeutxo data not found for the given blockhash" + expected_error(log_msg=error_details, error_msg=expected_error_msg) # resurrect node again rmtree(chainstate_snapshot_path) -- cgit v1.2.3