Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_blockchain.py
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | def _test_getblockchaininfo(self): | ||||
'chain', | 'chain', | ||||
'chainwork', | 'chainwork', | ||||
'difficulty', | 'difficulty', | ||||
'headers', | 'headers', | ||||
'initialblockdownload', | 'initialblockdownload', | ||||
'mediantime', | 'mediantime', | ||||
'pruned', | 'pruned', | ||||
'size_on_disk', | 'size_on_disk', | ||||
'softforks', | |||||
'verificationprogress', | 'verificationprogress', | ||||
'warnings', | 'warnings', | ||||
] | ] | ||||
res = self.nodes[0].getblockchaininfo() | res = self.nodes[0].getblockchaininfo() | ||||
# result should have these additional pruning keys if manual pruning is | # result should have these additional pruning keys if manual pruning is | ||||
# enabled | # enabled | ||||
assert_equal(sorted(res.keys()), sorted( | assert_equal(sorted(res.keys()), sorted( | ||||
['pruneheight', 'automatic_pruning'] + keys)) | ['pruneheight', 'automatic_pruning'] + keys)) | ||||
# size_on_disk should be > 0 | # size_on_disk should be > 0 | ||||
assert_greater_than(res['size_on_disk'], 0) | assert_greater_than(res['size_on_disk'], 0) | ||||
assert_equal(res['softforks'], { | |||||
'testdummy': { | |||||
'type': 'bip9', | |||||
'bip9': { | |||||
'status': 'started', | |||||
'bit': 28, | |||||
'start_time': 0, | |||||
# testdummy does not have a timeout so is set to the max int64 value | |||||
'timeout': 0x7fffffffffffffff, | |||||
'since': 144, | |||||
'statistics': { | |||||
'period': 144, | |||||
'threshold': 108, | |||||
'elapsed': 57, | |||||
'count': 57, | |||||
'possible': True, | |||||
}, | |||||
}, | |||||
'active': False} | |||||
}) | |||||
# pruneheight should be greater or equal to 0 | # pruneheight should be greater or equal to 0 | ||||
assert_greater_than_or_equal(res['pruneheight'], 0) | assert_greater_than_or_equal(res['pruneheight'], 0) | ||||
# check other pruning fields given that prune=1 | # check other pruning fields given that prune=1 | ||||
assert res['pruned'] | assert res['pruned'] | ||||
assert not res['automatic_pruning'] | assert not res['automatic_pruning'] | ||||
self.restart_node(0, ['-stopatheight=207']) | self.restart_node(0, ['-stopatheight=207']) | ||||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |