mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
cli: replace testnet with chain and return network name as per BIP70.
This commit is contained in:
parent
12408d33c6
commit
890396cbd5
3
doc/release-notes-15566.md
Normal file
3
doc/release-notes-15566.md
Normal file
@ -0,0 +1,3 @@
|
||||
Miscellaneous CLI Changes
|
||||
-------------------------
|
||||
- The `testnet` field in `bitcoin-cli -getinfo` has been renamed to `chain` and now returns the current network name as defined in BIP70 (main, test, regtest).
|
@ -262,7 +262,7 @@ public:
|
||||
result.pushKV("connections", batch[ID_NETWORKINFO]["result"]["connections"]);
|
||||
result.pushKV("proxy", batch[ID_NETWORKINFO]["result"]["networks"][0]["proxy"]);
|
||||
result.pushKV("difficulty", batch[ID_BLOCKCHAININFO]["result"]["difficulty"]);
|
||||
result.pushKV("testnet", UniValue(batch[ID_BLOCKCHAININFO]["result"]["chain"].get_str() == "test"));
|
||||
result.pushKV("chain", UniValue(batch[ID_BLOCKCHAININFO]["result"]["chain"]));
|
||||
if (!batch[ID_WALLETINFO].isNull()) {
|
||||
result.pushKV("walletversion", batch[ID_WALLETINFO]["result"]["walletversion"]);
|
||||
result.pushKV("balance", batch[ID_WALLETINFO]["result"]["balance"]);
|
||||
|
@ -65,7 +65,7 @@ class TestBitcoinCli(BitcoinTestFramework):
|
||||
assert_equal(cli_get_info['connections'], network_info['connections'])
|
||||
assert_equal(cli_get_info['proxy'], network_info['networks'][0]['proxy'])
|
||||
assert_equal(cli_get_info['difficulty'], blockchain_info['difficulty'])
|
||||
assert_equal(cli_get_info['testnet'], blockchain_info['chain'] == "test")
|
||||
assert_equal(cli_get_info['chain'], blockchain_info['chain'])
|
||||
if self.is_wallet_compiled():
|
||||
assert_equal(cli_get_info['balance'], wallet_info['balance'])
|
||||
assert_equal(cli_get_info['keypoololdest'], wallet_info['keypoololdest'])
|
||||
|
Loading…
Reference in New Issue
Block a user