From 1e0aa634b26d1a634e6ab116a087747d9ec8ff76 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Mon, 11 Mar 2019 10:26:38 -0400 Subject: [PATCH] Merge #15566: cli: replace testnet with chain and return network name as per BIP70. 890396cbd5 cli: replace testnet with chain and return network name as per BIP70. (fanquake) Pull request description: Related IRC discussion [here (line 151)](http://www.erisian.com.au/bitcoin-core-dev/log-2019-03-09.html). Tree-SHA512: 8bdbacc7b8ce8bd2cc7c47aa9d73f2830a7c2e2ec43686430e3fba1a9db0e53a285467f26cde6dcc3bf948b7d6d59b9b7f184ce1a30a8970f39e5396dfc122f0 --- doc/release-notes-15566.md | 3 +++ src/dash-cli.cpp | 2 +- test/functional/interface_bitcoin_cli.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 doc/release-notes-15566.md diff --git a/doc/release-notes-15566.md b/doc/release-notes-15566.md new file mode 100644 index 0000000000..1cf19e24b2 --- /dev/null +++ b/doc/release-notes-15566.md @@ -0,0 +1,3 @@ +Miscellaneous CLI Changes +------------------------- +- The `testnet` field in `dash-cli -getinfo` has been renamed to `chain` and now returns the current network name as defined in BIP70 (main, test, regtest). \ No newline at end of file diff --git a/src/dash-cli.cpp b/src/dash-cli.cpp index e02e31416e..3242a22156 100644 --- a/src/dash-cli.cpp +++ b/src/dash-cli.cpp @@ -281,7 +281,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"]); diff --git a/test/functional/interface_bitcoin_cli.py b/test/functional/interface_bitcoin_cli.py index c841384cb8..ba8acd6a1d 100755 --- a/test/functional/interface_bitcoin_cli.py +++ b/test/functional/interface_bitcoin_cli.py @@ -66,7 +66,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'])