diff options
author | fanquake <fanquake@gmail.com> | 2023-11-10 09:41:25 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-11-10 09:55:56 +0000 |
commit | 1fdd832842f3b002ce0dd079747b6015fe5569cd (patch) | |
tree | 79898cf6efbfb0af1a6f5f9d621c914dbc9f0192 | |
parent | b3898e946cf81e2e7b573e1c5204bd29af2feecd (diff) | |
parent | 7de76853728b423339d17f39224cf20305da1832 (diff) | |
download | bitcoin-1fdd832842f3b002ce0dd079747b6015fe5569cd.tar.xz |
Merge bitcoin/bitcoin#28835: test: Check error details with assert_debug_log on the assumeutxo invalid hash dump - follow-up #28698
7de76853728b423339d17f39224cf20305da1832 test, assumeutxo: Use assert_debug_log for error details (pablomartin4btc)
Pull request description:
This is a follow-up on the invalid hash dump fix #28698, [suggested](https://github.com/bitcoin/bitcoin/pull/28698#pullrequestreview-1698178157) by theStack and agreed by Sjors and ryanofsky.
ACKs for top commit:
Sjors:
ACK 7de76853728b423339d17f39224cf20305da1832
maflcko:
lgtm ACK 7de76853728b423339d17f39224cf20305da1832
Tree-SHA512: 036b3cef3084e3ead8923e8dcabe4fa7ebe97fb514d223aa38bc38df10337e3fe3113e42322178b58fb03fcd4511af4b5b56bceecbb7ded5b9758842c70db3f2
-rwxr-xr-x | test/functional/feature_assumeutxo.py | 10 |
1 files 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) |