aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-05-09 11:55:15 -0400
committerAva Chow <github@achow101.com>2024-05-09 11:55:15 -0400
commit921c61e9a5c8592cc9e07986612d3f4f31d663fc (patch)
treed7c8e36744c9a80517e89b8a831d10afd753c87c /test
parent6f1d9064381d834b0f8daa9011f18ba40834d85a (diff)
parentb259b0e8d360726b062c4b0453d1cf5a68e1933f (diff)
downloadbitcoin-921c61e9a5c8592cc9e07986612d3f4f31d663fc.tar.xz
Merge bitcoin/bitcoin#29973: test: Assumeutxo: ensure failure when importing a snapshot twice
b259b0e8d360726b062c4b0453d1cf5a68e1933f [Test] Assumeutxo: ensure failure when importing a snapshot twice (Alfonso Roman Zubeldia) Pull request description: I am getting familiar with the `assume_utxo` tests and I found that the scenario of trying to activate a snapshot twice is not covered. This test is to ensure failure when loading a snapshot if there is already a snapshot-based chainstate. ACKs for top commit: fjahr: Code review ACK b259b0e8d360726b062c4b0453d1cf5a68e1933f kevkevinpal: tACK [b259b0e](https://github.com/bitcoin/bitcoin/pull/29973/commits/b259b0e8d360726b062c4b0453d1cf5a68e1933f) achow101: ACK b259b0e8d360726b062c4b0453d1cf5a68e1933f rkrux: tACK [b259b0e](https://github.com/bitcoin/bitcoin/pull/29973/commits/b259b0e8d360726b062c4b0453d1cf5a68e1933f) Tree-SHA512: 3510861390d0e40cdad6861b728df04827a1b63e642f3d956aee66ed2770b1cb7e3aa3eb00c62eb9da0544703c943cc5296936c9ebfcac18c719741c354421bb
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_assumeutxo.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/feature_assumeutxo.py b/test/functional/feature_assumeutxo.py
index 58a5442f4e..0d6c92c9fa 100755
--- a/test/functional/feature_assumeutxo.py
+++ b/test/functional/feature_assumeutxo.py
@@ -405,6 +405,10 @@ class AssumeutxoTest(BitcoinTestFramework):
assert_equal(snapshot['snapshot_blockhash'], dump_output['base_hash'])
assert_equal(snapshot['validated'], False)
+ self.log.info("Check that loading the snapshot again will fail because there is already an active snapshot.")
+ with n2.assert_debug_log(expected_msgs=["[snapshot] can't activate a snapshot-based chainstate more than once"]):
+ assert_raises_rpc_error(-32603, "Unable to load UTXO snapshot", n2.loadtxoutset, dump_output['path'])
+
self.connect_nodes(0, 2)
self.wait_until(lambda: n2.getchainstates()['chainstates'][-1]['blocks'] == FINAL_HEIGHT)
self.sync_blocks()