Skip to content

Commit c28c7b8

Browse files
committed
test: add -getinfo "unlocked_until" and "headers" coverage
1 parent bb13f46 commit c28c7b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/functional/interface_bitcoin_cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,14 @@ def run_test(self):
5050
assert_raises_process_error(1, "-getinfo takes no arguments", self.nodes[0].cli('-getinfo').help)
5151

5252
self.log.info("Test -getinfo returns expected network and blockchain info")
53+
if self.is_wallet_compiled():
54+
self.nodes[0].encryptwallet(password)
5355
cli_get_info = self.nodes[0].cli('-getinfo').send_cli()
5456
network_info = self.nodes[0].getnetworkinfo()
5557
blockchain_info = self.nodes[0].getblockchaininfo()
5658
assert_equal(cli_get_info['version'], network_info['version'])
5759
assert_equal(cli_get_info['blocks'], blockchain_info['blocks'])
60+
assert_equal(cli_get_info['headers'], blockchain_info['headers'])
5861
assert_equal(cli_get_info['timeoffset'], network_info['timeoffset'])
5962
assert_equal(cli_get_info['connections'], network_info['connections'])
6063
assert_equal(cli_get_info['proxy'], network_info['networks'][0]['proxy'])
@@ -66,9 +69,9 @@ def run_test(self):
6669
assert_equal(cli_get_info['balance'], BALANCE)
6770
wallet_info = self.nodes[0].getwalletinfo()
6871
assert_equal(cli_get_info['keypoolsize'], wallet_info['keypoolsize'])
72+
assert_equal(cli_get_info['unlocked_until'], wallet_info['unlocked_until'])
6973
assert_equal(cli_get_info['paytxfee'], wallet_info['paytxfee'])
7074
assert_equal(cli_get_info['relayfee'], network_info['relayfee'])
71-
# unlocked_until is not tested because the wallet is not encrypted
7275
assert_equal(self.nodes[0].cli.getwalletinfo(), wallet_info)
7376
else:
7477
self.log.info("*** Wallet not compiled; cli getwalletinfo and -getinfo wallet tests skipped")

0 commit comments

Comments
 (0)