Skip to content

Commit 1fdd832

Browse files
committed
Merge bitcoin#28835: test: Check error details with assert_debug_log on the assumeutxo invalid hash dump - follow-up bitcoin#28698
7de7685 test, assumeutxo: Use assert_debug_log for error details (pablomartin4btc) Pull request description: This is a follow-up on the invalid hash dump fix bitcoin#28698, [suggested](bitcoin#28698 (review)) by theStack and agreed by Sjors and ryanofsky. ACKs for top commit: Sjors: ACK 7de7685 maflcko: lgtm ACK 7de7685 Tree-SHA512: 036b3cef3084e3ead8923e8dcabe4fa7ebe97fb514d223aa38bc38df10337e3fe3113e42322178b58fb03fcd4511af4b5b56bceecbb7ded5b9758842c70db3f2
2 parents b3898e9 + 7de7685 commit 1fdd832

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/functional/feature_assumeutxo.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,14 @@ def test_invalid_chainstate_scenarios(self):
118118
chainstate_snapshot_path.mkdir()
119119
with open(chainstate_snapshot_path / "base_blockhash", 'wb') as f:
120120
f.write(b'z' * 32)
121-
expected_error = f"Error: A fatal internal error occurred, see debug.log for details"
122-
self.nodes[0].assert_start_raises_init_error(expected_msg=expected_error)
121+
122+
def expected_error(log_msg="", error_msg=""):
123+
with self.nodes[0].assert_debug_log([log_msg]):
124+
self.nodes[0].assert_start_raises_init_error(expected_msg=error_msg)
125+
126+
expected_error_msg = f"Error: A fatal internal error occurred, see debug.log for details"
127+
error_details = f"Assumeutxo data not found for the given blockhash"
128+
expected_error(log_msg=error_details, error_msg=expected_error_msg)
123129

124130
# resurrect node again
125131
rmtree(chainstate_snapshot_path)

0 commit comments

Comments
 (0)