|
11 | 11 |
|
12 | 12 | ## Possible test improvements
|
13 | 13 |
|
14 |
| -- TODO: test what happens with -reindex and -reindex-chainstate before the |
15 |
| - snapshot is validated, and make sure it's deleted successfully. |
16 |
| -
|
17 | 14 | Interesting test cases could be loading an assumeutxo snapshot file with:
|
18 | 15 |
|
19 | 16 | - TODO: Valid hash but invalid snapshot file (bad coin height or
|
@@ -379,6 +376,17 @@ def check_tx_counts(final: bool) -> None:
|
379 | 376 | assert_equal(loaded['coins_loaded'], SNAPSHOT_BASE_HEIGHT)
|
380 | 377 | assert_equal(loaded['base_height'], SNAPSHOT_BASE_HEIGHT)
|
381 | 378 |
|
| 379 | + for reindex_arg in ['-reindex=1', '-reindex-chainstate=1']: |
| 380 | + self.log.info(f"Check that restarting with {reindex_arg} will delete the snapshot chainstate") |
| 381 | + self.restart_node(2, extra_args=[reindex_arg, *self.extra_args[2]]) |
| 382 | + assert_equal(1, len(n2.getchainstates()["chainstates"])) |
| 383 | + for i in range(1, 300): |
| 384 | + block = n0.getblock(n0.getblockhash(i), 0) |
| 385 | + n2.submitheader(block) |
| 386 | + loaded = n2.loadtxoutset(dump_output['path']) |
| 387 | + assert_equal(loaded['coins_loaded'], SNAPSHOT_BASE_HEIGHT) |
| 388 | + assert_equal(loaded['base_height'], SNAPSHOT_BASE_HEIGHT) |
| 389 | + |
382 | 390 | normal, snapshot = n2.getchainstates()['chainstates']
|
383 | 391 | assert_equal(normal['blocks'], START_HEIGHT)
|
384 | 392 | assert_equal(normal.get('snapshot_blockhash'), None)
|
|
0 commit comments