Skip to content

Commit

Permalink
Change Bitcoin to Dogecoin in qa/ files
Browse files Browse the repository at this point in the history
This changes all occurrences of `BITCOIN` to `DOGECOIN` and `bitcoind`
to `dogecoind` in all files in `qa/`. It does not change copyright
information.
  • Loading branch information
chromatic committed Jun 22, 2024
1 parent 5bbb1fa commit 1cabf8d
Show file tree
Hide file tree
Showing 23 changed files with 78 additions and 78 deletions.
6 changes: 3 additions & 3 deletions qa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Possible options, which apply to each individual test run:

```
-h, --help show this help message and exit
--nocleanup Leave bitcoinds and test.* datadir on exit or error
--noshutdown Don't stop bitcoinds after the test execution
--srcdir=SRCDIR Source directory containing bitcoind/bitcoin-cli
--nocleanup Leave dogecoinds and test.* datadir on exit or error
--noshutdown Don't stop dogecoinds after the test execution
--srcdir=SRCDIR Source directory containing dogecoind/dogecoin-cli
(default: ../../src)
--tmpdir=TMPDIR Root directory for datadirs
--tracerpc Print out all RPC calls as they are made
Expand Down
16 changes: 8 additions & 8 deletions qa/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#If imported values are not defined then set to zero (or disabled)
if 'ENABLE_WALLET' not in vars():
ENABLE_WALLET=0
if 'ENABLE_BITCOIND' not in vars():
ENABLE_BITCOIND=0
if 'ENABLE_DOGECOIND' not in vars():
ENABLE_DOGECOIND=0
if 'ENABLE_UTILS' not in vars():
ENABLE_UTILS=0
if 'ENABLE_ZMQ' not in vars():
Expand Down Expand Up @@ -76,17 +76,17 @@
opts.add(arg)

#Set env vars
if "BITCOIND" not in os.environ:
os.environ["BITCOIND"] = BUILDDIR + '/src/bitcoind' + EXEEXT
if "DOGECOIND" not in os.environ:
os.environ["DOGECOIND"] = BUILDDIR + '/src/dogecoind' + EXEEXT

if EXEEXT == ".exe" and "-win" not in opts:
# https://github.com/bitcoin/bitcoin/commit/d52802551752140cf41f0d9a225a43e84404d3e9
# https://github.com/bitcoin/bitcoin/pull/5677#issuecomment-136646964
print("Win tests currently disabled by default. Use -win option to enable")
sys.exit(0)

if not (ENABLE_WALLET == 1 and ENABLE_UTILS == 1 and ENABLE_BITCOIND == 1):
print("No rpc tests to run. Wallet, utils, and bitcoind must all be enabled")
if not (ENABLE_WALLET == 1 and ENABLE_UTILS == 1 and ENABLE_DOGECOIND == 1):
print("No rpc tests to run. Wallet, utils, and dogecoind must all be enabled")
sys.exit(0)

# python3-zmq may not be installed. Handle this gracefully and with some helpful info
Expand Down Expand Up @@ -288,7 +288,7 @@ def __init__(self, num_tests_parallel, test_list=None, flags=None):
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 dogecoinds, 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
Expand Down Expand Up @@ -335,7 +335,7 @@ class RPCCoverage(object):
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 `dogecoin-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.
Expand Down
2 changes: 1 addition & 1 deletion qa/pull-tester/tests_config.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ EXEEXT="@EXEEXT@"
# These will turn into comments if they were disabled when configuring.
@ENABLE_WALLET_TRUE@ENABLE_WALLET=1
@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1
@BUILD_BITCOIND_TRUE@ENABLE_DOGECOIND=1
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=1
20 changes: 10 additions & 10 deletions qa/rpc-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Base class for new regression tests.
Generally useful functions.

### [test_framework/mininode.py](test_framework/mininode.py)
Basic code to support p2p connectivity to a bitcoind.
Basic code to support p2p connectivity to a dogecoind.

### [test_framework/comptool.py](test_framework/comptool.py)
Framework for comparison-tool style, p2p tests.
Expand Down Expand Up @@ -41,10 +41,10 @@ over the network (```CBlock```, ```CTransaction```, etc, along with the network-
wrappers for them, ```msg_block```, ```msg_tx```, etc).

* P2P tests have two threads. One thread handles all network communication
with the bitcoind(s) being tested (using python's asyncore package); the other
with the dogecoind(s) being tested (using python's asyncore package); the other
implements the test logic.

* ```NodeConn``` is the class used to connect to a bitcoind. If you implement
* ```NodeConn``` is the class used to connect to a dogecoind. If you implement
a callback class that derives from ```NodeConnCB``` and pass that to the
```NodeConn``` object, your code will receive the appropriate callbacks when
events of interest arrive.
Expand All @@ -64,13 +64,13 @@ is tested. Examples: ```p2p-accept-block.py```, ```maxblocksinflight.py```.
## Comptool

* Testing framework for writing tests that compare the block/tx acceptance
behavior of a bitcoind against 1 or more other bitcoind instances, or against
behavior of a dogecoind against 1 or more other dogecoind instances, or against
known outcomes, or both.

* Set the ```num_nodes``` variable (defined in ```ComparisonTestFramework```) to start up
1 or more nodes. If using 1 node, then ```--testbinary``` can be used as a command line
option to change the bitcoind binary used by the test. If using 2 or more nodes,
then ```--refbinary``` can be optionally used to change the bitcoind that will be used
option to change the dogecoind binary used by the test. If using 2 or more nodes,
then ```--refbinary``` can be optionally used to change the dogecoind that will be used
on nodes 2 and up.

* Implement a (generator) function called ```get_tests()``` which yields ```TestInstance```s.
Expand All @@ -79,13 +79,13 @@ Each ```TestInstance``` consists of:
* ```object``` is a ```CBlock```, ```CTransaction```, or
```CBlockHeader```. ```CBlock```'s and ```CTransaction```'s are tested for
acceptance. ```CBlockHeader```s can be used so that the test runner can deliver
complete headers-chains when requested from the bitcoind, to allow writing
complete headers-chains when requested from the dogecoind, to allow writing
tests where blocks can be delivered out of order but still processed by
headers-first bitcoind's.
headers-first dogecoind's.
* ```outcome``` is ```True```, ```False```, or ```None```. If ```True```
or ```False```, the tip is compared with the expected tip -- either the
block passed in, or the hash specified as the optional 3rd entry. If
```None``` is specified, then the test will compare all the bitcoind's
```None``` is specified, then the test will compare all the dogecoind's
being tested to see if they all agree on what the best tip is.
* ```hash``` is the block hash of the tip to compare against. Optional to
specify; if left out then the hash of the block passed in will be used as
Expand All @@ -99,7 +99,7 @@ Each ```TestInstance``` consists of:
sequence and synced (this is slower when processing many blocks).
- ```sync_every_transaction```: ```True/False```. Analogous to
```sync_every_block```, except if the outcome on the last tx is "None",
then the contents of the entire mempool are compared across all bitcoind
then the contents of the entire mempool are compared across all dogecoind
connections. If ```True``` or ```False```, then only the last tx's
acceptance is tested against the given outcome.

Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/bumpfee.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setup_network(self, split=False):

# Encrypt wallet for test_locked_wallet_fails test
self.nodes[1].encryptwallet(WALLET_PASSPHRASE)
bitcoind_processes[1].wait()
dogecoind_processes[1].wait()
self.nodes[1] = start_node(1, self.options.tmpdir, extra_args[1])
self.nodes[1].walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)

Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/httpbasics.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def run_test(self):
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 dogecoind should use keep-alive by default

# Check excessive request size
conn = http.client.HTTPConnection(urlNode2.hostname, urlNode2.port)
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/keypool.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def run_test(self):

# Encrypt wallet and wait to terminate
nodes[0].encryptwallet('test')
bitcoind_processes[0].wait()
dogecoind_processes[0].wait()
# Restart node 0
nodes[0] = start_node(0, self.options.tmpdir)
# Keep creating keys
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/multi_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self):

def setup_chain(self):
super().setup_chain()
#Append rpcauth to bitcoin.conf before initialization
#Append rpcauth to dogecoin.conf before initialization
rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144"
rpcauth2 = "rpcauth=rt2:f8607b1a88861fac29dfccf9b52ff9f$ff36a0c23c8c62b4846112e50fa888416e94c17bfd4c42f88fd8f55ec6a3137e"
with open(os.path.join(self.options.tmpdir+"/node0", "dogecoin.conf"), 'a', encoding='utf8') as f:
Expand Down
12 changes: 6 additions & 6 deletions qa/rpc-tests/p2p-compactblocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Version 2 compact blocks are post-segwit (wtxids)
'''

# TestNode: A peer we use to send messages to bitcoind, and store responses.
# TestNode: A peer we use to send messages to dogecoind, and store responses.
class TestNode(SingleNodeConnCB):
def __init__(self):
SingleNodeConnCB.__init__(self)
Expand Down Expand Up @@ -266,7 +266,7 @@ def check_announcement_of_new_block(node, peer, predicate):
old_node.request_headers_and_sync(locator=[tip])
check_announcement_of_new_block(node, old_node, lambda p: p.last_cmpctblock is not None)

# This test actually causes bitcoind to (reasonably!) disconnect us, so do this last.
# This test actually causes dogecoind 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])
Expand All @@ -281,7 +281,7 @@ def test_invalid_cmpctblock_message(self):
assert(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.
# dogecoind's choice of nonce.
def test_compactblock_construction(self, node, test_node, version, use_witness_address):
# Generate a bunch of transactions.
node.generate(101)
Expand Down Expand Up @@ -396,7 +396,7 @@ def check_compactblock_construction_from_block(self, version, header_and_shortid
header_and_shortids.shortids.pop(0)
index += 1

# Test that bitcoind requests compact blocks when we announce new blocks
# Test that dogecoind requests compact blocks when we announce new blocks
# via header or inv, and that responding to getblocktxn causes the block
# to be successfully reconstructed.
# Post-segwit: upgraded nodes would only make this request of cb-version-2,
Expand Down Expand Up @@ -580,7 +580,7 @@ def test_incorrect_blocktxn_response(self, node, test_node, version):
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 dogecoind 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
Expand Down Expand Up @@ -611,7 +611,7 @@ def test_incorrect_blocktxn_response(self, node, test_node, version):
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
# dogecoind will not send blocktxn responses for blocks whose height is
# more than 10 blocks deep.
MAX_GETBLOCKTXN_DEPTH = 10
chain_height = node.getblockcount()
Expand Down
4 changes: 2 additions & 2 deletions qa/rpc-tests/p2p-fullblocktest.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def update_block(block_number, new_transactions):
b26 = update_block(26, [])
yield rejected(RejectResult(16, b'bad-cb-length'))

# Extend the b26 chain to make sure bitcoind isn't accepting b26
# Extend the b26 chain to make sure dogecoind isn't accepting b26
b27 = block(27, spend=out[7])
yield rejected(RejectResult(0, b'bad-prevblk'))

Expand All @@ -409,7 +409,7 @@ def update_block(block_number, new_transactions):
b28 = update_block(28, [])
yield rejected(RejectResult(16, b'bad-cb-length'))

# Extend the b28 chain to make sure bitcoind isn't accepting b28
# Extend the b28 chain to make sure dogecoind isn't accepting b28
b29 = block(29, spend=out[7])
yield rejected(RejectResult(0, b'bad-prevblk'))

Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/p2p-leaktests.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self):
super().__init__()

# 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 dogecoind ban behavior changes
def on_open(self, conn):
super().on_open(conn)
for i in range(banscore):
Expand Down
10 changes: 5 additions & 5 deletions qa/rpc-tests/p2p-segwit.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def test_unnecessary_witness_before_segwit_activation(self):
# rule).
self.test_node.test_witness_block(block, accepted=False)
# TODO: fix synchronization so we can test reject reason
# Right now, bitcoind delays sending reject messages for blocks
# Right now, dogecoind delays sending reject messages for blocks
# until the future, making synchronization here difficult.
#assert_equal(self.test_node.last_reject.reason, "unexpected-witness")

Expand Down Expand Up @@ -612,7 +612,7 @@ def test_submit_block(self):
self.nodes[0].submitblock(bytes_to_hex_str(block.serialize(True)))
assert(self.nodes[0].getbestblockhash() != block.hash)

# Now redo commitment with the standard nonce, but let bitcoind fill it in.
# Now redo commitment with the standard nonce, but let dogecoind fill it in.
add_witness_commitment(block, nonce=0)
block.vtx[0].wit = CTxWitness()
block.solve()
Expand Down Expand Up @@ -1527,7 +1527,7 @@ def test_p2sh_witness(self, segwit_activated):
# This transaction should not be accepted into the mempool pre- or
# post-segwit. Mempool acceptance will use SCRIPT_VERIFY_WITNESS which
# will require a witness to spend a witness program regardless of
# segwit activation. Note that older bitcoind's that are not
# segwit activation. Note that older dogecoind's that are not
# segwit-aware would also reject this for failing CLEANSTACK.
self.test_node.test_transaction_acceptance(spend_tx, with_witness=False, accepted=False)

Expand Down Expand Up @@ -1563,12 +1563,12 @@ def test_p2sh_witness(self, segwit_activated):
# Test the behavior of starting up a segwit-aware node after the softfork
# has activated. As segwit requires different block data than pre-segwit
# nodes would have stored, this requires special handling.
# To enable this test, pass --oldbinary=<path-to-pre-segwit-bitcoind> to
# To enable this test, pass --oldbinary=<path-to-pre-segwit-dogecoind> to
# the test.
def test_upgrade_after_activation(self, node, node_id):
print("\tTesting software upgrade after softfork activation")

assert(node_id != 0) # node0 is assumed to be a segwit-active bitcoind
assert(node_id != 0) # node0 is assumed to be a segwit-active dogecoind

# Make sure the nodes are all up
sync_blocks(self.nodes)
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/p2p-timeouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
""" TimeoutsTest -- test various net timeouts (only in extended tests)
- Create three bitcoind nodes:
- Create three dogecoind 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)
Expand Down
12 changes: 6 additions & 6 deletions qa/rpc-tests/proxy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
from test_framework.netutil import test_ipv6_local
'''
Test plan:
- Start bitcoind's with different proxy configurations
- Start dogecoind 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 dogecoind side:
- `-proxy` (proxy everything)
- `-onion` (proxy just onions)
- `-proxyrandomize` Circuit randomization
Expand All @@ -30,8 +30,8 @@
- proxy on IPv6
- Create various proxies (as threads)
- Create bitcoinds that connect to them
- Manipulate the bitcoinds using addnode (onetry) an observe effects
- Create dogecoinds that connect to them
- Manipulate the dogecoinds using addnode (onetry) an observe effects
addnode connect to IPv4
addnode connect to IPv6
Expand Down Expand Up @@ -97,7 +97,7 @@ def node_test(self, node, proxies, auth, test_onion=True):
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: dogecoind'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)
Expand All @@ -111,7 +111,7 @@ def node_test(self, node, proxies, auth, test_onion=True):
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: dogecoind'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)
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/rpcbind_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def run_bind_test(self, allow_ips, connect_to, addresses, expected):
base_args += ['-rpcallowip=' + x for x in allow_ips]
binds = ['-rpcbind='+addr for addr in addresses]
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [base_args + binds], connect_to)
pid = bitcoind_processes[0].pid
pid = dogecoind_processes[0].pid
assert_equal(set(get_bind_addrs(pid)), set(expected))
stop_nodes(self.nodes)

Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/test_framework/comptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .util import p2p_port

'''
This is a tool for comparing two or more bitcoinds to each other
This is a tool for comparing two or more dogecoinds to each other
using a script provided.
To use, create a class that implements get_tests(), and pass it in
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/test_framework/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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 `dogecoin-cli` for
coverage comparison. This will only happen once per coverage
directory.
Expand Down
Loading

0 comments on commit 1cabf8d

Please sign in to comment.