Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_pruning.py
Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | def manual_test(self, node_number, use_timestamp): | ||||
def height(index): | def height(index): | ||||
if use_timestamp: | if use_timestamp: | ||||
return node.getblockheader(node.getblockhash(index))[ | return node.getblockheader(node.getblockhash(index))[ | ||||
"time"] + TIMESTAMP_WINDOW | "time"] + TIMESTAMP_WINDOW | ||||
else: | else: | ||||
return index | return index | ||||
def prune(index, expected_ret=None): | def prune(index, expected_ret=None): | ||||
ret = node.pruneblockchain(height(index)) | ret = node.pruneblockchain(height=height(index)) | ||||
# Check the return value. When use_timestamp is True, just check | # Check the return value. When use_timestamp is True, just check | ||||
# that the return value is less than or equal to the expected | # that the return value is less than or equal to the expected | ||||
# value, because when more than one block is generated per second, | # value, because when more than one block is generated per second, | ||||
# a timestamp will not be granular enough to uniquely identify an | # a timestamp will not be granular enough to uniquely identify an | ||||
# individual block. | # individual block. | ||||
if expected_ret is None: | if expected_ret is None: | ||||
expected_ret = index | expected_ret = index | ||||
if use_timestamp: | if use_timestamp: | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |