mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 11:32:46 +01:00
Some Dashification (#3513)
* Trivial Dashification * Tweak getnetworkinfo and dumpwallet help text We don't have RBF and Segwit * CopyrightHolders should also check for missing "Dash Core" copyright
This commit is contained in:
parent
3e20aa480f
commit
469d6aa737
@ -57,12 +57,12 @@ the pull request affects. Valid areas as:
|
||||
|
||||
- *Consensus* for changes to consensus critical code
|
||||
- *Docs* for changes to the documentation
|
||||
- *Qt* for changes to bitcoin-qt
|
||||
- *Qt* for changes to dash-qt
|
||||
- *Mining* for changes to the mining code
|
||||
- *Net* or *P2P* for changes to the peer-to-peer network code
|
||||
- *RPC/REST/ZMQ* for changes to the RPC, REST or ZMQ APIs
|
||||
- *Scripts and tools* for changes to the scripts and tools
|
||||
- *Tests* for changes to the bitcoin unit tests or QA tests
|
||||
- *Tests* for changes to the unit tests or QA tests
|
||||
- *Trivial* should **only** be used for PRs that do not change generated
|
||||
executable code. Notably, refactors (change of function arguments and code
|
||||
reorganization) and changes in behavior should **not** be marked as trivial.
|
||||
|
@ -15,8 +15,8 @@ BITCOINQT=${BITCOINQT:-$SRCDIR/qt/dash-qt}
|
||||
BTCVER=($($BITCOINCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }'))
|
||||
|
||||
# Create a footer file with copyright content.
|
||||
# This gets autodetected fine for bitcoind if --version-string is not set,
|
||||
# but has different outcomes for bitcoin-qt and bitcoin-cli.
|
||||
# This gets autodetected fine for dashd if --version-string is not set,
|
||||
# but has different outcomes for dash-qt and dash-cli.
|
||||
echo "[COPYRIGHT]" > footer.h2m
|
||||
$BITCOIND --version | sed -n '1!p' >> footer.h2m
|
||||
|
||||
|
@ -52,7 +52,7 @@ READELF_CMD = os.getenv('READELF', '/usr/bin/readelf')
|
||||
CPPFILT_CMD = os.getenv('CPPFILT', '/usr/bin/c++filt')
|
||||
# Allowed NEEDED libraries
|
||||
ALLOWED_LIBRARIES = {
|
||||
# bitcoind and bitcoin-qt
|
||||
# dashd and dash-qt
|
||||
'libgcc_s.so.1', # GCC base support
|
||||
'libc.so.6', # C library
|
||||
'libpthread.so.0', # threading
|
||||
@ -61,7 +61,7 @@ ALLOWED_LIBRARIES = {
|
||||
'librt.so.1', # real-time (clock)
|
||||
'ld-linux-x86-64.so.2', # 64-bit dynamic linker
|
||||
'ld-linux.so.2', # 32-bit dynamic linker
|
||||
# bitcoin-qt only
|
||||
# dash-qt only
|
||||
'libX11-xcb.so.1', # part of X11
|
||||
'libX11.so.6', # part of X11
|
||||
'libxcb.so.1', # part of X11
|
||||
|
@ -25,7 +25,7 @@
|
||||
# Additional options (avoid -conf and -datadir, use flags above)
|
||||
#BITCOIND_OPTS=""
|
||||
|
||||
# The timeout in seconds OpenRC will wait for bitcoind to terminate
|
||||
# The timeout in seconds OpenRC will wait for dashd to terminate
|
||||
# after a SIGTERM has been raised.
|
||||
# Note that this will be mapped as argument to start-stop-daemon's
|
||||
# '--retry' option, which means you can specify a retry schedule
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
# bitcoind RPC settings (linearize-hashes)
|
||||
# dashd RPC settings (linearize-hashes)
|
||||
rpcuser=someuser
|
||||
rpcpassword=somepassword
|
||||
host=127.0.0.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
# bitcoind RPC settings (linearize-hashes)
|
||||
# dashd RPC settings (linearize-hashes)
|
||||
rpcuser=someuser
|
||||
rpcpassword=somepassword
|
||||
#datadir=~/.bitcoin
|
||||
#datadir=~/.dashcore
|
||||
host=127.0.0.1
|
||||
port=9998
|
||||
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Dash network. It limits outbound TCP traffic with a source or destination port of 9999, but not if the destination IP is within a LAN.
|
||||
|
||||
This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it.
|
||||
This means one can have an always-on dashd instance running, and another local dashd/dash-qt instance which connects to this node and receives blocks from it.
|
||||
|
@ -659,7 +659,7 @@ A few guidelines for introducing and reviewing new RPC interfaces:
|
||||
- Try not to overload methods on argument type. E.g. don't make `getblock(true)` and `getblock("hash")`
|
||||
do different things.
|
||||
|
||||
- *Rationale*: This is impossible to use with `bitcoin-cli`, and can be surprising to users.
|
||||
- *Rationale*: This is impossible to use with `dash-cli`, and can be surprising to users.
|
||||
|
||||
- *Exception*: Some RPC calls can take both an `int` and `bool`, most notably when a bool was switched
|
||||
to a multi-value, or due to other historical reasons. **Always** have false map to 0 and
|
||||
@ -678,7 +678,7 @@ A few guidelines for introducing and reviewing new RPC interfaces:
|
||||
|
||||
- Add every non-string RPC argument `(method, idx, name)` to the table `vRPCConvertParams` in `rpc/client.cpp`.
|
||||
|
||||
- *Rationale*: `bitcoin-cli` and the GUI debug console use this table to determine how to
|
||||
- *Rationale*: `dash-cli` and the GUI debug console use this table to determine how to
|
||||
convert a plaintext command line to JSON. If the types don't match, the method can be unusable
|
||||
from there.
|
||||
|
||||
@ -700,7 +700,7 @@ A few guidelines for introducing and reviewing new RPC interfaces:
|
||||
RPCs whose behavior does *not* depend on the current chainstate may omit this
|
||||
call.
|
||||
|
||||
- *Rationale*: In previous versions of Bitcoin Core, the wallet was always
|
||||
- *Rationale*: In previous versions of Dash Core, the wallet was always
|
||||
in-sync with the chainstate (by virtue of them all being updated in the
|
||||
same cs_main lock). In order to maintain the behavior that wallet RPCs
|
||||
return results as of at least the highest best-known block an RPC
|
||||
|
@ -45,7 +45,7 @@ operation.
|
||||
|
||||
By default, the ZeroMQ feature is automatically compiled in if the
|
||||
necessary prerequisites are found. To disable, use --disable-zmq
|
||||
during the *configure* step of building bitcoind:
|
||||
during the *configure* step of building dashd:
|
||||
|
||||
$ ./configure --disable-zmq (other options)
|
||||
|
||||
|
@ -127,7 +127,7 @@ bool AppInit(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
// -server defaults to true for bitcoind but not for the GUI so do this here
|
||||
// -server defaults to true for dashd but not for the GUI so do this here
|
||||
gArgs.SoftSetBoolArg("-server", true);
|
||||
// Set this early so that parameter interactions go to console
|
||||
InitLogging();
|
||||
|
@ -184,7 +184,7 @@ bool ShutdownRequested()
|
||||
/**
|
||||
* This is a minimally invasive approach to shutdown on LevelDB read errors from the
|
||||
* chainstate, while keeping user interface out of the common library, which is shared
|
||||
* between bitcoind, and bitcoin-qt and non-server tools.
|
||||
* between dashd, and dash-qt and non-server tools.
|
||||
*/
|
||||
class CCoinsViewErrorCatcher final : public CCoinsViewBacked
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ void InitLogging();
|
||||
//!Parameter interaction: change current parameters depending on various rules
|
||||
void InitParameterInteraction();
|
||||
|
||||
/** Initialize bitcoin core: Basic context setup.
|
||||
/** Initialize Dash Core: Basic context setup.
|
||||
* @note This can be done before daemonization. Do not call Shutdown() if this function fails.
|
||||
* @pre Parameters should be parsed and config file should be read.
|
||||
*/
|
||||
@ -49,13 +49,13 @@ bool AppInitParameterInteraction();
|
||||
*/
|
||||
bool AppInitSanityChecks();
|
||||
/**
|
||||
* Lock bitcoin core data directory.
|
||||
* Lock Dash Core data directory.
|
||||
* @note This should only be done after daemonization. Do not call Shutdown() if this function fails.
|
||||
* @pre Parameters should be parsed and config file should be read, AppInitSanityChecks should have been called.
|
||||
*/
|
||||
bool AppInitLockDataDirectory();
|
||||
/**
|
||||
* Bitcoin core main initialization.
|
||||
* Dash Core main initialization.
|
||||
* @note This should only be done after daemonization. Call Shutdown() if this function fails.
|
||||
* @pre Parameters should be parsed and config file should be read, AppInitLockDataDirectory should have been called.
|
||||
*/
|
||||
|
@ -13,7 +13,7 @@ class NetworkStyle;
|
||||
|
||||
/** Class for the splashscreen with information of the running client.
|
||||
*
|
||||
* @note this is intentionally not a QSplashScreen. Bitcoin Core initialization
|
||||
* @note this is intentionally not a QSplashScreen. Dash Core initialization
|
||||
* can take a long time, and in that case a progress window that cannot be
|
||||
* moved around and minimized has turned out to be frustrating to the user.
|
||||
*/
|
||||
|
@ -105,9 +105,9 @@ QModelIndex FindTx(const QAbstractItemModel& model, const uint256& txid)
|
||||
//
|
||||
// This also requires overriding the default minimal Qt platform:
|
||||
//
|
||||
// src/qt/test/test_bitcoin-qt -platform xcb # Linux
|
||||
// src/qt/test/test_bitcoin-qt -platform windows # Windows
|
||||
// src/qt/test/test_bitcoin-qt -platform cocoa # macOS
|
||||
// src/qt/test/test_dash-qt -platform xcb # Linux
|
||||
// src/qt/test/test_dash-qt -platform windows # Windows
|
||||
// src/qt/test/test_dash-qt -platform cocoa # macOS
|
||||
void TestGUI()
|
||||
{
|
||||
// Set up wallet and chain with 105 blocks (5 mature blocks for spending).
|
||||
|
@ -1182,7 +1182,7 @@ UniValue echo(const JSONRPCRequest& request)
|
||||
"echo|echojson \"message\" ...\n"
|
||||
"\nSimply echo back the input arguments. This command is for testing.\n"
|
||||
"\nThe difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in"
|
||||
"bitcoin-cli and the GUI. There is no server-side difference."
|
||||
"dash-cli and the GUI. There is no server-side difference."
|
||||
);
|
||||
|
||||
return request.params;
|
||||
@ -1195,8 +1195,8 @@ static UniValue getinfo_deprecated(const JSONRPCRequest& request)
|
||||
"\nThis call was removed in version 0.16.0. Use the appropriate fields from:\n"
|
||||
"- getblockchaininfo: blocks, difficulty, chain\n"
|
||||
"- getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings\n"
|
||||
"- getwalletinfo: balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion\n"
|
||||
"\nbitcoin-cli has the option -getinfo to collect and format these in the old format."
|
||||
"- getwalletinfo: balance, privatesend_balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion\n"
|
||||
"\ndash-cli has the option -getinfo to collect and format these in the old format."
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ UniValue getnetworkinfo(const JSONRPCRequest& request)
|
||||
" ,...\n"
|
||||
" ],\n"
|
||||
" \"relayfee\": x.xxxxxxxx, (numeric) minimum relay fee for transactions in " + CURRENCY_UNIT + "/kB\n"
|
||||
" \"incrementalfee\": x.xxxxxxxx, (numeric) minimum fee increment for mempool limiting or BIP 125 replacement in " + CURRENCY_UNIT + "/kB\n"
|
||||
" \"incrementalfee\": x.xxxxxxxx, (numeric) minimum fee increment for mempool limiting in " + CURRENCY_UNIT + "/kB\n"
|
||||
" \"localaddresses\": [ (array) list of local addresses\n"
|
||||
" {\n"
|
||||
" \"address\": \"xxxx\", (string) network address\n"
|
||||
|
@ -39,7 +39,7 @@ enum RPCErrorCode
|
||||
// It should not be used for application-layer errors.
|
||||
RPC_METHOD_NOT_FOUND = -32601,
|
||||
RPC_INVALID_PARAMS = -32602,
|
||||
// RPC_INTERNAL_ERROR should only be used for genuine errors in bitcoind
|
||||
// RPC_INTERNAL_ERROR should only be used for genuine errors in dashd
|
||||
// (for example datadir corruption).
|
||||
RPC_INTERNAL_ERROR = -32603,
|
||||
RPC_PARSE_ERROR = -32700,
|
||||
|
@ -14,7 +14,7 @@ This class is aligned with the JSON standard, [RFC
|
||||
|
||||
## Library usage
|
||||
|
||||
This is a fork of univalue used by Bitcoin Core. It is not maintained for usage
|
||||
This is a fork of univalue used by Dash Core. It is not maintained for usage
|
||||
by other projects. Notably, the API may break in non-backward-compatible ways.
|
||||
|
||||
Other projects looking for a maintained library should use the upstream
|
||||
|
@ -589,7 +589,7 @@ public:
|
||||
std::pair<bool,std::string> found_result(false, std::string());
|
||||
|
||||
// We pass "true" to GetArgHelper in order to return the last
|
||||
// argument value seen from the command line (so "bitcoind -foo=bar
|
||||
// argument value seen from the command line (so "dashd -foo=bar
|
||||
// -foo=baz" gives GetArg(am,"foo")=={true,"baz"}
|
||||
found_result = GetArgHelper(am.m_override_args, arg, true);
|
||||
if (found_result.first) {
|
||||
@ -1370,6 +1370,10 @@ std::string CopyrightHolders(const std::string& strPrefix, unsigned int nStartYe
|
||||
{
|
||||
std::string strCopyrightHolders = strPrefix + strprintf(" %u-%u ", nStartYear, nEndYear) + strprintf(_(COPYRIGHT_HOLDERS), _(COPYRIGHT_HOLDERS_SUBSTITUTION));
|
||||
|
||||
// Check for untranslated substitution to make sure Dash Core copyright is not removed by accident
|
||||
if (strprintf(COPYRIGHT_HOLDERS, COPYRIGHT_HOLDERS_SUBSTITUTION).find("Dash Core") == std::string::npos) {
|
||||
strCopyrightHolders += "\n" + strPrefix + strprintf(" %u-%u ", 2014, nEndYear) + "The Dash Core developers";
|
||||
}
|
||||
// Check for untranslated substitution to make sure Bitcoin Core copyright is not removed by accident
|
||||
if (strprintf(COPYRIGHT_HOLDERS, COPYRIGHT_HOLDERS_SUBSTITUTION).find("Bitcoin Core") == std::string::npos) {
|
||||
strCopyrightHolders += "\n" + strPrefix + strprintf(" %u-%u ", 2009, nEndYear) + "The Bitcoin Core developers";
|
||||
|
@ -825,7 +825,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
|
||||
throw std::runtime_error(
|
||||
"dumpwallet \"filename\"\n"
|
||||
"\nDumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files.\n"
|
||||
"Imported scripts are included in the dumpfile, but corresponding BIP173 addresses, etc. may not be added automatically by importwallet.\n"
|
||||
"Imported scripts are included in the dumpfile too, their corresponding addresses will be added automatically by importwallet.\n"
|
||||
"Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by\n"
|
||||
"only backing up the seed itself, and must be backed up too (e.g. ensure you back up the whole dumpfile).\n"
|
||||
"\nArguments:\n"
|
||||
|
@ -126,9 +126,9 @@ class BIP66Test(BitcoinTestFramework):
|
||||
wait_until(lambda: "reject" in self.nodes[0].p2p.last_message.keys(), lock=mininode_lock)
|
||||
with mininode_lock:
|
||||
# We can receive different reject messages depending on whether
|
||||
# bitcoind is running with multiple script check threads. If script
|
||||
# dashd is running with multiple script check threads. If script
|
||||
# check threads are not in use, then transaction script validation
|
||||
# happens sequentially, and bitcoind produces more specific reject
|
||||
# happens sequentially, and dashd produces more specific reject
|
||||
# reasons.
|
||||
assert self.nodes[0].p2p.last_message["reject"].code in [REJECT_INVALID, REJECT_NONSTANDARD]
|
||||
assert_equal(self.nodes[0].p2p.last_message["reject"].data, block.sha256)
|
||||
|
@ -87,14 +87,14 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
|
||||
return utxo_hash
|
||||
except:
|
||||
# An exception here should mean the node is about to crash.
|
||||
# If bitcoind exits, then try again. wait_for_node_exit()
|
||||
# should raise an exception if bitcoind doesn't exit.
|
||||
# If dashd exits, then try again. wait_for_node_exit()
|
||||
# should raise an exception if dashd doesn't exit.
|
||||
self.wait_for_node_exit(node_index, timeout=10)
|
||||
self.crashed_on_restart += 1
|
||||
time.sleep(1)
|
||||
|
||||
# If we got here, bitcoind isn't coming back up on restart. Could be a
|
||||
# bug in bitcoind, or we've gotten unlucky with our dbcrash ratio --
|
||||
# If we got here, dashd isn't coming back up on restart. Could be a
|
||||
# bug in dashd, or we've gotten unlucky with our dbcrash ratio --
|
||||
# perhaps we generated a test case that blew up our cache?
|
||||
# TODO: If this happens a lot, we should try to restart without -dbcrashratio
|
||||
# and make sure that recovery happens.
|
||||
|
@ -88,7 +88,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
conn.request('POST', '/', '{"method": "getbestblockhash"}', headers)
|
||||
out1 = conn.getresponse().read()
|
||||
assert(b'"error":null' in out1)
|
||||
assert(conn.sock!=None) #connection must be closed because bitcoind should use keep-alive by default
|
||||
assert(conn.sock!=None) #connection must be closed because dashd should use keep-alive by default
|
||||
|
||||
# Check excessive request size
|
||||
conn = http.client.HTTPConnection(urlNode2.hostname, urlNode2.port)
|
||||
|
@ -4,7 +4,7 @@
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test mempool persistence.
|
||||
|
||||
By default, bitcoind will dump mempool on shutdown and
|
||||
By default, dashd will dump mempool on shutdown and
|
||||
then reload it on startup. This can be overridden with
|
||||
the -persistmempool=0 command line option.
|
||||
|
||||
@ -103,7 +103,7 @@ class MempoolPersistTest(BitcoinTestFramework):
|
||||
self.start_node(1, extra_args=[])
|
||||
wait_until(lambda: len(self.nodes[1].getrawmempool()) == 5)
|
||||
|
||||
self.log.debug("Prevent bitcoind from writing mempool.dat to disk. Verify that `savemempool` fails")
|
||||
self.log.debug("Prevent dashd from writing mempool.dat to disk. Verify that `savemempool` fails")
|
||||
# to test the exception we are creating a tmp folder called mempool.dat.new
|
||||
# which is an implementation detail that could change and break this test
|
||||
mempooldotnew1 = mempooldat1 + '.new'
|
||||
|
@ -4,7 +4,7 @@
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test multiwallet.
|
||||
|
||||
Verify that a bitcoind node can load multiple wallet files
|
||||
Verify that a dashd node can load multiple wallet files
|
||||
"""
|
||||
import os
|
||||
import shutil
|
||||
|
@ -11,7 +11,7 @@ from test_framework.util import *
|
||||
from test_framework.blocktools import create_block, create_coinbase
|
||||
from test_framework.script import CScript, OP_TRUE
|
||||
|
||||
# TestNode: A peer we use to send messages to bitcoind, and store responses.
|
||||
# TestNode: A peer we use to send messages to dashd, and store responses.
|
||||
class TestNode(P2PInterface):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
@ -218,7 +218,7 @@ class CompactBlocksTest(BitcoinTestFramework):
|
||||
#old_node.request_headers_and_sync(locator=[tip])
|
||||
#check_announcement_of_new_block(node, old_node, lambda p: "cmpctblock" in p.last_message)
|
||||
|
||||
# This test actually causes bitcoind to (reasonably!) disconnect us, so do this last.
|
||||
# This test actually causes dashd to (reasonably!) disconnect us, so do this last.
|
||||
def test_invalid_cmpctblock_message(self):
|
||||
self.nodes[0].generate(101)
|
||||
block = self.build_block_on_tip(self.nodes[0])
|
||||
@ -233,7 +233,7 @@ class CompactBlocksTest(BitcoinTestFramework):
|
||||
assert_equal(int(self.nodes[0].getbestblockhash(), 16), block.hashPrevBlock)
|
||||
|
||||
# Compare the generated shortids to what we expect based on BIP 152, given
|
||||
# bitcoind's choice of nonce.
|
||||
# dashd's choice of nonce.
|
||||
def test_compactblock_construction(self, node, test_node, version):
|
||||
# Generate a bunch of transactions.
|
||||
node.generate(101)
|
||||
@ -324,7 +324,7 @@ class CompactBlocksTest(BitcoinTestFramework):
|
||||
header_and_shortids.shortids.pop(0)
|
||||
index += 1
|
||||
|
||||
# Test that bitcoind requests compact blocks when we announce new blocks
|
||||
# Test that dashd requests compact blocks when we announce new blocks
|
||||
# via header or inv, and that responding to getblocktxn causes the block
|
||||
# to be successfully reconstructed.
|
||||
def test_compactblock_requests(self, node, test_node):
|
||||
@ -494,7 +494,7 @@ class CompactBlocksTest(BitcoinTestFramework):
|
||||
assert_equal(absolute_indexes, [6, 7, 8, 9, 10])
|
||||
|
||||
# Now give an incorrect response.
|
||||
# Note that it's possible for bitcoind to be smart enough to know we're
|
||||
# Note that it's possible for dashd to be smart enough to know we're
|
||||
# lying, since it could check to see if the shortid matches what we're
|
||||
# sending, and eg disconnect us for misbehavior. If that behavior
|
||||
# change were made, we could just modify this test by having a
|
||||
@ -519,7 +519,7 @@ class CompactBlocksTest(BitcoinTestFramework):
|
||||
assert_equal(int(node.getbestblockhash(), 16), block.sha256)
|
||||
|
||||
def test_getblocktxn_handler(self, node, test_node, version):
|
||||
# bitcoind will not send blocktxn responses for blocks whose height is
|
||||
# dashd will not send blocktxn responses for blocks whose height is
|
||||
# more than 10 blocks deep.
|
||||
MAX_GETBLOCKTXN_DEPTH = 10
|
||||
chain_height = node.getblockcount()
|
||||
|
@ -315,7 +315,7 @@ class FullBlockTest(BitcoinTestFramework):
|
||||
b26 = self.update_block(26, [])
|
||||
self.send_blocks([b26], False, 16, b'bad-cb-length', reconnect=True)
|
||||
|
||||
# Extend the b26 chain to make sure bitcoind isn't accepting b26
|
||||
# Extend the b26 chain to make sure dashd isn't accepting b26
|
||||
b27 = self.next_block(27, spend=out[7])
|
||||
self.send_blocks([b27], False)
|
||||
|
||||
@ -327,7 +327,7 @@ class FullBlockTest(BitcoinTestFramework):
|
||||
b28 = self.update_block(28, [])
|
||||
self.send_blocks([b28], False, 16, b'bad-cb-length', reconnect=True)
|
||||
|
||||
# Extend the b28 chain to make sure bitcoind isn't accepting b28
|
||||
# Extend the b28 chain to make sure dashd isn't accepting b28
|
||||
b29 = self.next_block(29, spend=out[7])
|
||||
self.send_blocks([b29], False)
|
||||
|
||||
@ -836,7 +836,7 @@ class FullBlockTest(BitcoinTestFramework):
|
||||
assert_equal(len(b64a.serialize()), MAX_BLOCK_SIZE + 8)
|
||||
self.send_blocks([b64a], False, 1, b'error parsing message')
|
||||
|
||||
# bitcoind doesn't disconnect us for sending a bloated block, but if we subsequently
|
||||
# dashd doesn't disconnect us for sending a bloated block, but if we subsequently
|
||||
# resend the header message, it won't send us the getdata message again. Just
|
||||
# disconnect and reconnect and then call sync_blocks.
|
||||
# TODO: improve this test to be less dependent on P2P DOS behaviour.
|
||||
|
@ -55,7 +55,7 @@ class CLazyNode(P2PInterface):
|
||||
# anyway, and eventually get disconnected.
|
||||
class CNodeNoVersionBan(CLazyNode):
|
||||
# send a bunch of veracks without sending a message. This should get us disconnected.
|
||||
# NOTE: implementation-specific check here. Remove if bitcoind ban behavior changes
|
||||
# NOTE: implementation-specific check here. Remove if dashd ban behavior changes
|
||||
def on_open(self):
|
||||
super().on_open()
|
||||
for i in range(banscore):
|
||||
|
@ -4,7 +4,7 @@
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test various net timeouts.
|
||||
|
||||
- Create three bitcoind nodes:
|
||||
- Create three dashd nodes:
|
||||
|
||||
no_verack_node - we never send a verack in response to their version
|
||||
no_version_node - we never send a version (only a ping)
|
||||
|
@ -2,13 +2,13 @@
|
||||
# Copyright (c) 2015-2016 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test bitcoind with different proxy configuration.
|
||||
"""Test dashd with different proxy configuration.
|
||||
|
||||
Test plan:
|
||||
- Start bitcoind's with different proxy configurations
|
||||
- Start dashd's with different proxy configurations
|
||||
- Use addnode to initiate connections
|
||||
- Verify that proxies are connected to, and the right connection command is given
|
||||
- Proxy configurations to test on bitcoind side:
|
||||
- Proxy configurations to test on dashd side:
|
||||
- `-proxy` (proxy everything)
|
||||
- `-onion` (proxy just onions)
|
||||
- `-proxyrandomize` Circuit randomization
|
||||
@ -18,8 +18,8 @@ Test plan:
|
||||
- proxy on IPv6
|
||||
|
||||
- Create various proxies (as threads)
|
||||
- Create bitcoinds that connect to them
|
||||
- Manipulate the bitcoinds using addnode (onetry) an observe effects
|
||||
- Create dashds that connect to them
|
||||
- Manipulate the dashds using addnode (onetry) an observe effects
|
||||
|
||||
addnode connect to IPv4
|
||||
addnode connect to IPv6
|
||||
@ -95,7 +95,7 @@ class ProxyTest(BitcoinTestFramework):
|
||||
node.addnode("15.61.23.23:1234", "onetry")
|
||||
cmd = proxies[0].queue.get()
|
||||
assert(isinstance(cmd, Socks5Command))
|
||||
# Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
|
||||
# Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
|
||||
assert_equal(cmd.atyp, AddressType.DOMAINNAME)
|
||||
assert_equal(cmd.addr, b"15.61.23.23")
|
||||
assert_equal(cmd.port, 1234)
|
||||
@ -109,7 +109,7 @@ class ProxyTest(BitcoinTestFramework):
|
||||
node.addnode("[1233:3432:2434:2343:3234:2345:6546:4534]:5443", "onetry")
|
||||
cmd = proxies[1].queue.get()
|
||||
assert(isinstance(cmd, Socks5Command))
|
||||
# Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
|
||||
# Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
|
||||
assert_equal(cmd.atyp, AddressType.DOMAINNAME)
|
||||
assert_equal(cmd.addr, b"1233:3432:2434:2343:3234:2345:6546:4534")
|
||||
assert_equal(cmd.port, 5443)
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright (c) 2014-2016 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test running bitcoind with -reindex and -reindex-chainstate options.
|
||||
"""Test running dashd with -reindex and -reindex-chainstate options.
|
||||
|
||||
- Start a single node and generate 3 blocks.
|
||||
- Stop the node and restart it with -reindex. Verify that the node has reindexed up to block 3.
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Copyright (c) 2014-2016 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test running bitcoind with the -rpcbind and -rpcallowip options."""
|
||||
"""Test running dashd with the -rpcbind and -rpcallowip options."""
|
||||
|
||||
import socket
|
||||
import sys
|
||||
|
@ -19,7 +19,7 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this software; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""HTTP proxy for opening RPC connection to bitcoind.
|
||||
"""HTTP proxy for opening RPC connection to dashd.
|
||||
|
||||
AuthServiceProxy has the following improvements over python-jsonrpc's
|
||||
ServiceProxy class:
|
||||
|
@ -76,7 +76,7 @@ def get_filename(dirname, n_node):
|
||||
|
||||
def write_all_rpc_commands(dirname, node):
|
||||
"""
|
||||
Write out a list of all RPC functions available in `bitcoin-cli` for
|
||||
Write out a list of all RPC functions available in `dash-cli` for
|
||||
coverage comparison. This will only happen once per coverage
|
||||
directory.
|
||||
|
||||
|
@ -105,7 +105,7 @@ class BitcoinTestFramework():
|
||||
parser.add_option("--pdbonfailure", dest="pdbonfailure", default=False, action="store_true",
|
||||
help="Attach a python debugger if test fails")
|
||||
parser.add_option("--usecli", dest="usecli", default=False, action="store_true",
|
||||
help="use bitcoin-cli instead of RPC for all commands")
|
||||
help="use dash-cli instead of RPC for all commands")
|
||||
parser.add_option("--dashd-arg", dest="dashd_extra_args", default=[], type='string', action='append',
|
||||
help="Pass extra args to all dashd instances")
|
||||
self.add_options(parser)
|
||||
|
@ -82,7 +82,7 @@ class TestNode():
|
||||
self.p2ps = []
|
||||
|
||||
def __del__(self):
|
||||
# Ensure that we don't leave any bitcoind processes lying around after
|
||||
# Ensure that we don't leave any dashd processes lying around after
|
||||
# the test ends
|
||||
if self.process and self.cleanup_on_exit:
|
||||
# Should only happen on test failure
|
||||
@ -109,7 +109,7 @@ class TestNode():
|
||||
if self.mocktime != 0:
|
||||
all_args = all_args + ["-mocktime=%d" % self.mocktime]
|
||||
# Delete any existing cookie file -- if such a file exists (eg due to
|
||||
# unclean shutdown), it will get overwritten anyway by bitcoind, and
|
||||
# unclean shutdown), it will get overwritten anyway by dashd, and
|
||||
# potentially interfere with our attempt to authenticate
|
||||
delete_cookie_file(self.datadir)
|
||||
self.process = subprocess.Popen(all_args, stderr=stderr, *args, **kwargs)
|
||||
@ -245,17 +245,17 @@ class TestNodeCLIAttr:
|
||||
return lambda: self(*args, **kwargs)
|
||||
|
||||
class TestNodeCLI():
|
||||
"""Interface to bitcoin-cli for an individual node"""
|
||||
"""Interface to dash-cli for an individual node"""
|
||||
|
||||
def __init__(self, binary, datadir):
|
||||
self.options = []
|
||||
self.binary = binary
|
||||
self.datadir = datadir
|
||||
self.input = None
|
||||
self.log = logging.getLogger('TestFramework.bitcoincli')
|
||||
self.log = logging.getLogger('TestFramework.dashcli')
|
||||
|
||||
def __call__(self, *options, input=None):
|
||||
# TestNodeCLI is callable with bitcoin-cli command-line options
|
||||
# TestNodeCLI is callable with dash-cli command-line options
|
||||
cli = TestNodeCLI(self.binary, self.datadir)
|
||||
cli.options = [str(o) for o in options]
|
||||
cli.input = input
|
||||
@ -274,18 +274,18 @@ class TestNodeCLI():
|
||||
return results
|
||||
|
||||
def send_cli(self, command=None, *args, **kwargs):
|
||||
"""Run bitcoin-cli command. Deserializes returned string as python object."""
|
||||
"""Run dash-cli command. Deserializes returned string as python object."""
|
||||
|
||||
pos_args = [str(arg) for arg in args]
|
||||
named_args = [str(key) + "=" + str(value) for (key, value) in kwargs.items()]
|
||||
assert not (pos_args and named_args), "Cannot use positional arguments and named arguments in the same bitcoin-cli call"
|
||||
assert not (pos_args and named_args), "Cannot use positional arguments and named arguments in the same dash-cli call"
|
||||
p_args = [self.binary, "-datadir=" + self.datadir] + self.options
|
||||
if named_args:
|
||||
p_args += ["-named"]
|
||||
if command is not None:
|
||||
p_args += [command]
|
||||
p_args += pos_args + named_args
|
||||
self.log.debug("Running bitcoin-cli command: %s" % command)
|
||||
self.log.debug("Running dash-cli command: %s" % command)
|
||||
process = subprocess.Popen(p_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
|
||||
cli_stdout, cli_stderr = process.communicate(input=self.input)
|
||||
returncode = process.poll()
|
||||
|
@ -242,7 +242,7 @@ def main():
|
||||
sys.exit(0)
|
||||
|
||||
if not (enable_wallet and enable_utils and enable_bitcoind):
|
||||
print("No functional tests to run. Wallet, utils, and bitcoind must all be enabled")
|
||||
print("No functional tests to run. Wallet, utils, and dashd must all be enabled")
|
||||
print("Rerun `configure` with -enable-wallet, -with-utils and -with-daemon and rerun make")
|
||||
sys.exit(0)
|
||||
|
||||
@ -429,7 +429,7 @@ class TestHandler:
|
||||
self.test_list = test_list
|
||||
self.flags = flags
|
||||
self.num_running = 0
|
||||
# In case there is a graveyard of zombie bitcoinds, we can apply a
|
||||
# In case there is a graveyard of zombie dashds, we can apply a
|
||||
# pseudorandom offset to hopefully jump over them.
|
||||
# (625 is PORT_RANGE/MAX_NODES)
|
||||
self.portseed_offset = int(time.time() * 1000) % 625
|
||||
@ -538,7 +538,7 @@ class RPCCoverage():
|
||||
Coverage calculation works by having each test script subprocess write
|
||||
coverage files into a particular directory. These files contain the RPC
|
||||
commands invoked during testing, as well as a complete listing of RPC
|
||||
commands per `bitcoin-cli help` (`rpc_interface.txt`).
|
||||
commands per `dash-cli help` (`rpc_interface.txt`).
|
||||
|
||||
After all tests complete, the commands run are combined and diff'd against
|
||||
the complete list to calculate uncovered RPC commands.
|
||||
|
Loading…
Reference in New Issue
Block a user