Remove unnecessary dependencies for bitcoin-cli

This commit removes all the unnecessary dependencies (key, core,
netbase, sync, ...) from bitcoin-cli.

To do this it shards the chain parameters into BaseParams, which
contains just the RPC port and data directory (as used by utils and
bitcoin-cli) and Params, with the rest.
This commit is contained in:
Wladimir J. van der Laan
2014-06-19 15:10:04 +02:00
parent 14f888ca80
commit 84ce18ca93
19 changed files with 232 additions and 89 deletions

View File

@@ -142,9 +142,9 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse)
bool isPrivkey = find_value(metadata, "isPrivkey").get_bool();
bool isTestnet = find_value(metadata, "isTestnet").get_bool();
if (isTestnet)
SelectParams(CChainParams::TESTNET);
SelectParams(CBaseChainParams::TESTNET);
else
SelectParams(CChainParams::MAIN);
SelectParams(CBaseChainParams::MAIN);
if(isPrivkey)
{
bool isCompressed = find_value(metadata, "isCompressed").get_bool();
@@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_parse)
BOOST_CHECK_MESSAGE(!secret.IsValid(), "IsValid pubkey as privkey:" + strTest);
}
}
SelectParams(CChainParams::MAIN);
SelectParams(CBaseChainParams::MAIN);
}
// Goal: check that generated keys match test vectors
@@ -198,9 +198,9 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen)
bool isPrivkey = find_value(metadata, "isPrivkey").get_bool();
bool isTestnet = find_value(metadata, "isTestnet").get_bool();
if (isTestnet)
SelectParams(CChainParams::TESTNET);
SelectParams(CBaseChainParams::TESTNET);
else
SelectParams(CChainParams::MAIN);
SelectParams(CBaseChainParams::MAIN);
if(isPrivkey)
{
bool isCompressed = find_value(metadata, "isCompressed").get_bool();
@@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(base58_keys_valid_gen)
CTxDestination nodest = CNoDestination();
BOOST_CHECK(!dummyAddr.Set(nodest));
SelectParams(CChainParams::MAIN);
SelectParams(CBaseChainParams::MAIN);
}
// Goal: check that base58 parsing code is robust against a variety of corrupted data