mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-21 17:42:37 +02:00
QA: Test prune locks via RPC
This commit is contained in:
parent
977027d11c
commit
ecbbb74626
@ -324,6 +324,17 @@ class PruneTest(BitcoinTestFramework):
|
|||||||
node.pruneblockchain(height(0))
|
node.pruneblockchain(height(0))
|
||||||
assert has_block(0), "blk00000.dat is missing when should still be there"
|
assert has_block(0), "blk00000.dat is missing when should still be there"
|
||||||
|
|
||||||
|
# height=500 shouldn't prune first file if there's a prune lock
|
||||||
|
node.setprunelock("test", {
|
||||||
|
"desc": "Testing",
|
||||||
|
"height": [2, 2],
|
||||||
|
})
|
||||||
|
assert_equal(node.listprunelocks(), {'prune_locks': [{'id': 'test', 'desc': 'Testing', 'height': [2, 2]}]})
|
||||||
|
prune(500)
|
||||||
|
assert has_block(0), "blk00000.dat is missing when should still be there"
|
||||||
|
node.setprunelock("test", {}) # delete prune lock
|
||||||
|
assert_equal(node.listprunelocks(), {'prune_locks': []})
|
||||||
|
|
||||||
# height=500 should prune first file
|
# height=500 should prune first file
|
||||||
prune(500)
|
prune(500)
|
||||||
assert not has_block(0), "blk00000.dat is still there, should be pruned by now"
|
assert not has_block(0), "blk00000.dat is still there, should be pruned by now"
|
||||||
|
Loading…
Reference in New Issue
Block a user