def _test_getblockchaininfo(self):
    self.log.info('Test getblockchaininfo')
    keys = ['bestblockhash', 'bip9_softforks', 'blocks', 'chain', 'chainwork', 'difficulty', 'headers', 'initialblockdownload', 'mediantime', 'pruned', 'size_on_disk', 'softforks', 'verificationprogress', 'warnings']
    res = self.nodes[0].getblockchaininfo()
    assert_equal(sorted(res.keys()), sorted((['pruneheight', 'automatic_pruning'] + keys)))
    assert_greater_than(res['size_on_disk'], 0)
    assert_greater_than_or_equal(res['pruneheight'], 0)
    assert res['pruned']
    assert (not res['automatic_pruning'])
    self.restart_node(0, ['-stopatheight=207', '-txindex=0'])
    res = self.nodes[0].getblockchaininfo()
    assert_equal(sorted(res.keys()), keys)
    self.restart_node(0, ['-stopatheight=207', '-prune=550', '-txindex=0'])
    res = self.nodes[0].getblockchaininfo()
    assert_equal(sorted(res.keys()), sorted((['pruneheight', 'automatic_pruning', 'prune_target_size'] + keys)))
    assert res['pruned']
    assert_equal(res['pruneheight'], 0)
    assert res['automatic_pruning']
    assert_equal(res['prune_target_size'], 576716800)
    assert_greater_than(res['size_on_disk'], 0)
def _test_getblockchaininfo(self):
    self.log.info('Test getblockchaininfo')
    keys = ['bestblockhash', 'bip9_softforks', 'blocks', 'chain', 'chainwork', 'difficulty', 'headers', 'initialblockdownload', 'mediantime', 'pruned', 'size_on_disk', 'softforks', 'verificationprogress', 'warnings']
    res = self.nodes[0].getblockchaininfo()
    assert_equal(sorted(res.keys()), sorted((['pruneheight', 'automatic_pruning'] + keys)))
    assert_greater_than(res['size_on_disk'], 0)
    assert_greater_than_or_equal(res['pruneheight'], 0)
    assert res['pruned']
    assert (not res['automatic_pruning'])
    self.restart_node(0, ['-stopatheight=207', '-txindex=0'])
    res = self.nodes[0].getblockchaininfo()
    assert_equal(sorted(res.keys()), keys)
    self.restart_node(0, ['-stopatheight=207', '-prune=550', '-txindex=0'])
    res = self.nodes[0].getblockchaininfo()
    assert_equal(sorted(res.keys()), sorted((['pruneheight', 'automatic_pruning', 'prune_target_size'] + keys)))
    assert res['pruned']
    assert_equal(res['pruneheight'], 0)
    assert res['automatic_pruning']
    assert_equal(res['prune_target_size'], 576716800)
    assert_greater_than(res['size_on_disk'], 0)